site
Version:
Site Engine is the world's first all-in-one engine to build a modern web site, game, or blog. No HTML or CSS knowledge required.
1 lines • 7.74 kB
JavaScript
;Object.defineProperty(exports,"__esModule",{value:!0});var t=c(require("./client.compatibility")),e=require("./shared.manifest"),a=c(require("./shared.main")),r=s(require("./client.text")),o=s(require("./client.ui")),i=s(require("./client.browser")),l=s(require("./client.dom")),n=c(require("./client.o-auth"));function s(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e.default=t,e}function c(t){return t&&t.__esModule?t:{default:t}}var u,d,h,m,v,y,S,g,f,p=function(t){return null!=t},b=function(t,e,a,r){return t(e)[a](e,...r)};t.default,a.default.isDebug()&&(e.global.shared_705357537593286848=a.default,e.global.client_705357537593286848=exports),exports.default=(h=Symbol(),m=Symbol(),v=Symbol(),y=Symbol(),S=Symbol(),g=Symbol(),(f=class{static get text(){return(()=>r.get())()}static mountOAuthAttachment(t){return(t=>(()=>(this.localData[t]=this.localMeta.oAuthAttachment,this.saveLocalData(),this.localMeta.oAuthAttachment=this[m].oAuthAttachment,this.saveLocalMeta()))())(t)}static startupClosed(){return t=document.getElementById("startup-705357537593286848"),!p(t);var t}static closeStartup(){return t=document.getElementById("startup-705357537593286848"),p(t)?(()=>t.parentElement.removeChild(t))():void 0;var t}static openLink(t,e){return((t,e)=>(void 0===e&&(e=!1),(()=>{var a;return(a=document.getElementById("link-simulator-705357537593286848")).href=t,a.target=e?"_blank":"",a.click()})()))(t,e)}static requestReadFile(t){return(t=>(void 0===t&&(t={}),(()=>new Promise((a,r)=>(()=>{var o,i;return void 0===(i=t=b(e.dotDot_573300145710716007,Object,"clone",[t])).accept&&(i.accept=""),void 0===(i=t).dataType&&(i.dataType="text"),void 0===(i=t).maxSize&&(i.maxSize=16777216),(o=document.getElementById("file-reader-simulator-705357537593286848")).value="",p(t.capture)?(()=>o.setAttribute("capture",t.capture))():(()=>o.removeAttribute("capture"))(),o.accept=t.accept,o.multiple=!1,o.onchange=(()=>{return(()=>{var e,i;return e=o.files[0],p(e)&&e.size<=t.maxSize?(()=>((i=new FileReader).onload=(e=>(()=>"text"===t.dataType?(()=>a(e.target.result))():(()=>"binary"===t.dataType?(()=>a(new Uint8Array(e.target.result)))():(()=>"uri"===t.dataType?(()=>a(e.target.result))():(()=>r())())())())()),"text"===t.dataType?(()=>i.readAsText(e))():(()=>"binary"===t.dataType?(()=>i.readAsArrayBuffer(e))():(()=>"uri"===t.dataType?(()=>i.readAsDataURL(e))():(()=>r())())())()))():(()=>r())()})()}),setTimeout(()=>{return(()=>r())()},9e5),o.click()})()))()))(t)}static get localData(){return(()=>{return(()=>(p(this[y])||(()=>this[S]())(),this[y]))()})()}static get defaultLocalData(){return(()=>{return(()=>this[g])()})()}static set defaultLocalData(t){return(t=>(()=>(this[g]=t,this[S]()))())(t)}static[h](){return(()=>{return(()=>(this.loadLocalMeta(),this.saveLocalMeta()))()})()}static[S](){return(()=>{return(()=>(this.loadLocalData(),this.saveLocalData()))()})()}static saveLocalMeta(t){return(t=>(()=>{p(t)?(()=>{localStorage.meta=JSON.stringify(t),this.localMeta=b(e.dotDot_573300145710716007,JSON,"clone",[t])})():(()=>{localStorage.meta=JSON.stringify(this.localMeta)})(),this.lit=a.default.fullLit(a.default.selectLit(this.localMeta.language))})())(t)}static loadLocalMeta(){return(()=>{return(()=>{var t,a;t=localStorage.meta,(a=localStorage.metaSchema===this[v]&&p(t)?(()=>(()=>{try{return(()=>JSON.parse(t))()}catch(t){return t,{}}})())():(()=>(localStorage.metaSchema=this[v],{}))())instanceof Object||(a={}),Object.keys(this[m]).forEach(t=>(()=>void 0===a[t]?(()=>{a[t]=this[m][t]})():void 0)()),this.localMeta=b(e.dotDot_573300145710716007,JSON,"clone",[a])})()})()}static resetLocalMeta(){return(()=>{return(()=>(localStorage.meta=JSON.stringify(this[m]),this.loadLocalMeta()))()})()}static resetLocalMetaOAuth(){return(()=>{return(()=>(this.localMeta.oAuthName=this[m].oAuthName,this.localMeta.oAuthState=this[m].oAuthState,this.localMeta.oAuthFinalUri=this[m].oAuthFinalUri,this.localMeta.oAuthAccessToken=this[m].oAuthAccessToken,this.localMeta.oAuthAttachment=this[m].oAuthAttachment,this.saveLocalMeta()))()})()}static saveLocalData(t){return(t=>(()=>(p(localStorage.dataSchema)||(()=>{localStorage.dataSchema=this.localDataSchema})(),p(t)?(()=>{localStorage.data=JSON.stringify(t),this[y]=b(e.dotDot_573300145710716007,JSON,"clone",[t])})():(()=>{localStorage.data=JSON.stringify(this.localData)})()))())(t)}static loadLocalData(){return(()=>{return(()=>{var t,a;t=localStorage.data,(a=localStorage.dataSchema===this.localDataSchema&&p(t)?(()=>(()=>{try{return(()=>JSON.parse(t))()}catch(t){return t,{}}})())():(()=>(localStorage.dataSchema=this.localDataSchema,{}))())instanceof Object||(a={}),Object.keys(this.defaultLocalData).forEach(t=>(()=>void 0===a[t]?(()=>{a[t]=this.defaultLocalData[t]})():void 0)()),this[y]=b(e.dotDot_573300145710716007,JSON,"clone",[a])})()})()}static resetLocalData(){return(()=>{return(()=>(localStorage.data=JSON.stringify(this.defaultLocalData),this.loadLocalData()))()})()}}).onLoad=(0,e.eventField)(),f.onUriChange=(0,e.eventField)(),f.ui=o,f.browser=i,f.dom=l,f.OAuth=n.default,f.autoCloseStartup=!0,f.setUri=null,f.getUri=null,f.localMeta=null,f[v]="v2",f[m]={language:navigator.language,oAuthName:null,oAuthState:null,oAuthFinalUri:null,oAuthAccessToken:null,oAuthAttachment:null},f[y]=null,f.localDataSchema="v1",f[g]={},f.Audio=(u=Symbol(),d=Symbol(),class{constructor(t){(t=>(()=>{this[u]=new e.global.Audio(t)})())(t)}play(){return(()=>(()=>(this[u].play(),this))())()}pause(){return(()=>(()=>(this[u].pause(),this))())()}setSource(t){return(t=>(()=>(this[d]=t,this[u].src=t,this))())(t)}getSource(){return(()=>(()=>this[d])())()}}),function(){return(()=>((()=>{(()=>{var t,a,r,l,n,s,c,u;t=(t=>(()=>{var e;return s||t.defaultEnabled_705357537593286848?void 0:(()=>(t.preventDefault(),["mousedown","touchstart"].indexOf(t.type)>=0?(()=>(e=document.activeElement,p(e)?(()=>e.blur())():void 0))():void 0))()})()),document.body.addEventListener("mousedown",t),document.body.addEventListener("mouseup",t),document.body.addEventListener("mousemove",t),this.browser.isTouch&&(()=>(document.body.addEventListener("touchstart",t),document.body.addEventListener("touchend",t),document.body.addEventListener("touchmove",t)))(),(()=>{(()=>{var t,e;t=location.href,e=(()=>(()=>{location.href!==t&&(()=>(t=location.href,this.onUriChange.fire()))()})()),window.addEventListener("hashchange",e),window.addEventListener("popstate",e),this.setUri=(t=>(()=>(history.pushState(null,"",t),e()))()),this.getUri=(()=>(()=>t)())})()})(),a=(()=>(()=>(o.refreshRem(),o.onResize.fire()))()),window.addEventListener("resize",a),r=document.getElementById("scale-keeper-705357537593286848"),l=document.getElementById("scale-keeper-current-scale-705357537593286848"),n=document.getElementById("scale-keeper-middle-705357537593286848"),s=!1,c=window.innerWidth,u=document.documentElement.clientWidth,setInterval(()=>(()=>{var t,o,d,h,m,v,y,S;t=window.innerWidth,o=document.documentElement.clientWidth,t+1<o?(d=window.innerHeight,h=document.documentElement.getBoundingClientRect(),m=Math.sqrt(t*d),v="handheld"===i.deviceType?.03125:.015625,y=o/t*100,S=b(e.dotDot_573300145710716007,y,"format",[{fractionalSize:y<101?2:0}]),l.textContent=S+"%",r.style.left=-h.left+"px",r.style.top=-h.top+"px",r.style.width=t+"px",r.style.height=d+"px",r.style.fontSize=v*m+"px",r.style.visibility="visible",n.style.visibility="visible",s=!0):(()=>t!==c||o!==u?(()=>(r.style.visibility="hidden",n.style.visibility="hidden",s=!1,t!==c?(()=>a())():void 0))():void 0)(),c=t,u=o})(),500),o.refreshRem(),o.setRoot(new o.Board)})()})(),this[h](),p(this.localMeta.oAuthState)?(()=>this.resetLocalMetaOAuth())():void 0))()}.call(f),f);