@netless/window-manager 1.0.0-canary.32 → 1.0.0-canary.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +12 -39
- package/dist/index.es.js +5141 -8860
- package/dist/index.umd.js +12 -39
- package/dist/src/App/AppContext.d.ts +1 -0
- package/dist/src/View/CameraSynchronizer.d.ts +2 -1
- package/dist/src/index.d.ts +5 -6
- package/dist/style.css +1 -1
- package/docs/mirgrate-to-1.0.md +12 -1
- package/package.json +17 -18
- package/pnpm-lock.yaml +3089 -4905
- package/src/App/AppContext.ts +12 -2
- package/src/BuiltinApps.ts +5 -9
- package/src/View/CameraSynchronizer.ts +10 -7
- package/src/View/ViewSync.ts +7 -10
- package/src/index.ts +9 -8
- package/vite.config.js +3 -1
package/dist/index.cjs.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
"use strict";var
|
2
|
-
;return ${t}`)();return typeof i=="undefined"&&(i=window[t]),i},bg=async(e,t,i)=>{const n=i||xg+t;te.emit("loadApp",{kind:t,status:"start"});try{const r=await Cg(e);if(!r||r.length===0){te.emit("loadApp",{kind:t,status:"failed",reason:"script is empty."});return}try{const s=uu(r,n);return te.emit("loadApp",{kind:t,status:"success"}),s}catch(s){if(s.message.includes("Can only have one anonymous define call per script file")){const o=window.define;typeof o=="function"&&o.amd&&delete o.amd;const a=uu(r,n);return te.emit("loadApp",{kind:t,status:"success"}),a}te.emit("loadApp",{kind:t,status:"failed",reason:s.message})}}catch(r){te.emit("loadApp",{kind:t,status:"failed",reason:r.message})}};async function Mg(e,t){const{timeout:i=1e4}=t,n=new AbortController,r=setTimeout(()=>n.abort(),i),s=await fetch(e,ft(H({},t),{signal:n.signal,headers:{"content-type":"text/plain"}}));return clearTimeout(r),s}class Ig{constructor(){this.kindEmitters=new Map,this.registered=new Map,this.appClassesCache=new Map,this.appClasses=new Map,this.syncRegisterApp=null,this.onSyncRegisterAppChange=t=>{this.register({kind:t.kind,src:t.src})}}setSyncRegisterApp(t){this.syncRegisterApp=t}async register(t){this.appClassesCache.delete(t.kind),this.registered.set(t.kind,t);const i=t.src;let n;if(typeof i=="string"?(n=async()=>{let r=await bg(i,t.kind,t.name);if(r)return r.__esModule&&(r=r.default),r;throw new Error(`[WindowManager]: load remote script failed, ${i}`)},this.syncRegisterApp&&this.syncRegisterApp({kind:t.kind,src:i,name:t.name})):typeof i=="function"?n=i:n=async()=>i,this.appClasses.set(t.kind,async()=>{let r=this.appClassesCache.get(t.kind);return r||(r=n(),this.appClassesCache.set(t.kind,r)),r}),t.addHooks){const r=this.createKindEmitter(t.kind);r&&t.addHooks(r)}}unregister(t){this.appClasses.delete(t),this.appClassesCache.delete(t),this.registered.delete(t);const i=this.kindEmitters.get(t);i&&(i.clearListeners(),this.kindEmitters.delete(t))}async notifyApp(t,i,n){const r=this.kindEmitters.get(t);await(r==null?void 0:r.emit(i,n))}createKindEmitter(t){if(!this.kindEmitters.has(t)){const i=new Zt.default;this.kindEmitters.set(t,i)}return this.kindEmitters.get(t)}}const Me=new Ig,Ag=async e=>{var i,n;const t=await((i=Me.appClasses.get(e))==null?void 0:i());return t&&((n=t.config)==null?void 0:n.singleton)?e:`${e}-${og.v4().replace("-","").slice(0,8)}`},gi=(e,t)=>{if(!e.didRelease&&e.focusScenePath!==t)return e.focusScenePath=t,e},cu=e=>{e.didRelease||e.release()},Ln=(e,t)=>{if(e&&e.isWritable&&e.state.sceneState.scenePath!==t){const i=t==="/"?"":t;e.setScenePath(i)}},Eg=(e,t,i)=>{var n;if(e&&t){const s=(n=mi(e)[t])==null?void 0:n[i];if(s)return`${t}/${s.name}`}},To=(e,t,i)=>{e&&e.scenePathType(t)!==I.ScenePathType.None&&e.removeScenes(t,i)},Tg=(e,t)=>{j.once(e).then(t)};A.debounce((e,t)=>{e.emit("mainViewModeChange",t)},200);const kg=(e,t,i=0)=>{const n=mi(e)[t];if(!n)return;const r=n[i];if(!r)return;const s=r.name;return t===ze?`/${s}`:`${t}/${s}`},mi=e=>e.entireScenes(),ji=(e,t,i,n)=>e==null?void 0:e.putScenes(t,i,n),Ng=e=>e.startsWith("/"),Js=e=>{const t=e.split("/");t.pop();let i=t.join("/");return i===""&&(i="/"),i},Pg=e=>e.endsWith("/")?e.slice(0,-1):e,du=e=>{const t=e.split(".").map(i=>i.padStart(2,"0")).join("");return parseInt(t)},Fr=e=>new Promise(t=>setTimeout(t,e)),zg=e=>e.split("").reduce((i,n)=>(n===ze&&(i+=1),i),0)===1;class Dg{constructor(t){this.manager=t,this.displayer=this.manager.displayer,this.mainMagixEventListener=i=>{if(i.authorId!==this.displayer.observerId){const n=i.payload;switch(n.eventName){case Z.AppMove:{this.appMoveHandler(n.payload);break}case Z.AppResize:{this.appResizeHandler(n.payload);break}case Z.AppBoxStateChange:{this.boxStateChangeHandler(n.payload);break}case Z.SetMainViewScenePath:{this.setMainViewScenePathHandler(n.payload);break}case Z.CursorMove:{this.cursorMoveHandler(n.payload);break}case Z.RootDirRemoved:{this.rootDirRemovedHandler();break}case Z.Refresh:{this.refreshHandler();break}case Z.InitMainViewCamera:{this.initMainViewCameraHandler();break}case Z.SetAppFocusIndex:{this.setAppFocusViewIndexHandler(n.payload);break}case Z.InvokeAttributesUpdateCallback:{this.manager.attributesUpdateCallback(this.manager.attributes.apps);break}}}},this.appMoveHandler=i=>{var n;(n=this.boxManager)==null||n.moveBox(i)},this.appResizeHandler=i=>{var n,r;(n=this.boxManager)==null||n.resizeBox(Object.assign(i,{skipUpdate:!0})),(r=this.manager.room)==null||r.refreshViewSize()},this.boxStateChangeHandler=i=>{te.emit("boxStateChange",i)},this.setMainViewScenePathHandler=({nextScenePath:i})=>{gi(this.manager.mainView,i),te.emit("mainViewScenePathChange",i)},this.cursorMoveHandler=i=>{j.emit("cursorMove",i)},this.rootDirRemovedHandler=()=>{this.manager.createRootDirScenesCallback(),this.manager.mainViewProxy.rebind(),j.emit("rootDirRemoved")},this.refreshHandler=()=>{this.manager.windowManger._refresh()},this.initMainViewCameraHandler=()=>{this.manager.mainViewProxy.addCameraReaction()},this.setAppFocusViewIndexHandler=i=>{if(i.type==="main")this.manager.setSceneIndexWithoutSync(i.index);else if(i.type==="app"&&i.appID){const n=this.manager.appProxies.get(i.appID);n&&n.setSceneIndexWithoutSync(i.index)}}}get boxManager(){return this.manager.boxManager}addListeners(){this.displayer.addMagixEventListener(Ao,this.mainMagixEventListener)}removeListeners(){this.displayer.removeMagixEventListener(Ao,this.mainMagixEventListener)}}class dd extends Error{constructor(){super(...arguments);this.message="[WindowManager]: app duplicate exists and cannot be created again"}}class jg extends Error{constructor(t){super(`[WindowManager]: app ${t} need register or provide src`)}}class Ce extends Error{constructor(){super(...arguments);this.message="[WindowManager]: AppManager must be initialized"}}class hd extends Error{constructor(t){super(`[WindowManager]: white-web-sdk version must large than ${t}`)}}class pd extends Error{constructor(){super(...arguments);this.message="[WindowManager]: kind must be a valid string"}}class fd extends Error{constructor(){super(...arguments);this.message="[WindowManager]: box need created"}}class gd extends Error{constructor(){super(...arguments);this.message='[WindowManager]: ScenePath should start with "/"'}}class md extends Error{constructor(){super(...arguments);this.message="[WindowManager]: boxManager not found"}}class vd extends Error{constructor(){super(...arguments);this.message="[WindowManager]: room phase only Connected can be bindContainer"}}const wd=e=>(t,i)=>{if(t!==void 0)if(I.listenUpdated){const n=r=>{r.map(o=>o.kind).includes(e)&&i()};return I.listenUpdated(t,n),i(),()=>I.unlistenUpdated(t,n)}else return I.reaction(()=>t,()=>{i()},{fireImmediately:!0})},yd=(e,t,i)=>{let n=null;const r=I.reaction(e,()=>{n&&(n(),n=null);const s=e();A.isObject(s)?(n=()=>I.unlistenUpdated(s,t),I.listenUpdated(s,t)):i==null||i(s)},{fireImmediately:!0});return()=>{n==null||n(),r()}},Lg=wd(I.UpdateEventKind.Removed);wd(I.UpdateEventKind.Inserted);const Ks=Object.keys;function hu(e){return Boolean(A.has(e,"__isRef"))}function Vg(e){return{k:Re.genUID(),v:e,__isRef:!0}}class Rg{constructor(){this.listeners=new Set}get length(){return this.listeners.size}dispatch(t){this.listeners.forEach(i=>i(t))}addListener(t){this.listeners.add(t)}removeListener(t){this.listeners.delete(t)}}const Ze="_WM-STORAGE_";class pu{constructor(t,i,n){if(this._sideEffect=new Re.SideEffectManager,this._destroyed=!1,this._refMap=new WeakMap,this._lastValue=new Map,this.onStateChanged=new Rg,n&&!A.isObject(n))throw new Error(`Default state for Storage ${i} is not an object.`);this._context=t,this.id=i||null,this._state={};const r=this._getRawState(this._state);this._context.isWritable&&(this.id===null?t.isAddApp&&n&&this.setState(n):(r===this._state||!A.isObject(r))&&(A.get(this._context.getAttributes(),[Ze])||this._context.updateAttributes([Ze],{}),this._context.updateAttributes([Ze,this.id],this._state),n&&this.setState(n))),Ks(r).forEach(s=>{if(!(this.id===null&&s===Ze))try{const o=A.isObject(r[s])?JSON.parse(JSON.stringify(r[s])):r[s];hu(o)?(this._state[s]=o.v,A.isObject(o.v)&&this._refMap.set(o.v,o)):this._state[s]=o}catch(o){console.error(o)}}),this._sideEffect.addDisposer(yd(()=>this.id===null?t.getAttributes():A.get(t.getAttributes(),[Ze,this.id]),this._updateProperties.bind(this),this.destroy.bind(this)))}get state(){return this._destroyed&&console.warn(`Accessing state on destroyed Storage "${this.id}"`),this._state}addStateChangedListener(t){return this.onStateChanged.addListener(t),()=>this.onStateChanged.removeListener(t)}ensureState(t){return this.setState(Ks(t).reduce((i,n)=>(A.has(this._state,n)||(i[n]=t[n]),i),{}))}setState(t){if(this._destroyed){console.error(new Error(`Cannot call setState on destroyed Storage "${this.id}".`));return}if(!this._context.isWritable){console.error(new Error(`Cannot setState on Storage "${this.id}" without writable access`),t);return}const i=Ks(t);i.length>0&&i.forEach(n=>{const r=t[n];if(r!==this._state[n])if(r===void 0)this._lastValue.set(n,this._state[n]),delete this._state[n],this._setRawState(n,r);else{this._lastValue.set(n,this._state[n]),this._state[n]=r;let s=r;if(A.isObject(r)){let o=this._refMap.get(r);o||(o=Vg(r),this._refMap.set(r,o)),s=o}this._setRawState(n,s)}})}emptyStorage(){if(!(A.size(this._state)<=0)){if(this._destroyed){console.error(new Error(`Cannot empty destroyed Storage "${this.id}".`));return}if(!this._context.isWritable){console.error(new Error(`Cannot empty Storage "${this.id}" without writable access.`));return}this.setState(A.mapValues(this._state,A.noop))}}deleteStorage(){if(this.id===null)throw new Error("Cannot delete main Storage");if(!this._context.isWritable){console.error(new Error(`Cannot delete Storage "${this.id}" without writable access.`));return}this.destroy(),this._context.updateAttributes([Ze,this.id],void 0)}get destroyed(){return this._destroyed}destroy(){this._destroyed=!0,this._sideEffect.flushAll()}_getRawState(t){var i;return this.id===null?(i=this._context.getAttributes())!=null?i:t:A.get(this._context.getAttributes(),[Ze,this.id],t)}_setRawState(t,i){if(this.id===null){if(t===Ze)throw new Error(`Cannot set attribute internal filed "${Ze}"`);return this._context.updateAttributes([t],i)}else return this._context.updateAttributes([Ze,this.id,t],i)}_updateProperties(t){var i;if(this._destroyed){console.error(new Error(`Cannot call _updateProperties on destroyed Storage "${this.id}".`));return}if(t.length>0){const n={};for(let r=0;r<t.length;r++)try{const s=t[r],o=s.key;if(this.id===null&&o===Ze)continue;const a=A.isObject(s.value)?JSON.parse(JSON.stringify(s.value)):s.value;let l;switch(this._lastValue.has(o)&&(l=this._lastValue.get(o),this._lastValue.delete(o)),s.kind){case 2:{A.has(this._state,o)&&(l=this._state[o],delete this._state[o]),n[o]={oldValue:l};break}default:{let u=a;if(hu(a)){const{k:h,v:p}=a,w=this._state[o];A.isObject(w)&&((i=this._refMap.get(w))==null?void 0:i.k)===h?u=w:(u=p,A.isObject(p)&&this._refMap.set(p,a))}u!==this._state[o]&&(l=this._state[o],this._state[o]=u),n[o]={newValue:u,oldValue:l};break}}}catch(s){console.error(s)}this.onStateChanged.dispatch(n)}}}class Bg{constructor(t,i,n,r){this.view=t,this.appContext=i,this.appProxy=n,this.ensureSize=r,this.nextPage=async()=>{const u=this.pageState.index+1;return this.jumpPage(u)},this.prevPage=async()=>{const u=this.pageState.index-1;return this.jumpPage(u)},this.jumpPage=async u=>u<0||u>=this.pageState.length?(console.warn(`[WindowManager]: index ${u} out of range`),!1):(this.appProxy.setSceneIndex(u),!0),this.addPage=async u=>{const h=u==null?void 0:u.after,p=u==null?void 0:u.scene,w=this.appProxy.scenePath;if(!!w)if(h){const C=this.pageState.index+1;ji(this.appContext.room,w,[p||{}],C)}else ji(this.appContext.room,w,[p||{}])},this.removePage=async u=>{const h=u===void 0?this.pageState.index:u;return this.pageState.length===1?(console.warn("[WindowManager]: can not remove the last page"),!1):h<0||h>=this.pageState.length?(console.warn(`[WindowManager]: page index ${u} out of range`),!1):this.appProxy.removeSceneByIndex(h)};const s=new M.Val(n.pageState),o=new M.Val(n.size$.value),a=u=>A.pick(u,["centerX","centerY","scale"]),l=new M.Val(a(this.view.camera));this.baseRect$=o,this.pageState$=s,this.baseCamera$=l,this.appProxy.sideEffectManager.add(()=>[n.appEmitter.on("pageStateChange",u=>s.setValue(u)),n.camera$.subscribe(u=>{u&&l.setValue(a(u))}),n.size$.subscribe(u=>{u&&o.setValue(A.pick(u,["width","height"]))})]),t.disableCameraTransform=!0}get pageState(){return this.pageState$.value}moveCamera(t){this.appProxy.moveCamera(t)}setBaseRect(t){this.appProxy.updateSize(t.width,t.height)}}const zt=(...e)=>{ge.debug&&console.log("[WindowManager]:",...e)},Og=(e,t)=>{const i=document.createElement("div");i.className="netless-window-manager-playground";const n=document.createElement("div");return n.className="netless-window-manager-main-view",t.appendChild(n),e.appendChild(i),{playground:i,mainViewElement:n}},_g=()=>{if(du(I.WhiteVersion)<du(ou))throw new hd(ou)},xd=(e,t)=>{const i=e==null?void 0:e.state.roomMembers;return i==null?void 0:i.find(n=>{var r;return((r=n.payload)==null?void 0:r.uid)===t})},fu=e=>e.map(t=>{var i;return H({uid:((i=t.payload)==null?void 0:i.uid)||""},I.toJS(t))}),gu=async e=>{try{return await e.createInvisiblePlugin(ge,{})}catch(t){if(t.message==='invisible plugin "WindowManager" exits')return await Fr(200),e.getInvisiblePlugin(ge.kind);zt("createInvisiblePlugin failed",t)}};class $g{constructor(t,i,n,r){this.manager=t,this.appId=i,this.appProxy=n,this.appOptions=r,this.mobxUtils={autorun:I.autorun,reaction:I.reaction,toJS:I.toJS},this.objectUtils={listenUpdated:I.listenUpdated,unlistenUpdated:I.unlistenUpdated,listenDisposed:I.listenDisposed,unlistenDisposed:I.unlistenDisposed},this.store=this.manager.store,this.isReplay=this.manager.isReplay,this.getAttributes=()=>this.appProxy.attributes,this.getScenes=()=>{const s=this.store.getAppAttributes(this.appId);return s!=null&&s.isDynamicPPT?this.appProxy.scenes:s==null?void 0:s.options.scenes},this.createWhiteBoardView=s=>{if(this.whiteBoardView)return this.whiteBoardView;let o=this.view;o||(o=this.appProxy.createAppDir()),s&&A.isBoolean(s.syncCamera)&&this.appProxy.syncCamera$.setValue(s.syncCamera);const a=document.createElement("div");return this._viewWrapper=a,a.className="window-manager-view-wrapper",this.box.$main.appendChild(a),o.divElement=a,this.appProxy.fireMemberStateChange(),this.isAddApp&&this.ensurePageSize(s==null?void 0:s.size),this.whiteBoardView=new Bg(o,this,this.appProxy,this.ensurePageSize),this.appProxy.sideEffectManager.add(()=>[this.box._stageRect$.subscribe(l=>{a.style.left=`${l.x}px`,a.style.top=`${l.y}px`,a.style.width=`${l.width}px`,a.style.height=`${l.height}px`}),()=>()=>{this.whiteBoardView=void 0}]),this.appProxy.whiteBoardViewCreated$.setValue(!0),this.whiteBoardView},this.ensurePageSize=s=>{var l;if(!A.isNumber(s)||!this.appProxy.scenePath||this.appProxy.pageState.length>=s)return;if(s<=0||s>=au)throw Error(`[WindowManager]: size ${s} muse be in range [1, ${au}]`);const o=s-this.appProxy.pageState.length,a=new Array(o).fill({});(l=this.room)==null||l.putScenes(this.appProxy.scenePath,a)},this.getInitScenePath=()=>this.appProxy.scenePath,this.setAttributes=s=>{this.manager.safeSetAttributes({[this.appId]:s})},this.updateAttributes=(s,o)=>{this.manager.attributes[this.appId]&&this.manager.safeUpdateAttributes([this.appId,...s],o)},this.setScenePath=async s=>{var o;!this.appProxy.box||(this.appProxy.setFullPath(s),(o=this.room)==null||o.setScenePath(s))},this.getAppOptions=()=>typeof this.appOptions=="function"?this.appOptions():this.appOptions,this.createStorage=(s,o)=>{const a=new pu(this,s,o);return this.emitter.on("destroy",()=>{a.destroy()}),a},this.dispatchMagixEvent=(...s)=>{var a;const o=`${this.appId}:${s[0]}`;return(a=this.manager.room)==null?void 0:a.dispatchMagixEvent(o,s[1])},this.addMagixEventListener=(s,o,a)=>{const l=`${this.appId}:${s}`;return this.manager.displayer.addMagixEventListener(l,o,a),()=>this.manager.displayer.removeMagixEventListener(l,o)},this.removeMagixEventListener=this.manager.displayer.removeMagixEventListener.bind(this.manager.displayer),this.emitter=n.appEmitter,this.isAddApp=n.isAddApp}get displayer(){return this.manager.displayer}get destroyed(){return this.appProxy.status==="destroyed"}get view(){return this.appProxy.view}get isWritable(){return this.manager.canOperate&&!this.destroyed}get box(){const t=this.appProxy.box$.value;if(t)return t;throw new fd}get room(){return this.manager.room}get members(){return this.manager.members$.value}get currentMember(){const t=xd(this.room,this.manager.uid);if(!t)throw new Error(`Member ${this.manager.uid} not found.`);return H({uid:this.manager.uid},t)}get storage(){return this._storage||(this._storage=new pu(this)),this._storage}}class Ug{constructor(t){this.params=t,this.sceneNode=null,this.createSceneNode=r=>(this.scenePath=r,this.sceneNode&&this.sceneNode.dispose(),this.sceneNode=this.params.displayer.createScenesCallback(r,{onAddScene:this.onSceneChange,onRemoveScene:this.onSceneChange}),this.sceneNode),this.onSceneChange=()=>{this.params.notifyPageStateChange()};const{displayer:i,scenePath:n}=this.params;this.view=this.params.view,n&&(this.scenePath=n,this.sceneNode=i.createScenesCallback(n,{onAddScene:this.onSceneChange,onRemoveScene:this.onSceneChange}))}setView(t){this.view=t}getFullPath(t){var n;const i=(n=this.sceneNode)==null?void 0:n.scenes;if(this.scenePath&&i){const r=i[t];if(r)return`${this.scenePath}/${r}`}}toObject(){var t,i;return{index:((t=this.view)==null?void 0:t.focusSceneIndex)||0,length:((i=this.sceneNode)==null?void 0:i.scenes.length)||0}}destroy(){var t;(t=this.sceneNode)==null||t.dispose()}}class Wg{constructor(t){this.saveCamera=t,this.setRect=i=>{this.rect=i,this.remoteCamera&&this.remoteSize&&this.onRemoteUpdate(this.remoteCamera,this.remoteSize)},this.onRemoteUpdate=A.throttle((i,n)=>{if(this.remoteCamera=i,this.remoteSize=n,this.remoteSize&&this.rect){const r=this.rect.width/n.width,s=this.rect.height/n.height,a={scale:i.scale*Math.min(r,s),animationMode:I.AnimationMode.Continuous};i.centerX!==null&&(a.centerX=i.centerX),i.centerY!==null&&(a.centerY=i.centerY),this.moveCamera(a)}},10)}setView(t){this.view=t}onRemoteSizeUpdate(t){this.remoteSize=t;const i=!A.isEqual(A.pick(this.rect,["width","height"]),A.pick(t,["width","height"]));if(this.rect&&this.remoteCamera&&i){const n=this.rect.width/t.width,r=this.remoteCamera.scale*n;this.moveCamera({scale:r})}}onLocalCameraUpdate(t){this.saveCamera(t),this.remoteCamera=t}moveCamera(t){var i;(i=this.view)==null||i.moveCamera(ft(H({},t),{animationMode:I.AnimationMode.Continuous}))}}class Sd{constructor(t){this.context=t,this.sem=new Re.SideEffectManager,this.bindView=n=>{!n||(this.synchronizer.setView(n),this.sem.flush("view"),this.sem.add(()=>(n.callbacks.on("onCameraUpdatedByDevice",this.onCameraUpdatedByDevice),()=>n.callbacks.off("onCameraUpdatedByDevice",this.onCameraUpdatedByDevice)),"view"))},this.onCameraUpdatedByDevice=n=>{if(!n)return;this.synchronizer.onLocalCameraUpdate(ft(H({},n),{id:this.context.uid}));const r=this.context.stageRect$.value;if(r){const s={width:r.width,height:r.height,id:this.context.uid};A.isEqual(s,this.context.size$.value)||this.context.storeSize(s)}},this.synchronizer=new Wg(n=>{this.context.camera$.setValue(n,!0),!(this.context.viewMode$&&this.context.viewMode$.value===I.ViewMode.Freedom)&&this.context.storeCamera(n)}),this.bindView(this.context.view$.value),this.sem.add(()=>[this.context.view$.subscribe(n=>{const r=this.context.camera$.value;r&&this.context.size$.value&&(n==null||n.moveCamera({scale:1,animationMode:I.AnimationMode.Immediately}),this.synchronizer.onRemoteUpdate(r,this.context.size$.value)),this.bindView(n)}),this.context.camera$.subscribe((n,r)=>{const s=this.context.size$.value;n&&s&&!r&&this.synchronizer.onRemoteUpdate(n,s)}),this.context.size$.subscribe(n=>{n&&this.synchronizer.onRemoteSizeUpdate(n)}),this.context.stageRect$.subscribe(n=>{n&&this.synchronizer.setRect(n)})]);const i=M.combine([this.context.camera$,this.context.size$]);i.reaction(([n,r])=>{n&&r&&(this.synchronizer.onRemoteUpdate(n,r),i.destroy())})}destroy(){this.sem.flushAll()}}const wt=new Zt.default,ja=(e,t)=>{let i=0;const n=t.length-1;return e===t.index?e===n?i=e-1:i=t.index+1:i=t.index,i};var re=(e=>(e.Apps="apps",e.Focus="focus",e.State="state",e.BoxState="boxState",e.MainViewCamera="mainViewCamera",e.MainViewSize="mainViewSize",e.Broadcaster="broadcaster",e.Cursors="cursors",e.Position="position",e.CursorState="cursorState",e.FullPath="fullPath",e.Registered="registered",e.Camera="camera",e.Size="size",e))(re||{});class Hg{constructor(t){this.context=t,this.setAppFocus=(i,n)=>{n?this.context.safeSetAttributes({focus:i}):this.context.safeSetAttributes({focus:void 0})}}setContext(t){this.context=t}get attributes(){return this.context.getAttributes()}apps(){return A.get(this.attributes,["apps"])}get focus(){return A.get(this.attributes,["focus"])}getAppAttributes(t){return A.get(this.apps(),[t])}getAppState(t){return A.get(this.apps(),[t,"state"])}getMaximized(){return A.get(this.attributes,["maximized"])}getMinimized(){return A.get(this.attributes,["minimized"])}setupAppAttributes(t,i,n){this.attributes.apps||this.context.safeSetAttributes({apps:{}});const s=["scenePath","title"];n||s.push("scenes");const o=A.pick(t.options,s),a={kind:t.kind,options:o,isDynamicPPT:n,setup:!1};typeof t.src=="string"&&(a.src=t.src),a.createdAt=Date.now(),this.context.safeUpdateAttributes(["apps",i],a),this.context.safeUpdateAttributes(["apps",i,"state"],{[Xe.Size]:{},[Xe.Position]:{},[Xe.SceneIndex]:0})}updateAppState(t,i,n){A.get(this.attributes,["apps",t,"state"])&&this.context.safeUpdateAttributes(["apps",t,"state",i],n)}updateAppAttributes(t,i,n){this.context.safeUpdateAttributes(["apps",t,i],n)}cleanAppAttributes(t){this.context.safeUpdateAttributes(["apps",t],void 0),this.context.safeSetAttributes({[t]:void 0}),this.attributes.focus===t&&this.cleanFocus()}cleanFocus(){this.context.safeSetAttributes({focus:void 0})}getAppSceneIndex(t){var i;return(i=this.getAppState(t))==null?void 0:i[Xe.SceneIndex]}getAppScenePath(t){var i,n;return(n=(i=this.getAppAttributes(t))==null?void 0:i.options)==null?void 0:n.scenePath}getMainViewScenePath(){return this.attributes._mainScenePath}getMainViewSceneIndex(){return this.attributes._mainSceneIndex}getBoxState(){return this.attributes.boxState}setMainViewScenePath(t){this.context.safeSetAttributes({_mainScenePath:t})}setMainViewSceneIndex(t){this.context.safeSetAttributes({_mainSceneIndex:t})}getMainViewCamera(){return A.get(this.attributes,["mainViewCamera"])}getMainViewSize(){return A.get(this.attributes,["mainViewSize"])}setMainViewCamera(t){this.context.safeSetAttributes({mainViewCamera:H({},t)})}setMainViewSize(t){this.context.safeSetAttributes({mainViewSize:H({},t)})}setMainViewCameraAndSize(t,i){this.context.safeSetAttributes({mainViewCamera:H({},t),mainViewSize:H({},i)})}updateCursor(t,i){A.get(this.attributes,["cursors"])||this.context.safeUpdateAttributes(["cursors"],{}),A.get(this.attributes,["cursors",t])||this.context.safeUpdateAttributes(["cursors",t],{}),this.context.safeUpdateAttributes(["cursors",t,"position"],i)}updateCursorState(t,i){A.get(this.attributes,["cursors",t])||this.context.safeUpdateAttributes(["cursors",t],{}),this.context.safeUpdateAttributes(["cursors",t,"cursorState"],i)}getCursorState(t){return A.get(this.attributes,["cursors",t,"cursorState"])}cleanCursor(t){this.context.safeUpdateAttributes(["cursors",t],void 0)}setMainViewFocusPath(t){const i=this.getMainViewScenePath();i&&gi(t,i)}}const Fg=new Hg({getAttributes:()=>{throw new Error("getAttributes not implemented")},safeSetAttributes:()=>{throw new Error("safeSetAttributes not implemented")},safeUpdateAttributes:()=>{throw new Error("safeUpdateAttributes not implemented")}});class La{constructor(t,i,n,r){var s;this.params=t,this.manager=i,this.boxManager=this.manager.boxManager,this.appProxies=this.manager.appProxies,this.viewManager=this.manager.viewManager,this.store=this.manager.store,this.uid=this.manager.uid,this.status="normal",this.sideEffectManager=new Re.SideEffectManager,this.valManager=new M.ValManager,this.fullPath$=this.valManager.attach(new M.Val(void 0)),this.camera$=this.valManager.attach(new M.Val(void 0)),this.size$=this.valManager.attach(new M.Val(void 0)),this.box$=this.valManager.attach(new M.Val(void 0)),this.view$=this.valManager.attach(new M.Val(void 0)),this.syncCamera$=this.valManager.attach(new M.Val(!0)),this.whiteBoardViewCreated$=this.valManager.attach(new M.Val(!1)),this.fireMemberStateChange=()=>{this.manager.room&&this.onMemberStateChange(this.manager.room.state.memberState)},this.onMemberStateChange=o=>{var l,u;o.currentApplianceName==="clicker"?(l=this.appContext)!=null&&l._viewWrapper&&(this.appContext._viewWrapper.style.pointerEvents="none"):(u=this.appContext)!=null&&u._viewWrapper&&(this.appContext._viewWrapper.style.pointerEvents="auto")},this.computedInitialRect=o=>{var l;const a=(l=this.manager.boxManager)==null?void 0:l.stageRect;if(a){const{width:u,height:h}=a,p=o.height/o.width;return h<480?{width:480/p,height:480}:{width:u*.65,height:h*.65}}},this.getAppInitState=o=>{var C,E;const a=this.store.getAppState(o);if(!a)return;const l=this.store.focus,u=(C=this.attributes)==null?void 0:C.maximized,h=(E=this.attributes)==null?void 0:E.minimized;let p={maximized:u,minimized:h,id:o};const w=A.omitBy(a,A.isUndefined);return l===o&&(p=ft(H({},p),{focus:!0})),Object.assign(p,w)},this.appAttributesUpdateListener=o=>{this.sideEffectManager.add(()=>[this.manager.refresher.add(o,()=>I.autorun(()=>{const a=this.manager.attributes[o];a&&this.appEmitter.emit("attributesUpdate",a)})),this.manager.refresher.add(this.stateKey,()=>I.autorun(()=>{var l,u,h;const a=(l=this.appAttributes)==null?void 0:l.state;(a==null?void 0:a.zIndex)>0&&a.zIndex!==((u=this.box)==null?void 0:u.zIndex)&&((h=this.boxManager)==null||h.setZIndex(o,a.zIndex))})),this.manager.refresher.add(`${o}-fullPath`,()=>I.autorun(()=>{var l;const a=(l=this.appAttributes)==null?void 0:l.fullPath;this.setFocusScenePathHandler(a),this.fullPath$.value!==a&&(this.notifyPageStateChange(),this.fullPath$.setValue(a))}))])},this.setFocusScenePathHandler=A.debounce(o=>{var a;this.view&&o&&o!==((a=this.view)==null?void 0:a.focusScenePath)&&gi(this.view,o)},50),this.notifyPageStateChange=A.debounce(()=>{this.pageState&&this.appEmitter.emit("pageStateChange",this.pageState)},50),this.storeCamera=o=>{this.store.updateAppAttributes(this.id,re.Camera,o)},this.storeSize=o=>{this.store.updateAppAttributes(this.id,re.Size,o)},this.updateSize=(o,a)=>{const l={id:this.manager.uid,width:o,height:a};this.store.updateAppAttributes(this.id,re.Size,l),this.size$.setValue(l)},this.moveCamera=o=>{if(!this.camera$.value)return;const a=ft(H(H({},this.camera$.value),o),{id:this.uid});this.storeCamera(a),this.camera$.setValue(a)},this.addCameraReaction=()=>{this.sideEffectManager.add(()=>this.manager.refresher.add(`${this.id}-camera`,()=>I.reaction(()=>{var o;return(o=this.appAttributes)==null?void 0:o.camera},o=>{if(o){const a=I.toJS(o);A.isEqual(a,this.camera$.value)||this.camera$.setValue(a)}})),"camera")},this.addSizeReaction=()=>{this.sideEffectManager.add(()=>this.manager.refresher.add(`${this.id}-size`,()=>I.reaction(()=>{var o;return(o=this.appAttributes)==null?void 0:o.size},o=>{if(o){const a=I.toJS(o);A.isEqual(a,this.size$.value)||this.size$.setValue(a)}})),"size")},this.onFocus=()=>{this.setScenePath()},this.setupDone=()=>{this.store.updateAppAttributes(this.id,"setup",!0),this.manager.dispatchInternalEvent(Z.InvokeAttributesUpdateCallback)},this.kind=t.kind,this.id=n,this.appScenePath=`/${this.id}-app-dir`,this.stateKey=`${this.id}_state`,this.appProxies.set(this.id,this),this.appEmitter=new Zt.default,this.appListener=this.makeAppEventListener(this.id),this.isAddApp=r,this.initScenes(),(s=this.params.options)!=null&&s.scenePath&&this.createView(),this.scenePath||(this.scenePath=this.appScenePath),this._pageState=new Ug({displayer:this.manager.displayer,scenePath:this.scenePath,view:this.view,notifyPageStateChange:this.notifyPageStateChange}),this.sideEffectManager.add(()=>()=>this._pageState.destroy()),this.camera$.setValue(I.toJS(this.appAttributes.camera)),this.size$.setValue(I.toJS(this.appAttributes.size)),this.addCameraReaction(),this.addSizeReaction(),this.sideEffectManager.add(()=>j.on("memberStateChange",this.onMemberStateChange)),this.sideEffectManager.add(()=>[this.syncCamera$.reaction(o=>{o||this.viewSync&&(this.viewSync.destroy(),this.viewSync=void 0,this.sideEffectManager.flush("camera"),this.sideEffectManager.flush("size"))}),this.whiteBoardViewCreated$.reaction(o=>{if(o&&this.box){if(!this.syncCamera$.value)return;M.combine([this.box$,this.view$]).subscribe(([a,l])=>{if(a&&l){if(this.camera$.value||(this.storeCamera({centerX:null,centerY:null,scale:1,id:this.uid}),this.camera$.setValue(I.toJS(this.appAttributes.camera))),!this.size$.value&&a.stageRect){const u=this.computedInitialRect(a.stageRect),h=(u==null?void 0:u.width)||a.stageRect.width,p=(u==null?void 0:u.height)||a.stageRect.height;this.storeSize({id:this.uid,width:h,height:p}),this.size$.setValue(I.toJS(this.appAttributes.size))}this.viewSync=new Sd({uid:this.uid,view$:this.view$,camera$:this.camera$,size$:this.size$,stageRect$:a._stageRect$,storeCamera:this.storeCamera,storeSize:this.storeSize}),this.sideEffectManager.add(()=>()=>{var u;return(u=this.viewSync)==null?void 0:u.destroy()}),this.whiteBoardViewCreated$.destroy()}})}}),this.manager.members$.reaction(o=>{this.appEmitter.emit("roomMembersChange",o)})])}createAppDir(){const t=this.scenePath||this.appScenePath;this._pageState.createSceneNode(t)||(ji(this.manager.room,t,[{name:"1"}]),this._pageState.createSceneNode(t),this.setSceneIndex(0)),this.scenes=mi(this.manager.displayer)[t];const n=this.createView();return this._pageState.setView(n),n}initScenes(){var i;const t=this.params.options;t&&(this.scenePath=t.scenePath,((i=this.appAttributes)==null?void 0:i.isDynamicPPT)&&this.scenePath?this.scenes=mi(this.manager.displayer)[this.scenePath]:this.scenes=t.scenes)}get view(){return this.view$.value}get viewIndex(){var t;return(t=this.view)==null?void 0:t.focusSceneIndex}get isWritable(){var t;return this.manager.canOperate&&!((t=this.box)!=null&&t.readonly)}get attributes(){return this.manager.attributes[this.id]}get appAttributes(){return this.store.getAppAttributes(this.id)}getFullScenePath(){if(this.scenePath)return A.get(this.appAttributes,[re.FullPath])||this.getFullScenePathFromScenes()}getFullScenePathFromScenes(){const t=A.get(this.appAttributes,["state","SceneIndex"],0),i=Eg(this.manager.room,this.scenePath,t);return i&&this.setFullPath(i),i}setFullPath(t){this.store.updateAppAttributes(this.id,re.FullPath,t)}async baseInsertApp(t=!1){var s;const i=this.params;if(!i.kind)throw new Error("[WindowManager]: kind require");const n=await((s=Me.appClasses.get(i.kind))==null?void 0:s()),r=Me.registered.get(i.kind);if(n)await this.setupApp(this.id,t,n,i.options,r==null?void 0:r.appOptions);else throw new Error(`[WindowManager]: app load failed ${i.kind} ${i.src}`);return j.emit("updateManagerRect"),{appId:this.id,app:n}}get box(){return this.box$.value}async setupApp(t,i,n,r,s){var a;if(zt("setupApp",t,n,r),!this.boxManager)throw new md;const o=new $g(this.manager,t,this,s);this.appContext=o;try{j.once(`${t}${Z.WindowCreated}`).then(async()=>{var p;let h;i||(h=this.getAppInitState(t),(p=this.boxManager)==null||p.updateBoxState(h)),this.appEmitter.onAny(this.appListener),this.appAttributesUpdateListener(t),this.setViewFocusScenePath(),setTimeout(async()=>{const w=await n.setup(o);this.appResult=w,Me.notifyApp(this.kind,"created",{appId:t,result:w}),this.fixMobileSize(),this.isAddApp&&this.setupDone()},cd)});const l=(a=this.boxManager)==null?void 0:a.createBox({appId:t,app:n,options:r,canOperate:this.manager.canOperate,smartPosition:this.isAddApp}),u=Me.registered.get(this.kind);u!=null&&u.contentStyles&&(l==null||l.mountUserStyles(u.contentStyles)),this.box$.setValue(l),this.isAddApp&&this.box&&(this.store.updateAppState(t,Xe.ZIndex,this.box.zIndex),this.store.updateAppState(t,Xe.Size,{width:this.box.intrinsicWidth,height:this.box.intrinsicHeight}),this.boxManager.focusBox({appId:t},!1))}catch(l){throw console.error(l),new Error(`[WindowManager]: app setup error: ${l.message}`)}}fixMobileSize(){var i,n;const t=(i=this.boxManager)==null?void 0:i.getBox(this.id);t&&(t.minimized||(n=this.boxManager)==null||n.resizeBox({appId:this.id,width:t.intrinsicWidth+.001,height:t.intrinsicHeight+.001,skipUpdate:!0}))}async onSeek(t){var n;this.appEmitter.emit("seek",t).catch(r=>{console.log(`[WindowManager]: emit seek error: ${r.message}`)});const i=this.getAppInitState(this.id);(n=this.boxManager)==null||n.updateBoxState(i)}async onReconnected(){var s;if(!Boolean(this.manager.attributes.apps[this.id])){await this.destroy(!0,!1,!0);return}this.appEmitter.emit("reconnected",void 0);const i=this.getAppInitState(this.id);await this.destroy(!0,!1,!0);const n=this.params;await new La(n,this.manager,this.id,this.isAddApp).baseInsertApp(!0),(s=this.boxManager)==null||s.updateBoxState(i)}async onRemoveScene(t){if(this.scenePath&&t.startsWith(this.scenePath+"/")){let i=this.pageState.index,n=this._pageState.getFullPath(i);n||(i=0,n=this._pageState.getFullPath(i)),n&&this.setFullPath(n),this.setViewFocusScenePath(),this.view&&(this.view.focusSceneIndex=i)}}emitAppSceneStateChange(t){this.appEmitter.emit("sceneStateChange",t)}emitAppIsWritableChange(){this.appEmitter.emit("writableChange",this.isWritable)}makeAppEventListener(t){return(i,n)=>{var r,s,o,a;if(!!this.manager.canOperate)switch(i){case"setBoxSize":{(r=this.boxManager)==null||r.resizeBox({appId:t,width:n.width,height:n.height,skipUpdate:!1});break}case"setBoxMinSize":{(s=this.boxManager)==null||s.setBoxMinSize({appId:t,minWidth:n.minwidth,minHeight:n.minheight});break}case"setBoxTitle":{(o=this.boxManager)==null||o.setBoxTitle({appId:t,title:n.title});break}case ad.destroy:{if(this.status==="destroyed")return;this.destroy(!0,!1,!0,n==null?void 0:n.error),n!=null&&n.error&&console.error(n==null?void 0:n.error);break}case"focus":{(a=this.boxManager)==null||a.focusBox({appId:this.id}),wt.emit("focus",{appId:this.id});break}}}}setScenePath(){if(!this.manager.canOperate)return;const t=this.getFullScenePath();this.manager.room&&t&&this.view&&Ln(this.manager.room,t)}setViewFocusScenePath(){if(this.status==="destroyed")return;const t=this.getFullScenePath();return t&&this.view&&gi(this.view,t),t}createView(){const t=this.viewManager.createView(this.id);return this.view$.setValue(t),this.setViewFocusScenePath(),t}get pageState(){return this._pageState.toObject()}async removeSceneByIndex(t){const i=this._pageState.getFullPath(t);if(i&&this.pageState){const n=ja(t,this.pageState);return this.setSceneIndexWithoutSync(n),this.manager.dispatchInternalEvent(Z.SetAppFocusIndex,{type:"app",appID:this.id,index:n}),setTimeout(()=>{To(this.manager.room,i,t)},100),!0}else return!1}setSceneIndexWithoutSync(t){this.view&&(this.view.focusSceneIndex=t)}setSceneIndex(t){if(this.view){this.view.focusSceneIndex=t;const i=this._pageState.getFullPath(t);i&&(this.setFullPath(i),Ln(this.manager.room,i))}}async destroy(t,i,n,r){var s;if(this.status!=="destroyed"){this.status="destroyed";try{await Me.notifyApp(this.kind,"destroy",{appId:this.id}),te.emit("appClose",{appId:this.id,kind:this.kind,error:r}),await this.appEmitter.emit("destroy",{error:r})}catch(o){console.error("[WindowManager]: notifyApp error",o.message,o.stack)}this.appEmitter.clearListeners(),this.sideEffectManager.flushAll(),j.emit(`destroy-${this.id}`,{error:r}),t&&((s=this.boxManager)==null||s.closeBox(this.id,n)),i&&(this.store.cleanAppAttributes(this.id),this.scenePath&&To(this.manager.room,this.scenePath)),this.appProxies.delete(this.id),this.viewManager.destroyView(this.id),this.manager.appStatus.delete(this.id),this.valManager.destroy()}}close(){return this.destroy(!0,!0,!1)}}class Qg{constructor(t){this.displayer=t,this.views=new Map}createView(t){const i=Cd(this.displayer);return this.views.set(t,i),i}getView(t){return this.views.get(t)}destroyView(t){const i=this.views.get(t);if(i){try{i.release()}catch{}this.views.delete(t)}}setViewScenePath(t,i){const n=this.views.get(t);n&&(n.focusScenePath=i)}destroy(){this.views.forEach(t=>{try{t.release()}catch{}}),this.views.clear()}}const Cd=e=>{const t=e.views.createView();return Zg(t),t},Zg=e=>{e.setCameraBound({maxContentMode:()=>10,minContentMode:()=>.1})};class Yg{constructor(t){this.manager=t,this.started=!1,this.mainViewIsAddListener=!1,this.store=this.manager.store,this.sideEffectManager=new Re.SideEffectManager,this.camera$=new M.Val(void 0),this.size$=new M.Val(void 0),this.view$=new M.Val(void 0),this.createViewSync=()=>{var i;this.manager.boxManager&&!this.viewSync&&(this.viewSync=new Sd({uid:this.manager.uid,view$:this.view$,camera$:this.camera$,size$:this.size$,stageRect$:(i=this.manager.boxManager)==null?void 0:i.stageRect$,viewMode$:this.manager.windowManger.viewMode$,storeCamera:this.storeCamera,storeSize:this.storeSize}))},this.startListenWritableChange=()=>{this.sideEffectManager.add(()=>j.on("writableChange",i=>{i&&this.ensureCameraAndSize()}))},this.addCameraReaction=()=>{this.manager.refresher.add(re.MainViewCamera,this.cameraReaction),this.manager.refresher.add(re.MainViewSize,this.sizeReaction)},this.storeCurrentCamera=()=>{const i=this.view.camera;this.storeCamera(H({id:this.manager.uid},i))},this.storeCurrentSize=()=>{var n;const i=(n=this.manager.boxManager)==null?void 0:n.stageRect;i&&this.storeSize({id:this.manager.uid,width:i.width,height:i.height})},this.storeCamera=i=>{this.store.setMainViewCamera(i)},this.storeSize=i=>{this.store.setMainViewSize(i)},this.cameraReaction=()=>I.reaction(()=>this.mainViewCamera,i=>{if(i){const n=I.toJS(i);A.isEqual(n,this.camera$.value)||this.camera$.setValue(n)}},{fireImmediately:!0}),this.sizeReaction=()=>I.reaction(()=>this.mainViewSize,i=>{if(i){const n=I.toJS(i);A.isEqual(n,this.size$.value)||this.size$.setValue(n)}},{fireImmediately:!0}),this.mainViewClickListener=()=>{this.mainViewClickHandler()},this.setMainViewSize=A.debounce(i=>{this.store.setMainViewSize(ft(H({},i),{id:this.manager.uid}))},50),this.onCameraOrSizeUpdated=()=>{te.emit("cameraStateChange",this.cameraState)},this.mainView=this.createMainView(),j.once("mainViewMounted").then(()=>{this.addMainViewListener(),this.start(),this.ensureCameraAndSize(),this.startListenWritableChange()}),this.sideEffectManager.add(()=>[j.on("startReconnect",()=>{cu(this.mainView)})]),this.createViewSync(),this.sideEffectManager.add(()=>j.on("focusedChange",({focused:i})=>{if(i===void 0){const n=this.store.getMainViewScenePath();n&&Ln(this.manager.room,n)}}))}ensureCameraAndSize(){var t;if(!this.mainViewCamera||!this.mainViewSize){this.manager.dispatchInternalEvent(Z.InitMainViewCamera),this.storeCamera(H({id:this.manager.uid},this.view.camera));const i=(t=this.manager.boxManager)==null?void 0:t.stageRect;i&&!this.mainViewSize&&this.storeSize({id:this.manager.uid,width:i.width,height:i.height})}}get mainViewCamera(){return this.store.getMainViewCamera()}get mainViewSize(){return this.store.getMainViewSize()}get didRelease(){return A.get(this.view,["didRelease"])}start(){this.started||(this.addCameraListener(),this.addCameraReaction(),this.started=!0)}get view(){return this.mainView}get cameraState(){return H(H({},this.view.camera),this.view.size)}createMainView(){const t=Cd(this.manager.displayer),i=this.store.getMainViewScenePath();return i&&gi(t,i),this.view$.setValue(t),t}onReconnect(){if(this.didRelease)this.rebind();else{const t=this.store.getMainViewScenePath();this.setFocusScenePath(t)}}setFocusScenePath(t){if(t)return gi(this.view,t)}rebind(){const t=this.mainView.divElement,i=this.mainView.disableCameraTransform,n=H({},this.mainView.camera);this.stop(),cu(this.mainView),this.removeMainViewListener(),this.mainView=this.createMainView(),this.mainView.disableCameraTransform=i,this.mainView.divElement=t,this.mainView.moveCamera(ft(H({},n),{animationMode:I.AnimationMode.Immediately})),this.addMainViewListener(),this.start()}addMainViewListener(){this.mainViewIsAddListener||this.view.divElement&&(this.view.divElement.addEventListener("click",this.mainViewClickListener),this.view.divElement.addEventListener("touchend",this.mainViewClickListener),this.mainViewIsAddListener=!0)}removeMainViewListener(){this.view.divElement&&(this.view.divElement.removeEventListener("click",this.mainViewClickListener),this.view.divElement.removeEventListener("touchend",this.mainViewClickListener)),this.mainViewIsAddListener=!1}async mainViewClickHandler(){var t;!this.manager.canOperate||(this.store.cleanFocus(),(t=this.manager.boxManager)==null||t.blurAllBox())}addCameraListener(){this.view.callbacks.on("onCameraUpdated",this.onCameraOrSizeUpdated),this.view.callbacks.on("onSizeUpdated",this.onCameraOrSizeUpdated)}removeCameraListener(){this.view.callbacks.off("onCameraUpdated",this.onCameraOrSizeUpdated),this.view.callbacks.off("onSizeUpdated",this.onCameraOrSizeUpdated)}stop(){this.removeCameraListener(),this.manager.refresher.remove(re.MainViewCamera),this.manager.refresher.remove(re.MainViewSize),this.started=!1}destroy(){this.camera$.destroy(),this.size$.destroy(),this.view$.destroy(),this.removeMainViewListener(),this.stop(),this.sideEffectManager.flushAll()}}class Gg{constructor(t){this.context=t,this.addRedoUndoListeners=i=>{if(i===void 0)this.addViewCallbacks(this.context.mainView(),this.onCanRedoStepsUpdate,this.onCanUndoStepsUpdate);else{const n=this.context.getAppProxy(i);n&&n.view&&this.addViewCallbacks(n.view,this.onCanRedoStepsUpdate,this.onCanUndoStepsUpdate)}},this.addViewCallbacks=(i,n,r)=>{n(i.canRedoSteps),r(i.canUndoSteps),i.callbacks.on("onCanRedoStepsUpdate",n),i.callbacks.on("onCanUndoStepsUpdate",r)},this.disposeViewCallbacks=i=>{i.callbacks.off("onCanRedoStepsUpdate",this.onCanRedoStepsUpdate),i.callbacks.off("onCanUndoStepsUpdate",this.onCanUndoStepsUpdate)},this.onCanRedoStepsUpdate=i=>{te.emit("canRedoStepsChange",i)},this.onCanUndoStepsUpdate=i=>{te.emit("canUndoStepsChange",i)},this.disposePrevFocusViewRedoUndoListeners=i=>{let n;if(i===void 0)n=this.context.mainView();else{const r=this.context.getAppProxy(i);r&&r.view&&(n=r.view)}n&&this.disposeViewCallbacks(n)},j.on("focusedChange",i=>{this.disposePrevFocusViewRedoUndoListeners(i.prev),setTimeout(()=>{this.addRedoUndoListeners(i.focused)},0)}),j.on("rootDirRemoved",()=>{this.disposePrevFocusViewRedoUndoListeners(t.focus()),this.addRedoUndoListeners(t.focus())}),this.addRedoUndoListeners(t.focus())}destroy(){this.disposePrevFocusViewRedoUndoListeners(this.context.focus())}}class Xg{constructor(t){this.windowManger=t,this.appProxies=new Map,this.appStatus=new Map,this.store=Fg,this.isReplay=this.windowManger.isReplay,this.mainViewScenesLength=0,this.callbacksNode=null,this.appCreateQueue=new hg,this.sceneIndex$=new M.Val(void 0),this.focused$=new M.Val(void 0),this.members$=new M.Val([]),this.sideEffectManager=new Re.SideEffectManager,this.sceneState=null,this.rootDirRemoving=!1,this.onRemoveScenes=async i=>{var r,s;const{scenePath:n}=i;if(n===ze){await this.onRootDirRemoved(),this.dispatchInternalEvent(Z.RootDirRemoved);return}if(zg(n)){let o=this.mainView.focusSceneIndex||0,a=(r=this.callbacksNode)==null?void 0:r.scenes[o];a||(o=0,a=(s=this.callbacksNode)==null?void 0:s.scenes[o]),a&&await this.setMainViewScenePath(`${ze}${a}`),await this.setMainViewSceneIndex(o)}else this.appProxies.forEach(o=>{o.onRemoveScene(n)})},this.onReadonlyChanged=()=>{this.appProxies.forEach(i=>{i.emitAppIsWritableChange()})},this.onPlayerSeekStart=async()=>{await this.closeAll()},this.onPlayerSeekDone=async i=>{await this.attributesUpdateCallback(this.attributes.apps),this.appProxies.forEach(n=>{n.onSeek(i)})},this.createRootDirScenesCallback=()=>{let i=!1;this.callbacksNode&&(this.callbacksNode.dispose(),i=!0),this.callbacksNode=this.displayer.createScenesCallback(ze,{onAddScene:this.onSceneChange,onRemoveScene:async(n,r)=>{await this.onSceneChange(n),j.emit("rootDirSceneRemoved",r)}}),this.callbacksNode&&(this.updateSceneState(this.callbacksNode),this.mainViewScenesLength=this.callbacksNode.scenes.length,i&&this.emitMainViewScenesChange(this.callbacksNode.scenes.length))},this.removeSceneByIndex=async i=>{var s;const n=ja(i,this.windowManger.pageState);this.setSceneIndexWithoutSync(n),this.dispatchInternalEvent(Z.SetAppFocusIndex,{type:"main",index:n});const r=(s=this.callbacksNode)==null?void 0:s.scenes[i];return setTimeout(()=>{r&&To(this.room,`${ze}${r}`,i)},100),new Promise((o,a)=>{j.once("rootDirSceneRemoved").then(l=>{l===r&&o(!0)}).catch(l=>{console.log(`[WindowManager]: removePage error: ${l}`),a(!1)})})},this.setSceneIndexWithoutSync=i=>{var r;const n=(r=this.callbacksNode)==null?void 0:r.scenes[i];n&&this.mainViewProxy.setFocusScenePath(`${ze}${n}`)},this.onSceneChange=i=>(this.mainViewScenesLength=i.scenes.length,this.updateSceneState(i),this.emitMainViewScenesChange(this.mainViewScenesLength)),this.emitMainViewScenesChange=i=>Promise.all([te.emit("mainViewScenesLengthChange",i),j.emit("changePageState")]),this.updateSceneState=i=>{const n=this.store.getMainViewSceneIndex()||0;let r=i.scenes[n];r||(r=i.scenes[this.mainView.focusSceneIndex||0]),this.sceneState={scenePath:`${ze}${r}`,contextPath:i.path,index:n,scenes:i.scenes.map(s=>({name:s})),sceneName:r},te.emit("sceneStateChange",this.sceneState)},this.onBoxMove=i=>{this.dispatchInternalEvent(Z.AppMove,i),this.store.updateAppState(i.appId,Xe.Position,{x:i.x,y:i.y})},this.onBoxResize=i=>{i.width&&i.height&&(this.dispatchInternalEvent(Z.AppResize,i),this.store.updateAppState(i.appId,Xe.Size,{width:i.width,height:i.height}))},this.onBoxFocus=i=>{this.windowManger.safeSetAttributes({focus:i.appId})},this.onBoxClose=i=>{const n=this.appProxies.get(i.appId);n&&n.destroy(!1,!0,!0,i.error)},this.onBoxStateChange=i=>{this.dispatchInternalEvent(Z.AppBoxStateChange,i)},this.addAppsChangeListener=()=>{this.refresher.add("apps",()=>yd(()=>this.attributes.apps,()=>{this.attributesUpdateCallback(this.attributes.apps)}))},this.addAppCloseListener=()=>{var i;(i=this.refresher)==null||i.add("appsClose",()=>Lg(this.attributes.apps,()=>{this.onAppDelete(this.attributes.apps)}))},this.onMainViewIndexChange=i=>{i!==void 0&&this.sceneIndex$.value!==i&&(te.emit("mainViewSceneIndexChange",i),j.emit("changePageState"),this.callbacksNode&&this.updateSceneState(this.callbacksNode),this.sceneIndex$.setValue(i))},this.onFocusChange=i=>{var n;this.focused$.value!==i&&(te.emit("focusedChange",i),j.emit("focusedChange",{focused:i,prev:this.focused$.value}),this.focused$.setValue(i),i!==void 0&&((n=this.boxManager)==null||n.focusBox({appId:i}),setTimeout(()=>{const r=this.appProxies.get(i);r&&(r.onFocus(),Me.notifyApp(r.kind,"focus",{appId:i}))},0)))},this.attributesUpdateCallback=A.debounce(i=>this._attributesUpdateCallback(i),100),this.onRegisteredChange=i=>{!i||Object.entries(i).forEach(([n,r])=>{Me.appClasses.has(n)||Me.register({kind:n,src:r.src,name:r.name})})},this.onMinimized=i=>{var n,r;((n=this.boxManager)==null?void 0:n.minimized)!==i&&(i===!0&&((r=this.boxManager)==null||r.blurAllBox()),setTimeout(()=>{var s;(s=this.boxManager)==null||s.setMinimized(Boolean(i))},0))},this.onAppDelete=async i=>{const n=Object.keys(i);for(const[r,s]of this.appProxies.entries())n.includes(r)||await s.destroy(!0,!1,!0)},this.closeAll=async()=>{for(const[i,n]of this.appProxies.entries())await n.destroy(!0,!1,!0)},this.displayerStateListener=i=>{const n=i.sceneState;if(n){const r=n.scenePath;this.appProxies.forEach(s=>{s.scenePath&&r.startsWith(s.scenePath)&&(s.emitAppSceneStateChange(n),s.setFullPath(r))})}this.appProxies.forEach(r=>{r.appEmitter.emit("roomStateChange",i)}),i.roomMembers&&this.members$.setValue(fu(i.roomMembers)),j.emit("observerIdChange",this.displayer.observerId),i.memberState&&j.emit("memberStateChange",I.toJS(i.memberState))},this.displayerWritableListener=i=>{var s,o;const n=!i,r=this.windowManger.readonly===void 0||!this.windowManger.readonly;this.windowManger.readonly===void 0?(s=this.boxManager)==null||s.setReadonly(i):(o=this.boxManager)==null||o.setReadonly(!(n&&r)),this.appProxies.forEach(a=>{a.emitAppIsWritableChange()}),n&&this.room&&this.room.disableSerialization===!0&&(this.room.disableSerialization=!1),j.emit("writableChange",n)},this.updateSceneIndex=()=>{const i=this.store.getMainViewScenePath(),n=Js(i),r=mi(this.displayer)[n];if(r.length){const s=i.replace(n,"").replace("/",""),o=r.findIndex(a=>a.name===s);A.isInteger(o)&&o>=0&&this.safeSetAttributes({_mainSceneIndex:o})}},this.updateRootDirRemoving=i=>{this.rootDirRemoving=i},this.displayer=t.displayer,this.store.setContext({getAttributes:()=>this.attributes,safeSetAttributes:i=>this.safeSetAttributes(i),safeUpdateAttributes:(i,n)=>this.safeUpdateAttributes(i,n)}),this.mainViewProxy=new Yg(this),this.viewManager=new Qg(this.displayer),this.appListeners=new Dg(this),this.displayer.callbacks.on(this.eventName,this.displayerStateListener),this.appListeners.addListeners(),this.refresher=Uf,this.refresher.setRoom(this.room),this.refresher.setContext({emitter:j}),this.sideEffectManager.add(()=>()=>{var i,n,r;this.appCreateQueue.destroy(),this.mainViewProxy.destroy(),(i=this.refresher)==null||i.destroy(),this.viewManager.destroy(),(n=this.boxManager)==null||n.destroy(),(r=this.callbacksNode)==null||r.dispose()}),j.once("onCreated").then(()=>this.onCreated()),j.on("onReconnected",()=>this.onReconnected()),I.isPlayer(this.displayer)&&(j.on("seekStart",this.onPlayerSeekStart),j.on("seek",this.onPlayerSeekDone)),j.on("removeScenes",this.onRemoveScenes),j.on("setReadonly",this.onReadonlyChanged),this.createRootDirScenesCallback(),Me.setSyncRegisterApp(i=>{this.safeUpdateAttributes([re.Registered,i.kind],i)}),this.members$.setValue(fu(this.displayer.state.roomMembers))}async onRootDirRemoved(t=!0){await this.setMainViewScenePath(ud),this.createRootDirScenesCallback();for(const[i,n]of this.appProxies.entries())n.view&&await this.closeApp(i,t);this.mainViewProxy.rebind(),await j.emit("rootDirRemoved"),this.updateRootDirRemoving(!1)}get eventName(){return I.isRoom(this.displayer)?"onRoomStateChanged":"onPlayerStateChanged"}get attributes(){return this.windowManger.attributes}get canOperate(){return this.windowManger.canOperate}get room(){return I.isRoom(this.displayer)?this.displayer:void 0}get mainView(){return this.mainViewProxy.view}get focusApp(){if(this.store.focus)return this.appProxies.get(this.store.focus)}get uid(){var t;return((t=this.room)==null?void 0:t.uid)||""}getMainViewSceneDir(){const t=this.store.getMainViewScenePath();if(t)return Js(t);throw new Error("[WindowManager]: mainViewSceneDir not found")}async onCreated(){var t;if(await this.attributesUpdateCallback(this.attributes.apps),j.emit("updateManagerRect"),wt.on("move",this.onBoxMove),wt.on("resize",this.onBoxResize),wt.on("focus",this.onBoxFocus),wt.on("close",this.onBoxClose),wt.on("boxStateChange",this.onBoxStateChange),this.addAppsChangeListener(),this.addAppCloseListener(),this.refresher.add("maximized",()=>I.autorun(()=>{var n;const i=this.attributes.maximized;(n=this.boxManager)==null||n.setMaximized(Boolean(i))})),this.refresher.add("minimized",()=>I.autorun(()=>{const i=this.attributes.minimized;this.onMinimized(i)})),this.refresher.add("mainViewIndex",()=>I.autorun(()=>{const i=A.get(this.attributes,"_mainSceneIndex");this.onMainViewIndexChange(i)})),this.refresher.add("focusedChange",()=>I.autorun(()=>{const i=A.get(this.attributes,"focus");this.onFocusChange(i)})),this.refresher.add("registeredChange",()=>I.autorun(()=>{const i=A.get(this.attributes,re.Registered);this.onRegisteredChange(i)})),!this.attributes.apps||Object.keys(this.attributes.apps).length===0){const i=this.store.getMainViewScenePath();if(!i)return;this.resetScenePath(i)}this.displayerWritableListener(!((t=this.room)!=null&&t.isWritable)),this.displayer.callbacks.on("onEnableWriteNowChanged",this.displayerWritableListener),this.focused$.setValue(this.attributes.focus),this.sideEffectManager.add(()=>{const i=new Gg({mainView:()=>this.mainViewProxy.view,focus:()=>this.attributes.focus,getAppProxy:n=>this.appProxies.get(n)});return()=>i.destroy()})}async _attributesUpdateCallback(t){if(t&&ge.container){const i=Object.keys(t);i.length===0&&this.appCreateQueue.emitReady();const n=i.map(r=>t[r].setup?{id:r,createdAt:t[r].createdAt}:{});for(const{id:r}of A.orderBy(n,"createdAt","asc"))if(r&&!this.appProxies.has(r)&&!this.appStatus.has(r)){const s=t[r];try{if(!this.attributes[r])throw new Error("appAttributes is undefined");this.appCreateQueue.push(()=>(this.appStatus.set(r,Eo.StartCreate),this.baseInsertApp({kind:s.kind,options:s.options,isDynamicPPT:s.isDynamicPPT},r,!1))),this.focusByAttributes(t)}catch(o){console.warn("[WindowManager]: Insert App Error",o)}}}}refresh(){this.attributesUpdateCallback(this.attributes.apps)}setBoxManager(t){this.boxManager=t,this.mainViewProxy.createViewSync()}resetMaximized(){var t;(t=this.boxManager)==null||t.setMaximized(Boolean(this.store.getMaximized()))}resetMinimized(){var t;(t=this.boxManager)==null||t.setMinimized(Boolean(this.store.getMinimized()))}bindMainView(t,i){const n=this.mainViewProxy.view;n.disableCameraTransform=i,Fr(30).then(()=>{n.divElement=t,j.emit("mainViewMounted")}),n.focusScenePath||this.setMainViewFocusPath()}setMainViewFocusPath(t){var n;const i=t||this.store.getMainViewScenePath();if(i)return gi(this.mainView,i),((n=this.mainView)==null?void 0:n.focusScenePath)===i}resetScenePath(t){this.displayer.state.sceneState.scenePath!==t&&Ln(this.room,t)}async addApp(t,i){zt("addApp",t);const{appId:n,needFocus:r}=await this.beforeAddApp(t,i),s=await this.baseInsertApp(t,n,!0,r);return this.afterAddApp(s),s==null?void 0:s.id}async beforeAddApp(t,i){var o,a;const n=await Ag(t.kind);this.appStatus.set(n,Eo.StartCreate);const r=(o=t.attributes)!=null?o:{};this.safeUpdateAttributes([n],r),this.store.setupAppAttributes(t,n,i);const s=!((a=this.boxManager)!=null&&a.minimized);return s&&this.store.setAppFocus(n,!0),{appId:n,needFocus:s}}afterAddApp(t){var i,n;if(t&&t.box){const r=t.box;wt.emit("move",{appId:t.id,x:r==null?void 0:r.intrinsicX,y:r==null?void 0:r.intrinsicY}),this.store.updateAppState(t.id,Xe.ZIndex,r.zIndex)}(i=this.boxManager)!=null&&i.minimized&&((n=this.boxManager)==null||n.setMinimized(!1,!1))}async closeApp(t,i=!0){const n=this.appProxies.get(t);n&&n.destroy(!0,i,!1)}async baseInsertApp(t,i,n,r){if(this.appProxies.has(i)){console.warn("[WindowManager]: app duplicate exists and cannot be created again");return}const s=new La(t,this,i,n);if(s)return await s.baseInsertApp(r),this.appStatus.delete(i),s;throw this.appStatus.delete(i),new Error("[WindowManger]: initialize AppProxy failed")}safeSetAttributes(t){this.windowManger.safeSetAttributes(t)}safeUpdateAttributes(t,i){this.windowManger.safeUpdateAttributes(t,i)}async setMainViewScenePath(t){if(this.room){const i=this.displayer.scenePathType(t);if(Js(t)!==ze)throw new Error('[WindowManager]: main view scenePath must in root dir "/"');if(i===I.ScenePathType.None)throw new Error(`[WindowManager]: ${t} not valid scene`);if(i===I.ScenePathType.Page)await this._setMainViewScenePath(t);else if(i===I.ScenePathType.Dir){const r=kg(this.displayer,t);r&&await this._setMainViewScenePath(r)}}}async _setMainViewScenePath(t){this.setMainViewFocusPath(t)&&(this.safeSetAttributes({_mainScenePath:t}),this.store.setMainViewFocusPath(this.mainView),this.updateSceneIndex(),this.dispatchSetMainViewScenePath(t))}async setMainViewSceneIndex(t){var i;if(this.room){if(this.store.getMainViewSceneIndex()===t)return;const n=(i=this.callbacksNode)==null?void 0:i.scenes[t],r=`${ze}${n}`;if(n)this.setMainViewFocusPath(r)&&(this.store.setMainViewScenePath(r),this.safeSetAttributes({_mainSceneIndex:t}),this.dispatchSetMainViewScenePath(r));else throw new Error(`[WindowManager]: ${t} not valid index`)}}dispatchSetMainViewScenePath(t){this.dispatchInternalEvent(Z.SetMainViewScenePath,{nextScenePath:t}),Ln(this.room,t)}getAppInitPath(t){var n;const i=this.store.getAppAttributes(t);if(i)return(n=i==null?void 0:i.options)==null?void 0:n.scenePath}safeDispatchMagixEvent(t,i){this.canOperate&&this.displayer.dispatchMagixEvent(t,i)}focusByAttributes(t){var i;if(t&&Object.keys(t).length===((i=this.boxManager)==null?void 0:i.boxSize)){const n=this.store.focus;n&&this.boxManager.focusBox({appId:n})}}async onReconnected(){this.attributesUpdateCallback(this.attributes.apps);const i=Array.from(this.appProxies.values()).map(n=>n.onReconnected());this.mainViewProxy.onReconnect(),await Promise.all(i)}notifyContainerRectUpdate(t){this.appProxies.forEach(i=>{i.appEmitter.emit("containerRectUpdate",t)})}dispatchInternalEvent(t,i){this.safeDispatchMagixEvent(Ao,{eventName:t,payload:i})}destroy(){this.displayer.callbacks.off(this.eventName,this.displayerStateListener),this.displayer.callbacks.off("onEnableWriteNowChanged",this.displayerWritableListener),this.appListeners.removeListeners(),wt.clearListeners(),j.clearListeners(),this.appProxies.size&&this.appProxies.forEach(t=>{t.destroy(!0,!1,!0)}),te.clearListeners(),this.sideEffectManager.flushAll(),this.sceneIndex$.destroy(),this.focused$.destroy(),this.members$.destroy()}}/*! *****************************************************************************
|
1
|
+
"use strict";var Co=Object.defineProperty,Io=Object.defineProperties;var _o=Object.getOwnPropertyDescriptors;var oi=Object.getOwnPropertySymbols;var fr=Object.prototype.hasOwnProperty,br=Object.prototype.propertyIsEnumerable;var mr=(t,e,i)=>e in t?Co(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,O=(t,e)=>{for(var i in e||(e={}))fr.call(e,i)&&mr(t,i,e[i]);if(oi)for(var i of oi(e))br.call(e,i)&&mr(t,i,e[i]);return t},ye=(t,e)=>Io(t,_o(e));var yr=(t,e)=>{var i={};for(var s in t)fr.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(t!=null&&oi)for(var s of oi(t))e.indexOf(s)<0&&br.call(t,s)&&(i[s]=t[s]);return i};Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var Ao=require("p-retry"),ko=require("emittery"),I=require("lodash"),M=require("white-web-sdk"),To=require("uuid"),ve=require("side-effect-manager"),w=require("value-enhancer"),la=require("@juggle/resize-observer");function ca(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var No=ca(Ao),rt=ca(ko),Y=(t=>(t.AppMove="AppMove",t.AppFocus="AppFocus",t.AppResize="AppResize",t.AppBoxStateChange="AppBoxStateChange",t.GetAttributes="GetAttributes",t.UpdateWindowManagerWrapper="UpdateWindowManagerWrapper",t.WindowCreated="WindowCreated",t.SetMainViewScenePath="SetMainViewScenePath",t.SetMainViewSceneIndex="SetMainViewSceneIndex",t.SetAppFocusIndex="SetAppFocusIndex",t.SwitchViewsToFreedom="SwitchViewsToFreedom",t.CursorMove="CursorMove",t.RootDirRemoved="RootDirRemoved",t.Refresh="Refresh",t.InitMainViewCamera="InitMainViewCamera",t.InvokeAttributesUpdateCallback="InvokeAttributesUpdateCallback",t))(Y||{});const ds="__WindowManger",Gi="__WindowMangerEnsureReconnected__";var Ee=(t=>(t.Size="size",t.Position="position",t.SceneIndex="SceneIndex",t.ZIndex="zIndex",t.Visible="visible",t.Ratio="ratio",t.StageRatio="stageRatio",t.Draggable="draggable",t.Resizable="resizable",t))(Ee||{}),ha=(t=>(t.setBoxSize="setBoxSize",t.setBoxMinSize="setBoxMinSize",t.destroy="destroy",t))(ha||{}),us=(t=>(t.StartCreate="StartCreate",t))(us||{}),da=(t=>(t.Leave="leave",t.Normal="normal",t))(da||{});const wr="2.16.1",Eo=340/720,Po=340/720,zo=9/16,we="/",ua="/init",pa=50,vr=500,J=new rt.default;class Do{constructor(){this.list=[],this.isEmit=!1,this.invoked=()=>{this.currentInvoker=void 0,this.list.length===0&&(this.clear(),this.emitReady())},this.clear=()=>{clearInterval(this.timer),this.timer=void 0}}initInterval(){return setInterval(()=>{this.invoke()},50)}push(e){this.list.push(e),this.invoke(),this.timer===void 0&&this.list.length>0&&(this.timer=this.initInterval())}invoke(){if(this.list.length===0||this.currentInvoker!==void 0)return;const e=this.list.shift();e&&(this.currentInvoker=e,e().then(()=>{this.invoked()}).catch(i=>{console.error(`[WindowManager]: create app error: ${i.message}`),this.invoked()}))}emitReady(){this.isEmit||setTimeout(()=>{J.emit("ready")},pa),this.isEmit=!0}empty(){this.list=[],this.clear()}destroy(){this.timer&&this.clear()}}const P=new rt.default,Lo="__WindowManagerAppCache";let Zt,xr;const Vo=async()=>{Zt=await Bo()},$o=(t,e)=>{if(!!Zt)return Oo(Zt,{kind:t,sourceCode:e})},jo=async t=>Zt?await Ro(Zt,t):null;function Bo(){return new Promise((t,e)=>{const i=indexedDB.open(Lo,2);i.onerror=s=>{e(s)},i.onupgradeneeded=s=>{const r=s.target.result;r.objectStoreNames.contains("apps")||(xr=r.createObjectStore("apps",{keyPath:"kind"}),xr.createIndex("kind","kind",{unique:!0}))},i.onsuccess=()=>{const s=i.result;t(s)}})}function Ro(t,e){return new Promise((i,s)=>{const a=t.transaction(["apps"]).objectStore("apps").index("kind").get(e);a.onerror=n=>s(n),a.onsuccess=()=>{a.result?i(a.result):i(null)}})}function Oo(t,e){return new Promise((i,s)=>{const r=t.transaction(["apps"],"readwrite").objectStore("apps").add(e);r.onsuccess=()=>i(),r.onerror=()=>s()})}const Uo="NetlessApp",Wo=1e4,Ho=async t=>{const e=await jo(t);if(e)return e.sourceCode;{const s=await(await Zo(t,{timeout:Wo})).text();return await $o(t,s),s}},Mr=(t,e)=>{let i=Function(t+`
|
2
|
+
;return ${e}`)();return typeof i=="undefined"&&(i=window[e]),i},Fo=async(t,e,i)=>{const s=i||Uo+e;J.emit("loadApp",{kind:e,status:"start"});try{const r=await Ho(t);if(!r||r.length===0){J.emit("loadApp",{kind:e,status:"failed",reason:"script is empty."});return}try{const a=Mr(r,s);return J.emit("loadApp",{kind:e,status:"success"}),a}catch(a){if(a.message.includes("Can only have one anonymous define call per script file")){const n=window.define;typeof n=="function"&&n.amd&&delete n.amd;const o=Mr(r,s);return J.emit("loadApp",{kind:e,status:"success"}),o}J.emit("loadApp",{kind:e,status:"failed",reason:a.message})}}catch(r){J.emit("loadApp",{kind:e,status:"failed",reason:r.message})}};async function Zo(t,e){const{timeout:i=1e4}=e,s=new AbortController,r=setTimeout(()=>s.abort(),i),a=await fetch(t,ye(O({},e),{signal:s.signal,headers:{"content-type":"text/plain"}}));return clearTimeout(r),a}class Yo{constructor(){this.kindEmitters=new Map,this.registered=new Map,this.appClassesCache=new Map,this.appClasses=new Map,this.syncRegisterApp=null,this.onSyncRegisterAppChange=e=>{this.register({kind:e.kind,src:e.src})}}setSyncRegisterApp(e){this.syncRegisterApp=e}async register(e){this.appClassesCache.delete(e.kind),this.registered.set(e.kind,e);const i=e.src;let s;if(typeof i=="string"?(s=async()=>{let r=await Fo(i,e.kind,e.name);if(r)return r.__esModule&&(r=r.default),r;throw new Error(`[WindowManager]: load remote script failed, ${i}`)},this.syncRegisterApp&&this.syncRegisterApp({kind:e.kind,src:i,name:e.name})):typeof i=="function"?s=i:s=async()=>i,this.appClasses.set(e.kind,async()=>{let r=this.appClassesCache.get(e.kind);return r||(r=s(),this.appClassesCache.set(e.kind,r)),r}),e.addHooks){const r=this.createKindEmitter(e.kind);r&&e.addHooks(r)}}unregister(e){this.appClasses.delete(e),this.appClassesCache.delete(e),this.registered.delete(e);const i=this.kindEmitters.get(e);i&&(i.clearListeners(),this.kindEmitters.delete(e))}async notifyApp(e,i,s){const r=this.kindEmitters.get(e);await(r==null?void 0:r.emit(i,s))}createKindEmitter(e){if(!this.kindEmitters.has(e)){const i=new rt.default;this.kindEmitters.set(e,i)}return this.kindEmitters.get(e)}}const ue=new Yo,Qo=async t=>{var i,s;const e=await((i=ue.appClasses.get(t))==null?void 0:i());return e&&((s=e.config)==null?void 0:s.singleton)?t:`${t}-${To.v4().replace("-","").slice(0,8)}`},dt=(t,e)=>{if(!t.didRelease&&t.focusScenePath!==e)return t.focusScenePath=e,t},Sr=t=>{t.didRelease||t.release()},Yt=(t,e)=>{if(t&&t.isWritable&&t.state.sceneState.scenePath!==e){const i=e==="/"?"":e;t.setScenePath(i)}},Go=(t,e,i)=>{var s;if(t&&e){const a=(s=ut(t)[e])==null?void 0:s[i];if(a)return`${e}/${a.name}`}},ps=(t,e,i)=>{t&&t.scenePathType(e)!==M.ScenePathType.None&&t.removeScenes(e,i)},qo=(t,e)=>{P.once(t).then(e)};I.debounce((t,e)=>{t.emit("mainViewModeChange",e)},200);const Jo=(t,e,i=0)=>{const s=ut(t)[e];if(!s)return;const r=s[i];if(!r)return;const a=r.name;return e===we?`/${a}`:`${e}/${a}`},ut=t=>t.entireScenes(),vt=(t,e,i,s)=>t==null?void 0:t.putScenes(e,i,s),Xo=t=>t.startsWith("/"),qi=t=>{const e=t.split("/");e.pop();let i=e.join("/");return i===""&&(i="/"),i},Ko=t=>t.endsWith("/")?t.slice(0,-1):t,Cr=t=>{const e=t.split(".").map(i=>i.padStart(2,"0")).join("");return parseInt(e)},Mi=t=>new Promise(e=>setTimeout(e,t)),el=t=>t.split("").reduce((i,s)=>(s===we&&(i+=1),i),0)===1;class tl{constructor(e){this.manager=e,this.displayer=this.manager.displayer,this.mainMagixEventListener=i=>{if(i.authorId!==this.displayer.observerId){const s=i.payload;switch(s.eventName){case Y.AppMove:{this.appMoveHandler(s.payload);break}case Y.AppResize:{this.appResizeHandler(s.payload);break}case Y.AppBoxStateChange:{this.boxStateChangeHandler(s.payload);break}case Y.SetMainViewScenePath:{this.setMainViewScenePathHandler(s.payload);break}case Y.CursorMove:{this.cursorMoveHandler(s.payload);break}case Y.RootDirRemoved:{this.rootDirRemovedHandler();break}case Y.Refresh:{this.refreshHandler();break}case Y.InitMainViewCamera:{this.initMainViewCameraHandler();break}case Y.SetAppFocusIndex:{this.setAppFocusViewIndexHandler(s.payload);break}case Y.InvokeAttributesUpdateCallback:{this.manager.attributesUpdateCallback(this.manager.attributes.apps);break}}}},this.appMoveHandler=i=>{var s;(s=this.boxManager)==null||s.moveBox(i)},this.appResizeHandler=i=>{var s,r;(s=this.boxManager)==null||s.resizeBox(Object.assign(i,{skipUpdate:!0})),(r=this.manager.room)==null||r.refreshViewSize()},this.boxStateChangeHandler=i=>{J.emit("boxStateChange",i)},this.setMainViewScenePathHandler=({nextScenePath:i})=>{dt(this.manager.mainView,i),J.emit("mainViewScenePathChange",i)},this.cursorMoveHandler=i=>{P.emit("cursorMove",i)},this.rootDirRemovedHandler=()=>{this.manager.createRootDirScenesCallback(),this.manager.mainViewProxy.rebind(),P.emit("rootDirRemoved")},this.refreshHandler=()=>{this.manager.windowManger._refresh()},this.initMainViewCameraHandler=()=>{this.manager.mainViewProxy.addCameraReaction()},this.setAppFocusViewIndexHandler=i=>{if(i.type==="main")this.manager.setSceneIndexWithoutSync(i.index);else if(i.type==="app"&&i.appID){const s=this.manager.appProxies.get(i.appID);s&&s.setSceneIndexWithoutSync(i.index)}}}get boxManager(){return this.manager.boxManager}addListeners(){this.displayer.addMagixEventListener(ds,this.mainMagixEventListener)}removeListeners(){this.displayer.removeMagixEventListener(ds,this.mainMagixEventListener)}}class ga extends Error{constructor(){super(...arguments);this.message="[WindowManager]: app duplicate exists and cannot be created again"}}class il extends Error{constructor(e){super(`[WindowManager]: app ${e} need register or provide src`)}}class he extends Error{constructor(){super(...arguments);this.message="[WindowManager]: AppManager must be initialized"}}class ma extends Error{constructor(e){super(`[WindowManager]: white-web-sdk version must large than ${e}`)}}class fa extends Error{constructor(){super(...arguments);this.message="[WindowManager]: kind must be a valid string"}}class ba extends Error{constructor(){super(...arguments);this.message="[WindowManager]: box need created"}}class ya extends Error{constructor(){super(...arguments);this.message='[WindowManager]: ScenePath should start with "/"'}}class wa extends Error{constructor(){super(...arguments);this.message="[WindowManager]: boxManager not found"}}class va extends Error{constructor(){super(...arguments);this.message="[WindowManager]: room phase only Connected can be bindContainer"}}const xa=t=>(e,i)=>{if(e!==void 0)if(M.listenUpdated){const s=r=>{r.map(n=>n.kind).includes(t)&&i()};return M.listenUpdated(e,s),i(),()=>M.unlistenUpdated(e,s)}else return M.reaction(()=>e,()=>{i()},{fireImmediately:!0})},Ma=(t,e,i)=>{let s=null;const r=M.reaction(t,()=>{s&&(s(),s=null);const a=t();I.isObject(a)?(s=()=>M.unlistenUpdated(a,e),M.listenUpdated(a,e)):i==null||i(a)},{fireImmediately:!0});return()=>{s==null||s(),r()}},sl=xa(M.UpdateEventKind.Removed);xa(M.UpdateEventKind.Inserted);const Ji=Object.keys;function Ir(t){return Boolean(I.has(t,"__isRef"))}function rl(t){return{k:ve.genUID(),v:t,__isRef:!0}}class al{constructor(){this.listeners=new Set}get length(){return this.listeners.size}dispatch(e){this.listeners.forEach(i=>i(e))}addListener(e){this.listeners.add(e)}removeListener(e){this.listeners.delete(e)}}const Te="_WM-STORAGE_";class _r{constructor(e,i,s){if(this._sideEffect=new ve.SideEffectManager,this._destroyed=!1,this._refMap=new WeakMap,this._lastValue=new Map,this.onStateChanged=new al,s&&!I.isObject(s))throw new Error(`Default state for Storage ${i} is not an object.`);this._context=e,this.id=i||null,this._state={};const r=this._getRawState(this._state);this._context.isWritable&&(this.id===null?e.isAddApp&&s&&this.setState(s):(r===this._state||!I.isObject(r))&&(I.get(this._context.getAttributes(),[Te])||this._context.updateAttributes([Te],{}),this._context.updateAttributes([Te,this.id],this._state),s&&this.setState(s))),Ji(r).forEach(a=>{if(!(this.id===null&&a===Te))try{const n=I.isObject(r[a])?JSON.parse(JSON.stringify(r[a])):r[a];Ir(n)?(this._state[a]=n.v,I.isObject(n.v)&&this._refMap.set(n.v,n)):this._state[a]=n}catch(n){console.error(n)}}),this._sideEffect.addDisposer(Ma(()=>this.id===null?e.getAttributes():I.get(e.getAttributes(),[Te,this.id]),this._updateProperties.bind(this),this.destroy.bind(this)))}get state(){return this._destroyed&&console.warn(`Accessing state on destroyed Storage "${this.id}"`),this._state}addStateChangedListener(e){return this.onStateChanged.addListener(e),()=>this.onStateChanged.removeListener(e)}ensureState(e){return this.setState(Ji(e).reduce((i,s)=>(I.has(this._state,s)||(i[s]=e[s]),i),{}))}setState(e){if(this._destroyed){console.error(new Error(`Cannot call setState on destroyed Storage "${this.id}".`));return}if(!this._context.isWritable){console.error(new Error(`Cannot setState on Storage "${this.id}" without writable access`),e);return}const i=Ji(e);i.length>0&&i.forEach(s=>{const r=e[s];if(r!==this._state[s])if(r===void 0)this._lastValue.set(s,this._state[s]),delete this._state[s],this._setRawState(s,r);else{this._lastValue.set(s,this._state[s]),this._state[s]=r;let a=r;if(I.isObject(r)){let n=this._refMap.get(r);n||(n=rl(r),this._refMap.set(r,n)),a=n}this._setRawState(s,a)}})}emptyStorage(){if(!(I.size(this._state)<=0)){if(this._destroyed){console.error(new Error(`Cannot empty destroyed Storage "${this.id}".`));return}if(!this._context.isWritable){console.error(new Error(`Cannot empty Storage "${this.id}" without writable access.`));return}this.setState(I.mapValues(this._state,I.noop))}}deleteStorage(){if(this.id===null)throw new Error("Cannot delete main Storage");if(!this._context.isWritable){console.error(new Error(`Cannot delete Storage "${this.id}" without writable access.`));return}this.destroy(),this._context.updateAttributes([Te,this.id],void 0)}get destroyed(){return this._destroyed}destroy(){this._destroyed=!0,this._sideEffect.flushAll()}_getRawState(e){var i;return this.id===null?(i=this._context.getAttributes())!=null?i:e:I.get(this._context.getAttributes(),[Te,this.id],e)}_setRawState(e,i){if(this.id===null){if(e===Te)throw new Error(`Cannot set attribute internal filed "${Te}"`);return this._context.updateAttributes([e],i)}else return this._context.updateAttributes([Te,this.id,e],i)}_updateProperties(e){var i;if(this._destroyed){console.error(new Error(`Cannot call _updateProperties on destroyed Storage "${this.id}".`));return}if(e.length>0){const s={};for(let r=0;r<e.length;r++)try{const a=e[r],n=a.key;if(this.id===null&&n===Te)continue;const o=I.isObject(a.value)?JSON.parse(JSON.stringify(a.value)):a.value;let c;switch(this._lastValue.has(n)&&(c=this._lastValue.get(n),this._lastValue.delete(n)),a.kind){case 2:{I.has(this._state,n)&&(c=this._state[n],delete this._state[n]),s[n]={oldValue:c};break}default:{let l=o;if(Ir(o)){const{k:d,v:u}=o,p=this._state[n];I.isObject(p)&&((i=this._refMap.get(p))==null?void 0:i.k)===d?l=p:(l=u,I.isObject(u)&&this._refMap.set(u,o))}l!==this._state[n]&&(c=this._state[n],this._state[n]=l),s[n]={newValue:l,oldValue:c};break}}}catch(a){console.error(a)}this.onStateChanged.dispatch(s)}}}class nl{constructor(e,i,s,r){this.view=e,this.appContext=i,this.appProxy=s,this.ensureSize=r,this.nextPage=async()=>{const l=this.pageState.index+1;return this.jumpPage(l)},this.prevPage=async()=>{const l=this.pageState.index-1;return this.jumpPage(l)},this.jumpPage=async l=>l<0||l>=this.pageState.length?(console.warn(`[WindowManager]: index ${l} out of range`),!1):(this.appProxy.setSceneIndex(l),!0),this.addPage=async l=>{const d=l==null?void 0:l.after,u=l==null?void 0:l.scene,p=this.appProxy.scenePath;if(!!p)if(d){const m=this.pageState.index+1;vt(this.appContext.room,p,[u||{}],m)}else vt(this.appContext.room,p,[u||{}])},this.removePage=async l=>{const d=l===void 0?this.pageState.index:l;return this.pageState.length===1?(console.warn("[WindowManager]: can not remove the last page"),!1):d<0||d>=this.pageState.length?(console.warn(`[WindowManager]: page index ${l} out of range`),!1):this.appProxy.removeSceneByIndex(d)};const a=new w.Val(s.pageState),n=new w.Val(s.size$.value),o=l=>I.pick(l,["centerX","centerY","scale"]),c=new w.Val(o(this.view.camera));this.baseRect$=n,this.pageState$=a,this.baseCamera$=c,this.appProxy.sideEffectManager.add(()=>[s.appEmitter.on("pageStateChange",l=>a.setValue(l)),s.camera$.subscribe(l=>{l&&c.setValue(o(l))}),s.size$.subscribe(l=>{l&&n.setValue(I.pick(l,["width","height"]))})]),e.disableCameraTransform=!0}get pageState(){return this.pageState$.value}moveCamera(e){this.appProxy.moveCamera(e)}setBaseRect(e){this.appProxy.updateSize(e.width,e.height)}}const Je=(...t)=>{le.debug&&console.log("[WindowManager]:",...t)},ol=(t,e)=>{const i=document.createElement("div");i.className="netless-window-manager-playground";const s=document.createElement("div");return s.className="netless-window-manager-main-view",e.appendChild(s),t.appendChild(i),{playground:i,mainViewElement:s}},ll=()=>{if(Cr(M.WhiteVersion)<Cr(wr))throw new ma(wr)},Sa=(t,e)=>{const i=t==null?void 0:t.state.roomMembers;return i==null?void 0:i.find(s=>{var r;return((r=s.payload)==null?void 0:r.uid)===e})},Ar=t=>t.map(e=>{var i;return O({uid:((i=e.payload)==null?void 0:i.uid)||""},M.toJS(e))}),kr=async t=>{try{return await t.createInvisiblePlugin(le,{})}catch(e){if(e.message==='invisible plugin "WindowManager" exits')return await Mi(200),t.getInvisiblePlugin(le.kind);Je("createInvisiblePlugin failed",e)}};class cl{constructor(e,i,s,r){this.manager=e,this.appId=i,this.appProxy=s,this.appOptions=r,this.mobxUtils={autorun:M.autorun,reaction:M.reaction,toJS:M.toJS},this.objectUtils={listenUpdated:M.listenUpdated,unlistenUpdated:M.unlistenUpdated,listenDisposed:M.listenDisposed,unlistenDisposed:M.unlistenDisposed},this.store=this.manager.store,this.isReplay=this.manager.isReplay,this.getAttributes=()=>this.appProxy.attributes,this.getScenes=()=>{const a=this.store.getAppAttributes(this.appId);return a!=null&&a.isDynamicPPT?this.appProxy.scenes:a==null?void 0:a.options.scenes},this.createWhiteBoardView=a=>{if(this.whiteBoardView)return this.whiteBoardView;let n=this.view;n||(n=this.appProxy.createAppDir()),a&&I.isBoolean(a.syncCamera)&&this.appProxy.syncCamera$.setValue(a.syncCamera);const o=document.createElement("div");return this._viewWrapper=o,o.className="window-manager-view-wrapper",this.box.$main.appendChild(o),n.divElement=o,this.appProxy.fireMemberStateChange(),this.isAddApp&&this.ensurePageSize(a==null?void 0:a.size),this.whiteBoardView=new nl(n,this,this.appProxy,this.ensurePageSize),this.appProxy.sideEffectManager.add(()=>[this.box._stageRect$.subscribe(c=>{o.style.left=`${c.x}px`,o.style.top=`${c.y}px`,o.style.width=`${c.width}px`,o.style.height=`${c.height}px`}),()=>()=>{this.whiteBoardView=void 0}]),this.appProxy.whiteBoardViewCreated$.setValue(!0),this.whiteBoardView},this.ensurePageSize=a=>{var c;if(!I.isNumber(a)||!this.appProxy.scenePath||this.appProxy.pageState.length>=a)return;if(a<=0||a>=vr)throw Error(`[WindowManager]: size ${a} muse be in range [1, ${vr}]`);const n=a-this.appProxy.pageState.length,o=new Array(n).fill({});(c=this.room)==null||c.putScenes(this.appProxy.scenePath,o)},this.getInitScenePath=()=>this.appProxy.scenePath,this.setAttributes=a=>{this.manager.safeSetAttributes({[this.appId]:a})},this.updateAttributes=(a,n)=>{this.manager.attributes[this.appId]&&this.manager.safeUpdateAttributes([this.appId,...a],n)},this.setScenePath=async a=>{var n;!this.appProxy.box||(this.appProxy.setFullPath(a),(n=this.room)==null||n.setScenePath(a))},this.getAppOptions=()=>typeof this.appOptions=="function"?this.appOptions():this.appOptions,this.createStorage=(a,n)=>{const o=new _r(this,a,n);return this.emitter.on("destroy",()=>{o.destroy()}),o},this.dispatchMagixEvent=(...a)=>{var o;const n=`${this.appId}:${a[0]}`;return(o=this.manager.room)==null?void 0:o.dispatchMagixEvent(n,a[1])},this.addMagixEventListener=(a,n,o)=>{const c=`${this.appId}:${a}`;return this.manager.displayer.addMagixEventListener(c,n,o),()=>this.manager.displayer.removeMagixEventListener(c,n)},this.removeMagixEventListener=this.manager.displayer.removeMagixEventListener.bind(this.manager.displayer),this.emitter=s.appEmitter,this.isAddApp=s.isAddApp}get displayer(){return this.manager.displayer}get destroyed(){return this.appProxy.status==="destroyed"}get view(){return this.appProxy.view}get now(){if(this.isReplay){const e=this.displayer;return e.beginTimestamp+e.progressTime}else return this.displayer.calibrationTimestamp}get isWritable(){return this.manager.canOperate&&!this.destroyed}get box(){const e=this.appProxy.box$.value;if(e)return e;throw new ba}get room(){return this.manager.room}get members(){return this.manager.members$.value}get currentMember(){const e=Sa(this.room,this.manager.uid);if(!e)throw new Error(`Member ${this.manager.uid} not found.`);return O({uid:this.manager.uid},e)}get storage(){return this._storage||(this._storage=new _r(this)),this._storage}}class hl{constructor(e){this.params=e,this.sceneNode=null,this.createSceneNode=r=>(this.scenePath=r,this.sceneNode&&this.sceneNode.dispose(),this.sceneNode=this.params.displayer.createScenesCallback(r,{onAddScene:this.onSceneChange,onRemoveScene:this.onSceneChange}),this.sceneNode),this.onSceneChange=()=>{this.params.notifyPageStateChange()};const{displayer:i,scenePath:s}=this.params;this.view=this.params.view,s&&(this.scenePath=s,this.sceneNode=i.createScenesCallback(s,{onAddScene:this.onSceneChange,onRemoveScene:this.onSceneChange}))}setView(e){this.view=e}getFullPath(e){var s;const i=(s=this.sceneNode)==null?void 0:s.scenes;if(this.scenePath&&i){const r=i[e];if(r)return`${this.scenePath}/${r}`}}toObject(){var e,i;return{index:((e=this.view)==null?void 0:e.focusSceneIndex)||0,length:((i=this.sceneNode)==null?void 0:i.scenes.length)||0}}destroy(){var e;(e=this.sceneNode)==null||e.dispose()}}class dl{constructor(e){this.saveCamera=e,this.setRect=i=>{this.rect=i,this.remoteCamera&&this.remoteSize&&this.onRemoteUpdate(this.remoteCamera,this.remoteSize)},this.onRemoteUpdate=I.throttle((i,s)=>{if(this.remoteCamera=i,this.remoteSize=s,this.remoteSize&&this.rect){const a={scale:i.scale*Ca(s,this.rect)};i.centerX!==null&&(a.centerX=i.centerX),i.centerY!==null&&(a.centerY=i.centerY),this.moveCamera(a)}},10)}setView(e){this.view=e}onRemoteSizeUpdate(e){this.remoteSize=e;const i=!I.isEqual(I.pick(this.rect,["width","height"]),I.pick(e,["width","height"]));if(this.rect&&this.remoteCamera&&i){const s=this.rect.width/e.width,r=this.remoteCamera.scale*s;this.moveCamera({scale:r})}}onLocalCameraUpdate(e){this.saveCamera(e),this.remoteCamera=e}moveCamera(e){var i;(i=this.view)==null||i.moveCamera(ye(O({},e),{animationMode:M.AnimationMode.Immediately}))}}const Ca=(t,e)=>{const i=e.width/t.width,s=e.height/t.height;return Math.min(i,s)};class Ia{constructor(e){this.context=e,this.sem=new ve.SideEffectManager,this.bindView=s=>{!s||(this.synchronizer.setView(s),this.sem.flush("view"),this.sem.add(()=>(s.callbacks.on("onCameraUpdatedByDevice",this.onCameraUpdatedByDevice),()=>s.callbacks.off("onCameraUpdatedByDevice",this.onCameraUpdatedByDevice)),"view"))},this.onCameraUpdatedByDevice=s=>{if(!!s&&this.context.size$.value&&this.context.stageRect$.value){const r=Ca(this.context.size$.value,this.context.stageRect$.value),a=s.scale/r;this.synchronizer.onLocalCameraUpdate(ye(O({},s),{scale:a,id:this.context.uid}))}},this.synchronizer=new dl(s=>{this.context.camera$.setValue(s,!0),!(this.context.viewMode$&&this.context.viewMode$.value===M.ViewMode.Freedom)&&this.context.storeCamera(s)}),this.bindView(this.context.view$.value),this.sem.add(()=>[this.context.view$.subscribe(s=>{const r=this.context.camera$.value;r&&this.context.size$.value&&(s==null||s.moveCamera({scale:1,animationMode:M.AnimationMode.Immediately}),this.synchronizer.onRemoteUpdate(r,this.context.size$.value)),this.bindView(s)}),this.context.camera$.subscribe((s,r)=>{const a=this.context.size$.value;s&&a&&!r&&this.synchronizer.onRemoteUpdate(s,a)}),this.context.size$.subscribe(s=>{s&&this.synchronizer.onRemoteSizeUpdate(s)}),this.context.stageRect$.subscribe(s=>{s&&this.synchronizer.setRect(s)})]);const i=w.combine([this.context.camera$,this.context.size$]);i.reaction(([s,r])=>{s&&r&&(this.synchronizer.onRemoteUpdate(s,r),i.destroy())})}destroy(){this.sem.flushAll()}}const Ue=new rt.default,Ls=(t,e)=>{let i=0;const s=e.length-1;return t===e.index?t===s?i=t-1:i=e.index+1:i=e.index,i};var ee=(t=>(t.Apps="apps",t.Focus="focus",t.State="state",t.BoxState="boxState",t.MainViewCamera="mainViewCamera",t.MainViewSize="mainViewSize",t.Broadcaster="broadcaster",t.Cursors="cursors",t.Position="position",t.CursorState="cursorState",t.FullPath="fullPath",t.Registered="registered",t.Camera="camera",t.Size="size",t))(ee||{});class ul{constructor(e){this.context=e,this.setAppFocus=(i,s)=>{s?this.context.safeSetAttributes({focus:i}):this.context.safeSetAttributes({focus:void 0})}}setContext(e){this.context=e}get attributes(){return this.context.getAttributes()}apps(){return I.get(this.attributes,["apps"])}get focus(){return I.get(this.attributes,["focus"])}getAppAttributes(e){return I.get(this.apps(),[e])}getAppState(e){return I.get(this.apps(),[e,"state"])}getMaximized(){return I.get(this.attributes,["maximized"])}getMinimized(){return I.get(this.attributes,["minimized"])}setupAppAttributes(e,i,s){this.attributes.apps||this.context.safeSetAttributes({apps:{}});const a=["scenePath","title"];s||a.push("scenes");const n=I.pick(e.options,a),o={kind:e.kind,options:n,isDynamicPPT:s,setup:!1};typeof e.src=="string"&&(o.src=e.src),o.createdAt=Date.now(),this.context.safeUpdateAttributes(["apps",i],o),this.context.safeUpdateAttributes(["apps",i,"state"],{[Ee.Size]:{},[Ee.Position]:{},[Ee.SceneIndex]:0})}updateAppState(e,i,s){I.get(this.attributes,["apps",e,"state"])&&this.context.safeUpdateAttributes(["apps",e,"state",i],s)}updateAppAttributes(e,i,s){this.context.safeUpdateAttributes(["apps",e,i],s)}cleanAppAttributes(e){this.context.safeUpdateAttributes(["apps",e],void 0),this.context.safeSetAttributes({[e]:void 0}),this.attributes.focus===e&&this.cleanFocus()}cleanFocus(){this.context.safeSetAttributes({focus:void 0})}getAppSceneIndex(e){var i;return(i=this.getAppState(e))==null?void 0:i[Ee.SceneIndex]}getAppScenePath(e){var i,s;return(s=(i=this.getAppAttributes(e))==null?void 0:i.options)==null?void 0:s.scenePath}getMainViewScenePath(){return this.attributes._mainScenePath}getMainViewSceneIndex(){return this.attributes._mainSceneIndex}getBoxState(){return this.attributes.boxState}setMainViewScenePath(e){this.context.safeSetAttributes({_mainScenePath:e})}setMainViewSceneIndex(e){this.context.safeSetAttributes({_mainSceneIndex:e})}getMainViewCamera(){return I.get(this.attributes,["mainViewCamera"])}getMainViewSize(){return I.get(this.attributes,["mainViewSize"])}setMainViewCamera(e){this.context.safeSetAttributes({mainViewCamera:O({},e)})}setMainViewSize(e){this.context.safeSetAttributes({mainViewSize:O({},e)})}setMainViewCameraAndSize(e,i){this.context.safeSetAttributes({mainViewCamera:O({},e),mainViewSize:O({},i)})}updateCursor(e,i){I.get(this.attributes,["cursors"])||this.context.safeUpdateAttributes(["cursors"],{}),I.get(this.attributes,["cursors",e])||this.context.safeUpdateAttributes(["cursors",e],{}),this.context.safeUpdateAttributes(["cursors",e,"position"],i)}updateCursorState(e,i){I.get(this.attributes,["cursors",e])||this.context.safeUpdateAttributes(["cursors",e],{}),this.context.safeUpdateAttributes(["cursors",e,"cursorState"],i)}getCursorState(e){return I.get(this.attributes,["cursors",e,"cursorState"])}cleanCursor(e){this.context.safeUpdateAttributes(["cursors",e],void 0)}setMainViewFocusPath(e){const i=this.getMainViewScenePath();i&&dt(e,i)}}const pl=new ul({getAttributes:()=>{throw new Error("getAttributes not implemented")},safeSetAttributes:()=>{throw new Error("safeSetAttributes not implemented")},safeUpdateAttributes:()=>{throw new Error("safeUpdateAttributes not implemented")}});class Vs{constructor(e,i,s,r){var a;this.params=e,this.manager=i,this.boxManager=this.manager.boxManager,this.appProxies=this.manager.appProxies,this.viewManager=this.manager.viewManager,this.store=this.manager.store,this.uid=this.manager.uid,this.status="normal",this.sideEffectManager=new ve.SideEffectManager,this.valManager=new w.ValManager,this.fullPath$=this.valManager.attach(new w.Val(void 0)),this.camera$=this.valManager.attach(new w.Val(void 0)),this.size$=this.valManager.attach(new w.Val(void 0)),this.box$=this.valManager.attach(new w.Val(void 0)),this.view$=this.valManager.attach(new w.Val(void 0)),this.syncCamera$=this.valManager.attach(new w.Val(!0)),this.whiteBoardViewCreated$=this.valManager.attach(new w.Val(!1)),this.fireMemberStateChange=()=>{this.manager.room&&this.onMemberStateChange(this.manager.room.state.memberState)},this.onMemberStateChange=n=>{var c,l;n.currentApplianceName==="clicker"?(c=this.appContext)!=null&&c._viewWrapper&&(this.appContext._viewWrapper.style.pointerEvents="none"):(l=this.appContext)!=null&&l._viewWrapper&&(this.appContext._viewWrapper.style.pointerEvents="auto")},this.computedInitialRect=n=>{var c;const o=(c=this.manager.boxManager)==null?void 0:c.stageRect;if(o){const{width:l,height:d}=o,u=n.height/n.width;return d<480?{width:480/u,height:480}:{width:l*.65,height:d*.65}}},this.getAppInitState=n=>{var m,g;const o=this.store.getAppState(n);if(!o)return;const c=this.store.focus,l=(m=this.attributes)==null?void 0:m.maximized,d=(g=this.attributes)==null?void 0:g.minimized;let u={maximized:l,minimized:d,id:n};const p=I.omitBy(o,I.isUndefined);return c===n&&(u=ye(O({},u),{focus:!0})),Object.assign(u,p)},this.appAttributesUpdateListener=n=>{this.sideEffectManager.add(()=>[this.manager.refresher.add(n,()=>M.autorun(()=>{const o=this.manager.attributes[n];o&&this.appEmitter.emit("attributesUpdate",o)})),this.manager.refresher.add(this.stateKey,()=>M.autorun(()=>{var c,l,d;const o=(c=this.appAttributes)==null?void 0:c.state;(o==null?void 0:o.zIndex)>0&&o.zIndex!==((l=this.box)==null?void 0:l.zIndex)&&((d=this.boxManager)==null||d.setZIndex(n,o.zIndex))})),this.manager.refresher.add(`${n}-fullPath`,()=>M.autorun(()=>{var c;const o=(c=this.appAttributes)==null?void 0:c.fullPath;this.setFocusScenePathHandler(o),this.fullPath$.value!==o&&(this.notifyPageStateChange(),this.fullPath$.setValue(o))}))])},this.setFocusScenePathHandler=I.debounce(n=>{var o;this.view&&n&&n!==((o=this.view)==null?void 0:o.focusScenePath)&&dt(this.view,n)},50),this.notifyPageStateChange=I.debounce(()=>{this.pageState&&this.appEmitter.emit("pageStateChange",this.pageState)},50),this.storeCamera=n=>{this.store.updateAppAttributes(this.id,ee.Camera,n)},this.storeSize=n=>{this.store.updateAppAttributes(this.id,ee.Size,n)},this.updateSize=(n,o)=>{const c={id:this.manager.uid,width:n,height:o};this.store.updateAppAttributes(this.id,ee.Size,c),this.size$.setValue(c)},this.moveCamera=n=>{if(!this.camera$.value)return;const o=ye(O(O({},this.camera$.value),n),{id:this.uid});this.storeCamera(o),this.camera$.setValue(o)},this.addCameraReaction=()=>{this.sideEffectManager.add(()=>this.manager.refresher.add(`${this.id}-camera`,()=>M.reaction(()=>{var n;return(n=this.appAttributes)==null?void 0:n.camera},n=>{if(n){const o=M.toJS(n);I.isEqual(o,this.camera$.value)||this.camera$.setValue(o)}})),"camera")},this.addSizeReaction=()=>{this.sideEffectManager.add(()=>this.manager.refresher.add(`${this.id}-size`,()=>M.reaction(()=>{var n;return(n=this.appAttributes)==null?void 0:n.size},n=>{if(n){const o=M.toJS(n);I.isEqual(o,this.size$.value)||this.size$.setValue(o)}})),"size")},this.onFocus=()=>{this.setScenePath()},this.setupDone=()=>{this.store.updateAppAttributes(this.id,"setup",!0),this.manager.dispatchInternalEvent(Y.InvokeAttributesUpdateCallback)},this.kind=e.kind,this.id=s,this.appScenePath=`/${this.id}-app-dir`,this.stateKey=`${this.id}_state`,this.appProxies.set(this.id,this),this.appEmitter=new rt.default,this.appListener=this.makeAppEventListener(this.id),this.isAddApp=r,this.initScenes(),(a=this.params.options)!=null&&a.scenePath&&this.createView(),this.scenePath||(this.scenePath=this.appScenePath),this._pageState=new hl({displayer:this.manager.displayer,scenePath:this.scenePath,view:this.view,notifyPageStateChange:this.notifyPageStateChange}),this.sideEffectManager.add(()=>()=>this._pageState.destroy()),this.camera$.setValue(M.toJS(this.appAttributes.camera)),this.size$.setValue(M.toJS(this.appAttributes.size)),this.addCameraReaction(),this.addSizeReaction(),this.sideEffectManager.add(()=>P.on("memberStateChange",this.onMemberStateChange)),this.sideEffectManager.add(()=>[this.syncCamera$.reaction(n=>{n||this.viewSync&&(this.viewSync.destroy(),this.viewSync=void 0,this.sideEffectManager.flush("camera"),this.sideEffectManager.flush("size"))}),this.whiteBoardViewCreated$.reaction(n=>{if(n&&this.box){if(!this.syncCamera$.value)return;w.combine([this.box$,this.view$]).subscribe(([o,c])=>{if(o&&c){if(this.camera$.value||(this.storeCamera({centerX:null,centerY:null,scale:1,id:this.uid}),this.camera$.setValue(M.toJS(this.appAttributes.camera))),!this.size$.value&&o.stageRect){const l=this.computedInitialRect(o.stageRect),d=(l==null?void 0:l.width)||o.stageRect.width,u=(l==null?void 0:l.height)||o.stageRect.height;this.storeSize({id:this.uid,width:d,height:u}),this.size$.setValue(M.toJS(this.appAttributes.size))}this.viewSync=new Ia({uid:this.uid,view$:this.view$,camera$:this.camera$,size$:this.size$,stageRect$:o._stageRect$,storeCamera:this.storeCamera,storeSize:this.storeSize}),this.sideEffectManager.add(()=>()=>{var l;return(l=this.viewSync)==null?void 0:l.destroy()}),this.whiteBoardViewCreated$.destroy()}})}}),this.manager.members$.reaction(n=>{this.appEmitter.emit("roomMembersChange",n)})])}createAppDir(){const e=this.scenePath||this.appScenePath;this._pageState.createSceneNode(e)||(vt(this.manager.room,e,[{name:"1"}]),this._pageState.createSceneNode(e),this.setSceneIndex(0)),this.scenes=ut(this.manager.displayer)[e];const s=this.createView();return this._pageState.setView(s),s}initScenes(){var i;const e=this.params.options;e&&(this.scenePath=e.scenePath,((i=this.appAttributes)==null?void 0:i.isDynamicPPT)&&this.scenePath?this.scenes=ut(this.manager.displayer)[this.scenePath]:this.scenes=e.scenes)}get view(){return this.view$.value}get viewIndex(){var e;return(e=this.view)==null?void 0:e.focusSceneIndex}get isWritable(){var e;return this.manager.canOperate&&!((e=this.box)!=null&&e.readonly)}get attributes(){return this.manager.attributes[this.id]}get appAttributes(){return this.store.getAppAttributes(this.id)}getFullScenePath(){if(this.scenePath)return I.get(this.appAttributes,[ee.FullPath])||this.getFullScenePathFromScenes()}getFullScenePathFromScenes(){const e=I.get(this.appAttributes,["state","SceneIndex"],0),i=Go(this.manager.room,this.scenePath,e);return i&&this.setFullPath(i),i}setFullPath(e){this.store.updateAppAttributes(this.id,ee.FullPath,e)}async baseInsertApp(e=!1){var a;const i=this.params;if(!i.kind)throw new Error("[WindowManager]: kind require");const s=await((a=ue.appClasses.get(i.kind))==null?void 0:a()),r=ue.registered.get(i.kind);if(s)await this.setupApp(this.id,e,s,i.options,r==null?void 0:r.appOptions);else throw new Error(`[WindowManager]: app load failed ${i.kind} ${i.src}`);return P.emit("updateManagerRect"),{appId:this.id,app:s}}get box(){return this.box$.value}async setupApp(e,i,s,r,a){var o;if(Je("setupApp",e,s,r),!this.boxManager)throw new wa;const n=new cl(this.manager,e,this,a);this.appContext=n;try{P.once(`${e}${Y.WindowCreated}`).then(async()=>{var u;let d;i||(d=this.getAppInitState(e),(u=this.boxManager)==null||u.updateBoxState(d)),this.appEmitter.onAny(this.appListener),this.appAttributesUpdateListener(e),this.setViewFocusScenePath(),setTimeout(async()=>{const p=await s.setup(n);this.appResult=p,ue.notifyApp(this.kind,"created",{appId:e,result:p}),this.fixMobileSize(),this.isAddApp&&this.setupDone()},pa)});const c=(o=this.boxManager)==null?void 0:o.createBox({appId:e,app:s,options:r,canOperate:this.manager.canOperate,smartPosition:this.isAddApp}),l=ue.registered.get(this.kind);l!=null&&l.contentStyles&&(c==null||c.mountUserStyles(l.contentStyles)),this.box$.setValue(c),this.isAddApp&&this.box&&(this.store.updateAppState(e,Ee.ZIndex,this.box.zIndex),this.store.updateAppState(e,Ee.Size,{width:this.box.intrinsicWidth,height:this.box.intrinsicHeight}),this.boxManager.focusBox({appId:e},!1))}catch(c){throw console.error(c),new Error(`[WindowManager]: app setup error: ${c.message}`)}}fixMobileSize(){var i,s;const e=(i=this.boxManager)==null?void 0:i.getBox(this.id);e&&(e.minimized||(s=this.boxManager)==null||s.resizeBox({appId:this.id,width:e.intrinsicWidth+.001,height:e.intrinsicHeight+.001,skipUpdate:!0}))}async onSeek(e){var s;this.appEmitter.emit("seek",e).catch(r=>{console.log(`[WindowManager]: emit seek error: ${r.message}`)});const i=this.getAppInitState(this.id);(s=this.boxManager)==null||s.updateBoxState(i)}async onReconnected(){var a;if(!Boolean(this.manager.attributes.apps[this.id])){await this.destroy(!0,!1,!0);return}this.appEmitter.emit("reconnected",void 0);const i=this.getAppInitState(this.id);await this.destroy(!0,!1,!0);const s=this.params;await new Vs(s,this.manager,this.id,this.isAddApp).baseInsertApp(!0),(a=this.boxManager)==null||a.updateBoxState(i)}async onRemoveScene(e){if(this.scenePath&&e.startsWith(this.scenePath+"/")){let i=this.pageState.index,s=this._pageState.getFullPath(i);s||(i=0,s=this._pageState.getFullPath(i)),s&&this.setFullPath(s),this.setViewFocusScenePath(),this.view&&(this.view.focusSceneIndex=i)}}emitAppSceneStateChange(e){this.appEmitter.emit("sceneStateChange",e)}emitAppIsWritableChange(){this.appEmitter.emit("writableChange",this.isWritable)}makeAppEventListener(e){return(i,s)=>{var r,a,n,o;if(!!this.manager.canOperate)switch(i){case"setBoxSize":{(r=this.boxManager)==null||r.resizeBox({appId:e,width:s.width,height:s.height,skipUpdate:!1});break}case"setBoxMinSize":{(a=this.boxManager)==null||a.setBoxMinSize({appId:e,minWidth:s.minwidth,minHeight:s.minheight});break}case"setBoxTitle":{(n=this.boxManager)==null||n.setBoxTitle({appId:e,title:s.title});break}case ha.destroy:{if(this.status==="destroyed")return;this.destroy(!0,!1,!0,s==null?void 0:s.error),s!=null&&s.error&&console.error(s==null?void 0:s.error);break}case"focus":{(o=this.boxManager)==null||o.focusBox({appId:this.id}),Ue.emit("focus",{appId:this.id});break}}}}setScenePath(){if(!this.manager.canOperate)return;const e=this.getFullScenePath();this.manager.room&&e&&this.view&&Yt(this.manager.room,e)}setViewFocusScenePath(){if(this.status==="destroyed")return;const e=this.getFullScenePath();return e&&this.view&&dt(this.view,e),e}createView(){const e=this.viewManager.createView(this.id);return this.view$.setValue(e),this.setViewFocusScenePath(),e}get pageState(){return this._pageState.toObject()}async removeSceneByIndex(e){const i=this._pageState.getFullPath(e);if(i&&this.pageState){const s=Ls(e,this.pageState);return this.setSceneIndexWithoutSync(s),this.manager.dispatchInternalEvent(Y.SetAppFocusIndex,{type:"app",appID:this.id,index:s}),setTimeout(()=>{ps(this.manager.room,i,e)},100),!0}else return!1}setSceneIndexWithoutSync(e){this.view&&(this.view.focusSceneIndex=e)}setSceneIndex(e){if(this.view){this.view.focusSceneIndex=e;const i=this._pageState.getFullPath(e);i&&(this.setFullPath(i),Yt(this.manager.room,i))}}async destroy(e,i,s,r){var a;if(this.status!=="destroyed"){this.status="destroyed";try{await ue.notifyApp(this.kind,"destroy",{appId:this.id}),J.emit("appClose",{appId:this.id,kind:this.kind,error:r}),await this.appEmitter.emit("destroy",{error:r})}catch(n){console.error("[WindowManager]: notifyApp error",n.message,n.stack)}this.appEmitter.clearListeners(),this.sideEffectManager.flushAll(),P.emit(`destroy-${this.id}`,{error:r}),e&&((a=this.boxManager)==null||a.closeBox(this.id,s)),i&&(this.store.cleanAppAttributes(this.id),this.scenePath&&ps(this.manager.room,this.scenePath)),this.appProxies.delete(this.id),this.viewManager.destroyView(this.id),this.manager.appStatus.delete(this.id),this.valManager.destroy()}}close(){return this.destroy(!0,!0,!1)}}class gl{constructor(e){this.displayer=e,this.views=new Map}createView(e){const i=_a(this.displayer);return this.views.set(e,i),i}getView(e){return this.views.get(e)}destroyView(e){const i=this.views.get(e);if(i){try{i.release()}catch{}this.views.delete(e)}}setViewScenePath(e,i){const s=this.views.get(e);s&&(s.focusScenePath=i)}destroy(){this.views.forEach(e=>{try{e.release()}catch{}}),this.views.clear()}}const _a=t=>{const e=t.views.createView();return ml(e),e},ml=t=>{t.setCameraBound({maxContentMode:()=>10,minContentMode:()=>.1})};class fl{constructor(e){this.manager=e,this.started=!1,this.mainViewIsAddListener=!1,this.store=this.manager.store,this.sideEffectManager=new ve.SideEffectManager,this.camera$=new w.Val(void 0),this.size$=new w.Val(void 0),this.view$=new w.Val(void 0),this.createViewSync=()=>{var i;this.manager.boxManager&&!this.viewSync&&(this.viewSync=new Ia({uid:this.manager.uid,view$:this.view$,camera$:this.camera$,size$:this.size$,stageRect$:(i=this.manager.boxManager)==null?void 0:i.stageRect$,viewMode$:this.manager.windowManger.viewMode$,storeCamera:this.storeCamera,storeSize:this.storeSize}))},this.startListenWritableChange=()=>{this.sideEffectManager.add(()=>P.on("writableChange",i=>{i&&this.ensureCameraAndSize()}))},this.addCameraReaction=()=>{this.manager.refresher.add(ee.MainViewCamera,this.cameraReaction),this.manager.refresher.add(ee.MainViewSize,this.sizeReaction)},this.storeCurrentCamera=()=>{const i=this.view.camera;this.storeCamera(O({id:this.manager.uid},i))},this.storeCurrentSize=()=>{var s;const i=(s=this.manager.boxManager)==null?void 0:s.stageRect;i&&this.storeSize({id:this.manager.uid,width:i.width,height:i.height})},this.storeCamera=i=>{this.store.setMainViewCamera(i)},this.storeSize=i=>{this.store.setMainViewSize(i)},this.cameraReaction=()=>M.reaction(()=>this.mainViewCamera,i=>{if(i){const s=M.toJS(i);I.isEqual(s,this.camera$.value)||this.camera$.setValue(s)}},{fireImmediately:!0}),this.sizeReaction=()=>M.reaction(()=>this.mainViewSize,i=>{if(i){const s=M.toJS(i);I.isEqual(s,this.size$.value)||this.size$.setValue(s)}},{fireImmediately:!0}),this.mainViewClickListener=()=>{this.mainViewClickHandler()},this.setMainViewSize=I.debounce(i=>{this.store.setMainViewSize(ye(O({},i),{id:this.manager.uid}))},50),this.onCameraOrSizeUpdated=()=>{J.emit("cameraStateChange",this.cameraState)},this.mainView=this.createMainView(),P.once("mainViewMounted").then(()=>{this.addMainViewListener(),this.start(),this.ensureCameraAndSize(),this.startListenWritableChange()}),this.sideEffectManager.add(()=>[P.on("startReconnect",()=>{Sr(this.mainView)})]),this.createViewSync(),this.sideEffectManager.add(()=>P.on("focusedChange",({focused:i})=>{if(i===void 0){const s=this.store.getMainViewScenePath();s&&Yt(this.manager.room,s)}}))}ensureCameraAndSize(){var e;if(!this.mainViewCamera||!this.mainViewSize){this.manager.dispatchInternalEvent(Y.InitMainViewCamera),this.storeCamera(O({id:this.manager.uid},this.view.camera));const i=(e=this.manager.boxManager)==null?void 0:e.stageRect;i&&!this.mainViewSize&&this.storeSize({id:this.manager.uid,width:i.width,height:i.height})}}get mainViewCamera(){return this.store.getMainViewCamera()}get mainViewSize(){return this.store.getMainViewSize()}get didRelease(){return I.get(this.view,["didRelease"])}start(){this.started||(this.addCameraListener(),this.addCameraReaction(),this.started=!0)}get view(){return this.mainView}get cameraState(){return O(O({},this.view.camera),this.view.size)}createMainView(){const e=_a(this.manager.displayer),i=this.store.getMainViewScenePath();return i&&dt(e,i),this.view$.setValue(e),e}onReconnect(){if(this.didRelease)this.rebind();else{const e=this.store.getMainViewScenePath();this.setFocusScenePath(e)}}setFocusScenePath(e){if(e)return dt(this.view,e)}rebind(){const e=this.mainView.divElement,i=this.mainView.disableCameraTransform,s=O({},this.mainView.camera);this.stop(),Sr(this.mainView),this.removeMainViewListener(),this.mainView=this.createMainView(),this.mainView.disableCameraTransform=i,this.mainView.divElement=e,this.mainView.moveCamera(ye(O({},s),{animationMode:M.AnimationMode.Immediately})),this.addMainViewListener(),this.start()}addMainViewListener(){this.mainViewIsAddListener||this.view.divElement&&(this.view.divElement.addEventListener("click",this.mainViewClickListener),this.view.divElement.addEventListener("touchend",this.mainViewClickListener),this.mainViewIsAddListener=!0)}removeMainViewListener(){this.view.divElement&&(this.view.divElement.removeEventListener("click",this.mainViewClickListener),this.view.divElement.removeEventListener("touchend",this.mainViewClickListener)),this.mainViewIsAddListener=!1}async mainViewClickHandler(){var e;!this.manager.canOperate||(this.store.cleanFocus(),(e=this.manager.boxManager)==null||e.blurAllBox())}addCameraListener(){this.view.callbacks.on("onCameraUpdated",this.onCameraOrSizeUpdated),this.view.callbacks.on("onSizeUpdated",this.onCameraOrSizeUpdated)}removeCameraListener(){this.view.callbacks.off("onCameraUpdated",this.onCameraOrSizeUpdated),this.view.callbacks.off("onSizeUpdated",this.onCameraOrSizeUpdated)}stop(){this.removeCameraListener(),this.manager.refresher.remove(ee.MainViewCamera),this.manager.refresher.remove(ee.MainViewSize),this.started=!1}destroy(){this.camera$.destroy(),this.size$.destroy(),this.view$.destroy(),this.removeMainViewListener(),this.stop(),this.sideEffectManager.flushAll()}}class bl{constructor(e){this.context=e,this.addRedoUndoListeners=i=>{if(i===void 0)this.addViewCallbacks(this.context.mainView(),this.onCanRedoStepsUpdate,this.onCanUndoStepsUpdate);else{const s=this.context.getAppProxy(i);s&&s.view&&this.addViewCallbacks(s.view,this.onCanRedoStepsUpdate,this.onCanUndoStepsUpdate)}},this.addViewCallbacks=(i,s,r)=>{s(i.canRedoSteps),r(i.canUndoSteps),i.callbacks.on("onCanRedoStepsUpdate",s),i.callbacks.on("onCanUndoStepsUpdate",r)},this.disposeViewCallbacks=i=>{i.callbacks.off("onCanRedoStepsUpdate",this.onCanRedoStepsUpdate),i.callbacks.off("onCanUndoStepsUpdate",this.onCanUndoStepsUpdate)},this.onCanRedoStepsUpdate=i=>{J.emit("canRedoStepsChange",i)},this.onCanUndoStepsUpdate=i=>{J.emit("canUndoStepsChange",i)},this.disposePrevFocusViewRedoUndoListeners=i=>{let s;if(i===void 0)s=this.context.mainView();else{const r=this.context.getAppProxy(i);r&&r.view&&(s=r.view)}s&&this.disposeViewCallbacks(s)},P.on("focusedChange",i=>{this.disposePrevFocusViewRedoUndoListeners(i.prev),setTimeout(()=>{this.addRedoUndoListeners(i.focused)},0)}),P.on("rootDirRemoved",()=>{this.disposePrevFocusViewRedoUndoListeners(e.focus()),this.addRedoUndoListeners(e.focus())}),this.addRedoUndoListeners(e.focus())}destroy(){this.disposePrevFocusViewRedoUndoListeners(this.context.focus())}}class yl{constructor(e){this.windowManger=e,this.appProxies=new Map,this.appStatus=new Map,this.store=pl,this.isReplay=this.windowManger.isReplay,this.mainViewScenesLength=0,this.callbacksNode=null,this.appCreateQueue=new Do,this.sceneIndex$=new w.Val(void 0),this.focused$=new w.Val(void 0),this.members$=new w.Val([]),this.sideEffectManager=new ve.SideEffectManager,this.sceneState=null,this.rootDirRemoving=!1,this.onRemoveScenes=async i=>{var r,a;const{scenePath:s}=i;if(s===we){await this.onRootDirRemoved(),this.dispatchInternalEvent(Y.RootDirRemoved);return}if(el(s)){let n=this.mainView.focusSceneIndex||0,o=(r=this.callbacksNode)==null?void 0:r.scenes[n];o||(n=0,o=(a=this.callbacksNode)==null?void 0:a.scenes[n]),o&&await this.setMainViewScenePath(`${we}${o}`),await this.setMainViewSceneIndex(n)}else this.appProxies.forEach(n=>{n.onRemoveScene(s)})},this.onReadonlyChanged=()=>{this.appProxies.forEach(i=>{i.emitAppIsWritableChange()})},this.onPlayerSeekStart=async()=>{await this.closeAll()},this.onPlayerSeekDone=async i=>{await this.attributesUpdateCallback(this.attributes.apps),this.appProxies.forEach(s=>{s.onSeek(i)})},this.createRootDirScenesCallback=()=>{let i=!1;this.callbacksNode&&(this.callbacksNode.dispose(),i=!0),this.callbacksNode=this.displayer.createScenesCallback(we,{onAddScene:this.onSceneChange,onRemoveScene:async(s,r)=>{await this.onSceneChange(s),P.emit("rootDirSceneRemoved",r)}}),this.callbacksNode&&(this.updateSceneState(this.callbacksNode),this.mainViewScenesLength=this.callbacksNode.scenes.length,i&&this.emitMainViewScenesChange(this.callbacksNode.scenes.length))},this.removeSceneByIndex=async i=>{var a;const s=Ls(i,this.windowManger.pageState);this.setSceneIndexWithoutSync(s),this.dispatchInternalEvent(Y.SetAppFocusIndex,{type:"main",index:s});const r=(a=this.callbacksNode)==null?void 0:a.scenes[i];return setTimeout(()=>{r&&ps(this.room,`${we}${r}`,i)},100),new Promise((n,o)=>{P.once("rootDirSceneRemoved").then(c=>{c===r&&n(!0)}).catch(c=>{console.log(`[WindowManager]: removePage error: ${c}`),o(!1)})})},this.setSceneIndexWithoutSync=i=>{var r;const s=(r=this.callbacksNode)==null?void 0:r.scenes[i];s&&this.mainViewProxy.setFocusScenePath(`${we}${s}`)},this.onSceneChange=i=>(this.mainViewScenesLength=i.scenes.length,this.updateSceneState(i),this.emitMainViewScenesChange(this.mainViewScenesLength)),this.emitMainViewScenesChange=i=>Promise.all([J.emit("mainViewScenesLengthChange",i),P.emit("changePageState")]),this.updateSceneState=i=>{const s=this.store.getMainViewSceneIndex()||0;let r=i.scenes[s];r||(r=i.scenes[this.mainView.focusSceneIndex||0]),this.sceneState={scenePath:`${we}${r}`,contextPath:i.path,index:s,scenes:i.scenes.map(a=>({name:a})),sceneName:r},J.emit("sceneStateChange",this.sceneState)},this.onBoxMove=i=>{this.dispatchInternalEvent(Y.AppMove,i),this.store.updateAppState(i.appId,Ee.Position,{x:i.x,y:i.y})},this.onBoxResize=i=>{i.width&&i.height&&(this.dispatchInternalEvent(Y.AppResize,i),this.store.updateAppState(i.appId,Ee.Size,{width:i.width,height:i.height}))},this.onBoxFocus=i=>{this.windowManger.safeSetAttributes({focus:i.appId})},this.onBoxClose=i=>{const s=this.appProxies.get(i.appId);s&&s.destroy(!1,!0,!0,i.error)},this.onBoxStateChange=i=>{this.dispatchInternalEvent(Y.AppBoxStateChange,i)},this.addAppsChangeListener=()=>{this.refresher.add("apps",()=>Ma(()=>this.attributes.apps,()=>{this.attributesUpdateCallback(this.attributes.apps)}))},this.addAppCloseListener=()=>{var i;(i=this.refresher)==null||i.add("appsClose",()=>sl(this.attributes.apps,()=>{this.onAppDelete(this.attributes.apps)}))},this.onMainViewIndexChange=i=>{i!==void 0&&this.sceneIndex$.value!==i&&(J.emit("mainViewSceneIndexChange",i),P.emit("changePageState"),this.callbacksNode&&this.updateSceneState(this.callbacksNode),this.sceneIndex$.setValue(i))},this.onFocusChange=i=>{var s;this.focused$.value!==i&&(J.emit("focusedChange",i),P.emit("focusedChange",{focused:i,prev:this.focused$.value}),this.focused$.setValue(i),i!==void 0&&((s=this.boxManager)==null||s.focusBox({appId:i}),setTimeout(()=>{const r=this.appProxies.get(i);r&&(r.onFocus(),ue.notifyApp(r.kind,"focus",{appId:i}))},0)))},this.attributesUpdateCallback=I.debounce(i=>this._attributesUpdateCallback(i),100),this.onRegisteredChange=i=>{!i||Object.entries(i).forEach(([s,r])=>{ue.appClasses.has(s)||ue.register({kind:s,src:r.src,name:r.name})})},this.onMinimized=i=>{var s,r;((s=this.boxManager)==null?void 0:s.minimized)!==i&&(i===!0&&((r=this.boxManager)==null||r.blurAllBox()),setTimeout(()=>{var a;(a=this.boxManager)==null||a.setMinimized(Boolean(i))},0))},this.onAppDelete=async i=>{const s=Object.keys(i);for(const[r,a]of this.appProxies.entries())s.includes(r)||await a.destroy(!0,!1,!0)},this.closeAll=async()=>{for(const[i,s]of this.appProxies.entries())await s.destroy(!0,!1,!0)},this.displayerStateListener=i=>{const s=i.sceneState;if(s){const r=s.scenePath;this.appProxies.forEach(a=>{a.scenePath&&r.startsWith(a.scenePath)&&(a.emitAppSceneStateChange(s),a.setFullPath(r))})}this.appProxies.forEach(r=>{r.appEmitter.emit("roomStateChange",i)}),i.roomMembers&&this.members$.setValue(Ar(i.roomMembers)),P.emit("observerIdChange",this.displayer.observerId),i.memberState&&P.emit("memberStateChange",M.toJS(i.memberState))},this.displayerWritableListener=i=>{var a,n;const s=!i,r=this.windowManger.readonly===void 0||!this.windowManger.readonly;this.windowManger.readonly===void 0?(a=this.boxManager)==null||a.setReadonly(i):(n=this.boxManager)==null||n.setReadonly(!(s&&r)),this.appProxies.forEach(o=>{o.emitAppIsWritableChange()}),s&&this.room&&this.room.disableSerialization===!0&&(this.room.disableSerialization=!1),P.emit("writableChange",s)},this.updateSceneIndex=()=>{const i=this.store.getMainViewScenePath(),s=qi(i),r=ut(this.displayer)[s];if(r.length){const a=i.replace(s,"").replace("/",""),n=r.findIndex(o=>o.name===a);I.isInteger(n)&&n>=0&&this.safeSetAttributes({_mainSceneIndex:n})}},this.updateRootDirRemoving=i=>{this.rootDirRemoving=i},this.displayer=e.displayer,this.store.setContext({getAttributes:()=>this.attributes,safeSetAttributes:i=>this.safeSetAttributes(i),safeUpdateAttributes:(i,s)=>this.safeUpdateAttributes(i,s)}),this.mainViewProxy=new fl(this),this.viewManager=new gl(this.displayer),this.appListeners=new tl(this),this.displayer.callbacks.on(this.eventName,this.displayerStateListener),this.appListeners.addListeners(),this.refresher=uo,this.refresher.setRoom(this.room),this.refresher.setContext({emitter:P}),this.sideEffectManager.add(()=>()=>{var i,s,r;this.appCreateQueue.destroy(),this.mainViewProxy.destroy(),(i=this.refresher)==null||i.destroy(),this.viewManager.destroy(),(s=this.boxManager)==null||s.destroy(),(r=this.callbacksNode)==null||r.dispose()}),P.once("onCreated").then(()=>this.onCreated()),P.on("onReconnected",()=>this.onReconnected()),M.isPlayer(this.displayer)&&(P.on("seekStart",this.onPlayerSeekStart),P.on("seek",this.onPlayerSeekDone)),P.on("removeScenes",this.onRemoveScenes),P.on("setReadonly",this.onReadonlyChanged),this.createRootDirScenesCallback(),ue.setSyncRegisterApp(i=>{this.safeUpdateAttributes([ee.Registered,i.kind],i)}),this.members$.setValue(Ar(this.displayer.state.roomMembers))}async onRootDirRemoved(e=!0){await this.setMainViewScenePath(ua),this.createRootDirScenesCallback();for(const[i,s]of this.appProxies.entries())s.view&&await this.closeApp(i,e);this.mainViewProxy.rebind(),await P.emit("rootDirRemoved"),this.updateRootDirRemoving(!1)}get eventName(){return M.isRoom(this.displayer)?"onRoomStateChanged":"onPlayerStateChanged"}get attributes(){return this.windowManger.attributes}get canOperate(){return this.windowManger.canOperate}get room(){return M.isRoom(this.displayer)?this.displayer:void 0}get mainView(){return this.mainViewProxy.view}get focusApp(){if(this.store.focus)return this.appProxies.get(this.store.focus)}get uid(){var e;return((e=this.room)==null?void 0:e.uid)||""}getMainViewSceneDir(){const e=this.store.getMainViewScenePath();if(e)return qi(e);throw new Error("[WindowManager]: mainViewSceneDir not found")}async onCreated(){var e;if(await this.attributesUpdateCallback(this.attributes.apps),P.emit("updateManagerRect"),Ue.on("move",this.onBoxMove),Ue.on("resize",this.onBoxResize),Ue.on("focus",this.onBoxFocus),Ue.on("close",this.onBoxClose),Ue.on("boxStateChange",this.onBoxStateChange),this.addAppsChangeListener(),this.addAppCloseListener(),this.refresher.add("maximized",()=>M.autorun(()=>{var s;const i=this.attributes.maximized;(s=this.boxManager)==null||s.setMaximized(Boolean(i))})),this.refresher.add("minimized",()=>M.autorun(()=>{const i=this.attributes.minimized;this.onMinimized(i)})),this.refresher.add("mainViewIndex",()=>M.autorun(()=>{const i=I.get(this.attributes,"_mainSceneIndex");this.onMainViewIndexChange(i)})),this.refresher.add("focusedChange",()=>M.autorun(()=>{const i=I.get(this.attributes,"focus");this.onFocusChange(i)})),this.refresher.add("registeredChange",()=>M.autorun(()=>{const i=I.get(this.attributes,ee.Registered);this.onRegisteredChange(i)})),!this.attributes.apps||Object.keys(this.attributes.apps).length===0){const i=this.store.getMainViewScenePath();if(!i)return;this.resetScenePath(i)}this.displayerWritableListener(!((e=this.room)!=null&&e.isWritable)),this.displayer.callbacks.on("onEnableWriteNowChanged",this.displayerWritableListener),this.focused$.setValue(this.attributes.focus),this.sideEffectManager.add(()=>{const i=new bl({mainView:()=>this.mainViewProxy.view,focus:()=>this.attributes.focus,getAppProxy:s=>this.appProxies.get(s)});return()=>i.destroy()})}async _attributesUpdateCallback(e){if(e&&le.container){const i=Object.keys(e);i.length===0&&this.appCreateQueue.emitReady();const s=i.map(r=>e[r].setup?{id:r,createdAt:e[r].createdAt}:{});for(const{id:r}of I.orderBy(s,"createdAt","asc"))if(r&&!this.appProxies.has(r)&&!this.appStatus.has(r)){const a=e[r];try{if(!this.attributes[r])throw new Error("appAttributes is undefined");this.appCreateQueue.push(()=>(this.appStatus.set(r,us.StartCreate),this.baseInsertApp({kind:a.kind,options:a.options,isDynamicPPT:a.isDynamicPPT},r,!1))),this.focusByAttributes(e)}catch(n){console.warn("[WindowManager]: Insert App Error",n)}}}}refresh(){this.attributesUpdateCallback(this.attributes.apps)}setBoxManager(e){this.boxManager=e,this.mainViewProxy.createViewSync()}resetMaximized(){var e;(e=this.boxManager)==null||e.setMaximized(Boolean(this.store.getMaximized()))}resetMinimized(){var e;(e=this.boxManager)==null||e.setMinimized(Boolean(this.store.getMinimized()))}bindMainView(e,i){const s=this.mainViewProxy.view;s.disableCameraTransform=i,Mi(30).then(()=>{s.divElement=e,P.emit("mainViewMounted")}),s.focusScenePath||this.setMainViewFocusPath()}setMainViewFocusPath(e){var s;const i=e||this.store.getMainViewScenePath();if(i)return dt(this.mainView,i),((s=this.mainView)==null?void 0:s.focusScenePath)===i}resetScenePath(e){this.displayer.state.sceneState.scenePath!==e&&Yt(this.room,e)}async addApp(e,i){Je("addApp",e);const{appId:s,needFocus:r}=await this.beforeAddApp(e,i),a=await this.baseInsertApp(e,s,!0,r);return this.afterAddApp(a),a==null?void 0:a.id}async beforeAddApp(e,i){var n,o;const s=await Qo(e.kind);this.appStatus.set(s,us.StartCreate);const r=(n=e.attributes)!=null?n:{};this.safeUpdateAttributes([s],r),this.store.setupAppAttributes(e,s,i);const a=!((o=this.boxManager)!=null&&o.minimized);return a&&this.store.setAppFocus(s,!0),{appId:s,needFocus:a}}afterAddApp(e){var i,s;if(e&&e.box){const r=e.box;Ue.emit("move",{appId:e.id,x:r==null?void 0:r.intrinsicX,y:r==null?void 0:r.intrinsicY}),this.store.updateAppState(e.id,Ee.ZIndex,r.zIndex)}(i=this.boxManager)!=null&&i.minimized&&((s=this.boxManager)==null||s.setMinimized(!1,!1))}async closeApp(e,i=!0){const s=this.appProxies.get(e);s&&s.destroy(!0,i,!1)}async baseInsertApp(e,i,s,r){if(this.appProxies.has(i)){console.warn("[WindowManager]: app duplicate exists and cannot be created again");return}const a=new Vs(e,this,i,s);if(a)return await a.baseInsertApp(r),this.appStatus.delete(i),a;throw this.appStatus.delete(i),new Error("[WindowManger]: initialize AppProxy failed")}safeSetAttributes(e){this.windowManger.safeSetAttributes(e)}safeUpdateAttributes(e,i){this.windowManger.safeUpdateAttributes(e,i)}async setMainViewScenePath(e){if(this.room){const i=this.displayer.scenePathType(e);if(qi(e)!==we)throw new Error('[WindowManager]: main view scenePath must in root dir "/"');if(i===M.ScenePathType.None)throw new Error(`[WindowManager]: ${e} not valid scene`);if(i===M.ScenePathType.Page)await this._setMainViewScenePath(e);else if(i===M.ScenePathType.Dir){const r=Jo(this.displayer,e);r&&await this._setMainViewScenePath(r)}}}async _setMainViewScenePath(e){this.setMainViewFocusPath(e)&&(this.safeSetAttributes({_mainScenePath:e}),this.store.setMainViewFocusPath(this.mainView),this.updateSceneIndex(),this.dispatchSetMainViewScenePath(e))}async setMainViewSceneIndex(e){var i;if(this.room){if(this.store.getMainViewSceneIndex()===e)return;const s=(i=this.callbacksNode)==null?void 0:i.scenes[e],r=`${we}${s}`;if(s)this.setMainViewFocusPath(r)&&(this.store.setMainViewScenePath(r),this.safeSetAttributes({_mainSceneIndex:e}),this.dispatchSetMainViewScenePath(r));else throw new Error(`[WindowManager]: ${e} not valid index`)}}dispatchSetMainViewScenePath(e){this.dispatchInternalEvent(Y.SetMainViewScenePath,{nextScenePath:e}),Yt(this.room,e)}getAppInitPath(e){var s;const i=this.store.getAppAttributes(e);if(i)return(s=i==null?void 0:i.options)==null?void 0:s.scenePath}safeDispatchMagixEvent(e,i){this.canOperate&&this.displayer.dispatchMagixEvent(e,i)}focusByAttributes(e){var i;if(e&&Object.keys(e).length===((i=this.boxManager)==null?void 0:i.boxSize)){const s=this.store.focus;s&&this.boxManager.focusBox({appId:s})}}async onReconnected(){this.attributesUpdateCallback(this.attributes.apps);const i=Array.from(this.appProxies.values()).map(s=>s.onReconnected());this.mainViewProxy.onReconnect(),await Promise.all(i)}notifyContainerRectUpdate(e){this.appProxies.forEach(i=>{i.appEmitter.emit("containerRectUpdate",e)})}dispatchInternalEvent(e,i){this.safeDispatchMagixEvent(ds,{eventName:e,payload:i})}destroy(){this.displayer.callbacks.off(this.eventName,this.displayerStateListener),this.displayer.callbacks.off("onEnableWriteNowChanged",this.displayerWritableListener),this.appListeners.removeListeners(),Ue.clearListeners(),P.clearListeners(),this.appProxies.size&&this.appProxies.forEach(e=>{e.destroy(!0,!1,!0)}),J.clearListeners(),this.sideEffectManager.flushAll(),this.sceneIndex$.destroy(),this.focused$.destroy(),this.members$.destroy()}}/*! *****************************************************************************
|
3
3
|
Copyright (c) Microsoft Corporation.
|
4
4
|
|
5
5
|
Permission to use, copy, modify, and/or distribute this software for any
|
@@ -12,7 +12,7 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
12
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
15
|
-
***************************************************************************** */var ye=function(){return ye=Object.assign||function(t){for(var i,n=1,r=arguments.length;n<r;n++){i=arguments[n];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t},ye.apply(this,arguments)};function Va(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]]);return i}var qs=0,bd=typeof window!="undefined"&&window.requestAnimationFrame!==void 0?function(e){return window.requestAnimationFrame(e)}:function(e){var t=Date.now(),i=Math.max(0,16.7-(t-qs));qs=t+i,setTimeout(function(){return e(qs)},i)},Jg=function(e){var t=[],i=[],n=0,r=!1,s=0,o=new WeakSet,a=new WeakSet,l={cancel:function(u){var h=i.indexOf(u);o.add(u),h!==-1&&i.splice(h,1)},process:function(u){var h;if(r=!0,h=[i,t],t=h[0],i=h[1],i.length=0,n=t.length,n){var p;for(s=0;s<n;s++)p=t[s],p(u),a.has(p)===!0&&!o.has(p)&&(l.schedule(p),e(!0))}r=!1},schedule:function(u,h,p){h===void 0&&(h=!1),p===void 0&&(p=!1);var w=p&&r,C=w?t:i;o.delete(u),h&&a.add(u),C.indexOf(u)===-1&&(C.push(u),w&&(n=t.length))}};return l},Kg=40,mu=1/60*1e3,Ar=!0,Vn=!1,ko=!1,fn={delta:0,timestamp:0},Ra=["read","update","preRender","render","postRender"],qg=function(e){return Vn=e},Md=Ra.reduce(function(e,t){return e[t]=Jg(qg),e},{}),em=Ra.reduce(function(e,t){var i=Md[t];return e[t]=function(n,r,s){return r===void 0&&(r=!1),s===void 0&&(s=!1),Vn||im(),i.schedule(n,r,s),n},e},{}),tm=function(e){return Md[e].process(fn)},Id=function(e){Vn=!1,fn.delta=Ar?mu:Math.max(Math.min(e-fn.timestamp,Kg),1),Ar||(mu=fn.delta),fn.timestamp=e,ko=!0,Ra.forEach(tm),ko=!1,Vn&&(Ar=!1,bd(Id))},im=function(){Vn=!0,Ar=!0,ko||bd(Id)},Ad=function(e,t){return function(i){return Math.max(Math.min(i,t),e)}},Er=function(e){return e%1?Number(e.toFixed(5)):e},Ed=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i,As={test:function(e){return typeof e=="number"},parse:parseFloat,transform:function(e){return e}},yn=ye(ye({},As),{transform:Ad(0,1)}),lr=ye(ye({},As),{default:1}),Ba=function(e){return{test:function(t){return typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1},parse:parseFloat,transform:function(t){return""+t+e}}},ei=Ba("deg"),xn=Ba("%"),V=Ba("px"),vu=ye(ye({},xn),{parse:function(e){return xn.parse(e)/100},transform:function(e){return xn.transform(e*100)}}),nm=function(e){return e.substring(e.indexOf("(")+1,e.lastIndexOf(")"))},rm=Ad(0,255),No=function(e){return e.red!==void 0},Po=function(e){return e.hue!==void 0};function sm(e){return nm(e).replace(/(,|\/)/g," ").split(/ \s*/)}var Td=function(e){return function(t){if(typeof t!="string")return t;for(var i={},n=sm(t),r=0;r<4;r++)i[e[r]]=n[r]!==void 0?parseFloat(n[r]):1;return i}},om=function(e){var t=e.red,i=e.green,n=e.blue,r=e.alpha,s=r===void 0?1:r;return"rgba("+t+", "+i+", "+n+", "+s+")"},am=function(e){var t=e.hue,i=e.saturation,n=e.lightness,r=e.alpha,s=r===void 0?1:r;return"hsla("+t+", "+i+", "+n+", "+s+")"},eo=ye(ye({},As),{transform:function(e){return Math.round(rm(e))}});function Oa(e,t){return e.startsWith(t)&&Ed.test(e)}var Tr={test:function(e){return typeof e=="string"?Oa(e,"rgb"):No(e)},parse:Td(["red","green","blue","alpha"]),transform:function(e){var t=e.red,i=e.green,n=e.blue,r=e.alpha,s=r===void 0?1:r;return om({red:eo.transform(t),green:eo.transform(i),blue:eo.transform(n),alpha:Er(yn.transform(s))})}},to={test:function(e){return typeof e=="string"?Oa(e,"hsl"):Po(e)},parse:Td(["hue","saturation","lightness","alpha"]),transform:function(e){var t=e.hue,i=e.saturation,n=e.lightness,r=e.alpha,s=r===void 0?1:r;return am({hue:Math.round(t),saturation:xn.transform(Er(i)),lightness:xn.transform(Er(n)),alpha:Er(yn.transform(s))})}},wu=ye(ye({},Tr),{test:function(e){return typeof e=="string"&&Oa(e,"#")},parse:function(e){var t="",i="",n="";return e.length>4?(t=e.substr(1,2),i=e.substr(3,2),n=e.substr(5,2)):(t=e.substr(1,1),i=e.substr(2,1),n=e.substr(3,1),t+=t,i+=i,n+=n),{red:parseInt(t,16),green:parseInt(i,16),blue:parseInt(n,16),alpha:1}}}),et={test:function(e){return typeof e=="string"&&Ed.test(e)||No(e)||Po(e)},parse:function(e){return Tr.test(e)?Tr.parse(e):to.test(e)?to.parse(e):wu.test(e)?wu.parse(e):e},transform:function(e){return No(e)?Tr.transform(e):Po(e)?to.transform(e):e}},_a=function(e){var t=e.onRead,i=e.onRender,n=e.uncachedValues,r=n===void 0?new Set:n,s=e.useCache,o=s===void 0?!0:s;return function(a){a===void 0&&(a={});var l=Va(a,[]),u={},h=[],p=!1;function w(E,T){E.startsWith("--")&&(l.hasCSSVariable=!0);var c=u[E];u[E]=T,u[E]!==c&&(h.indexOf(E)===-1&&h.push(E),p||(p=!0,em.render(C.render)))}var C={get:function(E,T){T===void 0&&(T=!1);var c=!T&&o&&!r.has(E)&&u[E]!==void 0;return c?u[E]:t(E,l)},set:function(E,T){if(typeof E=="string")w(E,T);else for(var c in E)w(c,E[c]);return this},render:function(E){return E===void 0&&(E=!1),(p||E===!0)&&(i(u,l,h),p=!1,h.length=0),this}};return C}},lm=/([a-z])([A-Z])/g,um="$1-$2",Es=function(e){return e.replace(lm,um).toLowerCase()},kd=new Map,$a=new Map,Nd=["Webkit","Moz","O","ms",""],cm=Nd.length,dm=typeof document!="undefined",io,Pd=function(e,t){return $a.set(e,Es(t))},hm=function(e){io=io||document.createElement("div");for(var t=0;t<cm;t++){var i=Nd[t],n=i==="",r=n?e:i+e.charAt(0).toUpperCase()+e.slice(1);if(r in io.style||n){if(n&&e==="clipPath"&&$a.has(e))return;kd.set(e,r),Pd(e,(n?"":"-")+Es(r))}}},pm=function(e){return Pd(e,e)},zd=function(e,t){t===void 0&&(t=!1);var i=t?$a:kd;return i.has(e)||(dm?hm(e):pm(e)),i.get(e)||e},fm=["","X","Y","Z"],gm=["translate","scale","rotate","skew","transformPerspective"],zo=gm.reduce(function(e,t){return fm.reduce(function(i,n){return i.push(t+n),i},e)},["x","y","z"]),mm=zo.reduce(function(e,t){return e[t]=!0,e},{});function Ua(e){return mm[e]===!0}function vm(e,t){return zo.indexOf(e)-zo.indexOf(t)}var wm=new Set(["originX","originY","originZ"]);function ym(e){return wm.has(e)}var yu=ye(ye({},As),{transform:Math.round}),xm={color:et,backgroundColor:et,outlineColor:et,fill:et,stroke:et,borderColor:et,borderTopColor:et,borderRightColor:et,borderBottomColor:et,borderLeftColor:et,borderWidth:V,borderTopWidth:V,borderRightWidth:V,borderBottomWidth:V,borderLeftWidth:V,borderRadius:V,radius:V,borderTopLeftRadius:V,borderTopRightRadius:V,borderBottomRightRadius:V,borderBottomLeftRadius:V,width:V,maxWidth:V,height:V,maxHeight:V,size:V,top:V,right:V,bottom:V,left:V,padding:V,paddingTop:V,paddingRight:V,paddingBottom:V,paddingLeft:V,margin:V,marginTop:V,marginRight:V,marginBottom:V,marginLeft:V,rotate:ei,rotateX:ei,rotateY:ei,rotateZ:ei,scale:lr,scaleX:lr,scaleY:lr,scaleZ:lr,skew:ei,skewX:ei,skewY:ei,distance:V,translateX:V,translateY:V,translateZ:V,x:V,y:V,z:V,perspective:V,opacity:yn,originX:vu,originY:vu,originZ:V,zIndex:yu,fillOpacity:yn,strokeOpacity:yn,numOctaves:yu},Wa=function(e){return xm[e]},Sm=function(e,t){return t&&typeof e=="number"?t.transform(e):e},Sn="scrollLeft",Cn="scrollTop",Dd=new Set([Sn,Cn]),Cm=new Set([Sn,Cn,"transform"]),bm={x:"translateX",y:"translateY",z:"translateZ"};function jd(e){return typeof e=="function"}function Mm(e,t,i,n,r,s){s===void 0&&(s=!0);var o="",a=!1;i.sort(vm);for(var l=i.length,u=0;u<l;u++){var h=i[u];o+=(bm[h]||h)+"("+t[h]+") ",a=h==="z"?!0:a}return!a&&r?o+="translateZ(0)":o=o.trim(),jd(e.transform)?o=e.transform(t,n?"":o):s&&n&&(o="none"),o}function Im(e,t,i,n,r,s,o,a){t===void 0&&(t=!0),i===void 0&&(i={}),n===void 0&&(n={}),r===void 0&&(r={}),s===void 0&&(s=[]),o===void 0&&(o=!1),a===void 0&&(a=!0);var l=!0,u=!1,h=!1;for(var p in e){var w=e[p],C=Wa(p),E=Sm(w,C);Ua(p)?(u=!0,n[p]=E,s.push(p),l&&(C.default&&w!==C.default||!C.default&&w!==0)&&(l=!1)):ym(p)?(r[p]=E,h=!0):(!Cm.has(p)||!jd(E))&&(i[zd(p,o)]=E)}return(u||typeof e.transform=="function")&&(i.transform=Mm(e,n,s,l,t,a)),h&&(i.transformOrigin=(r.originX||"50%")+" "+(r.originY||"50%")+" "+(r.originZ||0)),i}function Ha(e){var t=e===void 0?{}:e,i=t.enableHardwareAcceleration,n=i===void 0?!0:i,r=t.isDashCase,s=r===void 0?!0:r,o=t.allowTransformNone,a=o===void 0?!0:o,l={},u={},h={},p=[];return function(w){return p.length=0,Im(w,n,l,u,h,p,s,a),l}}function Am(e,t){var i=t.element,n=t.preparseOutput,r=Wa(e);if(Ua(e))return r&&r.default||0;if(Dd.has(e))return i[e];var s=window.getComputedStyle(i,null).getPropertyValue(zd(e,!0))||0;return n&&r&&r.test(s)&&r.parse?r.parse(s):s}function Em(e,t,i){var n=t.element,r=t.buildStyles,s=t.hasCSSVariable;if(Object.assign(n.style,r(e)),s)for(var o=i.length,a=0;a<o;a++){var l=i[a];l.startsWith("--")&&n.style.setProperty(l,e[l])}i.indexOf(Sn)!==-1&&(n[Sn]=e[Sn]),i.indexOf(Cn)!==-1&&(n[Cn]=e[Cn])}var Tm=_a({onRead:Am,onRender:Em,uncachedValues:Dd});function km(e,t){t===void 0&&(t={});var i=t.enableHardwareAcceleration,n=t.allowTransformNone,r=Va(t,["enableHardwareAcceleration","allowTransformNone"]);return Tm(ye({element:e,buildStyles:Ha({enableHardwareAcceleration:i,allowTransformNone:n}),preparseOutput:!0},r))}var Ld=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues"]),xu=.5,Vd=function(){return{style:{}}},no=function(e,t){return V.transform(e*t)},Nm={x:0,y:0,width:0,height:0};function Su(e,t,i){return typeof e=="string"?e:V.transform(t+i*e)}function Pm(e,t,i){return Su(t,e.x,e.width)+" "+Su(i,e.y,e.height)}var Rd={enableHardwareAcceleration:!1,isDashCase:!1};function zm(e,t,i,n,r,s){t===void 0&&(t=Nm),n===void 0&&(n=Ha(Rd)),r===void 0&&(r=Vd()),s===void 0&&(s=!0);var o=e.attrX,a=e.attrY,l=e.originX,u=e.originY,h=e.pathLength,p=e.pathSpacing,w=p===void 0?1:p,C=e.pathOffset,E=C===void 0?0:C,T=Va(e,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]),c=n(T);for(var d in c)if(d==="transform")r.style.transform=c[d];else{var f=s&&!Ld.has(d)?Es(d):d;r[f]=c[d]}return(l!==void 0||u!==void 0||c.transform)&&(r.style.transformOrigin=Pm(t,l!==void 0?l:xu,u!==void 0?u:xu)),o!==void 0&&(r.x=o),a!==void 0&&(r.y=a),i!==void 0&&h!==void 0&&(r[s?"stroke-dashoffset":"strokeDashoffset"]=no(-E,i),r[s?"stroke-dasharray":"strokeDasharray"]=no(h,i)+" "+no(w,i)),r}function Dm(e,t,i){i===void 0&&(i=!0);var n=Vd(),r=Ha(Rd);return function(s){return zm(s,e,t,r,n,i)}}var jm=function(e){return typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()},Lm=function(e){try{return jm(e)}catch{return{x:0,y:0,width:0,height:0}}},Vm=function(e){return e.tagName==="path"},Rm=_a({onRead:function(e,t){var i=t.element;if(e=Ld.has(e)?e:Es(e),Ua(e)){var n=Wa(e);return n&&n.default||0}else return i.getAttribute(e)},onRender:function(e,t){var i=t.element,n=t.buildAttrs,r=n(e);for(var s in r)s==="style"?Object.assign(i.style,r.style):i.setAttribute(s,r[s])}}),Bm=function(e){var t=Lm(e),i=Vm(e)&&e.getTotalLength?e.getTotalLength():void 0;return Rm({element:e,buildAttrs:Dm(t,i)})},Om=_a({useCache:!1,onRead:function(e){return e==="scrollTop"?window.pageYOffset:window.pageXOffset},onRender:function(e){var t=e.scrollTop,i=t===void 0?0:t,n=e.scrollLeft,r=n===void 0?0:n;return window.scrollTo(r,i)}}),Do=new WeakMap,_m=function(e){return e instanceof HTMLElement||typeof e.click=="function"},$m=function(e){return e instanceof SVGElement||"ownerSVGElement"in e},Um=function(e,t){var i;return e===window?i=Om(e):_m(e)?i=km(e,t):$m(e)&&(i=Bm(e)),Do.set(e,i),i},Wm=function(e,t){return Do.has(e)?Do.get(e):Um(e,t)};function Hm(e,t){var i=typeof e=="string"?document.querySelector(e):e;return Wm(i,t)}var Ye=function(t,i,n,r){var s=n?n.call(r,t,i):void 0;if(s!==void 0)return!!s;if(t===i)return!0;if(typeof t!="object"||!t||typeof i!="object"||!i)return!1;var o=Object.keys(t),a=Object.keys(i);if(o.length!==a.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(i),u=0;u<o.length;u++){var h=o[u];if(!l(h))return!1;var p=t[h],w=i[h];if(s=n?n.call(r,p,w,h):void 0,s===!1||s===void 0&&p!==w)return!1}return!0},Fm=(()=>`.tele-fancy-scrollbar {
|
15
|
+
***************************************************************************** */var ce=function(){return ce=Object.assign||function(e){for(var i,s=1,r=arguments.length;s<r;s++){i=arguments[s];for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(e[a]=i[a])}return e},ce.apply(this,arguments)};function $s(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(t);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]]);return i}var Xi=0,Aa=typeof window!="undefined"&&window.requestAnimationFrame!==void 0?function(t){return window.requestAnimationFrame(t)}:function(t){var e=Date.now(),i=Math.max(0,16.7-(e-Xi));Xi=e+i,setTimeout(function(){return t(Xi)},i)},wl=function(t){var e=[],i=[],s=0,r=!1,a=0,n=new WeakSet,o=new WeakSet,c={cancel:function(l){var d=i.indexOf(l);n.add(l),d!==-1&&i.splice(d,1)},process:function(l){var d;if(r=!0,d=[i,e],e=d[0],i=d[1],i.length=0,s=e.length,s){var u;for(a=0;a<s;a++)u=e[a],u(l),o.has(u)===!0&&!n.has(u)&&(c.schedule(u),t(!0))}r=!1},schedule:function(l,d,u){d===void 0&&(d=!1),u===void 0&&(u=!1);var p=u&&r,m=p?e:i;n.delete(l),d&&o.add(l),m.indexOf(l)===-1&&(m.push(l),p&&(s=e.length))}};return c},vl=40,Tr=1/60*1e3,pi=!0,Qt=!1,gs=!1,zt={delta:0,timestamp:0},js=["read","update","preRender","render","postRender"],xl=function(t){return Qt=t},ka=js.reduce(function(t,e){return t[e]=wl(xl),t},{}),Ml=js.reduce(function(t,e){var i=ka[e];return t[e]=function(s,r,a){return r===void 0&&(r=!1),a===void 0&&(a=!1),Qt||Cl(),i.schedule(s,r,a),s},t},{}),Sl=function(t){return ka[t].process(zt)},Ta=function(t){Qt=!1,zt.delta=pi?Tr:Math.max(Math.min(t-zt.timestamp,vl),1),pi||(Tr=zt.delta),zt.timestamp=t,gs=!0,js.forEach(Sl),gs=!1,Qt&&(pi=!1,Aa(Ta))},Cl=function(){Qt=!0,pi=!0,gs||Aa(Ta)},Na=function(t,e){return function(i){return Math.max(Math.min(i,e),t)}},gi=function(t){return t%1?Number(t.toFixed(5)):t},Ea=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i,Ei={test:function(t){return typeof t=="number"},parse:parseFloat,transform:function(t){return t}},Vt=ce(ce({},Ei),{transform:Na(0,1)}),li=ce(ce({},Ei),{default:1}),Bs=function(t){return{test:function(e){return typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1},parse:parseFloat,transform:function(e){return""+e+t}}},lt=Bs("deg"),$t=Bs("%"),L=Bs("px"),Nr=ce(ce({},$t),{parse:function(t){return $t.parse(t)/100},transform:function(t){return $t.transform(t*100)}}),Il=function(t){return t.substring(t.indexOf("(")+1,t.lastIndexOf(")"))},_l=Na(0,255),ms=function(t){return t.red!==void 0},fs=function(t){return t.hue!==void 0};function Al(t){return Il(t).replace(/(,|\/)/g," ").split(/ \s*/)}var Pa=function(t){return function(e){if(typeof e!="string")return e;for(var i={},s=Al(e),r=0;r<4;r++)i[t[r]]=s[r]!==void 0?parseFloat(s[r]):1;return i}},kl=function(t){var e=t.red,i=t.green,s=t.blue,r=t.alpha,a=r===void 0?1:r;return"rgba("+e+", "+i+", "+s+", "+a+")"},Tl=function(t){var e=t.hue,i=t.saturation,s=t.lightness,r=t.alpha,a=r===void 0?1:r;return"hsla("+e+", "+i+", "+s+", "+a+")"},Ki=ce(ce({},Ei),{transform:function(t){return Math.round(_l(t))}});function Rs(t,e){return t.startsWith(e)&&Ea.test(t)}var mi={test:function(t){return typeof t=="string"?Rs(t,"rgb"):ms(t)},parse:Pa(["red","green","blue","alpha"]),transform:function(t){var e=t.red,i=t.green,s=t.blue,r=t.alpha,a=r===void 0?1:r;return kl({red:Ki.transform(e),green:Ki.transform(i),blue:Ki.transform(s),alpha:gi(Vt.transform(a))})}},es={test:function(t){return typeof t=="string"?Rs(t,"hsl"):fs(t)},parse:Pa(["hue","saturation","lightness","alpha"]),transform:function(t){var e=t.hue,i=t.saturation,s=t.lightness,r=t.alpha,a=r===void 0?1:r;return Tl({hue:Math.round(e),saturation:$t.transform(gi(i)),lightness:$t.transform(gi(s)),alpha:gi(Vt.transform(a))})}},Er=ce(ce({},mi),{test:function(t){return typeof t=="string"&&Rs(t,"#")},parse:function(t){var e="",i="",s="";return t.length>4?(e=t.substr(1,2),i=t.substr(3,2),s=t.substr(5,2)):(e=t.substr(1,1),i=t.substr(2,1),s=t.substr(3,1),e+=e,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(i,16),blue:parseInt(s,16),alpha:1}}}),ze={test:function(t){return typeof t=="string"&&Ea.test(t)||ms(t)||fs(t)},parse:function(t){return mi.test(t)?mi.parse(t):es.test(t)?es.parse(t):Er.test(t)?Er.parse(t):t},transform:function(t){return ms(t)?mi.transform(t):fs(t)?es.transform(t):t}},Os=function(t){var e=t.onRead,i=t.onRender,s=t.uncachedValues,r=s===void 0?new Set:s,a=t.useCache,n=a===void 0?!0:a;return function(o){o===void 0&&(o={});var c=$s(o,[]),l={},d=[],u=!1;function p(g,f){g.startsWith("--")&&(c.hasCSSVariable=!0);var b=l[g];l[g]=f,l[g]!==b&&(d.indexOf(g)===-1&&d.push(g),u||(u=!0,Ml.render(m.render)))}var m={get:function(g,f){f===void 0&&(f=!1);var b=!f&&n&&!r.has(g)&&l[g]!==void 0;return b?l[g]:e(g,c)},set:function(g,f){if(typeof g=="string")p(g,f);else for(var b in g)p(b,g[b]);return this},render:function(g){return g===void 0&&(g=!1),(u||g===!0)&&(i(l,c,d),u=!1,d.length=0),this}};return m}},Nl=/([a-z])([A-Z])/g,El="$1-$2",Pi=function(t){return t.replace(Nl,El).toLowerCase()},za=new Map,Us=new Map,Da=["Webkit","Moz","O","ms",""],Pl=Da.length,zl=typeof document!="undefined",ts,La=function(t,e){return Us.set(t,Pi(e))},Dl=function(t){ts=ts||document.createElement("div");for(var e=0;e<Pl;e++){var i=Da[e],s=i==="",r=s?t:i+t.charAt(0).toUpperCase()+t.slice(1);if(r in ts.style||s){if(s&&t==="clipPath"&&Us.has(t))return;za.set(t,r),La(t,(s?"":"-")+Pi(r))}}},Ll=function(t){return La(t,t)},Va=function(t,e){e===void 0&&(e=!1);var i=e?Us:za;return i.has(t)||(zl?Dl(t):Ll(t)),i.get(t)||t},Vl=["","X","Y","Z"],$l=["translate","scale","rotate","skew","transformPerspective"],bs=$l.reduce(function(t,e){return Vl.reduce(function(i,s){return i.push(e+s),i},t)},["x","y","z"]),jl=bs.reduce(function(t,e){return t[e]=!0,t},{});function Ws(t){return jl[t]===!0}function Bl(t,e){return bs.indexOf(t)-bs.indexOf(e)}var Rl=new Set(["originX","originY","originZ"]);function Ol(t){return Rl.has(t)}var Pr=ce(ce({},Ei),{transform:Math.round}),Ul={color:ze,backgroundColor:ze,outlineColor:ze,fill:ze,stroke:ze,borderColor:ze,borderTopColor:ze,borderRightColor:ze,borderBottomColor:ze,borderLeftColor:ze,borderWidth:L,borderTopWidth:L,borderRightWidth:L,borderBottomWidth:L,borderLeftWidth:L,borderRadius:L,radius:L,borderTopLeftRadius:L,borderTopRightRadius:L,borderBottomRightRadius:L,borderBottomLeftRadius:L,width:L,maxWidth:L,height:L,maxHeight:L,size:L,top:L,right:L,bottom:L,left:L,padding:L,paddingTop:L,paddingRight:L,paddingBottom:L,paddingLeft:L,margin:L,marginTop:L,marginRight:L,marginBottom:L,marginLeft:L,rotate:lt,rotateX:lt,rotateY:lt,rotateZ:lt,scale:li,scaleX:li,scaleY:li,scaleZ:li,skew:lt,skewX:lt,skewY:lt,distance:L,translateX:L,translateY:L,translateZ:L,x:L,y:L,z:L,perspective:L,opacity:Vt,originX:Nr,originY:Nr,originZ:L,zIndex:Pr,fillOpacity:Vt,strokeOpacity:Vt,numOctaves:Pr},Hs=function(t){return Ul[t]},Wl=function(t,e){return e&&typeof t=="number"?e.transform(t):t},jt="scrollLeft",Bt="scrollTop",$a=new Set([jt,Bt]),Hl=new Set([jt,Bt,"transform"]),Fl={x:"translateX",y:"translateY",z:"translateZ"};function ja(t){return typeof t=="function"}function Zl(t,e,i,s,r,a){a===void 0&&(a=!0);var n="",o=!1;i.sort(Bl);for(var c=i.length,l=0;l<c;l++){var d=i[l];n+=(Fl[d]||d)+"("+e[d]+") ",o=d==="z"?!0:o}return!o&&r?n+="translateZ(0)":n=n.trim(),ja(t.transform)?n=t.transform(e,s?"":n):a&&s&&(n="none"),n}function Yl(t,e,i,s,r,a,n,o){e===void 0&&(e=!0),i===void 0&&(i={}),s===void 0&&(s={}),r===void 0&&(r={}),a===void 0&&(a=[]),n===void 0&&(n=!1),o===void 0&&(o=!0);var c=!0,l=!1,d=!1;for(var u in t){var p=t[u],m=Hs(u),g=Wl(p,m);Ws(u)?(l=!0,s[u]=g,a.push(u),c&&(m.default&&p!==m.default||!m.default&&p!==0)&&(c=!1)):Ol(u)?(r[u]=g,d=!0):(!Hl.has(u)||!ja(g))&&(i[Va(u,n)]=g)}return(l||typeof t.transform=="function")&&(i.transform=Zl(t,s,a,c,e,o)),d&&(i.transformOrigin=(r.originX||"50%")+" "+(r.originY||"50%")+" "+(r.originZ||0)),i}function Fs(t){var e=t===void 0?{}:t,i=e.enableHardwareAcceleration,s=i===void 0?!0:i,r=e.isDashCase,a=r===void 0?!0:r,n=e.allowTransformNone,o=n===void 0?!0:n,c={},l={},d={},u=[];return function(p){return u.length=0,Yl(p,s,c,l,d,u,a,o),c}}function Ql(t,e){var i=e.element,s=e.preparseOutput,r=Hs(t);if(Ws(t))return r&&r.default||0;if($a.has(t))return i[t];var a=window.getComputedStyle(i,null).getPropertyValue(Va(t,!0))||0;return s&&r&&r.test(a)&&r.parse?r.parse(a):a}function Gl(t,e,i){var s=e.element,r=e.buildStyles,a=e.hasCSSVariable;if(Object.assign(s.style,r(t)),a)for(var n=i.length,o=0;o<n;o++){var c=i[o];c.startsWith("--")&&s.style.setProperty(c,t[c])}i.indexOf(jt)!==-1&&(s[jt]=t[jt]),i.indexOf(Bt)!==-1&&(s[Bt]=t[Bt])}var ql=Os({onRead:Ql,onRender:Gl,uncachedValues:$a});function Jl(t,e){e===void 0&&(e={});var i=e.enableHardwareAcceleration,s=e.allowTransformNone,r=$s(e,["enableHardwareAcceleration","allowTransformNone"]);return ql(ce({element:t,buildStyles:Fs({enableHardwareAcceleration:i,allowTransformNone:s}),preparseOutput:!0},r))}var Ba=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues"]),zr=.5,Ra=function(){return{style:{}}},is=function(t,e){return L.transform(t*e)},Xl={x:0,y:0,width:0,height:0};function Dr(t,e,i){return typeof t=="string"?t:L.transform(e+i*t)}function Kl(t,e,i){return Dr(e,t.x,t.width)+" "+Dr(i,t.y,t.height)}var Oa={enableHardwareAcceleration:!1,isDashCase:!1};function ec(t,e,i,s,r,a){e===void 0&&(e=Xl),s===void 0&&(s=Fs(Oa)),r===void 0&&(r=Ra()),a===void 0&&(a=!0);var n=t.attrX,o=t.attrY,c=t.originX,l=t.originY,d=t.pathLength,u=t.pathSpacing,p=u===void 0?1:u,m=t.pathOffset,g=m===void 0?0:m,f=$s(t,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]),b=s(f);for(var v in b)if(v==="transform")r.style.transform=b[v];else{var x=a&&!Ba.has(v)?Pi(v):v;r[x]=b[v]}return(c!==void 0||l!==void 0||b.transform)&&(r.style.transformOrigin=Kl(e,c!==void 0?c:zr,l!==void 0?l:zr)),n!==void 0&&(r.x=n),o!==void 0&&(r.y=o),i!==void 0&&d!==void 0&&(r[a?"stroke-dashoffset":"strokeDashoffset"]=is(-g,i),r[a?"stroke-dasharray":"strokeDasharray"]=is(d,i)+" "+is(p,i)),r}function tc(t,e,i){i===void 0&&(i=!0);var s=Ra(),r=Fs(Oa);return function(a){return ec(a,t,e,r,s,i)}}var ic=function(t){return typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()},sc=function(t){try{return ic(t)}catch{return{x:0,y:0,width:0,height:0}}},rc=function(t){return t.tagName==="path"},ac=Os({onRead:function(t,e){var i=e.element;if(t=Ba.has(t)?t:Pi(t),Ws(t)){var s=Hs(t);return s&&s.default||0}else return i.getAttribute(t)},onRender:function(t,e){var i=e.element,s=e.buildAttrs,r=s(t);for(var a in r)a==="style"?Object.assign(i.style,r.style):i.setAttribute(a,r[a])}}),nc=function(t){var e=sc(t),i=rc(t)&&t.getTotalLength?t.getTotalLength():void 0;return ac({element:t,buildAttrs:tc(e,i)})},oc=Os({useCache:!1,onRead:function(t){return t==="scrollTop"?window.pageYOffset:window.pageXOffset},onRender:function(t){var e=t.scrollTop,i=e===void 0?0:e,s=t.scrollLeft,r=s===void 0?0:s;return window.scrollTo(r,i)}}),ys=new WeakMap,lc=function(t){return t instanceof HTMLElement||typeof t.click=="function"},cc=function(t){return t instanceof SVGElement||"ownerSVGElement"in t},hc=function(t,e){var i;return t===window?i=oc(t):lc(t)?i=Jl(t,e):cc(t)&&(i=nc(t)),ys.set(t,i),i},dc=function(t,e){return ys.has(t)?ys.get(t):hc(t,e)};function uc(t,e){var i=typeof t=="string"?document.querySelector(t):t;return dc(i,e)}var Ne=function(e,i,s,r){var a=s?s.call(r,e,i):void 0;if(a!==void 0)return!!a;if(e===i)return!0;if(typeof e!="object"||!e||typeof i!="object"||!i)return!1;var n=Object.keys(e),o=Object.keys(i);if(n.length!==o.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(i),l=0;l<n.length;l++){var d=n[l];if(!c(d))return!1;var u=e[d],p=i[d];if(a=s?s.call(r,u,p,d):void 0,a===!1||a===void 0&&u!==p)return!1}return!0},pc=(()=>`.tele-fancy-scrollbar {
|
16
16
|
overscroll-behavior: contain;
|
17
17
|
overflow: auto;
|
18
18
|
overflow-y: scroll;
|
@@ -81,8 +81,8 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
81
81
|
overflow: hidden;
|
82
82
|
background-color: #fff;
|
83
83
|
background-color: var(--tele-boxStageBackground, #fff);
|
84
|
-
|
85
|
-
|
84
|
+
box-shadow: 0px 0px 16px rgba(0, 0, 0, 0.08);
|
85
|
+
box-shadow: var(--tele-boxStageShadow, 0px 0px 16px rgba(0, 0, 0, 0.08));
|
86
86
|
}
|
87
87
|
.telebox-footer-wrap {
|
88
88
|
flex-shrink: 0;
|
@@ -112,43 +112,16 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
112
112
|
.telebox-color-scheme-dark .telebox-box-stage {
|
113
113
|
background-color: #272a30;
|
114
114
|
background-color: var(--tele-boxStageBackground, #272a30);
|
115
|
-
|
116
|
-
|
115
|
+
box-shadow: 0px 0px 16px rgba(0, 0, 0, 0.24);
|
116
|
+
box-shadow: var(--tele-boxStageShadow, 0px 0px 16px rgba(0, 0, 0, 0.24));
|
117
117
|
}
|
118
118
|
.telebox-color-scheme-dark .telebox-footer-wrap {
|
119
119
|
color: #e9e9e9;
|
120
120
|
color: var(--tele-boxFooterColor, #e9e9e9);
|
121
121
|
background-color: #383b42;
|
122
122
|
background-color: var(--tele-boxFooterBackground, #383b42);
|
123
|
-
}`)(),Bd=(e=>(e.Light="light",e.Dark="dark",e.Auto="auto",e))(Bd||{}),ue=(e=>(e.Normal="normal",e.Minimized="minimized",e.Maximized="maximized",e))(ue||{}),be=(e=>(e.DarkMode="dark_mode",e.PrefersColorScheme="prefers_color_scheme",e.Close="close",e.Focus="focus",e.Blur="blur",e.IntrinsicMove="intrinsic_move",e.IntrinsicResize="intrinsic_resize",e.ZIndex="z_index",e.State="state",e.Minimized="minimized",e.Maximized="maximized",e.Readonly="readonly",e.Destroyed="destroyed",e))(be||{}),rt=(e=>(e.Close="close",e.Maximize="maximize",e.Minimize="minimize",e))(rt||{}),it=(e=>(e.North="n",e.South="s",e.West="w",e.East="e",e.NorthWest="nw",e.NorthEast="ne",e.SouthEast="se",e.SouthWest="sw",e))(it||{});const ro="dh";function Ai(e,t,i){return Math.min(Math.max(e,t),i)}function bn(e){e.stopPropagation(),e.cancelable&&e.preventDefault()}let Qm=1;function Zm(){return`New Box ${Qm++}`}class Od{constructor({readonly$:t,state$:i,title$:n,buttons:r,onEvent:s,onDragStart:o,namespace:a="telebox"}){this.sideEffect=new Re.SideEffectManager,this.lastTitleBarClick={timestamp:0,clientX:-100,clientY:-100},this.handleTitleBarClick=l=>{var u;if(!l.isPrimary||this.readonly$.value||l.button!==0||(u=l.target.dataset)!=null&&u.teleTitleBarNoDblClick)return;bn(l);const h=Date.now();h-this.lastTitleBarClick.timestamp<=500?Math.abs(l.clientX-this.lastTitleBarClick.clientX)<=5&&Math.abs(l.clientY-this.lastTitleBarClick.clientY)<=5&&this.onEvent&&this.onEvent({type:rt.Maximize}):this.onDragStart&&this.onDragStart(l),this.lastTitleBarClick.timestamp=h,this.lastTitleBarClick.clientX=l.clientX,this.lastTitleBarClick.clientY=l.clientY},this.readonly$=t,this.state$=i,this.title$=n,this.onEvent=s,this.onDragStart=o,this.namespace=a,this.buttons=r||[{type:rt.Minimize,iconClassName:this.wrapClassName("titlebar-icon-minimize")},{type:rt.Maximize,iconClassName:this.wrapClassName("titlebar-icon-maximize"),isActive:l=>l===ue.Maximized},{type:rt.Close,iconClassName:this.wrapClassName("titlebar-icon-close")}],this.$dragArea=this.renderDragArea()}render(){if(!this.$titleBar){this.$titleBar=document.createElement("div"),this.$titleBar.className=this.wrapClassName("titlebar");const t=document.createElement("div");t.className=this.wrapClassName("title-area"),t.dataset.teleBoxHandle=ro;const i=document.createElement("h1");i.className=this.wrapClassName("title"),i.dataset.teleBoxHandle=ro,t.appendChild(i),t.appendChild(this.$dragArea);const n=document.createElement("div");n.className=this.wrapClassName("titlebar-btns"),this.buttons.forEach(({iconClassName:r},s)=>{const o=String(s),a=document.createElement("button");a.className=`${this.wrapClassName("titlebar-btn")} ${r}`,a.dataset.teleTitleBarBtnIndex=o,a.dataset.teleTitleBarNoDblClick="true",n.appendChild(a)}),this.sideEffect.addDisposer(this.title$.subscribe(r=>{i.textContent=r,i.title=r}),"render-title"),this.sideEffect.addDisposer(this.state$.subscribe(r=>{this.buttons.forEach((s,o)=>{var a;s.isActive&&((a=n.children[o])==null||a.classList.toggle("is-active",s.isActive(r)))})}),"render-state-btns"),this.sideEffect.addEventListener(n,"click",r=>{var s;if(this.readonly$.value)return;const o=r.target,a=Number((s=o.dataset)==null?void 0:s.teleTitleBarBtnIndex);if(!Number.isNaN(a)&&a<this.buttons.length){bn(r);const l=this.buttons[a];this.onEvent&&this.onEvent({type:l.type,value:l.value})}},{},"render-btns-container-click"),this.$titleBar.appendChild(t),this.$titleBar.appendChild(n)}return this.$titleBar}renderDragArea(){const t=document.createElement("div");return t.className=this.wrapClassName("drag-area"),t.dataset.teleBoxHandle=ro,this.sideEffect.addEventListener(t,"pointerdown",this.handleTitleBarClick),t}dragHandle(){return this.$titleBar}wrapClassName(t){return`${this.namespace}-${t}`}destroy(){this.sideEffect.flushAll(),this.$titleBar&&(this.$titleBar=void 0,this.onDragStart=void 0,this.onEvent=void 0)}}function _d([e,t]){if(t<=0||e.width<=0||e.height<=0)return e;const i=e.width*t;if(i===e.height)return e;if(i<e.height)return{x:0,y:(e.height-i)/2,width:e.width,height:i};const n=e.height/t;return{x:(e.width-n)/2,y:0,width:n,height:e.height}}const Ym=window.ResizeObserver||od.ResizeObserver;class Gm{constructor({id:t=Re.genUID(),title:i=Zm(),namespace:n="telebox",visible:r=!0,width:s=.5,height:o=.5,minWidth:a=0,minHeight:l=0,x:u=.1,y:h=.1,resizable:p=!0,draggable:w=!0,boxRatio:C=-1,focus:E=!1,zIndex:T=100,stageRatio:c=null,enableShadowDOM:d=!0,titleBar:f,content:g,stage:m,footer:x,styles:y,userStyles:N,bodyStyle:D=null,stageStyle:P=null,darkMode$:J,fence$:q,minimized$:ee,maximized$:Fe,readonly$:Q,root:G,rootRect$:Qe,managerStageRect$:ae,managerStageRatio$:Oe,defaultBoxBodyStyle$:_e,defaultBoxStageStyle$:ht,collectorRect$:qt}){this.events=new Zt.default,this._delegateEvents=new Zt.default,this.handleTrackStart=U=>{var F;return(F=this._handleTrackStart)==null?void 0:F.call(this,U)},this._sideEffect=new Re.SideEffectManager,this.id=t,this.namespace=n,this.enableShadowDOM=d;const Et=new M.ValManager;this._sideEffect.addDisposer(()=>Et.destroy());const Ii=new M.Val(i),b=new M.Val(r),v=new M.Val(p),k=new M.Val(w),_=new M.Val(C),$=new M.Val(T),ke=new M.Val(E),ve=M.combine([ee,Fe],([U,F])=>U?ue.Minimized:F?ue.Maximized:ue.Normal),pt=new M.Val({width:Ai(a,0,1),height:Ai(l,0,1)},{compare:Ye}),Tt=M.combine([pt,ae],([U,F])=>({width:U.width*F.width,height:U.height*F.height}),{compare:Ye}),ar=new M.Val({width:s,height:o},{compare:Ye});this._sideEffect.addDisposer(pt.reaction((U,F)=>{ar.setValue({width:Math.max(s,U.width),height:Math.max(o,U.height)},F)}));const Ys=new M.Val({x:u,y:h},{compare:Ye}),Gs=M.combine([ar,ae],([U,F])=>({width:F.width*U.width,height:F.height*U.height}),{compare:Ye}),tn=M.combine([Ys,ae],([U,F])=>({x:U.x*F.width,y:U.y*F.height}),{compare:Ye}),Wf=new M.Val(D),Hf=new M.Val(P),Ff=new M.Val(null),tu=new M.Val(ae.value,{compare:Ye}),iu=new M.Val(c),Qf=M.combine([iu,Oe],([U,F])=>U!=null?U:F),Zf=M.combine([tu,Qf],_d,{compare:Ye}),Yf={darkMode:J,fence:q,minimized:ee,maximized:Fe,readonly:Q,rootRect:Qe,managerStageRect:ae,managerStageRatio:Oe,defaultBoxBodyStyle:_e,defaultBoxStageStyle:ht,collectorRect:qt};M.withReadonlyValueEnhancer(this,Yf);const Gf={zIndex:$,focus:ke,state:ve,minSize:pt,pxMinSize:Tt,intrinsicSize:ar,intrinsicCoord:Ys,pxIntrinsicSize:Gs,pxIntrinsicCoord:tn,bodyRect:tu,stageRect:Zf};M.withReadonlyValueEnhancer(this,Gf,Et);const Xf={title:Ii,visible:b,resizable:v,draggable:k,boxRatio:_,stageRatio:iu,bodyStyle:Wf,stageStyle:Hf};M.withValueEnhancer(this,Xf,Et),this.titleBar=f||new Od({readonly$:Q,state$:ve,title$:Ii,namespace:this.namespace,onDragStart:U=>{var F;return(F=this._handleTrackStart)==null?void 0:F.call(this,U)},onEvent:U=>this._delegateEvents.emit(U.type)}),this._sideEffect.addDisposer(_.subscribe(U=>{U>0&&this.transform(tn.value.x,tn.value.y,Gs.value.width,Gs.value.height)})),this._sideEffect.addDisposer(q.subscribe(U=>{U&&this.move(tn.value.x,tn.value.y)})),this.$box=this._render(),Ff.setValue(this.$content.parentElement),g&&this.mountContent(g),m&&this.mountStage(m),x&&this.mountFooter(x),y&&this.mountStyles(y),N&&this.mountUserStyles(N),G.appendChild(this.$box);const kt=(U,F)=>{this._sideEffect.addDisposer(U.reaction((Jf,Kf)=>{Kf||this.events.emit(F,Jf)}))};kt(J,be.DarkMode),kt(Q,be.Readonly),kt($,be.ZIndex),kt(ee,be.Minimized),kt(Fe,be.Maximized),kt(ve,be.State),kt(ar,be.IntrinsicResize),kt(Ys,be.IntrinsicMove),this._sideEffect.addDisposer([b.reaction((U,F)=>{!F&&!U&&this.events.emit(be.Close)}),ke.reaction((U,F)=>{F||this.events.emit(U?be.Focus:be.Blur)})])}get minWidth(){return this._minSize$.value.width}get minHeight(){return this._minSize$.value.height}setMinWidth(t,i=!1){this._minSize$.setValue({width:t,height:this.minHeight},i)}setMinHeight(t,i=!1){this._minSize$.setValue({width:this.minWidth,height:t},i)}resize(t,i,n=!1){this._intrinsicSize$.setValue({width:Math.max(t,this.minWidth),height:Math.max(i,this.minHeight)},n)}get intrinsicX(){return this._intrinsicCoord$.value.x}get intrinsicY(){return this._intrinsicCoord$.value.y}get intrinsicWidth(){return this._intrinsicSize$.value.width}get intrinsicHeight(){return this._intrinsicSize$.value.height}move(t,i,n=!1){let r,s;const o=this.managerStageRect,a=this.pxIntrinsicSize;this.fence?(r=Ai(t,0,o.width-a.width),s=Ai(i,0,o.height-a.height)):(r=Ai(t,-(a.width-120),0+o.width-20),s=Ai(i,0,0+o.height-20)),this._intrinsicCoord$.setValue({x:r/o.width,y:s/o.height},n)}transform(t,i,n,r,s=!1){const o=this.managerStageRect;if(n=Math.max(n,this.pxMinSize.width),r=Math.max(r,this.pxMinSize.height),this.boxRatio>0){const a=this.boxRatio*n;i!==this.pxIntrinsicCoord.y&&(i-=a-r),r=a}i<0&&(i=0,r=this.pxIntrinsicSize.height),this.move(t,i,s),this._intrinsicSize$.setValue({width:n/o.width,height:r/o.height},s)}mountContent(t){var i;(i=this.$authorContent)==null||i.remove(),this.$authorContent=t,this.$content.appendChild(t)}unmountContent(){this.$authorContent&&(this.$authorContent.remove(),this.$authorContent=void 0)}mountStage(t){var i;(i=this.$authorStage)==null||i.remove(),this.$authorStage=t,this.$stage||(this.$stage=this._renderStage()),this.$stage.appendChild(t),this.$stage.parentElement||this.$body.appendChild(this.$stage)}unmountStage(){var t;this.$authorStage&&(this.$authorStage.remove(),this.$authorStage=void 0),(t=this.$stage)==null||t.remove()}mountFooter(t){var i;(i=this.$authorFooter)==null||i.remove(),this.$authorFooter=t,this.$footer.appendChild(t)}unmountFooter(){this.$authorFooter&&(this.$authorFooter.remove(),this.$authorFooter=void 0)}mountStyles(t){this.$styles.textContent=t}unmountStyles(){this.$styles.textContent=""}mountUserStyles(t){this.$userStyles.textContent=t}unmountUserStyles(){this.$userStyles.textContent=""}_render(){if(this.$box)return this.$box;const t=(c,d)=>this._sideEffect.addDisposer([this._readonly$.subscribe(f=>c.classList.toggle(this.wrapClassName("readonly"),f)),this._draggable$.subscribe(f=>c.classList.toggle(this.wrapClassName("no-drag"),!f)),this._resizable$.subscribe(f=>c.classList.toggle(this.wrapClassName("no-resize"),!f)),this._focus$.subscribe(f=>c.classList.toggle(this.wrapClassName("blur"),!f)),this._darkMode$.subscribe(f=>{c.classList.toggle(this.wrapClassName("color-scheme-dark"),f),c.classList.toggle(this.wrapClassName("color-scheme-light"),!f)})],d);this.$box=document.createElement("div"),this.$box.classList.add(this.wrapClassName("box")),t(this.$box,"bind-box-state"),this._sideEffect.add(()=>{const c=this.wrapClassName("minimized"),d=this.wrapClassName("maximized"),f="box-maximized-timer";return this._state$.subscribe(g=>{this.$box.classList.toggle(c,g===ue.Minimized),g===ue.Maximized?(this._sideEffect.flush(f),this.$box.classList.toggle(d,!0)):this._sideEffect.setTimeout(()=>{this.$box.classList.toggle(d,!1)},0,f)})}),this._sideEffect.addDisposer(this._visible$.subscribe(c=>{this.$box.style.display=c?"block":"none"})),this._sideEffect.addDisposer(this._zIndex$.subscribe(c=>{this.$box.style.zIndex=String(c)})),this.$box.dataset.teleBoxID=this.id;const i=Hm(this.$box),n=M.combine([this._maximized$,this._minimized$,this._pxIntrinsicSize$,this._pxIntrinsicCoord$,this._collectorRect$,this._rootRect$,this._managerStageRect$],([c,d,f,g,m,x,y])=>{const N=c?{x:-y.x,y:-y.y,width:x.width,height:x.height,scaleX:1,scaleY:1}:{x:g.x,y:g.y,width:f.width,height:f.height,scaleX:1,scaleY:1};if(d&&m){const{width:D,height:P}=c?this.rootRect:f;N.x=m.x-D/2+m.width/2-y.x,N.y=m.y-P/2+m.height/2-y.y,N.scaleX=m.width/D,N.scaleY=m.height/P}return N},{compare:Ye}),r=n.value;this.$box.style.width=r.width+"px",this.$box.style.height=r.height+"px",this.$box.style.transform=`translate(${r.x-10}px,${r.y-10}px)`,this._sideEffect.addDisposer(n.subscribe(c=>{i.set(c)}));const s=document.createElement("div");s.className=this.wrapClassName("box-main"),this.$box.appendChild(s);const o=document.createElement("div");o.className=this.wrapClassName("titlebar-wrap"),o.appendChild(this.titleBar.render()),this.$titleBar=o;const a=document.createElement("div");a.className=this.wrapClassName("body-wrap"),this.$body=a;const l=document.createElement("style");this.$styles=l,a.appendChild(l);const u=document.createElement("style");this.$userStyles=u,a.appendChild(u);const h=document.createElement("div");h.className=this.wrapClassName("content")+" tele-fancy-scrollbar",this.$content=h,this._sideEffect.addDisposer(M.combine([this._bodyStyle$,this._defaultBoxBodyStyle$],([c,d])=>c!=null?c:d).subscribe(c=>h.style.cssText=c||"")),a.appendChild(h);const p=document.createElement("div");p.className=this.wrapClassName("footer-wrap"),this.$footer=p,s.appendChild(o);const w=document.createElement("div");w.className=this.wrapClassName("main"),this.$main=w,s.appendChild(w);const C=document.createElement("div");C.className=this.wrapClassName("quarantine-outer"),w.appendChild(C);const E=document.createElement("div");if(E.className=this.wrapClassName("quarantine"),E.appendChild(a),E.appendChild(p),this.enableShadowDOM){t(E,"bind-quarantine-state");const c=document.createElement("style");c.textContent=Fm,E.insertBefore(c,E.firstChild),C.attachShadow({mode:"open"}).appendChild(E)}else C.appendChild(E);this._renderResizeHandlers();const T=()=>{const c=a.getBoundingClientRect();this._bodyRect$.setValue({x:0,y:0,width:c.width,height:c.height})};return this._sideEffect.add(()=>{const c=new Ym(()=>{this.minimized||T()});return c.observe(a),()=>c.disconnect()}),this._sideEffect.addDisposer(this._minimized$.reaction(c=>{c||this._sideEffect.setTimeout(T,400,"minimized-content-rect-fix")})),this.$box}_renderStage(){const t=document.createElement("div");t.className=this.wrapClassName("box-stage");const i=n=>{t.style.top=n.y+"px",t.style.left=n.x+"px",t.style.width=n.width+"px",t.style.height=n.height+"px"};return this._sideEffect.addDisposer([M.combine([this._stageStyle$,this._defaultBoxStageStyle$],([n,r])=>n!=null?n:r).subscribe(n=>{t.style.cssText=n||"",i(this._stageRect$.value)}),this._stageRect$.subscribe(i)],"box-stage-styles"),t}_renderResizeHandlers(){const t=document.createElement("div");t.className=this.wrapClassName("resize-handles"),Object.values(it).forEach(T=>{const c=document.createElement("div");c.className=this.wrapClassName(T)+" "+this.wrapClassName("resize-handle"),c.dataset.teleBoxHandle=T,t.appendChild(c)}),this.$box.appendChild(t);const i="handle-tracking-listener",n=this.wrapClassName("transforming");let r,s=0,o=0,a=0,l=0,u=0,h=0,p;const w=T=>{if(!T.isPrimary||this.state!==ue.Normal)return;bn(T);let{pageX:c,pageY:d}=T;d<0&&(d=0);const f=c-u,g=d-h;let{x:m,y:x}=this.pxIntrinsicCoord,{width:y,height:N}=this.pxIntrinsicSize;switch(p){case it.North:{x=o+g,N=l-g;break}case it.South:{N=l+g;break}case it.West:{m=s+f,y=a-f;break}case it.East:{y=a+f;break}case it.NorthWest:{m=s+f,x=o+g,y=a-f,N=l-g;break}case it.NorthEast:{x=o+g,y=a+f,N=l-g;break}case it.SouthEast:{y=a+f,N=l+g;break}case it.SouthWest:{m=s+f,y=a-f,N=l+g;break}default:{this.move(s+f,o+g);return}}this.transform(m,x,y,N)},C=T=>{!T.isPrimary||(p=void 0,r&&(bn(T),this.$box.classList.toggle(n,!1),this._sideEffect.flush(i),r.remove()))},E=T=>{var c;if(!T.isPrimary||this.readonly||T.button!=null&&T.button!==0||!this.draggable||p||this.state!==ue.Normal)return;const d=T.target;if((c=d.dataset)!=null&&c.teleBoxHandle){bn(T),{x:s,y:o}=this.pxIntrinsicCoord,{width:a,height:l}=this.pxIntrinsicSize,{pageX:u,pageY:h}=T,p=d.dataset.teleBoxHandle,r||(r=document.createElement("div"));const f=p?this.wrapClassName(`cursor-${p}`):"";r.className=this.wrapClassName(`track-mask${f?` ${f}`:""}`),this.$box.appendChild(r),this.$box.classList.add(n),this._sideEffect.add(()=>(window.addEventListener("pointermove",w,{passive:!1}),window.addEventListener("pointerup",C,{passive:!1}),window.addEventListener("pointercancel",C,{passive:!1}),()=>{window.removeEventListener("pointermove",w),window.removeEventListener("pointerup",C),window.removeEventListener("pointercancel",C)}),i)}};this._handleTrackStart=E,this._sideEffect.addEventListener(t,"pointerdown",E,{},"box-resizeHandles-pointerdown")}async destroy(){this.$box.remove(),this._sideEffect.flushAll(),this._sideEffect.flushAll(),await this.events.emit(be.Destroyed),this.events.clearListeners(),this._delegateEvents.clearListeners()}wrapClassName(t){return`${this.namespace}-${t}`}}var Xm="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxOCAxNiI+CiAgICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxwYXRoIHN0cm9rZT0iIzdCODhBMCIgc3Ryb2tlLXdpZHRoPSIxLjQiIGQ9Ik0uNyAxLjJoMTYuNnYxMy42SC43eiIgLz4KICAgICAgICA8cGF0aCBmaWxsPSIjN0I4OEEwIiBkPSJNNCA1LjVoNnYxLjRINHpNNCA5LjVoMTB2MS40SDR6IiAvPgogICAgPC9nPgo8L3N2Zz4K";class Jm{constructor({minimized$:t,readonly$:i,darkMode$:n,namespace:r="telebox",styles:s={},root:o,onClick:a}){this._sideEffect=new Re.SideEffectManager,this.namespace=r;const l=new M.ValManager;this._sideEffect.addDisposer(()=>l.destroy());const u=new M.Val(void 0),h=M.derive(t),p=new M.Val(s),w=new M.Val(document.createElement("button")),C={styles:p,$collector:w};M.withValueEnhancer(this,C,l);const E={rect:u,visible:h};M.withReadonlyValueEnhancer(this,E,l),w.value.className=this.wrapClassName("collector"),w.value.style.backgroundImage=`url('${Xm}')`,this._sideEffect.addDisposer(w.subscribe(T=>{this._sideEffect.add(()=>(o.appendChild(T),()=>T.remove()),"telebox-collector-mount"),this._sideEffect.addEventListener(T,"click",()=>{i.value||a==null||a()},{},"telebox-collector-click"),this._sideEffect.addDisposer([h.subscribe(c=>{T.classList.toggle(this.wrapClassName("collector-visible"),c)}),i.subscribe(c=>{T.classList.toggle(this.wrapClassName("collector-readonly"),c)}),n.subscribe(c=>{T.classList.toggle(this.wrapClassName("color-scheme-dark"),c),T.classList.toggle(this.wrapClassName("color-scheme-light"),!c)}),p.subscribe(c=>{Object.keys(c).forEach(d=>{const f=c[d];f!=null&&(T.style[d]=f)})}),t.subscribe(c=>{if(c){const{x:d,y:f,width:g,height:m}=T.getBoundingClientRect(),x=o.getBoundingClientRect();u.setValue({x:d-x.x,y:f-x.y,width:g,height:m})}})],"telebox-collector-el")}))}destroy(){this._sideEffect.flushAll()}wrapClassName(t){return`${this.namespace}-${t}`}}var we=(e=>(e.Focused="focused",e.Blurred="blurred",e.Created="created",e.Removed="removed",e.State="state",e.Maximized="maximized",e.Minimized="minimized",e.IntrinsicMove="intrinsic_move",e.IntrinsicResize="intrinsic_resize",e.ZIndex="z_index",e.PrefersColorScheme="prefers_color_scheme",e.DarkMode="dark_mode",e))(we||{});class Km extends Od{constructor(t){super(t);this.boxes$=t.boxes$,this.rootRect$=t.rootRect$,this.darkMode$=t.darkMode$,t.root.appendChild(this.render())}focusBox(t){var i;if(!(this.focusedBox&&this.focusedBox===t)){if(this.$titles&&this.state$.value===ue.Maximized){const{children:n}=this.$titles.firstElementChild;for(let r=n.length-1;r>=0;r-=1){const s=n[r],o=(i=s.dataset)==null?void 0:i.teleBoxID;o&&(t&&o===t.id?s.classList.toggle(this.wrapClassName("titles-tab-focus"),!0):this.focusedBox&&o===this.focusedBox.id&&s.classList.toggle(this.wrapClassName("titles-tab-focus"),!1))}}this.focusedBox=t}}render(){if(this.$titleBar)return this.$titleBar;const t=super.render();t.classList.add(this.wrapClassName("max-titlebar")),this.sideEffect.addDisposer([this.state$.subscribe(n=>{t.classList.toggle(this.wrapClassName("max-titlebar-maximized"),n===ue.Maximized)}),this.readonly$.subscribe(n=>{t.classList.toggle(this.wrapClassName("readonly"),n)}),M.combine([this.state$,this.boxes$]).subscribe(([n,r])=>{n===ue.Maximized&&(t.classList.toggle(this.wrapClassName("max-titlebar-single-title"),r.length===1),r.length!==1&&t.replaceChild(this.renderTitles(),t.firstElementChild))})],"max-render");const i=document.createElement("div");return i.classList.add(this.wrapClassName("titles-area")),t.insertBefore(i,t.firstElementChild),t}destroy(){super.destroy(),this.$titles=void 0,this.focusedBox=void 0}renderTitles(){this.$titles=document.createElement("div"),this.$titles.className=this.wrapClassName("titles"),this.sideEffect.addEventListener(this.$titles,"wheel",n=>{n.currentTarget.scrollBy({left:n.deltaY>0?250:-250,behavior:"smooth"})},{passive:!1},"max-render-wheel-titles");const t=document.createElement("div");t.className=this.wrapClassName("titles-content"),this.$titles.appendChild(t);const i=this.boxes$.value.map(n=>{const r=document.createElement("button");return r.className=this.wrapClassName("titles-tab"),r.textContent=n.title,r.dataset.teleBoxID=n.id,r.dataset.teleTitleBarNoDblClick="true",this.focusedBox&&n.id===this.focusedBox.id&&r.classList.add(this.wrapClassName("titles-tab-focus")),t.appendChild(r),n._title$.reaction(s=>r.textContent=s)});return this.sideEffect.addDisposer(()=>i.forEach(n=>n()),"max-render-tab-titles"),this.$titles}}const qm=window.ResizeObserver||od.ResizeObserver;class ev{constructor({root:t=null,fullscreen:i=!1,prefersColorScheme:n=Bd.Light,minimized:r=!1,maximized:s=!1,fence:o=!0,collector:a,namespace:l="telebox",readonly:u=!1,stageRatio:h=-1,containerStyle:p="",stageStyle:w="",defaultBoxBodyStyle:C=null,defaultBoxStageStyle:E=null,theme:T={}}={}){this.events=new Zt.default,this._sideEffect=new Re.SideEffectManager,this.namespace=l;const c=new M.ValManager;this._sideEffect.addDisposer(()=>c.destroy());const d=new M.Val(t),f=new M.Val(u),g=new M.Val(o),m=new M.Val(p),x=new M.Val(w),y=new M.Val(h),N=new M.Val(C),D=new M.Val(E),P=new M.Val(i),J=new M.Val(r),q=new M.Val(s),ee=M.combine([q,P],([v,k])=>k?!0:v),Fe=M.combine([J,P],([v,k])=>k?!1:v);this.setMaximized=(v,k)=>q.setValue(v,k),this.setMinimized=(v,k)=>J.setValue(v,k);const Q=new M.Val({x:0,y:0,width:window.innerWidth,height:window.innerHeight},{compare:Ye});this._sideEffect.addDisposer(d.subscribe(v=>{this._sideEffect.add(()=>{if(!v)return()=>{};const k=new qm(()=>{const _=v.getBoundingClientRect();Q.setValue({x:0,y:0,width:_.width,height:_.height})});return k.observe(v),()=>k.disconnect()},"calc-root-rect")}));const G=M.combine([Q,y],_d,{compare:Ye});this.boxes$=new M.Val([]),this.topBox$=new M.Val(void 0),this._sideEffect.addDisposer(this.boxes$.subscribe(v=>{if(v.length>0){const k=v.reduce((_,$)=>_.zIndex>$.zIndex?_:$);this.topBox$.setValue(k)}else this.topBox$.setValue(void 0)}));const Qe=window.matchMedia("(prefers-color-scheme: dark)"),ae=new M.Val(!1);Qe&&(ae.setValue(Qe.matches),this._sideEffect.add(()=>{const v=k=>{ae.setValue(k.matches)};return Qe.addEventListener("change",v),()=>Qe.removeEventListener("change",v)}));const Oe=new M.Val(n);this._sideEffect.addDisposer(Oe.reaction((v,k)=>{k||this.events.emit(we.PrefersColorScheme,v)}));const _e=M.combine([ae,Oe],([v,k])=>k==="auto"?v:k==="dark"),ht=M.combine([Fe,ee],([v,k])=>v?ue.Minimized:k?ue.Maximized:ue.Normal),qt={darkMode:_e,state:ht,root:d,rootRect:Q,stageRect:G,minimized:Fe,maximized:ee};M.withReadonlyValueEnhancer(this,qt,c);const Et={fullscreen:P,prefersColorScheme:Oe,readonly:f,fence:g,stageRatio:y,containerStyle:m,stageStyle:x,defaultBoxBodyStyle:N,defaultBoxStageStyle:D};M.withValueEnhancer(this,Et,c);const Ii=this.wrapClassName("titlebar-icon-close"),b=v=>{var k;if(!v.isPrimary||f.value)return;const _=v.target;if(!!_.tagName)for(let $=_;$;$=$.parentElement){if($.classList&&$.classList.contains(Ii))return;const ke=(k=$.dataset)==null?void 0:k.teleBoxID;if(ke){const ve=this.getBox(ke);if(ve){this.focusBox(ve),this.makeBoxTop(ve);return}}}};this._sideEffect.addEventListener(window,"pointerdown",b,!0),this.$container=document.createElement("div"),this.$container.className=this.wrapClassName("manager-container"),this.setTheme(T),this.$stage=document.createElement("div"),this.$stage.className=this.wrapClassName("manager-stage"),this.$container.appendChild(this.$stage),this._sideEffect.addDisposer([_e.subscribe(v=>{this.$container.classList.toggle(this.wrapClassName("color-scheme-dark"),v),this.$container.classList.toggle(this.wrapClassName("color-scheme-light"),!v)}),P.subscribe(v=>{this.$container.classList.toggle(this.wrapClassName("is-fullscreen"),Boolean(v))}),M.combine([this.boxes$,P],([v,k])=>k==="no-titlebar"||k===!0&&v.length<=1).subscribe(v=>{this.$container.classList.toggle(this.wrapClassName("hide-fullscreen-titlebar"),v)}),ee.subscribe(v=>{this.$container.classList.toggle(this.wrapClassName("is-maximized"),v)}),Fe.subscribe(v=>{this.$container.classList.toggle(this.wrapClassName("is-minimized"),v)}),m.subscribe(v=>{this.$container.style.cssText=v}),x.subscribe(v=>{this.$stage.style.cssText=v,this.$stage.style.width=G.value.width+"px",this.$stage.style.height=G.value.height+"px"}),G.subscribe(v=>{this.$stage.style.width=v.width+"px",this.$stage.style.height=v.height+"px"}),d.subscribe(v=>{v?v.appendChild(this.$container):this.$container.parentElement&&this.$container.remove()})]),this.collector=a!=null?a:new Jm({minimized$:Fe,readonly$:f,darkMode$:_e,namespace:l,root:this.$container,onClick:()=>J.setValue(!1)}),this.titleBar=new Km({namespace:this.namespace,title$:M.derive(this.topBox$,v=>(v==null?void 0:v.title)||""),boxes$:this.boxes$,darkMode$:_e,readonly$:f,state$:ht,rootRect$:Q,root:this.$container,onEvent:v=>{switch(v.type){case rt.Maximize:{this.setMaximized(!ee.value);break}case rt.Minimize:{this.setMinimized(!0);break}case be.Close:{this.removeTopBox(),this.focusTopBox();break}}}}),this._sideEffect.addDisposer([ht.reaction((v,k)=>{k||this.events.emit(we.State,v)}),ee.reaction((v,k)=>{k||this.events.emit(we.Maximized,v)}),Fe.reaction((v,k)=>{k||this.events.emit(we.Minimized,v)}),_e.reaction((v,k)=>{k||this.events.emit(we.DarkMode,v)})])}get boxes(){return this.boxes$.value}get topBox(){return this.topBox$.value}setState(t,i=!1){switch(t){case ue.Maximized:{this.setMinimized(!1,i),this.setMaximized(!0,i);break}case ue.Minimized:{this.setMinimized(!0,i),this.setMaximized(!1,i);break}default:{this.setMinimized(!1,i),this.setMaximized(!1,i);break}}return this}create(t={},i=!0){const n=new Gm(ft(H(H({zIndex:this.topBox?this.topBox.zIndex+1:100},t),i?this.smartPosition(t):{}),{namespace:this.namespace,root:this.$stage,darkMode$:this._darkMode$,maximized$:this._maximized$,minimized$:this._minimized$,fence$:this._fence$,rootRect$:this._rootRect$,managerStageRect$:this._stageRect$,managerStageRatio$:this._stageRatio$,readonly$:this._readonly$,collectorRect$:this.collector._rect$,defaultBoxBodyStyle$:this._defaultBoxBodyStyle$,defaultBoxStageStyle$:this._defaultBoxStageStyle$}));return n.focus&&(this.focusBox(n),i&&this.makeBoxTop(n)),this.boxes$.setValue([...this.boxes,n]),this._sideEffect.addDisposer([n._delegateEvents.on(rt.Maximize,()=>{this.setMaximized(!this.maximized)}),n._delegateEvents.on(rt.Minimize,()=>{this.setMinimized(!0)}),n._delegateEvents.on(rt.Close,()=>{this.remove(n),this.focusTopBox()}),n._intrinsicCoord$.reaction((r,s)=>{s||this.events.emit(we.IntrinsicMove,n)}),n._intrinsicSize$.reaction((r,s)=>{s||this.events.emit(we.IntrinsicResize,n)}),n._zIndex$.reaction((r,s)=>{if(this.boxes.length>0){const o=this.boxes.reduce((a,l)=>a.zIndex>l.zIndex?a:l);this.topBox$.setValue(o)}s||this.events.emit(we.ZIndex,n)})]),this.events.emit(we.Created,n),n}query(t){return t?this.boxes.filter(this.teleBoxMatcher(t)):[...this.boxes]}queryOne(t){return t?this.boxes.find(this.teleBoxMatcher(t)):this.boxes[0]}update(t,i,n=!1){const r=this.boxes.find(s=>s.id===t);if(r)return this.updateBox(r,i,n)}updateAll(t,i=!1){this.boxes.forEach(n=>{this.updateBox(n,t,i)})}remove(t,i=!1){const n=this.getBoxIndex(t);if(n>=0){const r=this.boxes.slice(),s=r.splice(n,1);return this.boxes$.setValue(r),s.forEach(o=>o.destroy()),i||(this.boxes.length<=0&&(this.setMaximized(!1),this.setMinimized(!1)),this.events.emit(we.Removed,s)),s[0]}}removeTopBox(){if(this.topBox)return this.remove(this.topBox)}removeAll(t=!1){const i=this.boxes$.value;return this.boxes$.setValue([]),i.forEach(n=>n.destroy()),t||(this.boxes.length<=0&&(this.setMaximized(!1),this.setMinimized(!1)),this.events.emit(we.Removed,i)),i}setTheme(t){Object.keys(t).forEach(i=>{var n;this.$container.style.setProperty(`--tele-${i}`,(n=t[i])!=null?n:null)})}mount(t){this._root$.setValue(t)}unmount(){this._root$.setValue(null)}destroy(t=!1){this.events.clearListeners(),this._sideEffect.flushAll(),this.removeAll(t),this.collector.destroy(),this.titleBar.destroy()}wrapClassName(t){return`${this.namespace}-${t}`}focusBox(t,i=!1){const n=this.getBox(t);n&&(this.boxes.forEach(r=>{if(n===r){let s=!1;n.focus||(s=!0,n._focus$.setValue(!0,i)),s&&!i&&this.events.emit(we.Focused,n)}else r.focus&&this.blurBox(r,i)}),this.titleBar.focusBox(n))}focusTopBox(){if(this.topBox&&!this.topBox.focus)return this.focusBox(this.topBox)}blurBox(t,i=!1){const n=this.getBox(t);n&&(n.focus&&(n._focus$.setValue(!1,i),i||this.events.emit(we.Blurred,n)),this.titleBar.focusedBox===n&&this.titleBar.focusBox())}blurAll(t=!1){this.boxes.forEach(i=>{i.focus&&(i._focus$.setValue(!1,t),t||this.events.emit(we.Blurred,i))}),this.titleBar.focusedBox&&this.titleBar.focusBox()}teleBoxMatcher(t){const i=Object.keys(t);return n=>i.every(r=>t[r]===n[r])}updateBox(t,i,n=!1){var r,s,o,a,l,u;(i.x!=null||i.y!=null)&&t._intrinsicCoord$.setValue({x:(r=i.x)!=null?r:t.intrinsicX,y:(s=i.y)!=null?s:t.intrinsicY},n),(i.width!=null||i.height!=null)&&t._intrinsicSize$.setValue({width:(o=i.width)!=null?o:t.intrinsicWidth,height:(a=i.height)!=null?a:t.intrinsicHeight},n),i.title!=null&&t._title$.setValue(i.title),i.visible!=null&&t._visible$.setValue(i.visible,n),i.resizable!=null&&t._resizable$.setValue(i.resizable,n),i.draggable!=null&&t._draggable$.setValue(i.draggable,n),i.boxRatio!=null&&t._boxRatio$.setValue(i.boxRatio,n),i.zIndex!=null&&t._zIndex$.setValue(i.zIndex,n),i.stageRatio!==void 0&&t.setStageRatio(i.stageRatio,n),i.content!=null&&t.mountContent(i.content),i.footer!=null&&t.mountFooter(i.footer),(i.minHeight!=null||i.minWidth!=null)&&t._minSize$.setValue({width:(l=i.minWidth)!=null?l:t.minWidth,height:(u=i.minHeight)!=null?u:t.minHeight},n)}smartPosition(t){let{x:i,y:n}=t;const{width:r=.5,height:s=.5}=t,o=this.stageRect,a=this.topBox;if(i==null){let l=20;if(a){const u=a.pxIntrinsicCoord.x+20,h=r*o.width;u+h<=o.width&&(l=u)}i=l/o.width}if(n==null){let l=20;if(a){const u=a.pxIntrinsicCoord.y+20,h=s*o.height;u+h<=o.height&&(l=u)}n=l/o.height}return{x:i,y:n,width:r,height:s}}makeBoxTop(t,i=!1){this.topBox&&t!==this.topBox&&t._zIndex$.setValue(this.topBox.zIndex+1,i)}getBoxIndex(t){return typeof t=="string"?this.boxes.findIndex(i=>i.id===t):this.boxes.findIndex(i=>i===t)}getBox(t){return typeof t=="string"?this.boxes.find(i=>i.id===t):t}}const tv=(e,t,i,n,r)=>new iv({safeSetAttributes:s=>e.safeSetAttributes(s),updateAppState:(...s)=>{var o;return(o=e.appManager)==null?void 0:o.store.updateAppState(...s)},canOperate:()=>e.canOperate,notifyContainerRectUpdate:s=>{var o;return(o=e.appManager)==null?void 0:o.notifyContainerRectUpdate(s)},cleanFocus:()=>{var s;return(s=e.appManager)==null?void 0:s.store.cleanFocus()},setAppFocus:s=>{var o;return(o=e.appManager)==null?void 0:o.store.setAppFocus(s,!0)},callbacks:t,emitter:i,boxEmitter:n},r);class iv{constructor(t,i){this.context=t,this.sideEffectManager=new Re.SideEffectManager;const{emitter:n,callbacks:r,boxEmitter:s}=t;this.teleBoxManager=this.setupBoxManager(i),this.sideEffectManager.add(()=>[this.teleBoxManager.onValChanged("state",o=>{r.emit("boxStateChange",o),n.emit("boxStateChange",o)}),this.teleBoxManager.onValChanged("darkMode",o=>{r.emit("darkModeChange",o)}),this.teleBoxManager.onValChanged("prefersColorScheme",o=>{r.emit("prefersColorSchemeChange",o)}),this.teleBoxManager.onValChanged("minimized",(o,a)=>{if(!a)if(this.context.safeSetAttributes({minimized:o}),o)this.context.cleanFocus(),this.blurAllBox();else{const l=this.getTopBox();l&&(this.context.setAppFocus(l.id),this.focusBox({appId:l.id},!1))}}),this.teleBoxManager.onValChanged("maximized",(o,a)=>{a||this.context.safeSetAttributes({maximized:o})}),this.teleBoxManager.events.on("removed",o=>{o.forEach(a=>{s.emit("close",{appId:a.id})})}),this.teleBoxManager.events.on("intrinsic_move",A.debounce(o=>{s.emit("move",{appId:o.id,x:o.intrinsicX,y:o.intrinsicY})},50)),this.teleBoxManager.events.on("intrinsic_resize",A.debounce(o=>{s.emit("resize",{appId:o.id,width:o.intrinsicWidth,height:o.intrinsicHeight})},200)),this.teleBoxManager.events.on("focused",o=>{o&&(this.canOperate?s.emit("focus",{appId:o.id}):this.teleBoxManager.blurBox(o.id))}),this.teleBoxManager.events.on("z_index",o=>{this.context.updateAppState(o.id,Xe.ZIndex,o.zIndex)}),n.on("containerSizeRatioUpdate",o=>{this.teleBoxManager._stageRatio$.setValue(o)})])}get canOperate(){return this.context.canOperate()}get boxState(){return this.teleBoxManager.state}get maximized(){return this.teleBoxManager.maximized}get minimized(){return this.teleBoxManager.minimized}get darkMode(){return this.teleBoxManager.darkMode}get prefersColorScheme(){return this.teleBoxManager.prefersColorScheme}get boxSize(){return this.teleBoxManager.boxes.length}get stageRect(){return this.teleBoxManager.stageRect}get stageRect$(){return this.teleBoxManager._stageRect$}createBox(t){var p,w,C;if(!this.teleBoxManager)return;let{minwidth:i=ug,minheight:n=cg,enableShadowDOM:r=!0}=(p=t.app.config)!=null?p:{};const{width:s,height:o}=(w=t.app.config)!=null?w:{},a=((C=t.options)==null?void 0:C.title)||t.appId,l=this.teleBoxManager.rootRect;i>1&&(i=i/l.width),n>1&&(n=n/l.height);const u={title:a,minWidth:i,minHeight:n,width:s,height:o,id:t.appId,enableShadowDOM:r},h=this.teleBoxManager.create(u,t.smartPosition);return this.context.emitter.emit(`${t.appId}${Z.WindowCreated}`),h}setupBoxManager(t){const i=ge.playground,n={stageRatio:t==null?void 0:t.stageRatio,root:i,fence:!1,prefersColorScheme:t==null?void 0:t.prefersColorScheme};t!=null&&t.containerStyle&&(n.containerStyle=t.containerStyle),t!=null&&t.stageStyle&&(n.stageStyle=t.stageStyle),t!=null&&t.fullscreen&&(n.fullscreen=t.fullscreen);const r=new ev(n);this.teleBoxManager&&this.teleBoxManager.destroy(),this.teleBoxManager=r;const s=t==null?void 0:t.collectorContainer;return s&&this.teleBoxManager.collector.set$collector(s),t!=null&&t.collectorStyles&&this.teleBoxManager.collector.setStyles(t.collectorStyles),r}getBox(t){return this.teleBoxManager.queryOne({id:t})}closeBox(t,i=!1){return this.teleBoxManager.remove(t,i)}boxIsFocus(t){const i=this.getBox(t);return i==null?void 0:i.focus}getFocusBox(){return this.teleBoxManager.query({focus:!0})[0]}getTopBox(){return this.teleBoxManager.topBox}updateBoxState(t){if(!t)return;const i=this.getBox(t.id);i&&(t.size&&i._intrinsicSize$.setValue(t.size,!0),t.position&&i._intrinsicCoord$.setValue(t.position,!0),t.zIndex&&i._zIndex$.setValue(t.zIndex,!0),setTimeout(()=>{t.focus&&this.teleBoxManager.focusBox(i.id,!0),t.maximized!=null&&this.teleBoxManager.setMaximized(Boolean(t.maximized),!0),t.minimized!=null&&this.teleBoxManager.setMinimized(Boolean(t.minimized),!0)},50),this.context.callbacks.emit("boxStateChange",this.teleBoxManager.state))}moveBox({appId:t,x:i,y:n}){const r=this.getBox(t);r&&r._intrinsicCoord$.setValue({x:i,y:n},!0)}focusBox({appId:t},i=!0){this.teleBoxManager.focusBox(t,i)}resizeBox({appId:t,width:i,height:n,skipUpdate:r}){const s=this.getBox(t);s&&s._intrinsicSize$.setValue({width:i,height:n},r)}setBoxMinSize(t){this.teleBoxManager.update(t.appId,{minWidth:t.minWidth,minHeight:t.minHeight},!0)}setBoxTitle(t){this.teleBoxManager.update(t.appId,{title:t.title},!0)}blurAllBox(){this.teleBoxManager.blurAll()}updateAll(t){this.teleBoxManager.updateAll(t)}setMaximized(t,i=!0){t!==this.maximized&&this.teleBoxManager.setMaximized(t,i)}setMinimized(t,i=!0){this.teleBoxManager.setMinimized(t,i)}focusTopBox(){if(this.teleBoxManager.query().length>=1){const i=this.getTopBox();i&&this.focusBox({appId:i.id},!1)}}updateBox(t,i,n=!0){this.teleBoxManager.update(t,i,n)}setReadonly(t){this.teleBoxManager.setReadonly(t)}setPrefersColorScheme(t){this.teleBoxManager.setPrefersColorScheme(t)}setZIndex(t,i,n=!0){this.teleBoxManager.update(t,{zIndex:i},n)}setRoot(t){this.teleBoxManager._root$.setValue(t)}setCollector(t){this.teleBoxManager.collector.set$collector(t)}destroy(){this.sideEffectManager.flushAll(),this.teleBoxManager.destroy()}}function Qr(){}function $d(e){return e()}function Cu(){return Object.create(null)}function Ts(e){e.forEach($d)}function nv(e){return typeof e=="function"}function rv(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let ur;function Zr(e,t){return ur||(ur=document.createElement("a")),ur.href=t,e===ur.href}function sv(e){return Object.keys(e).length===0}function xt(e,t){e.appendChild(t)}function ks(e,t,i){e.insertBefore(t,i||null)}function Yn(e){e.parentNode.removeChild(e)}function Bt(e){return document.createElement(e)}function Fa(e){return document.createTextNode(e)}function jo(){return Fa(" ")}function le(e,t,i){i==null?e.removeAttribute(t):e.getAttribute(t)!==i&&e.setAttribute(t,i)}function ov(e){return Array.from(e.childNodes)}function Ud(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function he(e,t,i,n){i===null?e.style.removeProperty(t):e.style.setProperty(t,i,n?"important":"")}let Qa;function Mn(e){Qa=e}const gn=[],bu=[],kr=[],Mu=[],av=Promise.resolve();let Lo=!1;function lv(){Lo||(Lo=!0,av.then(Wd))}function Vo(e){kr.push(e)}const so=new Set;let cr=0;function Wd(){const e=Qa;do{for(;cr<gn.length;){const t=gn[cr];cr++,Mn(t),uv(t.$$)}for(Mn(null),gn.length=0,cr=0;bu.length;)bu.pop()();for(let t=0;t<kr.length;t+=1){const i=kr[t];so.has(i)||(so.add(i),i())}kr.length=0}while(gn.length);for(;Mu.length;)Mu.pop()();Lo=!1,so.clear(),Mn(e)}function uv(e){if(e.fragment!==null){e.update(),Ts(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(Vo)}}const cv=new Set;function dv(e,t){e&&e.i&&(cv.delete(e),e.i(t))}function hv(e,t,i,n){const{fragment:r,on_mount:s,on_destroy:o,after_update:a}=e.$$;r&&r.m(t,i),n||Vo(()=>{const l=s.map($d).filter(nv);o?o.push(...l):Ts(l),e.$$.on_mount=[]}),a.forEach(Vo)}function pv(e,t){const i=e.$$;i.fragment!==null&&(Ts(i.on_destroy),i.fragment&&i.fragment.d(t),i.on_destroy=i.fragment=null,i.ctx=[])}function fv(e,t){e.$$.dirty[0]===-1&&(gn.push(e),lv(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function gv(e,t,i,n,r,s,o,a=[-1]){const l=Qa;Mn(e);const u=e.$$={fragment:null,ctx:null,props:s,update:Qr,not_equal:r,bound:Cu(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(l?l.$$.context:[])),callbacks:Cu(),dirty:a,skip_bound:!1,root:t.target||l.$$.root};o&&o(u.root);let h=!1;if(u.ctx=i?i(e,t.props||{},(p,w,...C)=>{const E=C.length?C[0]:w;return u.ctx&&r(u.ctx[p],u.ctx[p]=E)&&(!u.skip_bound&&u.bound[p]&&u.bound[p](E),h&&fv(e,p)),w}):[],u.update(),h=!0,Ts(u.before_update),u.fragment=n?n(u.ctx):!1,t.target){if(t.hydrate){const p=ov(t.target);u.fragment&&u.fragment.l(p),p.forEach(Yn)}else u.fragment&&u.fragment.c();t.intro&&dv(e.$$.fragment),hv(e,t.target,t.anchor,t.customElement),Wd()}Mn(l)}class mv{$destroy(){pv(this,1),this.$destroy=Qr}$on(t,i){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(i),()=>{const r=n.indexOf(i);r!==-1&&n.splice(r,1)}}$set(t){this.$$set&&!sv(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function Iu(e){let t,i,n,r,s,o,a=e[14]&&Au(e),l=e[15]&&Eu(e);return{c(){t=Bt("div"),i=Bt("div"),a&&a.c(),n=jo(),r=Bt("span"),s=Fa(e[0]),o=jo(),l&&l.c(),he(r,"overflow","hidden"),he(r,"white-space","nowrap"),he(r,"text-overflow","ellipsis"),he(r,"max-width","80px"),le(i,"class",e[8]),he(i,"background-color",e[2]),he(i,"color",e[9]),he(i,"opacity",e[11]),le(t,"class","netless-window-manager-cursor-name")},m(u,h){ks(u,t,h),xt(t,i),a&&a.m(i,null),xt(i,n),xt(i,r),xt(r,s),xt(i,o),l&&l.m(i,null)},p(u,h){u[14]?a?a.p(u,h):(a=Au(u),a.c(),a.m(i,n)):a&&(a.d(1),a=null),h&1&&Ud(s,u[0]),u[15]?l?l.p(u,h):(l=Eu(u),l.c(),l.m(i,null)):l&&(l.d(1),l=null),h&256&&le(i,"class",u[8]),h&4&&he(i,"background-color",u[2]),h&512&&he(i,"color",u[9]),h&2048&&he(i,"opacity",u[11])},d(u){u&&Yn(t),a&&a.d(),l&&l.d()}}}function Au(e){let t,i;return{c(){t=Bt("img"),le(t,"class","netless-window-manager-cursor-selector-avatar"),le(t,"style",e[16]()),Zr(t.src,i=e[7])||le(t,"src",i),le(t,"alt","avatar")},m(n,r){ks(n,t,r)},p(n,r){r&128&&!Zr(t.src,i=n[7])&&le(t,"src",i)},d(n){n&&Yn(t)}}}function Eu(e){let t,i;return{c(){t=Bt("span"),i=Fa(e[1]),le(t,"class","netless-window-manager-cursor-tag-name"),he(t,"background-color",e[10])},m(n,r){ks(n,t,r),xt(t,i)},p(n,r){r&2&&Ud(i,n[1]),r&1024&&he(t,"background-color",n[10])},d(n){n&&Yn(t)}}}function vv(e){let t,i,n,r,s,o,a=!e[12]&&Iu(e);return{c(){t=Bt("div"),a&&a.c(),i=jo(),n=Bt("div"),r=Bt("img"),le(r,"class",s="netless-window-manager-cursor-"+e[3]+"-image"),Zr(r.src,o=e[6])||le(r,"src",o),le(r,"alt",e[3]),le(n,"class","cursor-image-wrapper"),le(t,"class","netless-window-manager-cursor-mid"),he(t,"transform","translateX("+e[4]+"px) translateY("+e[5]+"px)"),he(t,"display",e[13])},m(l,u){ks(l,t,u),a&&a.m(t,null),xt(t,i),xt(t,n),xt(n,r)},p(l,[u]){l[12]?a&&(a.d(1),a=null):a?a.p(l,u):(a=Iu(l),a.c(),a.m(t,i)),u&8&&s!==(s="netless-window-manager-cursor-"+l[3]+"-image")&&le(r,"class",s),u&64&&!Zr(r.src,o=l[6])&&le(r,"src",o),u&8&&le(r,"alt",l[3]),u&48&&he(t,"transform","translateX("+l[4]+"px) translateY("+l[5]+"px)"),u&8192&&he(t,"display",l[13])},i:Qr,o:Qr,d(l){l&&Yn(t),a&&a.d()}}}function wv(e,t,i){let n,r,s,o,a,{cursorName:l}=t,{tagName:u}=t,{backgroundColor:h}=t,{appliance:p}=t,{x:w}=t,{y:C}=t,{src:E}=t,{visible:T}=t,{avatar:c}=t,{theme:d}=t,{color:f}=t,{cursorTagBackgroundColor:g}=t,{opacity:m}=t;const x=()=>Object.entries({width:(n?19:28)+"px",height:(n?19:28)+"px",position:n?"initial":"absolute","border-color":n?"white":h,"margin-right":(n?4:0)+"px"}).map(([y,N])=>`${y}: ${N}`).join(";");return e.$$set=y=>{"cursorName"in y&&i(0,l=y.cursorName),"tagName"in y&&i(1,u=y.tagName),"backgroundColor"in y&&i(2,h=y.backgroundColor),"appliance"in y&&i(3,p=y.appliance),"x"in y&&i(4,w=y.x),"y"in y&&i(5,C=y.y),"src"in y&&i(6,E=y.src),"visible"in y&&i(17,T=y.visible),"avatar"in y&&i(7,c=y.avatar),"theme"in y&&i(8,d=y.theme),"color"in y&&i(9,f=y.color),"cursorTagBackgroundColor"in y&&i(10,g=y.cursorTagBackgroundColor),"opacity"in y&&i(11,m=y.opacity)},e.$$.update=()=>{e.$$.dirty&1&&(n=!A.isEmpty(l)),e.$$.dirty&2&&i(15,r=!A.isEmpty(u)),e.$$.dirty&128&&i(14,s=!A.isEmpty(c)),e.$$.dirty&131072&&i(13,o=T?"initial":"none"),e.$$.dirty&8&&i(12,a=p===I.ApplianceNames.laserPointer)},[l,u,h,p,w,C,E,c,d,f,g,m,a,o,s,r,x,T]}class yv extends mv{constructor(t){super();gv(this,t,wv,vv,rv,{cursorName:0,tagName:1,backgroundColor:2,appliance:3,x:4,y:5,src:6,visible:17,avatar:7,theme:8,color:9,cursorTagBackgroundColor:10,opacity:11})}}class xv{constructor(t,i,n,r){this.manager=t,this.memberId=i,this.cursorManager=n,this.wrapper=r,this.move=s=>{var o,a;if(s.type==="main"){const l=(o=this.manager.boxManager)==null?void 0:o.stageRect;this.component&&l&&(this.autoHidden(),this.moveCursor(s,l,this.manager.mainView))}else{const l=this.cursorManager.focusView,u=(a=l==null?void 0:l.divElement)==null?void 0:a.getBoundingClientRect(),h=l==null?void 0:l.camera;l&&u&&h&&this.component&&(this.autoHidden(),this.moveCursor(s,u,l))}},this.leave=()=>{this.hide()},this.updateMember(),this.createCursor(),this.autoHidden()}moveCursor(t,i,n){var l,u;const{x:r,y:s,type:o}=t,a=n==null?void 0:n.screen.convertPointToScreen(r,s);if(a){let h=a.x-2,p=a.y-18;if(o==="app"){const w=this.cursorManager.playgroundRect;w&&(h=h+i.x-w.x,p=p+i.y-w.y)}else h=h+i.x,p=p+i.y;a.x<0||a.x>i.width||a.y<0||a.y>i.height?(l=this.component)==null||l.$set({visible:!1,x:h,y:p}):(u=this.component)==null||u.$set({visible:!0,x:h,y:p})}}get memberApplianceName(){var t,i;return(i=(t=this.member)==null?void 0:t.memberState)==null?void 0:i.currentApplianceName}get memberColor(){var i,n;return`rgb(${(n=(i=this.member)==null?void 0:i.memberState)==null?void 0:n.strokeColor.join(",")})`}get payload(){var t;return(t=this.member)==null?void 0:t.payload}get memberCursorName(){var t,i;return((t=this.payload)==null?void 0:t.nickName)||((i=this.payload)==null?void 0:i.cursorName)||this.memberId}get memberTheme(){var t;return(t=this.payload)!=null&&t.theme?"netless-window-manager-cursor-inner-mellow":"netless-window-manager-cursor-inner"}get memberCursorTextColor(){var t;return((t=this.payload)==null?void 0:t.cursorTextColor)||"#FFFFFF"}get memberCursorTagBackgroundColor(){var t;return((t=this.payload)==null?void 0:t.cursorTagBackgroundColor)||this.memberColor}get memberAvatar(){var t;return(t=this.payload)==null?void 0:t.avatar}get memberOpacity(){return!this.memberCursorName&&!this.memberAvatar?0:1}get memberTagName(){var t;return(t=this.payload)==null?void 0:t.cursorTagName}autoHidden(){this.timer&&clearTimeout(this.timer),this.timer=window.setTimeout(()=>{this.hide()},1e3*10)}async createCursor(){this.member&&this.wrapper&&(this.component=new yv({target:this.wrapper,props:this.initProps()}))}initProps(){return{x:0,y:0,appliance:this.memberApplianceName,avatar:this.memberAvatar,src:this.getIcon(),visible:!1,backgroundColor:this.memberColor,cursorName:this.memberCursorName,theme:this.memberTheme,color:this.memberCursorTextColor,cursorTagBackgroundColor:this.memberCursorTagBackgroundColor,opacity:this.memberOpacity,tagName:this.memberTagName}}getIcon(){if(this.member){const t=this.cursorManager.applianceIcons;return t[this.memberApplianceName||I.ApplianceNames.shape]||t[I.ApplianceNames.shape]}}updateMember(){return this.member=xd(this.manager.room,this.memberId),this.updateComponent(),this.member}updateComponent(){var t;(t=this.component)==null||t.$set(A.omit(this.initProps(),["x","y"]))}destroy(){this.component&&this.component.$destroy(),this.cursorManager.cursorInstances.delete(this.memberId),this.timer&&clearTimeout(this.timer)}hide(){this.component&&(this.component.$set({visible:!1}),this.destroy())}}var Sv="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAYISURBVHgB7ZpNSCtXFIBPEuvz+dMGpYUKD/sWFX+Qti6kK7Hqpm6e9q0rIoIUFUShPLV10VZx4+JZqa9v20LBhdq9fyBUCtKNPH8qYl2IOw3G38Rkek4y15y5uTOZJDOWggcOSSYzN/ebc+45554JwIM8iBCPyTEP+86T4vyMfsRN4b+nQTKIJp0vzuGvlpID7os8EQNEIBD4oKio6Bm9DwaDv/v9/n/076JgbtWUYPchwrW8qD7UnOvr6wFNkpubm+/wu7f0c7y6mrnlvQufxB0Iau7V1dX3BDA/P6/V1dVpzc3N2uLiIofK1c8VYHys/wRKBUN3/hGHqaysNOjc3FwMis6hc0FtLTHuvYLxCCZgci8uLn4wg5Gh6Fy8Jk+/NkcCAlAAuUkoW4g0B+d5tLS05O/r67O8eGxsDNra2uDy8nKsoKCAwCIQDxQa0yTxgrvCYXyTk5Ml+Orf2dlJeeHIyAigFSE/P38ELfUNqNdSkjgF5FF89jL1TU1NlQwODl5gZPujp6cHWltbUw7Koc7Pz8mkZpHPFeFrJuZeqLnoMoPoZqe0JjDP/IZgnyLUG/o8NDRkuo5Ua2pjY6MC4oFCFf1cA0oKzRSOp6enRfTaGh0d/QxBt+1CUVgnOTs7+xrHfQzGyOcKkK3QTJMnQffZ6e/v/xwttmsHqqmpKXbdycnJCxy7ABLh3FEgVZ6hZJhnFZoFFMF0d3c/w7v+dyookXBnZ2c/xvHfhriVcvXfdBRItsxjnOhYqjwjoAimq6vrCysoGofk+Ph4Esd/F/UdiFtJAGUd2DygTpp5dmBUUJ2dnc9VUALm8PDwJY7/BPU9VD8k3M4RC6kskxZMKigKIMLN9vf3p3H8DyWgfEhEOwOQD9IXOTz7EObbwsLC4YWFBRgeHrY9ECXYo6MjaGlpKWlsbPxkYGDgRW1tbSEWquVlZWXBzc3Nl1VVVa8hXiXc6ioqBqGaPDk7AACJTRZ3NS9lcUp86cJwoSQ7Pj4Op6enfxUXF3/V0NCQv7q6GsCvwrqGUG/01xAD4+VQTOxaSF43d5bBOisrGBJRCtXX17+/trb268rKSgASFgmz97KFkmo6OztWuVyPweiWGc4WRkhFRQVEIpHg8vJyQAIQVlLBROVxvBYQHsXnO8tk62ZcyN0wecLBwcEvYHSzEPscBqOLCRhLC4n9uqaA8UAWAcAKhtbQ3t7eTHl5+Y9gtAp3twhT056CDMQ7MRzIFTeTYKb1yYYVQFH9VdzsqNmYKpfTJBDX3Ixgdnd3XyHMT2AMALJlBBSPaMpNngrIsTyTCgaj288YDGakictrxizvKFNOjgSSBLS+vv6UYHDb7DgMVgsChjTEgCIKGG4ZU+EWkgNBzN1qamq+pAMTExPgFMzW1tZrhHkFyWE5KxgSszx0527RaDRmOSpRshEOU11dPQPG8CwHARHJlMnTSrwSRFIlfXt7m3V5ngJGuJtqzaQtZkFBVNJezN5ZAdmwjKo2k9tVtrcI3OXk4tPgcg7ChCDZ1URgMOu72Xa5VFHOkymQhWVU60YVmjN6wiC7k6p+S1syCACOwJBYFaexV+yhBekNPsMBO6KAEeE4BMaCU67RsoYhSbXgaT//ht709vZCaWmp6YkEbLFmVJWzas04+iBL7EKpm0J7duqu0B7+CTUpNJuyvb1NCfMj1CqI9wLKUOlOUMeG+gGFkHii4HizUF4z/KFUrPsJ8WbEIyx7nnZ0dDynME6BAuce09iFHo+GrnmGltltb2//E4wVAN82y7vOjKOZXSBhJdHNiT3TYWD8OY2PTUJkdd7MkJMnT5wZVQF2RFX6yBMUdzPMvvfqxz3sXHF+GNT9ANXit/10O1sgHkZvdQAOKvs9B5L7ARELGAAXLSTvM8QExTE+YbHe+HURhZp1aRyF4CJXClbbWwGketgkW9VsY+YaiBCVhfgE+XvxRwgZSM4jUVCDZFQ9pytmXR8hUTB2gnidx4XffVWydN0yQjwmx/jkAZJBrIBI5J7ZvQGZWUgVSuU/EqmOAzicKNMVu816DdRWUV1/7xAP8n+SfwF3Du3NF2sYhwAAAABJRU5ErkJggg==",Cv="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADEAAAAxCAYAAABznEEcAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAZoSURBVHgB7VlLSCRXFL3ljNEhEXTGhMQJmOjCz8ZNVLKICz9xIYhCNi7UgINkGEk2En8hW5cBUQNxo05GAoKikuCAmvGzGMdPcCUGjDPxD/4Vv/3JvWW97luvq7ur+hMZ8MKlqrteNfe8e965970GuLVbC5kpJr53+hjHx9yY3TUxJgLMAQG4ITARfp5T4Mri4uL9q6urnxwOxz/oY5eXl1/Pzs7e195X2FX4jZsIhAK7gx5ps9m6nGj9/f3OtbU1pzAE0318fPwVjYHrrN7R3AjU/wpOBwA9Cmf/9ejoqDMtLU31iooKGdA+ATo4OMiXAEWAHhBAGEApXj4rPAik0vPt7e0vCgoKPH4gMzMTSktLIS8vD2JiYgABvcHMTZyennbHxsaOg3udOJmLzwqEYB0ZgRCZENm4u7e39yQuLq65srISZmZmvP5Ybm4u5OfnQ0lJyXWUCAgzNLS+vt6SnJz8WgvYwV5xSlcRgyVg3ha2Dkxzc3MvfZmVlQW+bGxsDBobGyE7O1u94uJPjIqKqklKSvrbbrfPnp+ff7e8vJwMnlSTKWfJjDKhywJo6wLp0YcZ+dyIUr7s4cOHLsrRlQwBTSBFuzc2NiZYhjjVAIyzZBqEwgCQv0OOM/gNzuiP/ijlDxBRjgClpqa6AF1cXDydmpoaLCws3JcAGYHyC4JMzoKaibKysvienp6FtrY2IA/WCFB5ebkqCHSvARo8Ozt7igIxwIJ2gJ+seFMnDoIyEUV+dHT0G3qWVUr5M043DdAB0m2IKZwAYpgZX+qkywR6NFbuR0iDxmAoZRUQKRxSLTMnJ8eIaqqSeVMnIYUOdu+sq6vrp4f+VCoYo8khZaNs01VRlERUu2/BrWAA7sl2Anink1Ao18JGjyY/PDx8hq1GZqgp5c2mp6chMjLy2b179x7hRzvoqeUUwXIzqq4O5nZsNUaEbIbLqPLTou/s7FTvT05OpsA9sXJG1AVsZDwjutqBIN6gUlWjxod8XRBNKXgsrqpqYZfwEqX9h8TExD7wbFm8LmzxHQ0QHSlXKZVSqFC/hkqlaKapTaGgCQTK7PHW1lb/wsLC86KiokkccoV+qV1tcE0pO7AWxmhTxBszDzqRr66ujqanp2cRpQLNBgUsCh8BwQ54bn5+/s+mpqa+4eHhfS1gb52vwuP0trPjhSZCBtLQ0NA3MDDQQIFYAUHBYhuvzjpVbJr1lZWVP3p7e19UVVXNgHumXYrI4uBx6Yqevz02b0FcRQ8CoBQF3dXVpQLZ3d39C7n+ora29vfJyclDYFnWgFyxK3cxhss/+KoT/N6DVkQpKypFGUCp3Ozo6HgSHx//GLW/BwHsg57zl5pzADajwLn52mPL1ZHPloMoRYPMFL6EhAR18e7s7MxVV1fPsAAp4Avteq7dC/c1+wKI4g+EfGzDM+EYHBw8RDrNiA2QL6upqVGvKJ2/gHu2L1nA5wwEB2YDfSYMO1x/px0cgEc2zBY+eo67u6H29vZ/wU2VC8l58JxKNjDOgojNEp08aFVfX++3l6JMEdDx8fEB0FNIBsDXBc8ArwuW1EkeI1RKdLWmCx+1DhkZGRvR0dFfSsHKxYtnW0iqvJAN9xNm6MR/QO5sfapUSkqKmqW5ubmfwVgyZdpw/vPZl2kUEAinBMSUStG+gwra0NDQSynQKyloIxnlewafjDFLJzLRBJqiFMnqyMgIbG5uDuD996Dnv8iAPOMAPmbcm5lVJwA/vZRMKZGZlpaWVtAvUL4GZMqE1fjRJrUd76LHoX+InlhcXPwZnWW2tra6jjrpiBM3UK/weQr6J+gfodMh9HtwncG7YLA3CMSsLmxx5WuDCt8B7vZeicInTjCWlpb6wc15mfey7oc9E8LElpVmMgb9AXoC+qcTExOPKRu4NlTHs6Q10GfhgfYOvRsJQZ76BWMKuDtaolQs+gfoH6Mn436gDg+e+5BKXUQx/C5Je/a+NpbeiQJPKgUdlNXx/BCBKxVdxW5Q0I3XBqFKRhU4KLtjYawi3csuTKdc4FnIXNvKUJkVEGRG20QZAAUpA5DbaYAQLmQzfzxyk/ffdnCD4NWVnGdE7kQBQvQHC5lVEDxgMaM29lkxGCNLKrDnIbFAMkFmBIaDkHstU41coGZ1TZD5UjReCGUAYbNgdNqoXZB/T67yYbFAMiGML3BhYeH8rb0t9h/zgcTBcTNGiQAAAABJRU5ErkJggg==",bv="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAgrSURBVHgB7ZprTBRXFIDP7gIt8lQppTwE5V0KaAn6o1pqNGkDDTEmTUhsgKRp+gNJw68CFkLbVC2QkDS+gD8KJdWmARvbFBNNWpuIRGPFWBXQRMPDqIki+KLATs+ZnTvcvXtnX8w2beJJToaduTP3fHPOPffcOwC8kP+2WCDwIvahGFxTuN8KmNSZmULPNjLeqF9F8rdPkIEGEn+r+vjx46LQ0NA8/Dsader58+e/h4WFDWntFO7ot6fMFAt3JLWi2lCDpqamCux2+2+KROj82NhYGrXT2lu5Z/DP/deFByElA4Pv3LlTiHY/nJ6eVnbv3q1s2bJFyc7OVrZu3arU1dUp4+PjxPUQoT+g9tp9PkMFgpo9kxljHRoaWp2Xl3duYmIiurKyEvDoclNCQgIcPnxYPc7MzHwcGRnZhaft4Ag7O9fUbRhaITCie4lgcnNzT7qDIaHz27dvh+vXr0NEREQneqoCHKFnAR+8ZCaQGGq2CxcurCGYycnJZHcwTNAzUFFRoUJFRUV1IFQ5OKBsXB9uxSwgl0TQ3d29Yt26dccwoyVXV1d7hGEiQmGi2AzOUHx/hob4K2yuYS9G987s7OwPISEh7xPM6dOnwVfBsIMjR45AZmbmo5s3b76Xnp7+J55egMVxBSAZT0v1ED+76yn66dOnLQSzd+9ev2BIyFP0MjBco1JTU/sxfFeDazp3cYgZHmKqdoaGNISHh9fv378fSJcqlPV6e3sBJ+I/goOD34VFL0k95Y+HxPHCYGxmw5DQ2NuzZw8EBQVtunXr1jvgwUP+hhz/QDXMMCNVE8zx48dNg2FCz6QQjI2N/RA8VBFmANnu3btXihnpG8pM9fX1EAi5du0aeWkVOAMBCF7yN+R0z4yOjq6NiYlpp9CgdBtIwXpPH6vgDKWLt0CygtM6MDCwBuUYZSKaOCksAiVY9wFOBePgDOOytPAGSKzNVCCC2bBhw69YdK7ypgpYimzbtk2dl7CM+hFcveOUHDylbTFO1YdhFbByx44dA1QFUP0VSJj4+Hjo6+sDq9U6iEmHKvFZTedQ50GYbN15SITVlwNlZWUnLRZL8s6dOwMOQ9UCTtKTra2ttdppt9V2kMF5cbmsjxuM43bMNrmUzc6fP6+GQiDGDoOJi4ubwb4qm5ubafyIE6nLxGqTPEsGo1cBOGNX0TyDYafC0CyOaxcVziyh53Z2dkJycvLMvn37PmpoaBgFR4jxYSbWdVIgI89Iq4CjR48CZjlYv369+tssqI6ODsjPz4f+/v668vLycxrEHHfkYdwC8SB6mGEV8Cl64cuuri5oa2tTG+EyGjZu3AiXLl1qefDgwV8lJSUFZkDV1tZCcXExXLx4sbWoqKgPFj0zx8GI9ZwO5W4M6ekZYeqpaqbqmaSqqkpNpcPDw4dwzfM9nrLduHEjEs+X0XV/Sx96LnqE1kLtBQUF3eDwCO8dGQyzV5rl+JyuegfXI29jRotiRlKnpFghHMzKyjqotVXS0tLacKPjF3bdHxjSq1evduAkepAD+ZsDYlC8V5w8ZBVg+PPq2MGMlkInqE4joTf45MmT4YyMjAPcA+ltLSQlJX2BafxnX6HI29QeK44TOTk57mCYZ0QoJ8OBM4yB6dkNkwGlSygsLFQvYtYB3BTMxFL+M+0eFgZqp4mJiU2+QKGX1fGIk/QIrn0aYXGsyDxjmAyMhO2jhaCGoUbX1NSkLSwsPMJqV8Fspu6lIZS6OYhjiOLwdU7fQM1HfRPD7wS1obZ0j0xpb4726Z49ezaJf2/S7s9ATUGNR41BjdJseRnke3WGwhrRTS9pD1mOGoeG15BxOOfoxuCkp0Ih6NeaEaSZGlieJyiCoc1FgsGldokGk8nBvAKOrWIGQ5uPsm0tt0BWDiicAaGuGhkZ+YqMw9StGzU4OKhCnT179hNsswY1FTXdE5QEJhc1S3tGogazXLOBwQSBl3tzIhQPtAL1VQJCTcNx8y1vHIUghSKFZE9PT7H2dlM1b+Wgrr1y5Uq77J75+fnplpaWMg2ch4nlYEI5z7hdensDpI4hrYNErcMMXJ32koG4ztf3pultz83NjWG99Ra2WQ0OL2VjZjwgeufUqVOqV8+cOdPIwdBLSNJeHg8TAh5WqJ6EfSmgt7IMNRJ1JThiOlnrOAMHshprmMKdoGSCpb9s3B3SYLIFGIqICJB7xisYi+RvfiypXw40DWGdlJaWRmMd141hk8V2OWm7ieYTXhBc3+BgaZyqAISjOYxSMVvXsBTNlzdiNQDgRao2AtK3pjggpmrqbGpqSsLPIN/dv38/gaBwUjTshMHcvn27JyUlpRmc5xpPMD599LIYnLNyUKKndKjGxsakXbt2deMCLIE8IVvs0YRM1fjdu3d/wrXN5+BcnzEgvor2uN3rjzAYMp5lPEoQlE5fA0fWo8GfhlCbKVFQ1pKNIfzcOHH58mWqaimVUwJI0+6n59D4pIlzmdZPMPiZzXjDjX47Le5g0Uu8x2zgPqWyKpjVe7x3+AUbq9NYjQbgp2dsBud5o8TP7d5kHAWcQchQfoEmLgn8HjOiBIF7o5hI1x6CEbLNP3bdqYAF44JzyWLzcN1i8DcT/o3awbm8Fz3DAy2A62INwPV/E3wWdx5inmBHuwChCBD6R2JwHge80TIQRQLjt7e8DTkGZgfX8cUMZTDAteFDkveaIlzjX9ySQs8X18r2t2VHUURPKoICmDR+eCO9aSdmOIub3/w9RgpgUpiJhvraXpa6jZKHGEqyusw0GLFzX+5RhN/8kYnMSNMMfyH/V/kHST6OYVElTPAAAAAASUVORK5CYII=",Mv="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDBweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDAgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT5zaGFwZS1jdXJzb3I8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZGVmcz4KICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0icGF0aC0xIj48L3BhdGg+CiAgICAgICAgPGZpbHRlciB4PSItNjQuNiUiIHk9Ii01OS41JSIgd2lkdGg9IjIyOS4zJSIgaGVpZ2h0PSIyNDYuMSUiIGZpbHRlclVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgaWQ9ImZpbHRlci0yIj4KICAgICAgICAgICAgPGZlTW9ycGhvbG9neSByYWRpdXM9IjEiIG9wZXJhdG9yPSJkaWxhdGUiIGluPSJTb3VyY2VBbHBoYSIgcmVzdWx0PSJzaGFkb3dTcHJlYWRPdXRlcjEiPjwvZmVNb3JwaG9sb2d5PgogICAgICAgICAgICA8ZmVPZmZzZXQgZHg9IjAiIGR5PSIyIiBpbj0ic2hhZG93U3ByZWFkT3V0ZXIxIiByZXN1bHQ9InNoYWRvd09mZnNldE91dGVyMSI+PC9mZU9mZnNldD4KICAgICAgICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMyIgaW49InNoYWRvd09mZnNldE91dGVyMSIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlR2F1c3NpYW5CbHVyPgogICAgICAgICAgICA8ZmVDb21wb3NpdGUgaW49InNoYWRvd0JsdXJPdXRlcjEiIGluMj0iU291cmNlQWxwaGEiIG9wZXJhdG9yPSJvdXQiIHJlc3VsdD0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbXBvc2l0ZT4KICAgICAgICAgICAgPGZlQ29sb3JNYXRyaXggdmFsdWVzPSIwIDAgMCAwIDAgICAwIDAgMCAwIDAgICAwIDAgMCAwIDAgIDAgMCAwIDAuMTYgMCIgdHlwZT0ibWF0cml4IiBpbj0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbG9yTWF0cml4PgogICAgICAgIDwvZmlsdGVyPgogICAgPC9kZWZzPgogICAgPGcgaWQ9Iumhtemdoi00IiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iV2hpdGVib2FyZC1HdWlkZWxpbmVzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzQ0LjAwMDAwMCwgLTc1MS4wMDAwMDApIj4KICAgICAgICAgICAgPGcgaWQ9InNoYXBlLWN1cnNvciIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzQ0LjAwMDAwMCwgNzUxLjAwMDAwMCkiPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9ouWkh+S7vS00NCIgZmlsbD0iI0ZGRkZGRiIgb3BhY2l0eT0iMC4wMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjQwIiBoZWlnaHQ9IjQwIiByeD0iMiI+PC9yZWN0PgogICAgICAgICAgICAgICAgPGcgaWQ9IuW9oueKtue7k+WQiCIgZmlsbC1ydWxlPSJub256ZXJvIj4KICAgICAgICAgICAgICAgICAgICA8dXNlIGZpbGw9ImJsYWNrIiBmaWxsLW9wYWNpdHk9IjEiIGZpbHRlcj0idXJsKCNmaWx0ZXItMikiIHhsaW5rOmhyZWY9IiNwYXRoLTEiPjwvdXNlPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIHN0cm9rZT0iI0ZGRkZGRiIgc3Ryb2tlLXdpZHRoPSIxIiBkPSJNMjAsMjEgQzIwLjQ4NTQxMDMsMjEgMjAuODk4MDg1LDIxLjM0Nzk5OTMgMjAuOTg5OTQ3OSwyMS44NjU0ODc3IEwyMSwyMiBMMjEsMjcgQzIxLDI3LjU1MjI4NDcgMjAuNTUyMjg0NywyOCAyMCwyOCBDMTkuNTE0NTg5NywyOCAxOS4xMDE5MTUsMjcuNjUyMDAwNyAxOS4wMTAwNTIxLDI3LjEzNDUxMjMgTDE5LDI3IEwxOSwyMiBDMTksMjEuNDQ3NzE1MyAxOS40NDc3MTUzLDIxIDIwLDIxIFogTTI3LDE5IEMyNy41NTIyODQ3LDE5IDI4LDE5LjQ0NzcxNTMgMjgsMjAgQzI4LDIwLjQ4NTQxMDMgMjcuNjUyMDAwNywyMC44OTgwODUgMjcuMTM0NTEyMywyMC45ODk5NDc5IEwyNywyMSBMMjIsMjEgQzIxLjQ0NzcxNTMsMjEgMjEsMjAuNTUyMjg0NyAyMSwyMCBDMjEsMTkuNTE0NTg5NyAyMS4zNDc5OTkzLDE5LjEwMTkxNSAyMS44NjU0ODc3LDE5LjAxMDA1MjEgTDIyLDE5IEwyNywxOSBaIE0xOCwxOSBDMTguNTUyMjg0NywxOSAxOSwxOS40NDc3MTUzIDE5LDIwIEMxOSwyMC40ODU0MTAzIDE4LjY1MjAwMDcsMjAuODk4MDg1IDE4LjEzNDUxMjMsMjAuOTg5OTQ3OSBMMTgsMjEgTDEzLDIxIEMxMi40NDc3MTUzLDIxIDEyLDIwLjU1MjI4NDcgMTIsMjAgQzEyLDE5LjUxNDU4OTcgMTIuMzQ3OTk5MywxOS4xMDE5MTUgMTIuODY1NDg3NywxOS4wMTAwNTIxIEwxMywxOSBMMTgsMTkgWiBNMjAsMTIgQzIwLjQ4NTQxMDMsMTIgMjAuODk4MDg1LDEyLjM0Nzk5OTMgMjAuOTg5OTQ3OSwxMi44NjU0ODc3IEwyMSwxMyBMMjEsMTggQzIxLDE4LjU1MjI4NDcgMjAuNTUyMjg0NywxOSAyMCwxOSBDMTkuNTE0NTg5NywxOSAxOS4xMDE5MTUsMTguNjUyMDAwNyAxOS4wMTAwNTIxLDE4LjEzNDUxMjMgTDE5LDE4IEwxOSwxMyBDMTksMTIuNDQ3NzE1MyAxOS40NDc3MTUzLDEyIDIwLDEyIFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9oiIgZmlsbD0iI0ZGRkZGRiIgeD0iMTguNSIgeT0iMTciIHdpZHRoPSIzIiBoZWlnaHQ9IjYiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaIiIGZpbGw9IiNGRkZGRkYiIHg9IjE3IiB5PSIxOC41IiB3aWR0aD0iNiIgaGVpZ2h0PSIzIj48L3JlY3Q+CiAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0i5b2i54q257uT5ZCIIiBmaWxsPSIjMjEyMzI0IiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+",Iv="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDdweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDcgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT50ZXh0LWN1cnNvcjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPgogICAgICAgIDxwYXRoIGQ9Ik0xNiwyNi41IEMxNS43MjM4NTc2LDI2LjUgMTUuNSwyNi4yNzYxNDI0IDE1LjUsMjYgQzE1LjUsMjUuNzU0NTQwMSAxNS42NzY4NzUyLDI1LjU1MDM5MTYgMTUuOTEwMTI0NCwyNS41MDgwNTU3IEwxNiwyNS41IEwxOS41LDI1LjUgTDE5LjUsMTQuNSBMMTYsMTQuNSBDMTUuNzIzODU3NiwxNC41IDE1LjUsMTQuMjc2MTQyNCAxNS41LDE0IEMxNS41LDEzLjc1NDU0MDEgMTUuNjc2ODc1MiwxMy41NTAzOTE2IDE1LjkxMDEyNDQsMTMuNTA4MDU1NyBMMTYsMTMuNSBMMjQsMTMuNSBDMjQuMjc2MTQyNCwxMy41IDI0LjUsMTMuNzIzODU3NiAyNC41LDE0IEMyNC41LDE0LjI0NTQ1OTkgMjQuMzIzMTI0OCwxNC40NDk2MDg0IDI0LjA4OTg3NTYsMTQuNDkxOTQ0MyBMMjQsMTQuNSBMMjAuNSwxNC41IEwyMC41LDI1LjUgTDI0LDI1LjUgQzI0LjI3NjE0MjQsMjUuNSAyNC41LDI1LjcyMzg1NzYgMjQuNSwyNiBDMjQuNSwyNi4yNDU0NTk5IDI0LjMyMzEyNDgsMjYuNDQ5NjA4NCAyNC4wODk4NzU2LDI2LjQ5MTk0NDMgTDI0LDI2LjUgTDE2LDI2LjUgWiIgaWQ9InBhdGgtMSI+PC9wYXRoPgogICAgICAgIDxmaWx0ZXIgeD0iLTI4NC4wJSIgeT0iLTgxLjUlIiB3aWR0aD0iNjY4LjElIiBoZWlnaHQ9IjI5My45JSIgZmlsdGVyVW5pdHM9Im9iamVjdEJvdW5kaW5nQm94IiBpZD0iZmlsdGVyLTIiPgogICAgICAgICAgICA8ZmVNb3JwaG9sb2d5IHJhZGl1cz0iMSIgb3BlcmF0b3I9ImRpbGF0ZSIgaW49IlNvdXJjZUFscGhhIiByZXN1bHQ9InNoYWRvd1NwcmVhZE91dGVyMSI+PC9mZU1vcnBob2xvZ3k+CiAgICAgICAgICAgIDxmZU9mZnNldCBkeD0iMCIgZHk9IjIiIGluPSJzaGFkb3dTcHJlYWRPdXRlcjEiIHJlc3VsdD0ic2hhZG93T2Zmc2V0T3V0ZXIxIj48L2ZlT2Zmc2V0PgogICAgICAgICAgICA8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSIzIiBpbj0ic2hhZG93T2Zmc2V0T3V0ZXIxIiByZXN1bHQ9InNoYWRvd0JsdXJPdXRlcjEiPjwvZmVHYXVzc2lhbkJsdXI+CiAgICAgICAgICAgIDxmZUNvbXBvc2l0ZSBpbj0ic2hhZG93Qmx1ck91dGVyMSIgaW4yPSJTb3VyY2VBbHBoYSIgb3BlcmF0b3I9Im91dCIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29tcG9zaXRlPgogICAgICAgICAgICA8ZmVDb2xvck1hdHJpeCB2YWx1ZXM9IjAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgMCAwIDAgMC4xNiAwIiB0eXBlPSJtYXRyaXgiIGluPSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29sb3JNYXRyaXg+CiAgICAgICAgPC9maWx0ZXI+CiAgICA8L2RlZnM+CiAgICA8ZyBpZD0i6aG16Z2iLTQiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSJXaGl0ZWJvYXJkLUd1aWRlbGluZXMiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0zODguMDAwMDAwLCAtNjcyLjAwMDAwMCkiPgogICAgICAgICAgICA8ZyBpZD0idGV4dC1jdXJzb3IiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDM5Mi4wMDAwMDAsIDY3Mi4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaLlpIfku70tNDAiIGZpbGw9IiNGRkZGRkYiIG9wYWNpdHk9IjAuMDEiIHg9IjAiIHk9IjAiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcng9IjIiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxnIGlkPSLlvaLnirbnu5PlkIgiIGZpbGwtcnVsZT0ibm9uemVybyI+CiAgICAgICAgICAgICAgICAgICAgPHVzZSBmaWxsPSJibGFjayIgZmlsbC1vcGFjaXR5PSIxIiBmaWx0ZXI9InVybCgjZmlsdGVyLTIpIiB4bGluazpocmVmPSIjcGF0aC0xIj48L3VzZT4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBzdHJva2U9IiNGRkZGRkYiIHN0cm9rZS13aWR0aD0iMSIgZD0iTTE5LDI1IEwxOSwxNSBMMTYsMTUgQzE1LjQ0NzcxNTMsMTUgMTUsMTQuNTUyMjg0NyAxNSwxNCBDMTUsMTMuNTE0NTg5NyAxNS4zNDc5OTkzLDEzLjEwMTkxNSAxNS44NjU0ODc3LDEzLjAxMDA1MjEgTDE2LDEzIEwyNCwxMyBDMjQuNTUyMjg0NywxMyAyNSwxMy40NDc3MTUzIDI1LDE0IEMyNSwxNC40ODU0MTAzIDI0LjY1MjAwMDcsMTQuODk4MDg1IDI0LjEzNDUxMjMsMTQuOTg5OTQ3OSBMMjQsMTUgTDIxLDE1IEwyMSwyNSBMMjQsMjUgQzI0LjU1MjI4NDcsMjUgMjUsMjUuNDQ3NzE1MyAyNSwyNiBDMjUsMjYuNDg1NDEwMyAyNC42NTIwMDA3LDI2Ljg5ODA4NSAyNC4xMzQ1MTIzLDI2Ljk4OTk0NzkgTDI0LDI3IEwxNiwyNyBDMTUuNDQ3NzE1MywyNyAxNSwyNi41NTIyODQ3IDE1LDI2IEMxNSwyNS41MTQ1ODk3IDE1LjM0Nzk5OTMsMjUuMTAxOTE1IDE1Ljg2NTQ4NzcsMjUuMDEwMDUyMSBMMTYsMjUgTDE5LDI1IFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=",Av="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjhweCIgaGVpZ2h0PSIyOHB4IiB2aWV3Qm94PSIwIDAgMjggMjgiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDU1LjEgKDc4MTM2KSAtIGh0dHBzOi8vc2tldGNoYXBwLmNvbSAtLT4KICAgIDx0aXRsZT7nvJbnu4QgMjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPgogICAgICAgIDxmaWx0ZXIgeD0iLTEyMC4wJSIgeT0iLTEyMC4wJSIgd2lkdGg9IjM0MC4wJSIgaGVpZ2h0PSIzNDAuMCUiIGZpbHRlclVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgaWQ9ImZpbHRlci0xIj4KICAgICAgICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iNCIgaW49IlNvdXJjZUdyYXBoaWMiPjwvZmVHYXVzc2lhbkJsdXI+CiAgICAgICAgPC9maWx0ZXI+CiAgICA8L2RlZnM+CiAgICA8ZyBpZD0i6aG16Z2iMSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9Iue8lue7hC0yIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg5LjAwMDAwMCwgOS4wMDAwMDApIiBmaWxsPSIjRkYwMTAwIj4KICAgICAgICAgICAgPGNpcmNsZSBpZD0i5qSt5ZyG5b2iIiBmaWx0ZXI9InVybCgjZmlsdGVyLTEpIiBjeD0iNSIgY3k9IjUiIHI9IjUiPjwvY2lyY2xlPgogICAgICAgICAgICA8cGF0aCBkPSJNNSw4IEM2LjY1Njg1NDI1LDggOCw2LjY1Njg1NDI1IDgsNSBDOCwzLjM0MzE0NTc1IDYuNjU2ODU0MjUsMiA1LDIgQzMuMzQzMTQ1NzUsMiAyLDMuMzQzMTQ1NzUgMiw1IEMyLDYuNjU2ODU0MjUgMy4zNDMxNDU3NSw4IDUsOCBaIE01LDYuMjg1NzE0MjkgQzQuMjg5OTE5NjEsNi4yODU3MTQyOSAzLjcxNDI4NTcxLDUuNzEwMDgwMzkgMy43MTQyODU3MSw1IEMzLjcxNDI4NTcxLDQuMjg5OTE5NjEgNC4yODk5MTk2MSwzLjcxNDI4NTcxIDUsMy43MTQyODU3MSBDNS43MTAwODAzOSwzLjcxNDI4NTcxIDYuMjg1NzE0MjksNC4yODk5MTk2MSA2LjI4NTcxNDI5LDUgQzYuMjg1NzE0MjksNS43MTAwODAzOSA1LjcxMDA4MDM5LDYuMjg1NzE0MjkgNSw2LjI4NTcxNDI5IFoiIGlkPSLmpK3lnIblvaIiIGZpbGwtcnVsZT0ibm9uemVybyI+PC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+";const Tu={[I.ApplianceNames.pencil]:Sv,[I.ApplianceNames.selector]:Cv,[I.ApplianceNames.eraser]:bv,[I.ApplianceNames.shape]:Mv,[I.ApplianceNames.text]:Iv,[I.ApplianceNames.laserPointer]:Av};class Ev{constructor(t,i,n){var s;this.manager=t,this.enableCursor=i,this.cursorInstances=new Map,this.sideEffectManager=new Re.SideEffectManager,this.store=this.manager.store,this.applianceIcons=Tu,this.onCursorMove=o=>{const a=this.initCursorInstance(o.uid);if(o.state===ld.Leave)a.leave();else{const l=a.updateMember();this.canMoveCursor(l)&&a.move(o.position)}},this.initCursorInstance=o=>{let a=this.cursorInstances.get(o);return a||(a=new xv(this.manager,o,this,ge.playground),this.cursorInstances.set(o,a)),a},this.mouseMoveListener=A.throttle(o=>{o.pointerType==="touch"&&!o.isPrimary||this.updateCursor(this.getType(o),o.clientX,o.clientY)},48),this.getPoint=(o,a,l)=>{var h;const u=(h=o==null?void 0:o.divElement)==null?void 0:h.getBoundingClientRect();if(u)return o==null?void 0:o.convertToPointInWorld({x:a-u.x,y:l-u.y})},this.getType=o=>{var u;const a=o.target,l=this.manager.focusApp;switch(a.parentElement){case this.mainViewElement:return{type:"main"};case((u=l==null?void 0:l.view)==null?void 0:u.divElement):return{type:"app"};default:return{type:"main"}}},this.mouseLeaveListener=()=>{this.hideCursor(this.manager.uid)},this.roomMembers=(s=this.manager.room)==null?void 0:s.state.roomMembers;const r=ge.playground;r&&this.setupWrapper(r),this.sideEffectManager.add(()=>j.on("cursorMove",this.onCursorMove)),this.sideEffectManager.add(()=>j.on("playgroundSizeChange",()=>this.updateContainerRect())),n&&(this.applianceIcons=H(H({},Tu),n))}canMoveCursor(t){const i=(t==null?void 0:t.memberState.currentApplianceName)===I.ApplianceNames.laserPointer;return this.enableCursor||i}setupWrapper(t){this.sideEffectManager.add(()=>(t.addEventListener("pointerenter",this.mouseMoveListener),t.addEventListener("pointermove",this.mouseMoveListener),t.addEventListener("pointerleave",this.mouseLeaveListener),()=>{t.removeEventListener("pointerenter",this.mouseMoveListener),t.removeEventListener("pointermove",this.mouseMoveListener),t.removeEventListener("pointerleave",this.mouseLeaveListener)})),this.updateContainerRect()}setMainViewDivElement(t){this.mainViewElement=t}get boxState(){return this.store.getBoxState()}get focusView(){var t;return(t=this.manager.focusApp)==null?void 0:t.view}updateCursor(t,i,n){if(this.wrapperRect&&this.manager.canOperate){const r=t.type==="main"?this.manager.mainView:this.focusView,s=this.getPoint(r,i,n);s&&this.manager.dispatchInternalEvent(Z.CursorMove,{uid:this.manager.uid,position:{x:s.x,y:s.y,type:t.type}})}}updateContainerRect(){var t,i;this.wrapperRect=(t=this.manager.boxManager)==null?void 0:t.stageRect,this.playgroundRect=(i=ge.playground)==null?void 0:i.getBoundingClientRect()}deleteCursor(t){this.store.cleanCursor(t);const i=this.cursorInstances.get(t);i&&i.destroy()}hideCursor(t){const i=this.cursorInstances.get(t);i&&i.hide()}destroy(){this.sideEffectManager.flushAll(),this.cursorInstances.size&&(this.cursorInstances.forEach(t=>{t.destroy()}),this.cursorInstances.clear())}}class Tv{constructor(t){this.manager=t,j.on("changePageState",()=>{te.emit("pageStateChange",this.toObject())})}get index(){var t;return((t=this.manager)==null?void 0:t.store.getMainViewSceneIndex())||0}get length(){var t;return((t=this.manager)==null?void 0:t.mainViewScenesLength)||0}toObject(){return{index:this.index>=this.length?this.length-1:this.index,length:this.length}}}class kv{constructor(t){this.ctx=t,this.reactors=new Map,this.disposers=new Map,this.onPhaseChanged=i=>{var n,r;i===I.RoomPhase.Reconnecting&&this.ctx.emitter.emit("startReconnect"),i===I.RoomPhase.Connected&&this.phase===I.RoomPhase.Reconnecting&&((n=this.room)!=null&&n.isWritable?(r=this.room)==null||r.dispatchMagixEvent(Xs,{}):this.onReconnected()),this.phase=i},this.onReconnected=A.debounce(()=>{this._onReconnected()},1e3),this._onReconnected=()=>{zt("onReconnected refresh reactors"),this.releaseDisposers(),this.reactors.forEach((i,n)=>{A.isFunction(i)&&this.disposers.set(n,i())}),this.ctx.emitter.emit("onReconnected")}}setRoom(t){this.room=t,this.phase=t==null?void 0:t.phase,t&&(t.callbacks.off("onPhaseChanged",this.onPhaseChanged),t.callbacks.on("onPhaseChanged",this.onPhaseChanged),t.addMagixEventListener(Xs,i=>{i.authorId===t.observerId&&this.onReconnected()},{fireSelfEventAfterCommit:!0}))}setContext(t){this.ctx=t}releaseDisposers(){this.disposers.forEach(t=>{A.isFunction(t)&&t()}),this.disposers.clear()}refresh(){this._onReconnected()}add(t,i){const n=this.disposers.get(t);return n&&A.isFunction(n)&&n(),A.isFunction(i)&&(this.reactors.set(t,i),this.disposers.set(t,i())),()=>this.remove(t)}remove(t){this.reactors.has(t)&&this.reactors.delete(t);const i=this.disposers.get(t);i&&(A.isFunction(i)&&i(),this.disposers.delete(t))}hasReactor(t){return this.reactors.has(t)}destroy(){var t,i;(t=this.room)==null||t.callbacks.off("onPhaseChanged",this.onPhaseChanged),(i=this.room)==null||i.removeMagixEventListener(Xs,this.onReconnected),this.releaseDisposers()}}const Nv=(e,t)=>{if(I.isPlayer(e))zv(e);else{if(e=e,Object.getOwnPropertyDescriptor(e,"disableCameraTransform"))return;Object.defineProperty(e,"disableCameraTransform",{get(){return t.mainView.disableCameraTransform},set(n){t.mainView.disableCameraTransform=n}}),Object.defineProperty(e,"canUndoSteps",{get(){return t.canUndoSteps}}),Object.defineProperty(e,"canRedoSteps",{get(){return t.canRedoSteps}}),e.moveCamera=n=>t.moveCamera(n),e.moveCameraToContain=(...n)=>t.moveCameraToContain(...n),e.convertToPointInWorld=(...n)=>t.mainView.convertToPointInWorld(...n),e.setCameraBound=(...n)=>t.mainView.setCameraBound(...n),e.scenePreview=(...n)=>t.mainView.scenePreview(...n),e.fillSceneSnapshot=(...n)=>t.mainView.fillSceneSnapshot(...n),e.generateScreenshot=(...n)=>t.mainView.generateScreenshot(...n),e.setMemberState=(...n)=>t.mainView.setMemberState(...n),e.redo=()=>t.redo(),e.undo=()=>t.undo(),e.cleanCurrentScene=()=>t.cleanCurrentScene(),e.delete=()=>t.delete(),e.copy=()=>t.copy(),e.paste=()=>t.paste(),e.duplicate=()=>t.duplicate(),e.insertImage=(...n)=>t.insertImage(...n),e.completeImageUpload=(...n)=>t.completeImageUpload(...n),e.insertText=(...n)=>t.insertText(...n),e.lockImage=(...n)=>t.lockImage(...n),e.lockImages=(...n)=>t.lockImages(...n),Pv(e,t),e.dynamicPpt.slideStateAdapter.pptHandler||(e.dynamicPpt.slideStateAdapter.pptHandler=t.createPPTHandler())}},Pv=(e,t)=>{const i=e.removeScenes;e.removeScenes=(n,r)=>{var o;n===ze&&((o=t.appManager)==null||o.updateRootDirRemoving(!0));const s=i.call(e,n);return j.emit("removeScenes",{scenePath:n,index:r}),s}},zv=e=>{const t=e.seekToProgressTime;async function i(n){await j.emit("seekStart");const r=await t.call(e,n);return j.emit("seek",n),r}e.seekToProgressTime=i};var Dv=Object.defineProperty,jv=Object.defineProperties,Lv=Object.getOwnPropertyDescriptors,ku=Object.getOwnPropertySymbols,Vv=Object.prototype.hasOwnProperty,Rv=Object.prototype.propertyIsEnumerable,Nu=(e,t,i)=>t in e?Dv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Hd=(e,t)=>{for(var i in t||(t={}))Vv.call(t,i)&&Nu(e,i,t[i]);if(ku)for(var i of ku(t))Rv.call(t,i)&&Nu(e,i,t[i]);return e},Fd=(e,t)=>jv(e,Lv(t)),Bv=`.netless-app-docs-viewer-content{position:relative;height:100%;overflow:hidden}.netless-app-docs-viewer-preview-mask{display:none;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%}.netless-app-docs-viewer-preview{display:flex;flex-direction:column;align-items:center;position:absolute;z-index:300;top:0;left:0;width:33%;max-width:200px;height:100%;padding-top:10px;transform:translate(-100%);background:rgba(237,237,240,.9);box-shadow:inset -1px 0 #0000001c;transition:transform .4s}.netless-app-docs-viewer-preview-active .netless-app-docs-viewer-preview-mask{display:block}.netless-app-docs-viewer-preview-active .netless-app-docs-viewer-preview{transform:translate(0)}.netless-app-docs-viewer-preview-page{position:relative;display:block;width:55%;margin-bottom:10px;font-size:0;color:transparent;outline:none;border:7px solid transparent;border-radius:4px;transition:border-color .3s;user-select:none}.netless-app-docs-viewer-preview-page:hover,.netless-app-docs-viewer-preview-page.netless-app-docs-viewer-preview-page-active{border-color:#444e601a}.netless-app-docs-viewer-preview-page>img{width:100%;height:auto;box-sizing:border-box;border:1px solid rgba(0,0,0,.5);border-radius:1px;background-color:#fff;box-shadow:0 2px 8px #0000004d}.netless-app-docs-viewer-preview-page-name{position:absolute;top:1px;left:-10px;transform:translate(-100%);text-align:right;font-size:12px;color:#5f5f5f;user-select:none}.netless-app-docs-viewer-footer{box-sizing:border-box;height:26px;display:flex;align-items:center;padding:0 16px;border-top:1px solid #eeeef7;color:#191919}.netless-app-docs-viewer-float-footer{width:100%;min-height:26px;position:absolute;left:0;bottom:0;z-index:2000;background:rgba(249,249,252,.9);transition:opacity .4s}.netless-app-docs-viewer-footer-btn{box-sizing:border-box;width:26px;height:26px;font-size:0;margin:0;padding:3px;border:none;border-radius:1px;outline:none;color:currentColor;background:transparent;transition:background .4s;cursor:pointer;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-docs-viewer-footer-btn:hover{background:rgba(237,237,240,.9)}@media (hover: none){.netless-app-docs-viewer-footer-btn:hover{background:transparent!important}}.netless-app-docs-viewer-footer-btn>svg{width:100%;height:100%}.netless-app-docs-viewer-footer-btn>svg:nth-of-type(2){display:none}.netless-app-docs-viewer-footer-btn.netless-app-docs-viewer-footer-btn-playing>svg:nth-of-type(1){display:none}.netless-app-docs-viewer-footer-btn.netless-app-docs-viewer-footer-btn-playing>svg:nth-of-type(2){display:initial}.netless-app-docs-viewer-footer-btn~.netless-app-docs-viewer-footer-btn{margin-left:15px}.netless-app-docs-viewer-page-jumps{flex:1;display:flex;justify-content:center;align-items:center}.netless-app-docs-viewer-page-number{margin-left:auto;font-size:13px;user-select:none;white-space:nowrap;word-break:keep-all}.netless-app-docs-viewer-page-number-input{border:none;outline:none;width:3em;margin:0;padding:0 2px;text-align:right;font-size:13px;line-height:1;font-weight:400;font-family:inherit;border-radius:2px;color:currentColor;background:transparent;transition:background .4s;user-select:text;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-docs-viewer-page-number-input:hover,.netless-app-docs-viewer-page-number-input:focus,.netless-app-docs-viewer-page-number-input:active{background:#fff;box-shadow:#63636333 0 2px 8px}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-footer-btn{cursor:not-allowed}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-footer-btn:hover{background:transparent}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input{cursor:not-allowed}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:hover,.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:focus,.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:active{background:transparent;box-shadow:none}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:disabled{color:inherit}.netless-app-docs-viewer-readonly.netless-app-docs-viewer-float-footer{display:none}.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input{color:#a6a6a8}.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input:active,.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input:focus,.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input:hover{color:#222}.telebox-color-scheme-dark .netless-app-docs-viewer-footer{color:#a6a6a8;background:#2d2d33;border-top:none}.telebox-color-scheme-dark .netless-app-docs-viewer-footer-btn:hover{background:#212126}.telebox-color-scheme-dark .netless-app-docs-viewer-preview{background:rgba(50,50,50,.9)}.netless-app-docs-viewer-static-scrollbar{position:absolute;top:0;right:0;z-index:2147483647;width:8px;min-height:30px;margin:0;padding:0;border:none;outline:none;border-radius:4px;background:rgba(68,78,96,.4);box-shadow:1px 1px 8px #ffffffb3;opacity:0;transition:background .4s,opacity .4s 3s,transform .2s;user-select:none}.netless-app-docs-viewer-static-scrollbar.netless-app-docs-viewer-static-scrollbar-dragging{background:rgba(68,78,96,.6);opacity:1;transition:background .4s,opacity .4s 3s!important}.netless-app-docs-viewer-static-scrollbar:hover,.netless-app-docs-viewer-static-scrollbar:focus{background:rgba(68,78,96,.5)}.netless-app-docs-viewer-static-scrollbar:active{background:rgba(68,78,96,.6)}.netless-app-docs-viewer-content:hover .netless-app-docs-viewer-static-scrollbar{opacity:1;transition:background .4s,opacity .4s,transform .2s}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-static-scrollbar{display:none}.netless-app-docs-viewer-static-pages:hover .netless-app-docs-viewer-static-scrollbar{opacity:1;transition:background .4s,opacity .4s,transform .2s}.page-renderer-pages-container{position:relative;overflow:hidden}.page-renderer-page{position:absolute;top:0;left:0;background-position:center;background-size:cover;background-repeat:no-repeat}.page-renderer-pages-container.is-hwa .page-renderer-page{will-change:transform}.page-renderer-page-img{display:block;width:100%;height:auto;user-select:none}.netless-app-docs-viewer-static-pages{overflow:hidden;position:relative;height:100%;user-select:none}.netless-app-docs-viewer-static-page{display:block;width:100%;height:auto;user-select:none}.netless-app-docs-viewer-static-wb-view,.netless-app-docs-viewer-dynamic-wb-view{position:absolute;top:0;left:0;width:100%;height:100%;z-index:100;overflow:hidden}.netless-app-docs-viewer-dynamic-wb-view .cursor-clicker .ppt-event-source{cursor:pointer}
|
124
|
-
`;const Ov=(e,t,i,n)=>{if(i==="length"||i==="prototype"||i==="arguments"||i==="caller")return;const r=Object.getOwnPropertyDescriptor(e,i),s=Object.getOwnPropertyDescriptor(t,i);!_v(r,s)&&n||Object.defineProperty(e,i,s)},_v=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},$v=(e,t)=>{const i=Object.getPrototypeOf(t);i!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,i)},Uv=(e,t)=>`/* Wrapped ${e}*/
|
125
|
-
${t}`,Wv=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Hv=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Fv=(e,t,i)=>{const n=i===""?"":`with ${i.trim()}() `,r=Uv.bind(null,n,t.toString());Object.defineProperty(r,"name",Hv),Object.defineProperty(e,"toString",Fd(Hd({},Wv),{value:r}))};function Qv(e,t,{ignoreNonConfigurable:i=!1}={}){const{name:n}=e;for(const r of Reflect.ownKeys(t))Ov(e,t,r,i);return $v(e,t),Fv(e,t,n),e}const Zv=(e,t={})=>{if(typeof e!="function")throw new TypeError(`Expected the first argument to be a function, got \`${typeof e}\``);const{wait:i=0,maxWait:n=Number.Infinity,before:r=!1,after:s=!0}=t;if(!r&&!s)throw new Error("Both `before` and `after` are false, function wouldn't be called.");let o,a,l;const u=function(...h){const p=this,w=()=>{o=void 0,a&&(clearTimeout(a),a=void 0),s&&(l=e.apply(p,h))},C=()=>{a=void 0,o&&(clearTimeout(o),o=void 0),s&&(l=e.apply(p,h))},E=r&&!o;return clearTimeout(o),o=setTimeout(w,i),n>0&&n!==Number.Infinity&&!a&&(a=setTimeout(C,n)),E&&(l=e.apply(p,h)),l};return Qv(u,e),u.cancel=()=>{o&&(clearTimeout(o),o=void 0),a&&(clearTimeout(a),a=void 0)},u},Qd="!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",Yv=Qd.length,Pu=Array(20),nn=()=>{for(let e=0;e<20;e++)Pu[e]=Qd.charAt(Math.random()*Yv);return Pu.join("")};class Ns{constructor(){this.disposers=new Map}add(t,i=nn()){return this.flush(i),this.disposers.set(i,t()),i}addDisposer(t,i=nn()){return this.flush(i),this.disposers.set(i,t),i}addEventListener(t,i,n,r,s=nn()){return this.add(()=>(t.addEventListener(i,n,r),()=>t.removeEventListener(i,n,r)),s),s}setTimeout(t,i,n=nn()){return this.add(()=>{const r=window.setTimeout(()=>{this.remove(n),t()},i);return()=>window.clearTimeout(r)},n)}setInterval(t,i,n=nn()){return this.add(()=>{const r=window.setInterval(t,i);return()=>window.clearInterval(r)},n)}remove(t){const i=this.disposers.get(t);return this.disposers.delete(t),i}flush(t){const i=this.remove(t);if(i)try{i()}catch(n){console.error(n)}}flushAll(){this.disposers.forEach(t=>{try{t()}catch(i){console.error(i)}}),this.disposers.clear()}}var li=[],Gv=function(){return li.some(function(e){return e.activeTargets.length>0})},Xv=function(){return li.some(function(e){return e.skippedTargets.length>0})},zu="ResizeObserver loop completed with undelivered notifications.",Jv=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:zu}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=zu),window.dispatchEvent(e)},Rn;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(Rn||(Rn={}));var ui=function(e){return Object.freeze(e)},Kv=function(){function e(t,i){this.inlineSize=t,this.blockSize=i,ui(this)}return e}(),Zd=function(){function e(t,i,n,r){return this.x=t,this.y=i,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,ui(this)}return e.prototype.toJSON=function(){var t=this,i=t.x,n=t.y,r=t.top,s=t.right,o=t.bottom,a=t.left,l=t.width,u=t.height;return{x:i,y:n,top:r,right:s,bottom:o,left:a,width:l,height:u}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),Za=function(e){return e instanceof SVGElement&&"getBBox"in e},Yd=function(e){if(Za(e)){var t=e.getBBox(),i=t.width,n=t.height;return!i&&!n}var r=e,s=r.offsetWidth,o=r.offsetHeight;return!(s||o||e.getClientRects().length)},Du=function(e){var t,i;if(e instanceof Element)return!0;var n=(i=(t=e)===null||t===void 0?void 0:t.ownerDocument)===null||i===void 0?void 0:i.defaultView;return!!(n&&e instanceof n.Element)},qv=function(e){switch(e.tagName){case"INPUT":if(e.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},In=typeof window!="undefined"?window:{},dr=new WeakMap,ju=/auto|scroll/,ew=/^tb|vertical/,tw=/msie|trident/i.test(In.navigator&&In.navigator.userAgent),tt=function(e){return parseFloat(e||"0")},Li=function(e,t,i){return e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=!1),new Kv((i?t:e)||0,(i?e:t)||0)},Lu=ui({devicePixelContentBoxSize:Li(),borderBoxSize:Li(),contentBoxSize:Li(),contentRect:new Zd(0,0,0,0)}),Gd=function(e,t){if(t===void 0&&(t=!1),dr.has(e)&&!t)return dr.get(e);if(Yd(e))return dr.set(e,Lu),Lu;var i=getComputedStyle(e),n=Za(e)&&e.ownerSVGElement&&e.getBBox(),r=!tw&&i.boxSizing==="border-box",s=ew.test(i.writingMode||""),o=!n&&ju.test(i.overflowY||""),a=!n&&ju.test(i.overflowX||""),l=n?0:tt(i.paddingTop),u=n?0:tt(i.paddingRight),h=n?0:tt(i.paddingBottom),p=n?0:tt(i.paddingLeft),w=n?0:tt(i.borderTopWidth),C=n?0:tt(i.borderRightWidth),E=n?0:tt(i.borderBottomWidth),T=n?0:tt(i.borderLeftWidth),c=p+u,d=l+h,f=T+C,g=w+E,m=a?e.offsetHeight-g-e.clientHeight:0,x=o?e.offsetWidth-f-e.clientWidth:0,y=r?c+f:0,N=r?d+g:0,D=n?n.width:tt(i.width)-y-x,P=n?n.height:tt(i.height)-N-m,J=D+c+x+f,q=P+d+m+g,ee=ui({devicePixelContentBoxSize:Li(Math.round(D*devicePixelRatio),Math.round(P*devicePixelRatio),s),borderBoxSize:Li(J,q,s),contentBoxSize:Li(D,P,s),contentRect:new Zd(p,l,D,P)});return dr.set(e,ee),ee},Xd=function(e,t,i){var n=Gd(e,i),r=n.borderBoxSize,s=n.contentBoxSize,o=n.devicePixelContentBoxSize;switch(t){case Rn.DEVICE_PIXEL_CONTENT_BOX:return o;case Rn.BORDER_BOX:return r;default:return s}},iw=function(){function e(t){var i=Gd(t);this.target=t,this.contentRect=i.contentRect,this.borderBoxSize=ui([i.borderBoxSize]),this.contentBoxSize=ui([i.contentBoxSize]),this.devicePixelContentBoxSize=ui([i.devicePixelContentBoxSize])}return e}(),Jd=function(e){if(Yd(e))return 1/0;for(var t=0,i=e.parentNode;i;)t+=1,i=i.parentNode;return t},nw=function(){var e=1/0,t=[];li.forEach(function(o){if(o.activeTargets.length!==0){var a=[];o.activeTargets.forEach(function(u){var h=new iw(u.target),p=Jd(u.target);a.push(h),u.lastReportedSize=Xd(u.target,u.observedBox),p<e&&(e=p)}),t.push(function(){o.callback.call(o.observer,a,o.observer)}),o.activeTargets.splice(0,o.activeTargets.length)}});for(var i=0,n=t;i<n.length;i++){var r=n[i];r()}return e},Vu=function(e){li.forEach(function(i){i.activeTargets.splice(0,i.activeTargets.length),i.skippedTargets.splice(0,i.skippedTargets.length),i.observationTargets.forEach(function(r){r.isActive()&&(Jd(r.target)>e?i.activeTargets.push(r):i.skippedTargets.push(r))})})},rw=function(){var e=0;for(Vu(e);Gv();)e=nw(),Vu(e);return Xv()&&Jv(),e>0},oo,Kd=[],sw=function(){return Kd.splice(0).forEach(function(e){return e()})},ow=function(e){if(!oo){var t=0,i=document.createTextNode(""),n={characterData:!0};new MutationObserver(function(){return sw()}).observe(i,n),oo=function(){i.textContent=""+(t?t--:t++)}}Kd.push(e),oo()},aw=function(e){ow(function(){requestAnimationFrame(e)})},Nr=0,lw=function(){return!!Nr},uw=250,cw={attributes:!0,characterData:!0,childList:!0,subtree:!0},Ru=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Bu=function(e){return e===void 0&&(e=0),Date.now()+e},ao=!1,dw=function(){function e(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return e.prototype.run=function(t){var i=this;if(t===void 0&&(t=uw),!ao){ao=!0;var n=Bu(t);aw(function(){var r=!1;try{r=rw()}finally{if(ao=!1,t=n-Bu(),!lw())return;r?i.run(1e3):t>0?i.run(t):i.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var t=this,i=function(){return t.observer&&t.observer.observe(document.body,cw)};document.body?i():In.addEventListener("DOMContentLoaded",i)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Ru.forEach(function(i){return In.addEventListener(i,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Ru.forEach(function(i){return In.removeEventListener(i,t.listener,!0)}),this.stopped=!0)},e}(),Ro=new dw,Ou=function(e){!Nr&&e>0&&Ro.start(),Nr+=e,!Nr&&Ro.stop()},hw=function(e){return!Za(e)&&!qv(e)&&getComputedStyle(e).display==="inline"},pw=function(){function e(t,i){this.target=t,this.observedBox=i||Rn.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=Xd(this.target,this.observedBox,!0);return hw(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),fw=function(){function e(t,i){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=i}return e}(),hr=new WeakMap,_u=function(e,t){for(var i=0;i<e.length;i+=1)if(e[i].target===t)return i;return-1},pr=function(){function e(){}return e.connect=function(t,i){var n=new fw(t,i);hr.set(t,n)},e.observe=function(t,i,n){var r=hr.get(t),s=r.observationTargets.length===0;_u(r.observationTargets,i)<0&&(s&&li.push(r),r.observationTargets.push(new pw(i,n&&n.box)),Ou(1),Ro.schedule())},e.unobserve=function(t,i){var n=hr.get(t),r=_u(n.observationTargets,i),s=n.observationTargets.length===1;r>=0&&(s&&li.splice(li.indexOf(n),1),n.observationTargets.splice(r,1),Ou(-1))},e.disconnect=function(t){var i=this,n=hr.get(t);n.observationTargets.slice().forEach(function(r){return i.unobserve(t,r.target)}),n.activeTargets.splice(0,n.activeTargets.length)},e}(),gw=function(){function e(t){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof t!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");pr.connect(this,t)}return e.prototype.observe=function(t,i){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Du(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");pr.observe(this,t,i)},e.prototype.unobserve=function(t){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Du(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");pr.unobserve(this,t)},e.prototype.disconnect=function(){pr.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();function mw(e){const t="http://www.w3.org/2000/svg",i=document.createElementNS(t,"svg");i.setAttribute("class",`${e}-footer-icon-sidebar`),i.setAttribute("viewBox","0 0 64 64");const n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M50 8H14c-3.309 0-6 2.691-6 6v36c0 3.309 2.691 6 6 6h36c3.309 0 6-2.691 6-6V14c0-3.309-2.691-6-6-6zM12 50V14c0-1.103.897-2 2-2h8v40h-8c-1.103 0-2-.897-2-2zm40 0c0 1.103-.897 2-2 2H26V12h24c1.103 0 2 .897 2 2z"),i.appendChild(n),i}function vw(e){const t="http://www.w3.org/2000/svg",i=document.createElementNS(t,"svg");i.setAttribute("class",`${e}-footer-icon-arrow-left`),i.setAttribute("viewBox","0 0 500 500");const n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M177.81 249.959L337.473 90.295c2.722-2.865 2.651-7.378-.143-10.1-2.793-2.65-7.163-2.65-9.956 0l-164.75 164.75c-2.793 2.793-2.793 7.306 0 10.1l164.75 164.75c2.865 2.722 7.378 2.65 10.099-.143 2.651-2.794 2.651-7.163 0-9.957L177.809 249.959z"),i.appendChild(n),i}function ww(e){const t="http://www.w3.org/2000/svg",i=document.createElementNS(t,"svg");i.setAttribute("class",`${e}-footer-icon-arrow-right`),i.setAttribute("viewBox","0 0 500 500");const n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M322.19 250.041L162.527 409.705c-2.722 2.865-2.651 7.378.143 10.1 2.793 2.65 7.163 2.65 9.956 0l164.75-164.75c2.793-2.793 2.793-7.306 0-10.1l-164.75-164.75c-2.865-2.722-7.378-2.65-10.099.143-2.651 2.794-2.651 7.163 0 9.957l159.664 159.736z"),i.appendChild(n),i}function yw(e){const t="http://www.w3.org/2000/svg",i=document.createElementNS(t,"svg");i.setAttribute("class",`${e}-footer-icon-play`),i.setAttribute("viewBox","0 0 500 500");const n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M418.158 257.419L174.663 413.33c-6.017 3.919-15.708 3.772-21.291-.29-2.791-2.018-4.295-4.483-4.295-7.084V94.109c0-5.65 6.883-10.289 15.271-10.289 4.298 0 8.391 1.307 11.181 3.332l242.629 155.484c6.016 3.917 6.451 10.292.649 14.491-.216.154-.432.154-.649.292zM170.621 391.288l223.116-141.301L170.71 107.753l-.089 283.535z"),i.appendChild(n),i}function xw(e){const t="http://www.w3.org/2000/svg",i=document.createElementNS(t,"svg");i.setAttribute("class",`${e}-footer-icon-pause`),i.setAttribute("viewBox","0 0 500 500");const n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.setAttribute("d","M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z"),i.appendChild(n),i}const Si=typeof window!="undefined",qd=Si&&!("onscroll"in window)||typeof navigator!="undefined"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),eh=Si&&"IntersectionObserver"in window,th=Si&&"classList"in document.createElement("p"),ih=Si&&window.devicePixelRatio>1,Sw={elements_selector:".lazy",container:qd||Si?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1},nh=e=>Object.assign({},Sw,e),$u=function(e,t){let i;const n="LazyLoad::Initialized",r=new e(t);try{i=new CustomEvent(n,{detail:{instance:r}})}catch{i=document.createEvent("CustomEvent"),i.initCustomEvent(n,!1,!1,{instance:r})}window.dispatchEvent(i)},Cw=(e,t)=>{if(!!t)if(!t.length)$u(e,t);else for(let i=0,n;n=t[i];i+=1)$u(e,n)},It="src",Ya="srcset",Ga="sizes",rh="poster",Gn="llOriginalAttrs",sh="data",Xa="loading",oh="loaded",ah="applied",bw="entered",Ja="error",lh="native",uh="data-",ch="ll-status",je=(e,t)=>e.getAttribute(uh+t),Mw=(e,t,i)=>{var n=uh+t;if(i===null){e.removeAttribute(n);return}e.setAttribute(n,i)},Xn=e=>je(e,ch),Ci=(e,t)=>Mw(e,ch,t),Ps=e=>Ci(e,null),Ka=e=>Xn(e)===null,Iw=e=>Xn(e)===Xa,Aw=e=>Xn(e)===Ja,qa=e=>Xn(e)===lh,Ew=[Xa,oh,ah,Ja],Tw=e=>Ew.indexOf(Xn(e))>=0,Jt=(e,t,i,n)=>{if(!!e){if(n!==void 0){e(t,i,n);return}if(i!==void 0){e(t,i);return}e(t)}},Ji=(e,t)=>{if(th){e.classList.add(t);return}e.className+=(e.className?" ":"")+t},nt=(e,t)=>{if(th){e.classList.remove(t);return}e.className=e.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},kw=e=>{e.llTempImage=document.createElement("IMG")},Nw=e=>{delete e.llTempImage},dh=e=>e.llTempImage,zs=(e,t)=>{if(!t)return;const i=t._observer;!i||i.unobserve(e)},Pw=e=>{e.disconnect()},zw=(e,t,i)=>{t.unobserve_entered&&zs(e,i)},el=(e,t)=>{!e||(e.loadingCount+=t)},Dw=e=>{!e||(e.toLoadCount-=1)},hh=(e,t)=>{!e||(e.toLoadCount=t)},jw=e=>e.loadingCount>0,Lw=e=>e.toLoadCount>0,ph=e=>{let t=[];for(let i=0,n;n=e.children[i];i+=1)n.tagName==="SOURCE"&&t.push(n);return t},tl=(e,t)=>{const i=e.parentNode;if(!i||i.tagName!=="PICTURE")return;ph(i).forEach(t)},fh=(e,t)=>{ph(e).forEach(t)},Ds=[It],gh=[It,rh],Yr=[It,Ya,Ga],mh=[sh],js=e=>!!e[Gn],vh=e=>e[Gn],wh=e=>delete e[Gn],Ui=(e,t)=>{if(js(e))return;const i={};t.forEach(n=>{i[n]=e.getAttribute(n)}),e[Gn]=i},Vw=e=>{js(e)||(e[Gn]={backgroundImage:e.style.backgroundImage})},Rw=(e,t,i)=>{if(!i){e.removeAttribute(t);return}e.setAttribute(t,i)},Wi=(e,t)=>{if(!js(e))return;const i=vh(e);t.forEach(n=>{Rw(e,n,i[n])})},Bw=e=>{if(!js(e))return;const t=vh(e);e.style.backgroundImage=t.backgroundImage},Ow=(e,t,i)=>{Ji(e,t.class_applied),Ci(e,ah),i&&(t.unobserve_completed&&zs(e,t),Jt(t.callback_applied,e,i))},yh=(e,t,i)=>{Ji(e,t.class_loading),Ci(e,Xa),i&&(el(i,1),Jt(t.callback_loading,e,i))},Ot=(e,t,i)=>{!i||e.setAttribute(t,i)},Uu=(e,t)=>{Ot(e,Ga,je(e,t.data_sizes)),Ot(e,Ya,je(e,t.data_srcset)),Ot(e,It,je(e,t.data_src))},_w=(e,t)=>{tl(e,i=>{Ui(i,Yr),Uu(i,t)}),Ui(e,Yr),Uu(e,t)},$w=(e,t)=>{Ui(e,Ds),Ot(e,It,je(e,t.data_src))},Uw=(e,t)=>{fh(e,i=>{Ui(i,Ds),Ot(i,It,je(i,t.data_src))}),Ui(e,gh),Ot(e,rh,je(e,t.data_poster)),Ot(e,It,je(e,t.data_src)),e.load()},Ww=(e,t)=>{Ui(e,mh),Ot(e,sh,je(e,t.data_src))},Hw=(e,t,i)=>{const n=je(e,t.data_bg),r=je(e,t.data_bg_hidpi),s=ih&&r?r:n;!s||(e.style.backgroundImage=`url("${s}")`,dh(e).setAttribute(It,s),yh(e,t,i))},Fw=(e,t,i)=>{const n=je(e,t.data_bg_multi),r=je(e,t.data_bg_multi_hidpi),s=ih&&r?r:n;!s||(e.style.backgroundImage=s,Ow(e,t,i))},xh={IMG:_w,IFRAME:$w,VIDEO:Uw,OBJECT:Ww},Qw=(e,t)=>{const i=xh[e.tagName];!i||i(e,t)},Zw=(e,t,i)=>{const n=xh[e.tagName];!n||(n(e,t),yh(e,t,i))},Yw=["IMG","IFRAME","VIDEO","OBJECT"],Gw=e=>Yw.indexOf(e.tagName)>-1,Sh=(e,t)=>{t&&!jw(t)&&!Lw(t)&&Jt(e.callback_finish,t)},Wu=(e,t,i)=>{e.addEventListener(t,i),e.llEvLisnrs[t]=i},Xw=(e,t,i)=>{e.removeEventListener(t,i)},il=e=>!!e.llEvLisnrs,Jw=(e,t,i)=>{il(e)||(e.llEvLisnrs={});const n=e.tagName==="VIDEO"?"loadeddata":"load";Wu(e,n,t),Wu(e,"error",i)},Bo=e=>{if(!il(e))return;const t=e.llEvLisnrs;for(let i in t){const n=t[i];Xw(e,i,n)}delete e.llEvLisnrs},Ch=(e,t,i)=>{Nw(e),el(i,-1),Dw(i),nt(e,t.class_loading),t.unobserve_completed&&zs(e,i)},Kw=(e,t,i,n)=>{const r=qa(t);Ch(t,i,n),Ji(t,i.class_loaded),Ci(t,oh),Jt(i.callback_loaded,t,n),r||Sh(i,n)},qw=(e,t,i,n)=>{const r=qa(t);Ch(t,i,n),Ji(t,i.class_error),Ci(t,Ja),Jt(i.callback_error,t,n),r||Sh(i,n)},nl=(e,t,i)=>{const n=dh(e)||e;if(il(n))return;Jw(n,o=>{Kw(o,e,t,i),Bo(n)},o=>{qw(o,e,t,i),Bo(n)})},ey=(e,t,i)=>{kw(e),nl(e,t,i),Vw(e),Hw(e,t,i),Fw(e,t,i)},ty=(e,t,i)=>{nl(e,t,i),Zw(e,t,i)},rl=(e,t,i)=>{Gw(e)?ty(e,t,i):ey(e,t,i)},iy=(e,t,i)=>{e.setAttribute("loading","lazy"),nl(e,t,i),Qw(e,t),Ci(e,lh)},Hu=e=>{e.removeAttribute(It),e.removeAttribute(Ya),e.removeAttribute(Ga)},ny=e=>{tl(e,t=>{Hu(t)}),Hu(e)},bh=e=>{tl(e,t=>{Wi(t,Yr)}),Wi(e,Yr)},ry=e=>{fh(e,t=>{Wi(t,Ds)}),Wi(e,gh),e.load()},sy=e=>{Wi(e,Ds)},oy=e=>{Wi(e,mh)},ay={IMG:bh,IFRAME:sy,VIDEO:ry,OBJECT:oy},ly=e=>{const t=ay[e.tagName];if(!t){Bw(e);return}t(e)},uy=(e,t)=>{Ka(e)||qa(e)||(nt(e,t.class_entered),nt(e,t.class_exited),nt(e,t.class_applied),nt(e,t.class_loading),nt(e,t.class_loaded),nt(e,t.class_error))},cy=(e,t)=>{ly(e),uy(e,t),Ps(e),wh(e)},dy=(e,t,i,n)=>{!i.cancel_on_exit||!Iw(e)||e.tagName==="IMG"&&(Bo(e),ny(e),bh(e),nt(e,i.class_loading),el(n,-1),Ps(e),Jt(i.callback_cancel,e,t,n))},hy=(e,t,i,n)=>{const r=Tw(e);Ci(e,bw),Ji(e,i.class_entered),nt(e,i.class_exited),zw(e,i,n),Jt(i.callback_enter,e,t,n),!r&&rl(e,i,n)},py=(e,t,i,n)=>{Ka(e)||(Ji(e,i.class_exited),dy(e,t,i,n),Jt(i.callback_exit,e,t,n))},fy=["IMG","IFRAME","VIDEO"],Mh=e=>e.use_native&&"loading"in HTMLImageElement.prototype,gy=(e,t,i)=>{e.forEach(n=>{fy.indexOf(n.tagName)!==-1&&iy(n,t,i)}),hh(i,0)},my=e=>e.isIntersecting||e.intersectionRatio>0,vy=e=>({root:e.container===document?null:e.container,rootMargin:e.thresholds||e.threshold+"px"}),wy=(e,t,i)=>{e.forEach(n=>my(n)?hy(n.target,n,t,i):py(n.target,n,t,i))},yy=(e,t)=>{t.forEach(i=>{e.observe(i)})},xy=(e,t)=>{Pw(e),yy(e,t)},Sy=(e,t)=>{!eh||Mh(e)||(t._observer=new IntersectionObserver(i=>{wy(i,e,t)},vy(e)))},Ih=e=>Array.prototype.slice.call(e),Gr=e=>e.container.querySelectorAll(e.elements_selector),Cy=e=>Ih(e).filter(Ka),by=e=>Aw(e),My=e=>Ih(e).filter(by),Fu=(e,t)=>Cy(e||Gr(t)),Iy=(e,t)=>{My(Gr(e)).forEach(n=>{nt(n,e.class_error),Ps(n)}),t.update()},Ay=(e,t)=>{!Si||window.addEventListener("online",()=>{Iy(e,t)})},Jn=function(e,t){const i=nh(e);this._settings=i,this.loadingCount=0,Sy(i,this),Ay(i,this),this.update(t)};Jn.prototype={update:function(e){const t=this._settings,i=Fu(e,t);if(hh(this,i.length),qd||!eh){this.loadAll(i);return}if(Mh(t)){gy(i,t,this);return}xy(this._observer,i)},destroy:function(){this._observer&&this._observer.disconnect(),Gr(this._settings).forEach(e=>{wh(e)}),delete this._observer,delete this._settings,delete this.loadingCount,delete this.toLoadCount},loadAll:function(e){const t=this._settings;Fu(e,t).forEach(n=>{zs(n,this),rl(n,t,this)})},restoreAll:function(){const e=this._settings;Gr(e).forEach(t=>{cy(t,e)})}};Jn.load=(e,t)=>{const i=nh(t);rl(e,i)};Jn.resetStatus=e=>{Ps(e)};Si&&Cw(Jn,window.lazyLoadOptions);class Ah{constructor({readonly:t,box:i,pages:n,onNewPageIndex:r,onPlay:s}){if(this.pageIndex=0,this.namespace="netless-app-docs-viewer",this.isShowPreview=!1,this.isSmallBox=!1,this.sideEffect=new Ns,n.length<=0)throw new Error("[DocsViewer] Empty pages.");this.readonly=t,this.box=i,this.pages=n,this.onNewPageIndex=r,this.onPlay=s,this.render()}mount(){this.box.mountContent(this.$content),this.box.mountFooter(this.$footer),this.sideEffect.add(()=>{const t=new Jn({container:this.$preview,elements_selector:`.${this.wrapClassName("preview-page>img")}`});return()=>t.destroy()},"preview-lazyload")}unmount(){this.$content.remove(),this.$footer.remove()}setReadonly(t){this.readonly!==t&&(this.readonly=t,this.$content.classList.toggle(this.wrapClassName("readonly"),t),this.$footer.classList.toggle(this.wrapClassName("readonly"),t),this.$pageNumberInput.disabled=t)}destroy(){this.sideEffect.flushAll(),this.unmount()}setPageIndex(t){Number.isNaN(t)||(this.pageIndex=t,this.$pageNumberInput.value=String(t+1))}setSmallBox(t){this.isSmallBox!==t&&(this.isSmallBox=t,this.$footer.classList.toggle(this.wrapClassName("float-footer"),t))}render(){return this.renderContent(),this.renderFooter(),this.$content}renderContent(){if(!this.$content){const t=document.createElement("div");t.className=this.wrapClassName("content"),this.$content=t,this.readonly&&t.classList.add(this.wrapClassName("readonly")),t.appendChild(this.renderPreviewMask()),t.appendChild(this.renderPreview())}return this.$content}renderPreview(){if(!this.$preview){const t=document.createElement("div");t.className=this.wrapClassName("preview")+" tele-fancy-scrollbar",this.$preview=t;const i=this.wrapClassName("preview-page"),n=this.wrapClassName("preview-page-name");this.pages.forEach((r,s)=>{var o;const a=(o=r.thumbnail)!=null?o:r.src.startsWith("ppt")?void 0:r.src;if(!a)return;const l=String(s),u=document.createElement("a");u.className=i+" "+this.wrapClassName(`preview-page-${s}`),u.setAttribute("href","#"),u.dataset.pageIndex=l;const h=document.createElement("span");h.className=n,h.textContent=String(s+1),h.dataset.pageIndex=l;const p=document.createElement("img");p.width=r.width,p.height=r.height,p.dataset.src=a,p.dataset.pageIndex=l,u.appendChild(p),u.appendChild(h),t.appendChild(u)}),this.sideEffect.addEventListener(t,"click",r=>{var s;if(this.readonly)return;const o=(s=r.target.dataset)==null?void 0:s.pageIndex;o&&(r.preventDefault(),r.stopPropagation(),r.stopImmediatePropagation(),this.onNewPageIndex(Number(o)),this.togglePreview(!1))})}return this.$preview}renderPreviewMask(){return this.$previewMask||(this.$previewMask=document.createElement("div"),this.$previewMask.className=this.wrapClassName("preview-mask"),this.sideEffect.addEventListener(this.$previewMask,"click",t=>{this.readonly||t.target===this.$previewMask&&this.togglePreview(!1)})),this.$previewMask}renderFooter(){if(!this.$footer){const t=document.createElement("div");if(t.className=this.wrapClassName("footer"),this.$footer=t,this.readonly&&t.classList.add(this.wrapClassName("readonly")),this.isSmallBox&&t.classList.add(this.wrapClassName("float-footer")),this.pages.some(l=>l.thumbnail||!l.src.startsWith("ppt"))){const l=this.renderFooterBtn("btn-sidebar",mw(this.namespace));this.sideEffect.addEventListener(l,"click",()=>{this.readonly||this.togglePreview()}),this.$footer.appendChild(l)}const i=document.createElement("div");i.className=this.wrapClassName("page-jumps");const n=this.renderFooterBtn("btn-page-back",vw(this.namespace));if(this.sideEffect.addEventListener(n,"click",()=>{this.readonly||this.onNewPageIndex(this.pageIndex-1)}),i.appendChild(n),this.onPlay){const l=this.renderFooterBtn("btn-page-play",yw(this.namespace),xw(this.namespace)),u=()=>{this.sideEffect.setTimeout(()=>{l.classList.toggle(this.wrapClassName("footer-btn-playing"),!1)},500,"returnPlay")};this.sideEffect.addEventListener(l,"click",()=>{this.readonly||(l.classList.toggle(this.wrapClassName("footer-btn-playing"),!0),this.onPlay&&this.onPlay(),u())}),i.appendChild(l)}const r=this.renderFooterBtn("btn-page-next",ww(this.namespace));this.sideEffect.addEventListener(r,"click",()=>{this.readonly||this.onNewPageIndex(this.pageIndex+1)}),i.appendChild(r);const s=document.createElement("div");s.className=this.wrapClassName("page-number");const o=document.createElement("input");o.className=this.wrapClassName("page-number-input"),o.value=String(this.pageIndex+1),this.readonly&&(o.disabled=!0),this.$pageNumberInput=o,this.sideEffect.addEventListener(o,"focus",()=>{o.select()}),this.sideEffect.addEventListener(o,"change",()=>{this.readonly||o.value&&this.onNewPageIndex(Number(o.value)-1)});const a=document.createElement("span");a.textContent=" / "+this.pages.length,s.appendChild(o),s.appendChild(a),this.$footer.appendChild(i),this.$footer.appendChild(s)}return this.$footer}renderFooterBtn(t,i,n){const r=document.createElement("button");return r.className=this.wrapClassName("footer-btn")+" "+this.wrapClassName(t),r.appendChild(i),n&&r.appendChild(n),r}togglePreview(t){if(this.isShowPreview=t!=null?t:!this.isShowPreview,this.$content.classList.toggle(this.wrapClassName("preview-active"),this.isShowPreview),this.isShowPreview){const i=this.$preview.querySelector("."+this.wrapClassName(`preview-page-${this.pageIndex}`));i&&this.$preview.scrollTo({top:i.offsetTop-16})}}wrapClassName(t){return`${this.namespace}-${t}`}}function Hi(e,t,i){return Math.min(Math.max(e,t),i)}function Qu(e){return e.touches?e.touches[0]:e}function Eh(e){e.stopPropagation(),e.cancelable&&e.preventDefault()}class Ey{constructor(t){var i,n,r;this.velocity=0,this.paused=!0,this._animationFrameID=null,this._loopTimestamp=0,this.looper=s=>{if(this.paused)return;let o=Math.floor((s-this._loopTimestamp)/1e3*60)+1;for(this._loopTimestamp=s;o-- >0;)this.stepper();this.onStep(this.current,this),!this.paused&&this.current!==this.target&&window.requestAnimationFrame(this.looper)},this.current=(i=t.start)!=null?i:0,this.target=this.current,this.stiffness=(n=t.stiffness)!=null?n:170,this.damping=(r=t.damping)!=null?r:26,this.onStep=t.onStep}stepTo(t,i){this.paused&&i!=null&&(this.current=i),this.paused=!1,this.target=t,this.onStep(this.current,this),this._loopTimestamp=Date.now(),window.requestAnimationFrame(this.looper)}pause(){this.paused=!0}destroy(){this.pause()}stepper(){const t=-this.stiffness*(this.current-this.target),i=-this.damping*this.velocity,n=this.velocity+(t+i)/60,r=this.current+n/60;Math.abs(n-0)<.01&&Math.abs(r-this.target)<.01?(this.current=this.target,this.velocity=0):(this.current=r,this.velocity=n)}}class Ty{constructor(t,i,n,r){this.scale=1,this.lastVisit=Date.now(),this.pageOffsetY=0,this.pageOffsetX=0,this.visible=!0,this.index=t,this.page=i,this.scale=n,this.pageOffsetX=(r-i.width)/2;const s=document.createElement("div");s.className="page-renderer-page",s.dataset.index=`${t}`,s.style.width=`${i.width*n}px`,s.style.height=`${i.height*n}px`,i.thumbnail&&(s.style.backgroundImage=`url("${i.thumbnail}")`);const o=document.createElement("img");o.className="page-renderer-page-img",o.width=i.width,o.height=i.height,o.src=i.src,s.appendChild(o),this.$page=s}translateY(t){Math.abs(t-this.pageOffsetY)>=.001&&(this.pageOffsetY=t,this.$page.style.transform=`translate(${this.pageOffsetX*this.scale}px, ${this.pageOffsetY*this.scale}px)`)}setScale(t){Math.abs(t-this.scale)>=.001&&(this.scale=t,this.$page.style.width=`${this.page.width*this.scale}px`,this.$page.style.height=`${this.page.height*this.scale}px`,this.$page.style.transform=`translate(${this.pageOffsetX*this.scale}px, ${this.pageOffsetY*this.scale}px)`)}setVisible(t){t!==this.visible&&(this.visible=t,this.$page.style.opacity=t?"1":"0")}}const ky=window.requestIdleCallback||(e=>window.setTimeout(e,5e3)),Ny=window.cancelIdleCallback||window.clearTimeout;class Py{constructor(t,i,n){this.pages=t,this.pagesIntrinsicWidth=i,this.scale=n,this.els=new Map,this.maxElCount=200,this.gcTimer=null,this.gc=()=>{if(this.gcTimer=null,this.els.size>this.maxElCount){const r=[...this.els.values()].sort((s,o)=>o.lastVisit-s.lastVisit);for(let s=Math.floor(this.maxElCount/4);s<r.length;s++)this.els.delete(r[s].index)}}}getEl(t){let i=this.els.get(t);return i||(i=new Ty(t,this.pages[t],this.scale,this.pagesIntrinsicWidth),this.els.set(t,i)),i.lastVisit=Date.now(),this.els.size>this.maxElCount&&this.gcTimer===null&&(this.gcTimer=ky(this.gc)),i}setScale(t){t!==this.scale&&(this.scale=t,this.els.forEach(i=>i.setScale(t)))}destroy(){this.els.clear(),this.gcTimer!==null&&(Ny(this.gcTimer),this.gcTimer=null)}}class zy{constructor(t){this._hwaTimeout=NaN,this._turnOffHWA=()=>{window.clearTimeout(this._hwaTimeout),this._hwaTimeout=NaN,this.$pages.classList.toggle("is-hwa",!1)},this.pagesScrollTop=t.pagesScrollTop||0,this.containerWidth=t.containerWidth||1,this.containerHeight=t.containerHeight||1,this.pages=t.pages.map(s=>{if(s.thumbnail)return s;try{const o=new URL(s.src);return o.searchParams.set("x-oss-process","image/resize,l_50"),Fd(Hd({},s),{thumbnail:o.toString()})}catch(o){return console.error(o),s}});const i=Array(this.pages.length);let n=1/0,r=0;this.pagesIntrinsicHeight=this.pages.reduce((s,o,a)=>(i[a]=s,o.width>r&&(r=o.width),o.height<=n&&(n=o.height),s+o.height),0),this.pagesIntrinsicWidth=r,this.pagesMinHeight=n,this.pagesIntrinsicYs=i,this.scale=this._calcScale(),this.threshold=this._calcThreshold(),this.onPageIndexChanged=t.onPageIndexChanged,this.pageScrollIndex=0,this.pagesScrollTop!==0&&(this.pageScrollIndex=this.findScrollPageIndex(),this.onPageIndexChanged&&this.pageScrollIndex>0&&this.onPageIndexChanged(this.pageScrollIndex)),this.pageElManager=new Py(this.pages,r,this.scale),this.$pages=this.renderPages()}setContainerSize(t,i){t>0&&i>0&&(t!==this.containerWidth||i!==this.containerHeight)&&(this.containerWidth=t,this.containerHeight=i,this.$pages.style.width=`${this.containerWidth}px`,this.$pages.style.height=`${this.containerHeight}px`,this.scale=this._calcScale(),this.threshold=this._calcThreshold(),this.pageElManager.setScale(this.scale),this.$pages.parentElement&&this.pagesScrollTo(this.pagesScrollTop,!0))}renderPages(){const t=document.createElement("div");return t.className="page-renderer-pages-container",t.style.width=`${this.containerWidth}px`,t.style.height=`${this.containerHeight}px`,t}pagesScrollTo(t,i){if(t=Hi(t,0,this.pagesIntrinsicHeight-this.containerHeight/this.scale),i||Math.abs(t-this.pagesScrollTop)>=.001){this._turnOnHWA(),this.pagesScrollTop=t;const n=this.findScrollPageIndex(),r=Math.max(n-this.threshold,0),s=Math.min(n+this.threshold,this.pages.length-1);for(let o=0;o<this.$pages.children.length;o++){const a=this.$pages.children[o],l=Number(a.dataset.index);l>=r&&l<=s||(a.remove(),o--)}for(let o=r;o<=s;o++){const a=this.pageElManager.getEl(o);a.$page.parentElement!==this.$pages&&this.$pages.appendChild(a.$page),a.translateY(this.pagesIntrinsicYs[o]-this.pagesScrollTop)}n!==this.pageScrollIndex&&(this.pageScrollIndex=n,this.onPageIndexChanged&&this.onPageIndexChanged(n))}}findScrollPageIndex(){for(let t=0;t<this.pagesIntrinsicYs.length;t++)if(this.pagesIntrinsicYs[t]+this.pages[t].height-this.pagesScrollTop>=.001)return t;return this.pagesIntrinsicYs.length-1}mount(t){t.appendChild(this.$pages),this.pagesScrollTo(this.pagesScrollTop,!0)}unmount(){this.$pages.remove()}destroy(){this.unmount(),this.onPageIndexChanged=void 0,this.pageElManager.destroy(),this._hwaTimeout&&(window.clearTimeout(this._hwaTimeout),this._hwaTimeout=NaN)}_calcScale(){return this.containerWidth/this.pagesIntrinsicWidth||1}_calcThreshold(){return Hi(Math.ceil(this.containerHeight/this.scale/this.pagesMinHeight/2),1,this.pages.length)}_turnOnHWA(){this._hwaTimeout?window.clearTimeout(this._hwaTimeout):this.$pages.classList.toggle("is-hwa",!0),this._hwaTimeout=window.setTimeout(this._turnOffHWA,1e3)}}const Dy=30;class jy{constructor(t){this.sideEffect=new Ns,this.pagesScrollTop=t.pagesScrollTop||0,this.containerWidth=t.containerWidth||1,this.containerHeight=t.containerHeight||1,this.pagesWidth=t.pagesWidth||1,this.pagesHeight=t.pagesHeight||1,this.scale=this._calcScale(),this.scrollbarMinHeight=t.scrollbarMinHeight||Dy,this.scrollbarHeight=this._calcScrollbarHeight(),this.readonly=t.readonly,this.wrapClassName=t.wrapClassName,this.onDragScroll=t.onDragScroll,this.$scrollbar=this.renderScrollbar()}mount(t){t.appendChild(this.$scrollbar),this.pagesScrollTo(this.pagesScrollTop,!0)}unmount(){this.$scrollbar.remove()}setReadonly(t){this.readonly=t}setContainerSize(t,i){t>0&&i>0&&(t!==this.containerWidth||i!==this.containerHeight)&&(this.containerWidth=t,this.containerHeight=i,this.scale=this._calcScale(),this._updateScrollbarHeight(),this.$scrollbar.parentElement&&this.pagesScrollTo(this.pagesScrollTop,!0))}pagesScrollTo(t,i){if(t=Hi(t,0,this.pagesHeight-this.containerHeight/this.scale),i||Math.abs(t-this.pagesScrollTop)>=.001){this.pagesScrollTop=t;const n=this.pagesScrollTop*this.scale,r=this.pagesHeight*this.scale,s=n/(r-this.containerHeight)*(this.containerHeight-this.scrollbarHeight);window.requestAnimationFrame?window.requestAnimationFrame(()=>{this.$scrollbar.style.transform=`translateY(${s}px)`}):this.$scrollbar.style.transform=`translateY(${s}px)`}}destroy(){this.unmount(),this.onDragScroll=void 0,this.sideEffect.flushAll()}renderScrollbar(){const t=document.createElement("button");t.className=this.wrapClassName("scrollbar"),t.style.minHeight=`${this.scrollbarMinHeight}px`,t.style.height=`${this.scrollbarHeight}px`;const i=n=>{if(this.readonly||n.button!=null&&n.button!==0)return;Eh(n);const r=this.wrapClassName("scrollbar-dragging");t.classList.toggle(r,!0);const s=this.pagesScrollTop,{clientY:o}=Qu(n),a=u=>{if(this.readonly)return;const{clientY:h}=Qu(u),p=(h-o)/this.scale;Math.abs(p)>0&&this.onDragScroll&&this.onDragScroll(s+p*(this.pagesHeight*this.scale/this.containerHeight))},l=()=>{t.classList.toggle(r,!1),window.removeEventListener("mousemove",a,!0),window.removeEventListener("touchmove",a,!0),window.removeEventListener("mouseup",l,!0),window.removeEventListener("touchend",l,!0),window.removeEventListener("touchcancel",l,!0)};window.addEventListener("mousemove",a,!0),window.addEventListener("touchmove",a,!0),window.addEventListener("mouseup",l,!0),window.addEventListener("touchend",l,!0),window.addEventListener("touchcancel",l,!0)};return this.sideEffect.addEventListener(t,"mousedown",i),this.sideEffect.addEventListener(t,"touchstart",i),t}_calcScale(){return this.containerWidth/this.pagesWidth||1}_calcScrollbarHeight(){return Hi(this.containerHeight/(this.pagesHeight*this.scale)*this.containerHeight,this.scrollbarMinHeight,this.containerHeight)}_updateScrollbarHeight(){const t=this._calcScrollbarHeight();Math.abs(t-this.scrollbarHeight)>.001&&(this.scrollbarHeight=t,this.$scrollbar.style.height=`${t}px`)}}const Ly=window.ResizeObserver||gw,rn=640;class Vy{constructor({whiteboardView:t,readonly:i,box:n,pages:r,pageScrollTop:s=0,mountWhiteboard:o,onUserScroll:a}){this.sideEffect=new Ns,this.userScrolling=!1,this.onNewPageIndex=p=>{this.scrollToPage(p)},this.whiteboardView=t,this.readonly=i,this.box=n,this.pages=r,this.mountWhiteboard=o,this._onUserScroll=a;const l=this.debounce(()=>{this.userScrolling=!1,this._onUserScroll&&this._onUserScroll(this.pageRenderer.pagesScrollTop)},{wait:80},"debounce-updateUserScroll");this.updateUserScroll=()=>{this.userScrolling=!0,l()},this.viewer=new Ah({readonly:i,box:n,pages:r,onNewPageIndex:this.onNewPageIndex});const{width:u,height:h}=this.whiteboardView.size;this.pageRenderer=new zy({pagesScrollTop:s,pages:this.pages,containerWidth:u,containerHeight:h,onPageIndexChanged:this.viewer.setPageIndex.bind(this.viewer)}),this.scrollbar=new jy({pagesScrollTop:this.pageRenderer.pagesScrollTop,containerWidth:u,containerHeight:h,pagesWidth:this.pageRenderer.pagesIntrinsicWidth,pagesHeight:this.pageRenderer.pagesIntrinsicHeight,readonly:this.readonly,wrapClassName:this.wrapClassName.bind(this),onDragScroll:p=>{this.pageScrollTo(p),this.updateUserScroll()}}),this.pageScrollStepper=new Ey({start:this.pageRenderer.pagesScrollTop,onStep:p=>{this.pageScrollTo(p)}}),this.render()}mount(){this.viewer.mount(),this.setupScrollListener();const t=this.debounce(this.renderRatioHeight.bind(this),{wait:80});return this.sideEffect.add(()=>{const i=new Ly(t);return i.observe(this.viewer.$content),()=>i.disconnect()}),this.sideEffect.setTimeout(()=>{this.userScrolling||this.pageScrollTo(this.pageRenderer.pagesScrollTop)},100),this}unmount(){return this.viewer.unmount(),this}setReadonly(t){this.readonly!==t&&(this.readonly=t,this.viewer.setReadonly(t),this.scrollbar.setReadonly(t))}destroy(){this.sideEffect.flushAll(),this.pageScrollStepper.destroy(),this._onUserScroll=void 0,this.unmount(),this.viewer.destroy(),this.pageRenderer.destroy(),this.scrollbar.destroy()}syncPageScrollTop(t){!this.userScrolling&&t>=0&&Math.abs(this.pageRenderer.pagesScrollTop-t)>.01&&this.pageScrollStepper.stepTo(t,this.pageRenderer.pagesScrollTop)}render(){this.pageRenderer.mount(this.viewer.$content),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.scrollbar.mount(this.viewer.$content),this.renderRatioHeight()}renderRatioHeight(){const t=this.box.absoluteHeight,i=t<=rn;if(this.viewer.setSmallBox(i),i){const n=26/rn,r=26/t,s=26/rn,o=0,a=Math.max((n+s-(r+o))/2,0);if(this.box.$titleBar){const l=r+a;this.box.$titleBar.style.height=`${l*100}%`}if(this.box.$footer){const l=o+a;this.box.$footer.style.height=`${l*100}%`}}else{if(this.box.$titleBar){const n=Math.max(26/rn,26/t);this.box.$titleBar.style.height=`${n*100}%`}if(this.box.$footer){const n=Math.max(26/rn,26/t);this.box.$footer.style.height=`${n*100}%`}}}renderWhiteboardView(){return this.$whiteboardView||(this.$whiteboardView=document.createElement("div"),this.$whiteboardView.className=this.wrapClassName("wb-view"),this.mountWhiteboard(this.$whiteboardView),this.sideEffect.addEventListener(this.$whiteboardView,"wheel",t=>{Eh(t),this.readonly||(this.pageScrollTo(this.pageRenderer.pagesScrollTop+t.deltaY),this.updateUserScroll())},{passive:!1,capture:!0}),this.sideEffect.addEventListener(this.$whiteboardView,"touchmove",t=>{this.readonly||t.touches.length<=1||this.updateUserScroll()},{passive:!0,capture:!0})),this.$whiteboardView}scrollTopPageToEl(t){return t*this.pageRenderer.scale}scrollTopElToPage(t){return t/this.pageRenderer.scale}elScrollTo(t){this.pageScrollTo(this.scrollTopElToPage(t))}pageScrollTo(t){const i=this.scrollTopElToPage(this.whiteboardView.size.height/2);this.whiteboardView.moveCamera({centerY:Hi(t+i,i,this.pageRenderer.pagesIntrinsicHeight-i),animationMode:"immediately"})}scrollToPage(t){if(!this.readonly&&!Number.isNaN(t)){const i=this.pageRenderer.pagesIntrinsicYs[t];i>=0&&(this.pageScrollTo(i+5/this.pageRenderer.scale),this.updateUserScroll())}}setupScrollListener(){this.sideEffect.add(()=>{const t=i=>{const{width:n,height:r}=this.whiteboardView.size;if(n<=0||r<=0)return;const s=i.centerY-this.pageRenderer.containerHeight/this.pageRenderer.scale/2;this.pageRenderer.pagesScrollTo(s),this.scrollbar.pagesScrollTo(s)};return this.whiteboardView.callbacks.on("onCameraUpdated",t),()=>this.whiteboardView.callbacks.off("onCameraUpdated",t)}),this.sideEffect.add(()=>{const t=({width:i,height:n})=>{if(i<=0||n<=0)return;this.pageRenderer.setContainerSize(i,n),this.scrollbar.setContainerSize(i,n);const{pagesIntrinsicWidth:r,pagesIntrinsicHeight:s}=this.pageRenderer;this.whiteboardView.moveCameraToContain({originX:0,originY:this.pageRenderer.pagesScrollTop,width:r,height:n/this.pageRenderer.scale,animationMode:"immediately"}),this.whiteboardView.setCameraBound({damping:1,maxContentMode:()=>this.pageRenderer.scale,minContentMode:()=>this.pageRenderer.scale,centerX:r/2,centerY:s/2,width:r,height:s})};return this.whiteboardView.callbacks.on("onSizeUpdated",t),()=>{this.whiteboardView.callbacks.off("onSizeUpdated",t)}},"whiteboard-size-update"),this.sideEffect.addEventListener(window,"keyup",t=>{if(this.readonly||!this.box.focus||this.box.minimized)return;let i=null;switch(t.key){case"PageDown":{i=this.pageRenderer.pagesScrollTop+this.pageRenderer.containerHeight/this.pageRenderer.scale;break}case"PageUp":{i=this.pageRenderer.pagesScrollTop-this.pageRenderer.containerHeight/this.pageRenderer.scale;break}case"ArrowDown":{i=this.pageRenderer.pagesScrollTop+this.pageRenderer.containerHeight/4/this.pageRenderer.scale;break}case"ArrowUp":{i=this.pageRenderer.pagesScrollTop-this.pageRenderer.containerHeight/4/this.pageRenderer.scale;break}}i!==null&&(this._onUserScroll?this._onUserScroll(i):(this.pageScrollTo(i),this.updateUserScroll()))},{capture:!0})}debounce(t,i,n){const r=Zv(t,i);return this.sideEffect.addDisposer(()=>r.cancel(),n),r}wrapClassName(t){return"netless-app-docs-viewer-static-"+t}}class Ry{constructor({context:t,whiteboardView:i,box:n,pages:r}){this.sideEffect=new Ns,this.onPlayPPT=()=>{const s=this.context.getRoom();s&&s.pptNextStep()},this._scaleDocsToFitImpl=()=>{const s=this.pages[this.getPageIndex()];s&&(this.whiteboardView.moveCameraToContain({originX:-s.width/2,originY:-s.height/2,width:s.width,height:s.height,animationMode:"immediately"}),this.whiteboardView.setCameraBound({damping:1,maxContentMode:()=>this.whiteboardView.camera.scale,minContentMode:()=>this.whiteboardView.camera.scale,centerX:0,centerY:0,width:s.width,height:s.height}))},this._scaleDocsToFitDebounced=()=>{this.sideEffect.setTimeout(this._scaleDocsToFitImpl,1e3,"_scaleDocsToFitDebounced")},this.scaleDocsToFit=()=>{this._scaleDocsToFitImpl(),this._scaleDocsToFitDebounced()},this.onNewPageIndex=s=>{this.jumpToPage(s,!0)},this.context=t,this.whiteboardView=i,this.box=n,this.pages=r,this.displayer=t.getDisplayer(),this.viewer=new Ah({readonly:!t.getIsWritable(),box:n,pages:r,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlayPPT}),this.render(),this.sideEffect.add(()=>{const s=o=>{this.viewer.setReadonly(!o)};return this.context.emitter.on("writableChange",s),()=>this.context.emitter.off("writableChange",s)}),this.sideEffect.add(()=>{const s=o=>{this.jumpToPage(o.index)};return this.context.emitter.on("sceneStateChange",s),()=>this.context.emitter.off("sceneStateChange",s)})}mount(){this.viewer.mount();const t=this.getPageIndex();return t!==0&&this.jumpToPage(t),this.scaleDocsToFit(),this.sideEffect.add(()=>(this.whiteboardView.callbacks.on("onSizeUpdated",this.scaleDocsToFit),()=>{this.whiteboardView.callbacks.off("onSizeUpdated",this.scaleDocsToFit)})),this}unmount(){return this.viewer.unmount(),this}destroy(){this.sideEffect.flushAll(),this.unmount(),this.viewer.destroy()}getPageIndex(){return this.displayer.state.sceneState.index}jumpToPage(t,i){var n,r;if(t=Hi(t,0,this.pages.length-1),t!==this.getPageIndex()&&this.context.getIsWritable()){const s=this.context.getInitScenePath(),o=(r=(n=this.context.getScenes())==null?void 0:n[t])==null?void 0:r.name;s&&o&&this.context.setScenePath(`${s}/${o}`),this.scaleDocsToFit()}if(t!==this.viewer.pageIndex&&this.viewer.setPageIndex(t),i){const s=this.context.getRoom();if(s){const o=s.state.globalState.__pptState;s.setGlobalState({__pptState:o&&{uuid:o.uuid,pageIndex:t,disableAutoPlay:o.disableAutoPlay}})}}}render(){this.viewer.$content.appendChild(this.renderMask()),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.sideEffect.addEventListener(window,"keydown",t=>{var i;if(this.box.focus)switch(t.key){case"ArrowUp":case"ArrowLeft":{this.jumpToPage(this.getPageIndex()-1,!0);break}case"ArrowRight":case"ArrowDown":{(i=this.context.getRoom())==null||i.pptNextStep();break}}})}renderMask(){if(!this.$mask){const t=document.createElement("div");t.className=this.wrapClassName("mask"),this.$mask=t;const i=document.createElement("button");i.className=this.wrapClassName("back");const n=document.createElement("button");n.className=this.wrapClassName("next")}return this.$mask}renderWhiteboardView(){return this.$whiteboardView||(this.$whiteboardView=document.createElement("div"),this.$whiteboardView.className=this.wrapClassName("wb-view"),this.sideEffect.addEventListener(this.$whiteboardView,"click",t=>{var i;const n=this.context.getRoom();if(n&&n.state.memberState.currentApplianceName==="clicker"){for(let r=t.target;r;r=r.parentElement)if((i=r.classList)!=null&&i.contains("ppt-event-source"))return;n.pptNextStep()}}),this.context.mountView(this.$whiteboardView)),this.$whiteboardView}wrapClassName(t){return"netless-app-docs-viewer-dynamic-"+t}}const By="DocsViewer",Xr={kind:By,setup(e){const t=e.getBox(),i=e.getScenes();if(!i)throw new Error("[Docs Viewer]: scenes not found.");const n=e.getView();if(!n)throw new Error("[Docs Viewer]: no whiteboard view.");const r=i.map(({ppt:s})=>s?{width:s.width,height:s.height,src:s.src,thumbnail:s.previewURL}:null).filter(s=>Boolean(s));if(r.length<=0)throw new Error("[Docs Viewer]: empty scenes.");t.mountStyles(Bv),r[0].src.startsWith("ppt")?_y(e,n,t,r):Oy(e,n,t,r)}};function Oy(e,t,i,n){var r;t.disableCameraTransform=!e.getIsWritable();const s=new Vy({whiteboardView:t,readonly:!e.getIsWritable(),box:i,pages:n,pageScrollTop:(r=e.getAttributes())==null?void 0:r.pageScrollTop,mountWhiteboard:e.mountView.bind(e),onUserScroll:o=>{var a;((a=e.getAttributes())==null?void 0:a.pageScrollTop)!==o&&!i.readonly&&e.updateAttributes(["pageScrollTop"],o)}}).mount();e.emitter.on("attributesUpdate",o=>{o&&o.pageScrollTop!=null&&s.syncPageScrollTop(o.pageScrollTop)}),e.emitter.on("writableChange",o=>{s.setReadonly(!o),t.disableCameraTransform=!o})}function _y(e,t,i,n){t.disableCameraTransform=!0;const r=new Ry({context:e,whiteboardView:t,box:i,pages:n}).mount();e.mountView(r.$whiteboardView),e.isAddApp&&t.callbacks.once("onSizeUpdated",({width:s,height:o})=>{if(n.length>0&&i.state!=="maximized"){const{width:a,height:l}=n[0],h=l/a*s-o;h!==0&&e.getIsWritable()&&e.emitter.emit("setBoxSize",{width:i.width,height:i.height+h/i.containerRect.height})}})}var bi={exports:{}},W={};/*
|
126
|
-
object-assign
|
127
|
-
(c) Sindre Sorhus
|
128
|
-
@license MIT
|
129
|
-
*/var Zu=Object.getOwnPropertySymbols,$y=Object.prototype.hasOwnProperty,Uy=Object.prototype.propertyIsEnumerable;function Wy(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function Hy(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},i=0;i<10;i++)t["_"+String.fromCharCode(i)]=i;var n=Object.getOwnPropertyNames(t).map(function(s){return t[s]});if(n.join("")!=="0123456789")return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(s){r[s]=s}),Object.keys(Object.assign({},r)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var Th=Hy()?Object.assign:function(e,t){for(var i,n=Wy(e),r,s=1;s<arguments.length;s++){i=Object(arguments[s]);for(var o in i)$y.call(i,o)&&(n[o]=i[o]);if(Zu){r=Zu(i);for(var a=0;a<r.length;a++)Uy.call(i,r[a])&&(n[r[a]]=i[r[a]])}}return n};/** @license React v16.14.0
|
130
|
-
* react.production.min.js
|
131
|
-
*
|
132
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
133
|
-
*
|
134
|
-
* This source code is licensed under the MIT license found in the
|
135
|
-
* LICENSE file in the root directory of this source tree.
|
136
|
-
*/var sl=Th,qe=typeof Symbol=="function"&&Symbol.for,Kn=qe?Symbol.for("react.element"):60103,Fy=qe?Symbol.for("react.portal"):60106,Qy=qe?Symbol.for("react.fragment"):60107,Zy=qe?Symbol.for("react.strict_mode"):60108,Yy=qe?Symbol.for("react.profiler"):60114,Gy=qe?Symbol.for("react.provider"):60109,Xy=qe?Symbol.for("react.context"):60110,Jy=qe?Symbol.for("react.forward_ref"):60112,Ky=qe?Symbol.for("react.suspense"):60113,qy=qe?Symbol.for("react.memo"):60115,e0=qe?Symbol.for("react.lazy"):60116,Yu=typeof Symbol=="function"&&Symbol.iterator;function qn(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var kh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Nh={};function Ki(e,t,i){this.props=e,this.context=t,this.refs=Nh,this.updater=i||kh}Ki.prototype.isReactComponent={};Ki.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error(qn(85));this.updater.enqueueSetState(this,e,t,"setState")};Ki.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ph(){}Ph.prototype=Ki.prototype;function ol(e,t,i){this.props=e,this.context=t,this.refs=Nh,this.updater=i||kh}var al=ol.prototype=new Ph;al.constructor=ol;sl(al,Ki.prototype);al.isPureReactComponent=!0;var ll={current:null},zh=Object.prototype.hasOwnProperty,Dh={key:!0,ref:!0,__self:!0,__source:!0};function jh(e,t,i){var n,r={},s=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)zh.call(t,n)&&!Dh.hasOwnProperty(n)&&(r[n]=t[n]);var a=arguments.length-2;if(a===1)r.children=i;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];r.children=l}if(e&&e.defaultProps)for(n in a=e.defaultProps,a)r[n]===void 0&&(r[n]=a[n]);return{$$typeof:Kn,type:e,key:s,ref:o,props:r,_owner:ll.current}}function t0(e,t){return{$$typeof:Kn,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ul(e){return typeof e=="object"&&e!==null&&e.$$typeof===Kn}function i0(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(i){return t[i]})}var Lh=/\/+/g,Jr=[];function Vh(e,t,i,n){if(Jr.length){var r=Jr.pop();return r.result=e,r.keyPrefix=t,r.func=i,r.context=n,r.count=0,r}return{result:e,keyPrefix:t,func:i,context:n,count:0}}function Rh(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>Jr.length&&Jr.push(e)}function Oo(e,t,i,n){var r=typeof e;(r==="undefined"||r==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(r){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Kn:case Fy:s=!0}}if(s)return i(n,e,t===""?"."+lo(e,0):t),1;if(s=0,t=t===""?".":t+":",Array.isArray(e))for(var o=0;o<e.length;o++){r=e[o];var a=t+lo(r,o);s+=Oo(r,a,i,n)}else if(e===null||typeof e!="object"?a=null:(a=Yu&&e[Yu]||e["@@iterator"],a=typeof a=="function"?a:null),typeof a=="function")for(e=a.call(e),o=0;!(r=e.next()).done;)r=r.value,a=t+lo(r,o++),s+=Oo(r,a,i,n);else if(r==="object")throw i=""+e,Error(qn(31,i==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":i,""));return s}function _o(e,t,i){return e==null?0:Oo(e,"",t,i)}function lo(e,t){return typeof e=="object"&&e!==null&&e.key!=null?i0(e.key):t.toString(36)}function n0(e,t){e.func.call(e.context,t,e.count++)}function r0(e,t,i){var n=e.result,r=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?$o(e,n,i,function(s){return s}):e!=null&&(ul(e)&&(e=t0(e,r+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(Lh,"$&/")+"/")+i)),n.push(e))}function $o(e,t,i,n,r){var s="";i!=null&&(s=(""+i).replace(Lh,"$&/")+"/"),t=Vh(t,s,n,r),_o(e,r0,t),Rh(t)}var Bh={current:null};function At(){var e=Bh.current;if(e===null)throw Error(qn(321));return e}var s0={ReactCurrentDispatcher:Bh,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:ll,IsSomeRendererActing:{current:!1},assign:sl};W.Children={map:function(e,t,i){if(e==null)return e;var n=[];return $o(e,n,null,t,i),n},forEach:function(e,t,i){if(e==null)return e;t=Vh(null,null,t,i),_o(e,n0,t),Rh(t)},count:function(e){return _o(e,function(){return null},null)},toArray:function(e){var t=[];return $o(e,t,null,function(i){return i}),t},only:function(e){if(!ul(e))throw Error(qn(143));return e}};W.Component=Ki;W.Fragment=Qy;W.Profiler=Yy;W.PureComponent=ol;W.StrictMode=Zy;W.Suspense=Ky;W.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=s0;W.cloneElement=function(e,t,i){if(e==null)throw Error(qn(267,e));var n=sl({},e.props),r=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=ll.current),t.key!==void 0&&(r=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)zh.call(t,l)&&!Dh.hasOwnProperty(l)&&(n[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)n.children=i;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];n.children=a}return{$$typeof:Kn,type:e.type,key:r,ref:s,props:n,_owner:o}};W.createContext=function(e,t){return t===void 0&&(t=null),e={$$typeof:Xy,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider={$$typeof:Gy,_context:e},e.Consumer=e};W.createElement=jh;W.createFactory=function(e){var t=jh.bind(null,e);return t.type=e,t};W.createRef=function(){return{current:null}};W.forwardRef=function(e){return{$$typeof:Jy,render:e}};W.isValidElement=ul;W.lazy=function(e){return{$$typeof:e0,_ctor:e,_status:-1,_result:null}};W.memo=function(e,t){return{$$typeof:qy,type:e,compare:t===void 0?null:t}};W.useCallback=function(e,t){return At().useCallback(e,t)};W.useContext=function(e,t){return At().useContext(e,t)};W.useDebugValue=function(){};W.useEffect=function(e,t){return At().useEffect(e,t)};W.useImperativeHandle=function(e,t,i){return At().useImperativeHandle(e,t,i)};W.useLayoutEffect=function(e,t){return At().useLayoutEffect(e,t)};W.useMemo=function(e,t){return At().useMemo(e,t)};W.useReducer=function(e,t,i){return At().useReducer(e,t,i)};W.useRef=function(e){return At().useRef(e)};W.useState=function(e){return At().useState(e)};W.version="16.14.0";bi.exports=W;var O=bi.exports,Oh={exports:{}},He={},_h={exports:{}},$h={};/** @license React v0.19.1
|
137
|
-
* scheduler.production.min.js
|
138
|
-
*
|
139
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
140
|
-
*
|
141
|
-
* This source code is licensed under the MIT license found in the
|
142
|
-
* LICENSE file in the root directory of this source tree.
|
143
|
-
*/(function(e){var t,i,n,r,s;if(typeof window=="undefined"||typeof MessageChannel!="function"){var o=null,a=null,l=function(){if(o!==null)try{var b=e.unstable_now();o(!0,b),o=null}catch(v){throw setTimeout(l,0),v}},u=Date.now();e.unstable_now=function(){return Date.now()-u},t=function(b){o!==null?setTimeout(t,0,b):(o=b,setTimeout(l,0))},i=function(b,v){a=setTimeout(b,v)},n=function(){clearTimeout(a)},r=function(){return!1},s=e.unstable_forceFrameRate=function(){}}else{var h=window.performance,p=window.Date,w=window.setTimeout,C=window.clearTimeout;if(typeof console!="undefined"){var E=window.cancelAnimationFrame;typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),typeof E!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if(typeof h=="object"&&typeof h.now=="function")e.unstable_now=function(){return h.now()};else{var T=p.now();e.unstable_now=function(){return p.now()-T}}var c=!1,d=null,f=-1,g=5,m=0;r=function(){return e.unstable_now()>=m},s=function(){},e.unstable_forceFrameRate=function(b){0>b||125<b?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):g=0<b?Math.floor(1e3/b):5};var x=new MessageChannel,y=x.port2;x.port1.onmessage=function(){if(d!==null){var b=e.unstable_now();m=b+g;try{d(!0,b)?y.postMessage(null):(c=!1,d=null)}catch(v){throw y.postMessage(null),v}}else c=!1},t=function(b){d=b,c||(c=!0,y.postMessage(null))},i=function(b,v){f=w(function(){b(e.unstable_now())},v)},n=function(){C(f),f=-1}}function N(b,v){var k=b.length;b.push(v);e:for(;;){var _=k-1>>>1,$=b[_];if($!==void 0&&0<J($,v))b[_]=v,b[k]=$,k=_;else break e}}function D(b){return b=b[0],b===void 0?null:b}function P(b){var v=b[0];if(v!==void 0){var k=b.pop();if(k!==v){b[0]=k;e:for(var _=0,$=b.length;_<$;){var ke=2*(_+1)-1,ve=b[ke],pt=ke+1,Tt=b[pt];if(ve!==void 0&&0>J(ve,k))Tt!==void 0&&0>J(Tt,ve)?(b[_]=Tt,b[pt]=k,_=pt):(b[_]=ve,b[ke]=k,_=ke);else if(Tt!==void 0&&0>J(Tt,k))b[_]=Tt,b[pt]=k,_=pt;else break e}}return v}return null}function J(b,v){var k=b.sortIndex-v.sortIndex;return k!==0?k:b.id-v.id}var q=[],ee=[],Fe=1,Q=null,G=3,Qe=!1,ae=!1,Oe=!1;function _e(b){for(var v=D(ee);v!==null;){if(v.callback===null)P(ee);else if(v.startTime<=b)P(ee),v.sortIndex=v.expirationTime,N(q,v);else break;v=D(ee)}}function ht(b){if(Oe=!1,_e(b),!ae)if(D(q)!==null)ae=!0,t(qt);else{var v=D(ee);v!==null&&i(ht,v.startTime-b)}}function qt(b,v){ae=!1,Oe&&(Oe=!1,n()),Qe=!0;var k=G;try{for(_e(v),Q=D(q);Q!==null&&(!(Q.expirationTime>v)||b&&!r());){var _=Q.callback;if(_!==null){Q.callback=null,G=Q.priorityLevel;var $=_(Q.expirationTime<=v);v=e.unstable_now(),typeof $=="function"?Q.callback=$:Q===D(q)&&P(q),_e(v)}else P(q);Q=D(q)}if(Q!==null)var ke=!0;else{var ve=D(ee);ve!==null&&i(ht,ve.startTime-v),ke=!1}return ke}finally{Q=null,G=k,Qe=!1}}function Et(b){switch(b){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var Ii=s;e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(b){b.callback=null},e.unstable_continueExecution=function(){ae||Qe||(ae=!0,t(qt))},e.unstable_getCurrentPriorityLevel=function(){return G},e.unstable_getFirstCallbackNode=function(){return D(q)},e.unstable_next=function(b){switch(G){case 1:case 2:case 3:var v=3;break;default:v=G}var k=G;G=v;try{return b()}finally{G=k}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=Ii,e.unstable_runWithPriority=function(b,v){switch(b){case 1:case 2:case 3:case 4:case 5:break;default:b=3}var k=G;G=b;try{return v()}finally{G=k}},e.unstable_scheduleCallback=function(b,v,k){var _=e.unstable_now();if(typeof k=="object"&&k!==null){var $=k.delay;$=typeof $=="number"&&0<$?_+$:_,k=typeof k.timeout=="number"?k.timeout:Et(b)}else k=Et(b),$=_;return k=$+k,b={id:Fe++,callback:v,priorityLevel:b,startTime:$,expirationTime:k,sortIndex:-1},$>_?(b.sortIndex=$,N(ee,b),D(q)===null&&b===D(ee)&&(Oe?n():Oe=!0,i(ht,$-_))):(b.sortIndex=k,N(q,b),ae||Qe||(ae=!0,t(qt))),b},e.unstable_shouldYield=function(){var b=e.unstable_now();_e(b);var v=D(q);return v!==Q&&Q!==null&&v!==null&&v.callback!==null&&v.startTime<=b&&v.expirationTime<Q.expirationTime||r()},e.unstable_wrapCallback=function(b){var v=G;return function(){var k=G;G=v;try{return b.apply(this,arguments)}finally{G=k}}}})($h);_h.exports=$h;/** @license React v16.14.0
|
144
|
-
* react-dom.production.min.js
|
145
|
-
*
|
146
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
147
|
-
*
|
148
|
-
* This source code is licensed under the MIT license found in the
|
149
|
-
* LICENSE file in the root directory of this source tree.
|
150
|
-
*/var Ls=bi.exports,xe=Th,ce=_h.exports;function S(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!Ls)throw Error(S(227));function o0(e,t,i,n,r,s,o,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(i,u)}catch(h){this.onError(h)}}var An=!1,Kr=null,qr=!1,Uo=null,a0={onError:function(e){An=!0,Kr=e}};function l0(e,t,i,n,r,s,o,a,l){An=!1,Kr=null,o0.apply(a0,arguments)}function u0(e,t,i,n,r,s,o,a,l){if(l0.apply(this,arguments),An){if(An){var u=Kr;An=!1,Kr=null}else throw Error(S(198));qr||(qr=!0,Uo=u)}}var cl=null,Uh=null,Wh=null;function Gu(e,t,i){var n=e.type||"unknown-event";e.currentTarget=Wh(i),u0(n,t,void 0,e),e.currentTarget=null}var es=null,Ei={};function Hh(){if(es)for(var e in Ei){var t=Ei[e],i=es.indexOf(e);if(!(-1<i))throw Error(S(96,e));if(!ts[i]){if(!t.extractEvents)throw Error(S(97,e));ts[i]=t,i=t.eventTypes;for(var n in i){var r=void 0,s=i[n],o=t,a=n;if(Wo.hasOwnProperty(a))throw Error(S(99,a));Wo[a]=s;var l=s.phasedRegistrationNames;if(l){for(r in l)l.hasOwnProperty(r)&&Xu(l[r],o,a);r=!0}else s.registrationName?(Xu(s.registrationName,o,a),r=!0):r=!1;if(!r)throw Error(S(98,n,e))}}}}function Xu(e,t,i){if(Fi[e])throw Error(S(100,e));Fi[e]=t,dl[e]=t.eventTypes[i].dependencies}var ts=[],Wo={},Fi={},dl={};function Fh(e){var t=!1,i;for(i in e)if(e.hasOwnProperty(i)){var n=e[i];if(!Ei.hasOwnProperty(i)||Ei[i]!==n){if(Ei[i])throw Error(S(102,i));Ei[i]=n,t=!0}}t&&Hh()}var Kt=!(typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"),Ho=null,Vi=null,Ri=null;function Ju(e){if(e=Uh(e)){if(typeof Ho!="function")throw Error(S(280));var t=e.stateNode;t&&(t=cl(t),Ho(e.stateNode,e.type,t))}}function Qh(e){Vi?Ri?Ri.push(e):Ri=[e]:Vi=e}function Zh(){if(Vi){var e=Vi,t=Ri;if(Ri=Vi=null,Ju(e),t)for(e=0;e<t.length;e++)Ju(t[e])}}function hl(e,t){return e(t)}function Yh(e,t,i,n,r){return e(t,i,n,r)}function pl(){}var Gh=hl,ni=!1,uo=!1;function fl(){(Vi!==null||Ri!==null)&&(pl(),Zh())}function Xh(e,t,i){if(uo)return e(t,i);uo=!0;try{return Gh(e,t,i)}finally{uo=!1,fl()}}var c0=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Ku=Object.prototype.hasOwnProperty,qu={},ec={};function d0(e){return Ku.call(ec,e)?!0:Ku.call(qu,e)?!1:c0.test(e)?ec[e]=!0:(qu[e]=!0,!1)}function h0(e,t,i,n){if(i!==null&&i.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:i!==null?!i.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function p0(e,t,i,n){if(t===null||typeof t=="undefined"||h0(e,t,i,n))return!0;if(n)return!1;if(i!==null)switch(i.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Se(e,t,i,n,r,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=r,this.mustUseProperty=i,this.propertyName=e,this.type=t,this.sanitizeURL=s}var de={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){de[e]=new Se(e,0,!1,e,null,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];de[t]=new Se(t,1,!1,e[1],null,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){de[e]=new Se(e,2,!1,e.toLowerCase(),null,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){de[e]=new Se(e,2,!1,e,null,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){de[e]=new Se(e,3,!1,e.toLowerCase(),null,!1)});["checked","multiple","muted","selected"].forEach(function(e){de[e]=new Se(e,3,!0,e,null,!1)});["capture","download"].forEach(function(e){de[e]=new Se(e,4,!1,e,null,!1)});["cols","rows","size","span"].forEach(function(e){de[e]=new Se(e,6,!1,e,null,!1)});["rowSpan","start"].forEach(function(e){de[e]=new Se(e,5,!1,e.toLowerCase(),null,!1)});var gl=/[\-:]([a-z])/g;function ml(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(gl,ml);de[t]=new Se(t,1,!1,e,null,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(gl,ml);de[t]=new Se(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(gl,ml);de[t]=new Se(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)});["tabIndex","crossOrigin"].forEach(function(e){de[e]=new Se(e,1,!1,e.toLowerCase(),null,!1)});de.xlinkHref=new Se("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0);["src","href","action","formAction"].forEach(function(e){de[e]=new Se(e,1,!1,e.toLowerCase(),null,!0)});var Je=Ls.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Je.hasOwnProperty("ReactCurrentDispatcher")||(Je.ReactCurrentDispatcher={current:null});Je.hasOwnProperty("ReactCurrentBatchConfig")||(Je.ReactCurrentBatchConfig={suspense:null});function vl(e,t,i,n){var r=de.hasOwnProperty(t)?de[t]:null,s=r!==null?r.type===0:n?!1:!(!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N");s||(p0(t,i,r,n)&&(i=null),n||r===null?d0(t)&&(i===null?e.removeAttribute(t):e.setAttribute(t,""+i)):r.mustUseProperty?e[r.propertyName]=i===null?r.type===3?!1:"":i:(t=r.attributeName,n=r.attributeNamespace,i===null?e.removeAttribute(t):(r=r.type,i=r===3||r===4&&i===!0?"":""+i,n?e.setAttributeNS(n,t,i):e.setAttribute(t,i))))}var f0=/^(.*)[\\\/]/,Te=typeof Symbol=="function"&&Symbol.for,fr=Te?Symbol.for("react.element"):60103,Ti=Te?Symbol.for("react.portal"):60106,ii=Te?Symbol.for("react.fragment"):60107,Jh=Te?Symbol.for("react.strict_mode"):60108,Pr=Te?Symbol.for("react.profiler"):60114,Kh=Te?Symbol.for("react.provider"):60109,qh=Te?Symbol.for("react.context"):60110,g0=Te?Symbol.for("react.concurrent_mode"):60111,wl=Te?Symbol.for("react.forward_ref"):60112,zr=Te?Symbol.for("react.suspense"):60113,Fo=Te?Symbol.for("react.suspense_list"):60120,yl=Te?Symbol.for("react.memo"):60115,ep=Te?Symbol.for("react.lazy"):60116,tp=Te?Symbol.for("react.block"):60121,tc=typeof Symbol=="function"&&Symbol.iterator;function sn(e){return e===null||typeof e!="object"?null:(e=tc&&e[tc]||e["@@iterator"],typeof e=="function"?e:null)}function m0(e){if(e._status===-1){e._status=0;var t=e._ctor;t=t(),e._result=t,t.then(function(i){e._status===0&&(i=i.default,e._status=1,e._result=i)},function(i){e._status===0&&(e._status=2,e._result=i)})}}function Mt(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ii:return"Fragment";case Ti:return"Portal";case Pr:return"Profiler";case Jh:return"StrictMode";case zr:return"Suspense";case Fo:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case qh:return"Context.Consumer";case Kh:return"Context.Provider";case wl:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case yl:return Mt(e.type);case tp:return Mt(e.render);case ep:if(e=e._status===1?e._result:null)return Mt(e)}return null}function xl(e){var t="";do{e:switch(e.tag){case 3:case 4:case 6:case 7:case 10:case 9:var i="";break e;default:var n=e._debugOwner,r=e._debugSource,s=Mt(e.type);i=null,n&&(i=Mt(n.type)),n=s,s="",r?s=" (at "+r.fileName.replace(f0,"")+":"+r.lineNumber+")":i&&(s=" (created by "+i+")"),i=`
|
151
|
-
in `+(n||"Unknown")+s}t+=i,e=e.return}while(e);return t}function Yt(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function ip(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function v0(e){var t=ip(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof i!="undefined"&&typeof i.get=="function"&&typeof i.set=="function"){var r=i.get,s=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function gr(e){e._valueTracker||(e._valueTracker=v0(e))}function np(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),n="";return e&&(n=ip(e)?e.checked?"true":"false":e.value),e=n,e!==i?(t.setValue(e),!0):!1}function Qo(e,t){var i=t.checked;return xe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i!=null?i:e._wrapperState.initialChecked})}function ic(e,t){var i=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;i=Yt(t.value!=null?t.value:i),e._wrapperState={initialChecked:n,initialValue:i,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function rp(e,t){t=t.checked,t!=null&&vl(e,"checked",t,!1)}function Zo(e,t){rp(e,t);var i=Yt(t.value),n=t.type;if(i!=null)n==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+i):e.value!==""+i&&(e.value=""+i);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Yo(e,t.type,i):t.hasOwnProperty("defaultValue")&&Yo(e,t.type,Yt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function nc(e,t,i){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,i||t===e.value||(e.value=t),e.defaultValue=t}i=e.name,i!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,i!==""&&(e.name=i)}function Yo(e,t,i){(t!=="number"||e.ownerDocument.activeElement!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}function w0(e){var t="";return Ls.Children.forEach(e,function(i){i!=null&&(t+=i)}),t}function Go(e,t){return e=xe({children:void 0},t),(t=w0(t.children))&&(e.children=t),e}function Bi(e,t,i,n){if(e=e.options,t){t={};for(var r=0;r<i.length;r++)t["$"+i[r]]=!0;for(i=0;i<e.length;i++)r=t.hasOwnProperty("$"+e[i].value),e[i].selected!==r&&(e[i].selected=r),r&&n&&(e[i].defaultSelected=!0)}else{for(i=""+Yt(i),t=null,r=0;r<e.length;r++){if(e[r].value===i){e[r].selected=!0,n&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function Xo(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(S(91));return xe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function rc(e,t){var i=t.value;if(i==null){if(i=t.children,t=t.defaultValue,i!=null){if(t!=null)throw Error(S(92));if(Array.isArray(i)){if(!(1>=i.length))throw Error(S(93));i=i[0]}t=i}t==null&&(t=""),i=t}e._wrapperState={initialValue:Yt(i)}}function sp(e,t){var i=Yt(t.value),n=Yt(t.defaultValue);i!=null&&(i=""+i,i!==e.value&&(e.value=i),t.defaultValue==null&&e.defaultValue!==i&&(e.defaultValue=i)),n!=null&&(e.defaultValue=""+n)}function sc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}var op={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function ap(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Jo(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?ap(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var mr,lp=function(e){return typeof MSApp!="undefined"&&MSApp.execUnsafeLocalFunction?function(t,i,n,r){MSApp.execUnsafeLocalFunction(function(){return e(t,i,n,r)})}:e}(function(e,t){if(e.namespaceURI!==op.svg||"innerHTML"in e)e.innerHTML=t;else{for(mr=mr||document.createElement("div"),mr.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=mr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Bn(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}function vr(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var ki={animationend:vr("Animation","AnimationEnd"),animationiteration:vr("Animation","AnimationIteration"),animationstart:vr("Animation","AnimationStart"),transitionend:vr("Transition","TransitionEnd")},co={},up={};Kt&&(up=document.createElement("div").style,"AnimationEvent"in window||(delete ki.animationend.animation,delete ki.animationiteration.animation,delete ki.animationstart.animation),"TransitionEvent"in window||delete ki.transitionend.transition);function Vs(e){if(co[e])return co[e];if(!ki[e])return e;var t=ki[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in up)return co[e]=t[i];return e}var cp=Vs("animationend"),dp=Vs("animationiteration"),hp=Vs("animationstart"),pp=Vs("transitionend"),mn="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),oc=new(typeof WeakMap=="function"?WeakMap:Map);function Sl(e){var t=oc.get(e);return t===void 0&&(t=new Map,oc.set(e,t)),t}function Mi(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.effectTag&1026)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function fp(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function ac(e){if(Mi(e)!==e)throw Error(S(188))}function y0(e){var t=e.alternate;if(!t){if(t=Mi(e),t===null)throw Error(S(188));return t!==e?null:e}for(var i=e,n=t;;){var r=i.return;if(r===null)break;var s=r.alternate;if(s===null){if(n=r.return,n!==null){i=n;continue}break}if(r.child===s.child){for(s=r.child;s;){if(s===i)return ac(r),e;if(s===n)return ac(r),t;s=s.sibling}throw Error(S(188))}if(i.return!==n.return)i=r,n=s;else{for(var o=!1,a=r.child;a;){if(a===i){o=!0,i=r,n=s;break}if(a===n){o=!0,n=r,i=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===i){o=!0,i=s,n=r;break}if(a===n){o=!0,n=s,i=r;break}a=a.sibling}if(!o)throw Error(S(189))}}if(i.alternate!==n)throw Error(S(190))}if(i.tag!==3)throw Error(S(188));return i.stateNode.current===i?e:t}function gp(e){if(e=y0(e),!e)return null;for(var t=e;;){if(t.tag===5||t.tag===6)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function Qi(e,t){if(t==null)throw Error(S(30));return e==null?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function Cl(e,t,i){Array.isArray(e)?e.forEach(t,i):e&&t.call(i,e)}var on=null;function x0(e){if(e){var t=e._dispatchListeners,i=e._dispatchInstances;if(Array.isArray(t))for(var n=0;n<t.length&&!e.isPropagationStopped();n++)Gu(e,t[n],i[n]);else t&&Gu(e,t,i);e._dispatchListeners=null,e._dispatchInstances=null,e.isPersistent()||e.constructor.release(e)}}function Rs(e){if(e!==null&&(on=Qi(on,e)),e=on,on=null,e){if(Cl(e,x0),on)throw Error(S(95));if(qr)throw e=Uo,qr=!1,Uo=null,e}}function bl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}function mp(e){if(!Kt)return!1;e="on"+e;var t=e in document;return t||(t=document.createElement("div"),t.setAttribute(e,"return;"),t=typeof t[e]=="function"),t}var is=[];function vp(e){e.topLevelType=null,e.nativeEvent=null,e.targetInst=null,e.ancestors.length=0,10>is.length&&is.push(e)}function wp(e,t,i,n){if(is.length){var r=is.pop();return r.topLevelType=e,r.eventSystemFlags=n,r.nativeEvent=t,r.targetInst=i,r}return{topLevelType:e,eventSystemFlags:n,nativeEvent:t,targetInst:i,ancestors:[]}}function yp(e){var t=e.targetInst,i=t;do{if(!i){e.ancestors.push(i);break}var n=i;if(n.tag===3)n=n.stateNode.containerInfo;else{for(;n.return;)n=n.return;n=n.tag!==3?null:n.stateNode.containerInfo}if(!n)break;t=i.tag,t!==5&&t!==6||e.ancestors.push(i),i=tr(n)}while(i);for(i=0;i<e.ancestors.length;i++){t=e.ancestors[i];var r=bl(e.nativeEvent);n=e.topLevelType;var s=e.nativeEvent,o=e.eventSystemFlags;i===0&&(o|=64);for(var a=null,l=0;l<ts.length;l++){var u=ts[l];u&&(u=u.extractEvents(n,t,s,r,o))&&(a=Qi(a,u))}Rs(a)}}function Ko(e,t,i){if(!i.has(e)){switch(e){case"scroll":vn(t,"scroll",!0);break;case"focus":case"blur":vn(t,"focus",!0),vn(t,"blur",!0),i.set("blur",null),i.set("focus",null);break;case"cancel":case"close":mp(e)&&vn(t,e,!0);break;case"invalid":case"submit":case"reset":break;default:mn.indexOf(e)===-1&&X(e,t)}i.set(e,null)}}var xp,Ml,Sp,qo=!1,st=[],_t=null,$t=null,Ut=null,On=new Map,_n=new Map,an=[],ea="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput close cancel copy cut paste click change contextmenu reset submit".split(" "),S0="focus blur dragenter dragleave mouseover mouseout pointerover pointerout gotpointercapture lostpointercapture".split(" ");function C0(e,t){var i=Sl(t);ea.forEach(function(n){Ko(n,t,i)}),S0.forEach(function(n){Ko(n,t,i)})}function ta(e,t,i,n,r){return{blockedOn:e,topLevelType:t,eventSystemFlags:i|32,nativeEvent:r,container:n}}function lc(e,t){switch(e){case"focus":case"blur":_t=null;break;case"dragenter":case"dragleave":$t=null;break;case"mouseover":case"mouseout":Ut=null;break;case"pointerover":case"pointerout":On.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":_n.delete(t.pointerId)}}function ln(e,t,i,n,r,s){return e===null||e.nativeEvent!==s?(e=ta(t,i,n,r,s),t!==null&&(t=ir(t),t!==null&&Ml(t)),e):(e.eventSystemFlags|=n,e)}function b0(e,t,i,n,r){switch(t){case"focus":return _t=ln(_t,e,t,i,n,r),!0;case"dragenter":return $t=ln($t,e,t,i,n,r),!0;case"mouseover":return Ut=ln(Ut,e,t,i,n,r),!0;case"pointerover":var s=r.pointerId;return On.set(s,ln(On.get(s)||null,e,t,i,n,r)),!0;case"gotpointercapture":return s=r.pointerId,_n.set(s,ln(_n.get(s)||null,e,t,i,n,r)),!0}return!1}function M0(e){var t=tr(e.target);if(t!==null){var i=Mi(t);if(i!==null){if(t=i.tag,t===13){if(t=fp(i),t!==null){e.blockedOn=t,ce.unstable_runWithPriority(e.priority,function(){Sp(i)});return}}else if(t===3&&i.stateNode.hydrate){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dr(e){if(e.blockedOn!==null)return!1;var t=El(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);if(t!==null){var i=ir(t);return i!==null&&Ml(i),e.blockedOn=t,!1}return!0}function uc(e,t,i){Dr(e)&&i.delete(t)}function I0(){for(qo=!1;0<st.length;){var e=st[0];if(e.blockedOn!==null){e=ir(e.blockedOn),e!==null&&xp(e);break}var t=El(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);t!==null?e.blockedOn=t:st.shift()}_t!==null&&Dr(_t)&&(_t=null),$t!==null&&Dr($t)&&($t=null),Ut!==null&&Dr(Ut)&&(Ut=null),On.forEach(uc),_n.forEach(uc)}function un(e,t){e.blockedOn===t&&(e.blockedOn=null,qo||(qo=!0,ce.unstable_scheduleCallback(ce.unstable_NormalPriority,I0)))}function Cp(e){function t(r){return un(r,e)}if(0<st.length){un(st[0],e);for(var i=1;i<st.length;i++){var n=st[i];n.blockedOn===e&&(n.blockedOn=null)}}for(_t!==null&&un(_t,e),$t!==null&&un($t,e),Ut!==null&&un(Ut,e),On.forEach(t),_n.forEach(t),i=0;i<an.length;i++)n=an[i],n.blockedOn===e&&(n.blockedOn=null);for(;0<an.length&&(i=an[0],i.blockedOn===null);)M0(i),i.blockedOn===null&&an.shift()}var bp={},Mp=new Map,Il=new Map,A0=["abort","abort",cp,"animationEnd",dp,"animationIteration",hp,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",pp,"transitionEnd","waiting","waiting"];function Al(e,t){for(var i=0;i<e.length;i+=2){var n=e[i],r=e[i+1],s="on"+(r[0].toUpperCase()+r.slice(1));s={phasedRegistrationNames:{bubbled:s,captured:s+"Capture"},dependencies:[n],eventPriority:t},Il.set(n,t),Mp.set(n,s),bp[r]=s}}Al("blur blur cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focus focus input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0);Al("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1);Al(A0,2);for(var cc="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),ho=0;ho<cc.length;ho++)Il.set(cc[ho],0);var E0=ce.unstable_UserBlockingPriority,T0=ce.unstable_runWithPriority,jr=!0;function X(e,t){vn(t,e,!1)}function vn(e,t,i){var n=Il.get(t);switch(n===void 0?2:n){case 0:n=k0.bind(null,t,1,e);break;case 1:n=N0.bind(null,t,1,e);break;default:n=Bs.bind(null,t,1,e)}i?e.addEventListener(t,n,!0):e.addEventListener(t,n,!1)}function k0(e,t,i,n){ni||pl();var r=Bs,s=ni;ni=!0;try{Yh(r,e,t,i,n)}finally{(ni=s)||fl()}}function N0(e,t,i,n){T0(E0,Bs.bind(null,e,t,i,n))}function Bs(e,t,i,n){if(jr)if(0<st.length&&-1<ea.indexOf(e))e=ta(null,e,t,i,n),st.push(e);else{var r=El(e,t,i,n);if(r===null)lc(e,n);else if(-1<ea.indexOf(e))e=ta(r,e,t,i,n),st.push(e);else if(!b0(r,e,t,i,n)){lc(e,n),e=wp(e,n,null,t);try{Xh(yp,e)}finally{vp(e)}}}}function El(e,t,i,n){if(i=bl(n),i=tr(i),i!==null){var r=Mi(i);if(r===null)i=null;else{var s=r.tag;if(s===13){if(i=fp(r),i!==null)return i;i=null}else if(s===3){if(r.stateNode.hydrate)return r.tag===3?r.stateNode.containerInfo:null;i=null}else r!==i&&(i=null)}}e=wp(e,n,i,t);try{Xh(yp,e)}finally{vp(e)}return null}var En={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},P0=["Webkit","ms","Moz","O"];Object.keys(En).forEach(function(e){P0.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),En[t]=En[e]})});function Ip(e,t,i){return t==null||typeof t=="boolean"||t===""?"":i||typeof t!="number"||t===0||En.hasOwnProperty(e)&&En[e]?(""+t).trim():t+"px"}function Ap(e,t){e=e.style;for(var i in t)if(t.hasOwnProperty(i)){var n=i.indexOf("--")===0,r=Ip(i,t[i],n);i==="float"&&(i="cssFloat"),n?e.setProperty(i,r):e[i]=r}}var z0=xe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ia(e,t){if(t){if(z0[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(S(137,e,""));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(S(60));if(!(typeof t.dangerouslySetInnerHTML=="object"&&"__html"in t.dangerouslySetInnerHTML))throw Error(S(61))}if(t.style!=null&&typeof t.style!="object")throw Error(S(62,""))}}function na(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var dc=op.html;function mt(e,t){e=e.nodeType===9||e.nodeType===11?e:e.ownerDocument;var i=Sl(e);t=dl[t];for(var n=0;n<t.length;n++)Ko(t[n],e,i)}function ns(){}function ra(e){if(e=e||(typeof document!="undefined"?document:void 0),typeof e=="undefined")return null;try{return e.activeElement||e.body}catch{return e.body}}function hc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pc(e,t){var i=hc(e);e=0;for(var n;i;){if(i.nodeType===3){if(n=e+i.textContent.length,e<=t&&n>=t)return{node:i,offset:t-e};e=n}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=hc(i)}}function Ep(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ep(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function fc(){for(var e=window,t=ra();t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=ra(e.document)}return t}function sa(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Tp="$",kp="/$",Tl="$?",kl="$!",po=null,fo=null;function Np(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function oa(e,t){return e==="textarea"||e==="option"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var go=typeof setTimeout=="function"?setTimeout:void 0,D0=typeof clearTimeout=="function"?clearTimeout:void 0;function Oi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break}return e}function gc(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i===Tp||i===kl||i===Tl){if(t===0)return e;t--}else i===kp&&t++}e=e.previousSibling}return null}var Nl=Math.random().toString(36).slice(2),Dt="__reactInternalInstance$"+Nl,rs="__reactEventHandlers$"+Nl,er="__reactContainere$"+Nl;function tr(e){var t=e[Dt];if(t)return t;for(var i=e.parentNode;i;){if(t=i[er]||i[Dt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=gc(e);e!==null;){if(i=e[Dt])return i;e=gc(e)}return t}e=i,i=e.parentNode}return null}function ir(e){return e=e[Dt]||e[er],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function vi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(S(33))}function Pl(e){return e[rs]||null}function vt(e){do e=e.return;while(e&&e.tag!==5);return e||null}function Pp(e,t){var i=e.stateNode;if(!i)return null;var n=cl(i);if(!n)return null;i=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(S(231,t,typeof i));return i}function mc(e,t,i){(t=Pp(e,i.dispatchConfig.phasedRegistrationNames[t]))&&(i._dispatchListeners=Qi(i._dispatchListeners,t),i._dispatchInstances=Qi(i._dispatchInstances,e))}function j0(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,i=[];t;)i.push(t),t=vt(t);for(t=i.length;0<t--;)mc(i[t],"captured",e);for(t=0;t<i.length;t++)mc(i[t],"bubbled",e)}}function aa(e,t,i){e&&i&&i.dispatchConfig.registrationName&&(t=Pp(e,i.dispatchConfig.registrationName))&&(i._dispatchListeners=Qi(i._dispatchListeners,t),i._dispatchInstances=Qi(i._dispatchInstances,e))}function L0(e){e&&e.dispatchConfig.registrationName&&aa(e._targetInst,null,e)}function Zi(e){Cl(e,j0)}var jt=null,zl=null,Lr=null;function zp(){if(Lr)return Lr;var e,t=zl,i=t.length,n,r="value"in jt?jt.value:jt.textContent,s=r.length;for(e=0;e<i&&t[e]===r[e];e++);var o=i-e;for(n=1;n<=o&&t[i-n]===r[s-n];n++);return Lr=r.slice(e,1<n?1-n:void 0)}function Vr(){return!0}function ss(){return!1}function Be(e,t,i,n){this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=i,e=this.constructor.Interface;for(var r in e)e.hasOwnProperty(r)&&((t=e[r])?this[r]=t(i):r==="target"?this.target=n:this[r]=i[r]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Vr:ss,this.isPropagationStopped=ss,this}xe(Be.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!="unknown"&&(e.returnValue=!1),this.isDefaultPrevented=Vr)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!="unknown"&&(e.cancelBubble=!0),this.isPropagationStopped=Vr)},persist:function(){this.isPersistent=Vr},isPersistent:ss,destructor:function(){var e=this.constructor.Interface,t;for(t in e)this[t]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=ss,this._dispatchInstances=this._dispatchListeners=null}});Be.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};Be.extend=function(e){function t(){}function i(){return n.apply(this,arguments)}var n=this;t.prototype=n.prototype;var r=new t;return xe(r,i.prototype),i.prototype=r,i.prototype.constructor=i,i.Interface=xe({},n.Interface,e),i.extend=n.extend,Dp(i),i};Dp(Be);function V0(e,t,i,n){if(this.eventPool.length){var r=this.eventPool.pop();return this.call(r,e,t,i,n),r}return new this(e,t,i,n)}function R0(e){if(!(e instanceof this))throw Error(S(279));e.destructor(),10>this.eventPool.length&&this.eventPool.push(e)}function Dp(e){e.eventPool=[],e.getPooled=V0,e.release=R0}var B0=Be.extend({data:null}),O0=Be.extend({data:null}),_0=[9,13,27,32],Dl=Kt&&"CompositionEvent"in window,Tn=null;Kt&&"documentMode"in document&&(Tn=document.documentMode);var $0=Kt&&"TextEvent"in window&&!Tn,jp=Kt&&(!Dl||Tn&&8<Tn&&11>=Tn),vc=String.fromCharCode(32),gt={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},wc=!1;function Lp(e,t){switch(e){case"keyup":return _0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function Vp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ni=!1;function U0(e,t){switch(e){case"compositionend":return Vp(t);case"keypress":return t.which!==32?null:(wc=!0,vc);case"textInput":return e=t.data,e===vc&&wc?null:e;default:return null}}function W0(e,t){if(Ni)return e==="compositionend"||!Dl&&Lp(e,t)?(e=zp(),Lr=zl=jt=null,Ni=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return jp&&t.locale!=="ko"?null:t.data;default:return null}}var H0={eventTypes:gt,extractEvents:function(e,t,i,n){var r;if(Dl)e:{switch(e){case"compositionstart":var s=gt.compositionStart;break e;case"compositionend":s=gt.compositionEnd;break e;case"compositionupdate":s=gt.compositionUpdate;break e}s=void 0}else Ni?Lp(e,i)&&(s=gt.compositionEnd):e==="keydown"&&i.keyCode===229&&(s=gt.compositionStart);return s?(jp&&i.locale!=="ko"&&(Ni||s!==gt.compositionStart?s===gt.compositionEnd&&Ni&&(r=zp()):(jt=n,zl="value"in jt?jt.value:jt.textContent,Ni=!0)),s=B0.getPooled(s,t,i,n),r?s.data=r:(r=Vp(i),r!==null&&(s.data=r)),Zi(s),r=s):r=null,(e=$0?U0(e,i):W0(e,i))?(t=O0.getPooled(gt.beforeInput,t,i,n),t.data=e,Zi(t)):t=null,r===null?t:t===null?r:[r,t]}},F0={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Rp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!F0[e.type]:t==="textarea"}var Bp={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}};function Op(e,t,i){return e=Be.getPooled(Bp.change,e,t,i),e.type="change",Qh(i),Zi(e),e}var kn=null,$n=null;function Q0(e){Rs(e)}function Os(e){var t=vi(e);if(np(t))return e}function Z0(e,t){if(e==="change")return t}var la=!1;Kt&&(la=mp("input")&&(!document.documentMode||9<document.documentMode));function yc(){kn&&(kn.detachEvent("onpropertychange",_p),$n=kn=null)}function _p(e){if(e.propertyName==="value"&&Os($n))if(e=Op($n,e,bl(e)),ni)Rs(e);else{ni=!0;try{hl(Q0,e)}finally{ni=!1,fl()}}}function Y0(e,t,i){e==="focus"?(yc(),kn=t,$n=i,kn.attachEvent("onpropertychange",_p)):e==="blur"&&yc()}function G0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Os($n)}function X0(e,t){if(e==="click")return Os(t)}function J0(e,t){if(e==="input"||e==="change")return Os(t)}var K0={eventTypes:Bp,_isInputEventSupported:la,extractEvents:function(e,t,i,n){var r=t?vi(t):window,s=r.nodeName&&r.nodeName.toLowerCase();if(s==="select"||s==="input"&&r.type==="file")var o=Z0;else if(Rp(r))if(la)o=J0;else{o=G0;var a=Y0}else(s=r.nodeName)&&s.toLowerCase()==="input"&&(r.type==="checkbox"||r.type==="radio")&&(o=X0);if(o&&(o=o(e,t)))return Op(o,i,n);a&&a(e,r,t),e==="blur"&&(e=r._wrapperState)&&e.controlled&&r.type==="number"&&Yo(r,"number",r.value)}},nr=Be.extend({view:null,detail:null}),q0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ex(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=q0[e])?!!t[e]:!1}function jl(){return ex}var xc=0,Sc=0,Cc=!1,bc=!1,rr=nr.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:jl,button:null,buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},movementX:function(e){if("movementX"in e)return e.movementX;var t=xc;return xc=e.screenX,Cc?e.type==="mousemove"?e.screenX-t:0:(Cc=!0,0)},movementY:function(e){if("movementY"in e)return e.movementY;var t=Sc;return Sc=e.screenY,bc?e.type==="mousemove"?e.screenY-t:0:(bc=!0,0)}}),$p=rr.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),cn={mouseEnter:{registrationName:"onMouseEnter",dependencies:["mouseout","mouseover"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["mouseout","mouseover"]},pointerEnter:{registrationName:"onPointerEnter",dependencies:["pointerout","pointerover"]},pointerLeave:{registrationName:"onPointerLeave",dependencies:["pointerout","pointerover"]}},tx={eventTypes:cn,extractEvents:function(e,t,i,n,r){var s=e==="mouseover"||e==="pointerover",o=e==="mouseout"||e==="pointerout";if(s&&(r&32)===0&&(i.relatedTarget||i.fromElement)||!o&&!s)return null;if(s=n.window===n?n:(s=n.ownerDocument)?s.defaultView||s.parentWindow:window,o){if(o=t,t=(t=i.relatedTarget||i.toElement)?tr(t):null,t!==null){var a=Mi(t);(t!==a||t.tag!==5&&t.tag!==6)&&(t=null)}}else o=null;if(o===t)return null;if(e==="mouseout"||e==="mouseover")var l=rr,u=cn.mouseLeave,h=cn.mouseEnter,p="mouse";else(e==="pointerout"||e==="pointerover")&&(l=$p,u=cn.pointerLeave,h=cn.pointerEnter,p="pointer");if(e=o==null?s:vi(o),s=t==null?s:vi(t),u=l.getPooled(u,o,i,n),u.type=p+"leave",u.target=e,u.relatedTarget=s,i=l.getPooled(h,t,i,n),i.type=p+"enter",i.target=s,i.relatedTarget=e,n=o,p=t,n&&p)e:{for(l=n,h=p,o=0,e=l;e;e=vt(e))o++;for(e=0,t=h;t;t=vt(t))e++;for(;0<o-e;)l=vt(l),o--;for(;0<e-o;)h=vt(h),e--;for(;o--;){if(l===h||l===h.alternate)break e;l=vt(l),h=vt(h)}l=null}else l=null;for(h=l,l=[];n&&n!==h&&(o=n.alternate,!(o!==null&&o===h));)l.push(n),n=vt(n);for(n=[];p&&p!==h&&(o=p.alternate,!(o!==null&&o===h));)n.push(p),p=vt(p);for(p=0;p<l.length;p++)aa(l[p],"bubbled",u);for(p=n.length;0<p--;)aa(n[p],"captured",i);return(r&64)===0?[u]:[u,i]}};function ix(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var wi=typeof Object.is=="function"?Object.is:ix,nx=Object.prototype.hasOwnProperty;function Un(e,t){if(wi(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),n=Object.keys(t);if(i.length!==n.length)return!1;for(n=0;n<i.length;n++)if(!nx.call(t,i[n])||!wi(e[i[n]],t[i[n]]))return!1;return!0}var rx=Kt&&"documentMode"in document&&11>=document.documentMode,Up={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Pi=null,ua=null,Nn=null,ca=!1;function Mc(e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;return ca||Pi==null||Pi!==ra(i)?null:(i=Pi,"selectionStart"in i&&sa(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Nn&&Un(Nn,i)?null:(Nn=i,e=Be.getPooled(Up.select,ua,e,t),e.type="select",e.target=Pi,Zi(e),e))}var sx={eventTypes:Up,extractEvents:function(e,t,i,n,r,s){if(r=s||(n.window===n?n.document:n.nodeType===9?n:n.ownerDocument),!(s=!r)){e:{r=Sl(r),s=dl.onSelect;for(var o=0;o<s.length;o++)if(!r.has(s[o])){r=!1;break e}r=!0}s=!r}if(s)return null;switch(r=t?vi(t):window,e){case"focus":(Rp(r)||r.contentEditable==="true")&&(Pi=r,ua=t,Nn=null);break;case"blur":Nn=ua=Pi=null;break;case"mousedown":ca=!0;break;case"contextmenu":case"mouseup":case"dragend":return ca=!1,Mc(i,n);case"selectionchange":if(rx)break;case"keydown":case"keyup":return Mc(i,n)}return null}},ox=Be.extend({animationName:null,elapsedTime:null,pseudoElement:null}),ax=Be.extend({clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),lx=nr.extend({relatedTarget:null});function Rr(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}var ux={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cx={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},dx=nr.extend({key:function(e){if(e.key){var t=ux[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Rr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?cx[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:jl,charCode:function(e){return e.type==="keypress"?Rr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Rr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),hx=rr.extend({dataTransfer:null}),px=nr.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:jl}),fx=Be.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),gx=rr.extend({deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),mx={eventTypes:bp,extractEvents:function(e,t,i,n){var r=Mp.get(e);if(!r)return null;switch(e){case"keypress":if(Rr(i)===0)return null;case"keydown":case"keyup":e=dx;break;case"blur":case"focus":e=lx;break;case"click":if(i.button===2)return null;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":e=rr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":e=hx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":e=px;break;case cp:case dp:case hp:e=ox;break;case pp:e=fx;break;case"scroll":e=nr;break;case"wheel":e=gx;break;case"copy":case"cut":case"paste":e=ax;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":e=$p;break;default:e=Be}return t=e.getPooled(r,t,i,n),Zi(t),t}};if(es)throw Error(S(101));es=Array.prototype.slice.call("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" "));Hh();var vx=ir;cl=Pl;Uh=vx;Wh=vi;Fh({SimpleEventPlugin:mx,EnterLeaveEventPlugin:tx,ChangeEventPlugin:K0,SelectEventPlugin:sx,BeforeInputEventPlugin:H0});var da=[],zi=-1;function Y(e){0>zi||(e.current=da[zi],da[zi]=null,zi--)}function ie(e,t){zi++,da[zi]=e.current,e.current=t}var Gt={},me={current:Gt},Ie={current:!1},yi=Gt;function Yi(e,t){var i=e.type.contextTypes;if(!i)return Gt;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var r={},s;for(s in i)r[s]=t[s];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=r),r}function Ae(e){return e=e.childContextTypes,e!=null}function os(){Y(Ie),Y(me)}function Ic(e,t,i){if(me.current!==Gt)throw Error(S(168));ie(me,t),ie(Ie,i)}function Wp(e,t,i){var n=e.stateNode;if(e=t.childContextTypes,typeof n.getChildContext!="function")return i;n=n.getChildContext();for(var r in n)if(!(r in e))throw Error(S(108,Mt(t)||"Unknown",r));return xe({},i,{},n)}function Br(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Gt,yi=me.current,ie(me,e),ie(Ie,Ie.current),!0}function Ac(e,t,i){var n=e.stateNode;if(!n)throw Error(S(169));i?(e=Wp(e,t,yi),n.__reactInternalMemoizedMergedChildContext=e,Y(Ie),Y(me),ie(me,e)):Y(Ie),ie(Ie,i)}var wx=ce.unstable_runWithPriority,Ll=ce.unstable_scheduleCallback,Hp=ce.unstable_cancelCallback,Ec=ce.unstable_requestPaint,ha=ce.unstable_now,yx=ce.unstable_getCurrentPriorityLevel,_s=ce.unstable_ImmediatePriority,Fp=ce.unstable_UserBlockingPriority,Qp=ce.unstable_NormalPriority,Zp=ce.unstable_LowPriority,Yp=ce.unstable_IdlePriority,Gp={},xx=ce.unstable_shouldYield,Sx=Ec!==void 0?Ec:function(){},yt=null,Or=null,mo=!1,Tc=ha(),$e=1e4>Tc?ha:function(){return ha()-Tc};function $s(){switch(yx()){case _s:return 99;case Fp:return 98;case Qp:return 97;case Zp:return 96;case Yp:return 95;default:throw Error(S(332))}}function Xp(e){switch(e){case 99:return _s;case 98:return Fp;case 97:return Qp;case 96:return Zp;case 95:return Yp;default:throw Error(S(332))}}function Xt(e,t){return e=Xp(e),wx(e,t)}function Jp(e,t,i){return e=Xp(e),Ll(e,t,i)}function kc(e){return yt===null?(yt=[e],Or=Ll(_s,Kp)):yt.push(e),Gp}function dt(){if(Or!==null){var e=Or;Or=null,Hp(e)}Kp()}function Kp(){if(!mo&&yt!==null){mo=!0;var e=0;try{var t=yt;Xt(99,function(){for(;e<t.length;e++){var i=t[e];do i=i(!0);while(i!==null)}}),yt=null}catch(i){throw yt!==null&&(yt=yt.slice(e+1)),Ll(_s,dt),i}finally{mo=!1}}}function _r(e,t,i){return i/=10,1073741821-(((1073741821-e+t/10)/i|0)+1)*i}function Ge(e,t){if(e&&e.defaultProps){t=xe({},t),e=e.defaultProps;for(var i in e)t[i]===void 0&&(t[i]=e[i])}return t}var as={current:null},ls=null,Di=null,us=null;function Vl(){us=Di=ls=null}function Rl(e){var t=as.current;Y(as),e.type._context._currentValue=t}function qp(e,t){for(;e!==null;){var i=e.alternate;if(e.childExpirationTime<t)e.childExpirationTime=t,i!==null&&i.childExpirationTime<t&&(i.childExpirationTime=t);else if(i!==null&&i.childExpirationTime<t)i.childExpirationTime=t;else break;e=e.return}}function _i(e,t){ls=e,us=Di=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.expirationTime>=t&&(ot=!0),e.firstContext=null)}function We(e,t){if(us!==e&&t!==!1&&t!==0)if((typeof t!="number"||t===1073741823)&&(us=e,t=1073741823),t={context:e,observedBits:t,next:null},Di===null){if(ls===null)throw Error(S(308));Di=t,ls.dependencies={expirationTime:0,firstContext:t,responders:null}}else Di=Di.next=t;return e._currentValue}var Pt=!1;function Bl(e){e.updateQueue={baseState:e.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}function Ol(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,baseQueue:e.baseQueue,shared:e.shared,effects:e.effects})}function Wt(e,t){return e={expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null},e.next=e}function Ht(e,t){if(e=e.updateQueue,e!==null){e=e.shared;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}}function Nc(e,t){var i=e.alternate;i!==null&&Ol(i,e),e=e.updateQueue,i=e.baseQueue,i===null?(e.baseQueue=t.next=t,t.next=t):(t.next=i.next,i.next=t)}function Wn(e,t,i,n){var r=e.updateQueue;Pt=!1;var s=r.baseQueue,o=r.shared.pending;if(o!==null){if(s!==null){var a=s.next;s.next=o.next,o.next=a}s=o,r.shared.pending=null,a=e.alternate,a!==null&&(a=a.updateQueue,a!==null&&(a.baseQueue=o))}if(s!==null){a=s.next;var l=r.baseState,u=0,h=null,p=null,w=null;if(a!==null){var C=a;do{if(o=C.expirationTime,o<n){var E={expirationTime:C.expirationTime,suspenseConfig:C.suspenseConfig,tag:C.tag,payload:C.payload,callback:C.callback,next:null};w===null?(p=w=E,h=l):w=w.next=E,o>u&&(u=o)}else{w!==null&&(w=w.next={expirationTime:1073741823,suspenseConfig:C.suspenseConfig,tag:C.tag,payload:C.payload,callback:C.callback,next:null}),Nf(o,C.suspenseConfig);e:{var T=e,c=C;switch(o=t,E=i,c.tag){case 1:if(T=c.payload,typeof T=="function"){l=T.call(E,l,o);break e}l=T;break e;case 3:T.effectTag=T.effectTag&-4097|64;case 0:if(T=c.payload,o=typeof T=="function"?T.call(E,l,o):T,o==null)break e;l=xe({},l,o);break e;case 2:Pt=!0}}C.callback!==null&&(e.effectTag|=32,o=r.effects,o===null?r.effects=[C]:o.push(C))}if(C=C.next,C===null||C===a){if(o=r.shared.pending,o===null)break;C=s.next=o.next,o.next=a,r.baseQueue=s=o,r.shared.pending=null}}while(1)}w===null?h=l:w.next=p,r.baseState=h,r.baseQueue=w,Qs(u),e.expirationTime=u,e.memoizedState=l}}function Pc(e,t,i){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],r=n.callback;if(r!==null){if(n.callback=null,n=r,r=i,typeof n!="function")throw Error(S(191,n));n.call(r)}}}var Pn=Je.ReactCurrentBatchConfig,ef=new Ls.Component().refs;function cs(e,t,i,n){t=e.memoizedState,i=i(n,t),i=i==null?t:xe({},t,i),e.memoizedState=i,e.expirationTime===0&&(e.updateQueue.baseState=i)}var Us={isMounted:function(e){return(e=e._reactInternalFiber)?Mi(e)===e:!1},enqueueSetState:function(e,t,i){e=e._reactInternalFiber;var n=ut(),r=Pn.suspense;n=pi(n,e,r),r=Wt(n,r),r.payload=t,i!=null&&(r.callback=i),Ht(e,r),Qt(e,n)},enqueueReplaceState:function(e,t,i){e=e._reactInternalFiber;var n=ut(),r=Pn.suspense;n=pi(n,e,r),r=Wt(n,r),r.tag=1,r.payload=t,i!=null&&(r.callback=i),Ht(e,r),Qt(e,n)},enqueueForceUpdate:function(e,t){e=e._reactInternalFiber;var i=ut(),n=Pn.suspense;i=pi(i,e,n),n=Wt(i,n),n.tag=2,t!=null&&(n.callback=t),Ht(e,n),Qt(e,i)}};function zc(e,t,i,n,r,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,s,o):t.prototype&&t.prototype.isPureReactComponent?!Un(i,n)||!Un(r,s):!0}function tf(e,t,i){var n=!1,r=Gt,s=t.contextType;return typeof s=="object"&&s!==null?s=We(s):(r=Ae(t)?yi:me.current,n=t.contextTypes,s=(n=n!=null)?Yi(e,r):Gt),t=new t(i,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Us,e.stateNode=t,t._reactInternalFiber=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=s),t}function Dc(e,t,i,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,n),t.state!==e&&Us.enqueueReplaceState(t,t.state,null)}function pa(e,t,i,n){var r=e.stateNode;r.props=i,r.state=e.memoizedState,r.refs=ef,Bl(e);var s=t.contextType;typeof s=="object"&&s!==null?r.context=We(s):(s=Ae(t)?yi:me.current,r.context=Yi(e,s)),Wn(e,i,r,n),r.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(cs(e,t,s,i),r.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(t=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),t!==r.state&&Us.enqueueReplaceState(r,r.state,null),Wn(e,i,r,n),r.state=e.memoizedState),typeof r.componentDidMount=="function"&&(e.effectTag|=4)}var wr=Array.isArray;function dn(e,t,i){if(e=i.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(i._owner){if(i=i._owner,i){if(i.tag!==1)throw Error(S(309));var n=i.stateNode}if(!n)throw Error(S(147,e));var r=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===r?t.ref:(t=function(s){var o=n.refs;o===ef&&(o=n.refs={}),s===null?delete o[r]:o[r]=s},t._stringRef=r,t)}if(typeof e!="string")throw Error(S(284));if(!i._owner)throw Error(S(290,e))}return e}function yr(e,t){if(e.type!=="textarea")throw Error(S(31,Object.prototype.toString.call(t)==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":t,""))}function nf(e){function t(c,d){if(e){var f=c.lastEffect;f!==null?(f.nextEffect=d,c.lastEffect=d):c.firstEffect=c.lastEffect=d,d.nextEffect=null,d.effectTag=8}}function i(c,d){if(!e)return null;for(;d!==null;)t(c,d),d=d.sibling;return null}function n(c,d){for(c=new Map;d!==null;)d.key!==null?c.set(d.key,d):c.set(d.index,d),d=d.sibling;return c}function r(c,d){return c=xi(c,d),c.index=0,c.sibling=null,c}function s(c,d,f){return c.index=f,e?(f=c.alternate,f!==null?(f=f.index,f<d?(c.effectTag=2,d):f):(c.effectTag=2,d)):d}function o(c){return e&&c.alternate===null&&(c.effectTag=2),c}function a(c,d,f,g){return d===null||d.tag!==6?(d=Co(f,c.mode,g),d.return=c,d):(d=r(d,f),d.return=c,d)}function l(c,d,f,g){return d!==null&&d.elementType===f.type?(g=r(d,f.props),g.ref=dn(c,d,f),g.return=c,g):(g=Hr(f.type,f.key,f.props,null,c.mode,g),g.ref=dn(c,d,f),g.return=c,g)}function u(c,d,f,g){return d===null||d.tag!==4||d.stateNode.containerInfo!==f.containerInfo||d.stateNode.implementation!==f.implementation?(d=bo(f,c.mode,g),d.return=c,d):(d=r(d,f.children||[]),d.return=c,d)}function h(c,d,f,g,m){return d===null||d.tag!==7?(d=Rt(f,c.mode,g,m),d.return=c,d):(d=r(d,f),d.return=c,d)}function p(c,d,f){if(typeof d=="string"||typeof d=="number")return d=Co(""+d,c.mode,f),d.return=c,d;if(typeof d=="object"&&d!==null){switch(d.$$typeof){case fr:return f=Hr(d.type,d.key,d.props,null,c.mode,f),f.ref=dn(c,null,d),f.return=c,f;case Ti:return d=bo(d,c.mode,f),d.return=c,d}if(wr(d)||sn(d))return d=Rt(d,c.mode,f,null),d.return=c,d;yr(c,d)}return null}function w(c,d,f,g){var m=d!==null?d.key:null;if(typeof f=="string"||typeof f=="number")return m!==null?null:a(c,d,""+f,g);if(typeof f=="object"&&f!==null){switch(f.$$typeof){case fr:return f.key===m?f.type===ii?h(c,d,f.props.children,g,m):l(c,d,f,g):null;case Ti:return f.key===m?u(c,d,f,g):null}if(wr(f)||sn(f))return m!==null?null:h(c,d,f,g,null);yr(c,f)}return null}function C(c,d,f,g,m){if(typeof g=="string"||typeof g=="number")return c=c.get(f)||null,a(d,c,""+g,m);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case fr:return c=c.get(g.key===null?f:g.key)||null,g.type===ii?h(d,c,g.props.children,m,g.key):l(d,c,g,m);case Ti:return c=c.get(g.key===null?f:g.key)||null,u(d,c,g,m)}if(wr(g)||sn(g))return c=c.get(f)||null,h(d,c,g,m,null);yr(d,g)}return null}function E(c,d,f,g){for(var m=null,x=null,y=d,N=d=0,D=null;y!==null&&N<f.length;N++){y.index>N?(D=y,y=null):D=y.sibling;var P=w(c,y,f[N],g);if(P===null){y===null&&(y=D);break}e&&y&&P.alternate===null&&t(c,y),d=s(P,d,N),x===null?m=P:x.sibling=P,x=P,y=D}if(N===f.length)return i(c,y),m;if(y===null){for(;N<f.length;N++)y=p(c,f[N],g),y!==null&&(d=s(y,d,N),x===null?m=y:x.sibling=y,x=y);return m}for(y=n(c,y);N<f.length;N++)D=C(y,c,N,f[N],g),D!==null&&(e&&D.alternate!==null&&y.delete(D.key===null?N:D.key),d=s(D,d,N),x===null?m=D:x.sibling=D,x=D);return e&&y.forEach(function(J){return t(c,J)}),m}function T(c,d,f,g){var m=sn(f);if(typeof m!="function")throw Error(S(150));if(f=m.call(f),f==null)throw Error(S(151));for(var x=m=null,y=d,N=d=0,D=null,P=f.next();y!==null&&!P.done;N++,P=f.next()){y.index>N?(D=y,y=null):D=y.sibling;var J=w(c,y,P.value,g);if(J===null){y===null&&(y=D);break}e&&y&&J.alternate===null&&t(c,y),d=s(J,d,N),x===null?m=J:x.sibling=J,x=J,y=D}if(P.done)return i(c,y),m;if(y===null){for(;!P.done;N++,P=f.next())P=p(c,P.value,g),P!==null&&(d=s(P,d,N),x===null?m=P:x.sibling=P,x=P);return m}for(y=n(c,y);!P.done;N++,P=f.next())P=C(y,c,N,P.value,g),P!==null&&(e&&P.alternate!==null&&y.delete(P.key===null?N:P.key),d=s(P,d,N),x===null?m=P:x.sibling=P,x=P);return e&&y.forEach(function(q){return t(c,q)}),m}return function(c,d,f,g){var m=typeof f=="object"&&f!==null&&f.type===ii&&f.key===null;m&&(f=f.props.children);var x=typeof f=="object"&&f!==null;if(x)switch(f.$$typeof){case fr:e:{for(x=f.key,m=d;m!==null;){if(m.key===x){switch(m.tag){case 7:if(f.type===ii){i(c,m.sibling),d=r(m,f.props.children),d.return=c,c=d;break e}break;default:if(m.elementType===f.type){i(c,m.sibling),d=r(m,f.props),d.ref=dn(c,m,f),d.return=c,c=d;break e}}i(c,m);break}else t(c,m);m=m.sibling}f.type===ii?(d=Rt(f.props.children,c.mode,g,f.key),d.return=c,c=d):(g=Hr(f.type,f.key,f.props,null,c.mode,g),g.ref=dn(c,d,f),g.return=c,c=g)}return o(c);case Ti:e:{for(m=f.key;d!==null;){if(d.key===m)if(d.tag===4&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){i(c,d.sibling),d=r(d,f.children||[]),d.return=c,c=d;break e}else{i(c,d);break}else t(c,d);d=d.sibling}d=bo(f,c.mode,g),d.return=c,c=d}return o(c)}if(typeof f=="string"||typeof f=="number")return f=""+f,d!==null&&d.tag===6?(i(c,d.sibling),d=r(d,f),d.return=c,c=d):(i(c,d),d=Co(f,c.mode,g),d.return=c,c=d),o(c);if(wr(f))return E(c,d,f,g);if(sn(f))return T(c,d,f,g);if(x&&yr(c,f),typeof f=="undefined"&&!m)switch(c.tag){case 1:case 0:throw c=c.type,Error(S(152,c.displayName||c.name||"Component"))}return i(c,d)}}var Gi=nf(!0),_l=nf(!1),sr={},lt={current:sr},Hn={current:sr},Fn={current:sr};function ri(e){if(e===sr)throw Error(S(174));return e}function fa(e,t){switch(ie(Fn,t),ie(Hn,e),ie(lt,sr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Jo(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Jo(t,e)}Y(lt),ie(lt,t)}function Xi(){Y(lt),Y(Hn),Y(Fn)}function jc(e){ri(Fn.current);var t=ri(lt.current),i=Jo(t,e.type);t!==i&&(ie(Hn,e),ie(lt,i))}function $l(e){Hn.current===e&&(Y(lt),Y(Hn))}var K={current:0};function ds(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data===Tl||i.data===kl))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.effectTag&64)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Ul(e,t){return{responder:e,props:t}}var $r=Je.ReactCurrentDispatcher,Ue=Je.ReactCurrentBatchConfig,Lt=0,ne=null,pe=null,fe=null,hs=!1;function Ne(){throw Error(S(321))}function Wl(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!wi(e[i],t[i]))return!1;return!0}function Hl(e,t,i,n,r,s){if(Lt=s,ne=t,t.memoizedState=null,t.updateQueue=null,t.expirationTime=0,$r.current=e===null||e.memoizedState===null?Cx:bx,e=i(n,r),t.expirationTime===Lt){s=0;do{if(t.expirationTime=0,!(25>s))throw Error(S(301));s+=1,fe=pe=null,t.updateQueue=null,$r.current=Mx,e=i(n,r)}while(t.expirationTime===Lt)}if($r.current=gs,t=pe!==null&&pe.next!==null,Lt=0,fe=pe=ne=null,hs=!1,t)throw Error(S(300));return e}function $i(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return fe===null?ne.memoizedState=fe=e:fe=fe.next=e,fe}function qi(){if(pe===null){var e=ne.alternate;e=e!==null?e.memoizedState:null}else e=pe.next;var t=fe===null?ne.memoizedState:fe.next;if(t!==null)fe=t,pe=e;else{if(e===null)throw Error(S(310));pe=e,e={memoizedState:pe.memoizedState,baseState:pe.baseState,baseQueue:pe.baseQueue,queue:pe.queue,next:null},fe===null?ne.memoizedState=fe=e:fe=fe.next=e}return fe}function ci(e,t){return typeof t=="function"?t(e):t}function xr(e){var t=qi(),i=t.queue;if(i===null)throw Error(S(311));i.lastRenderedReducer=e;var n=pe,r=n.baseQueue,s=i.pending;if(s!==null){if(r!==null){var o=r.next;r.next=s.next,s.next=o}n.baseQueue=r=s,i.pending=null}if(r!==null){r=r.next,n=n.baseState;var a=o=s=null,l=r;do{var u=l.expirationTime;if(u<Lt){var h={expirationTime:l.expirationTime,suspenseConfig:l.suspenseConfig,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null};a===null?(o=a=h,s=n):a=a.next=h,u>ne.expirationTime&&(ne.expirationTime=u,Qs(u))}else a!==null&&(a=a.next={expirationTime:1073741823,suspenseConfig:l.suspenseConfig,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null}),Nf(u,l.suspenseConfig),n=l.eagerReducer===e?l.eagerState:e(n,l.action);l=l.next}while(l!==null&&l!==r);a===null?s=n:a.next=o,wi(n,t.memoizedState)||(ot=!0),t.memoizedState=n,t.baseState=s,t.baseQueue=a,i.lastRenderedState=n}return[t.memoizedState,i.dispatch]}function Sr(e){var t=qi(),i=t.queue;if(i===null)throw Error(S(311));i.lastRenderedReducer=e;var n=i.dispatch,r=i.pending,s=t.memoizedState;if(r!==null){i.pending=null;var o=r=r.next;do s=e(s,o.action),o=o.next;while(o!==r);wi(s,t.memoizedState)||(ot=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),i.lastRenderedState=s}return[s,n]}function vo(e){var t=$i();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e=t.queue={pending:null,dispatch:null,lastRenderedReducer:ci,lastRenderedState:e},e=e.dispatch=uf.bind(null,ne,e),[t.memoizedState,e]}function ga(e,t,i,n){return e={tag:e,create:t,destroy:i,deps:n,next:null},t=ne.updateQueue,t===null?(t={lastEffect:null},ne.updateQueue=t,t.lastEffect=e.next=e):(i=t.lastEffect,i===null?t.lastEffect=e.next=e:(n=i.next,i.next=e,e.next=n,t.lastEffect=e)),e}function rf(){return qi().memoizedState}function ma(e,t,i,n){var r=$i();ne.effectTag|=e,r.memoizedState=ga(1|t,i,void 0,n===void 0?null:n)}function Fl(e,t,i,n){var r=qi();n=n===void 0?null:n;var s=void 0;if(pe!==null){var o=pe.memoizedState;if(s=o.destroy,n!==null&&Wl(n,o.deps)){ga(t,i,s,n);return}}ne.effectTag|=e,r.memoizedState=ga(1|t,i,s,n)}function Lc(e,t){return ma(516,4,e,t)}function ps(e,t){return Fl(516,4,e,t)}function sf(e,t){return Fl(4,2,e,t)}function of(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function af(e,t,i){return i=i!=null?i.concat([e]):null,Fl(4,2,of.bind(null,t,e),i)}function Ql(){}function Vc(e,t){return $i().memoizedState=[e,t===void 0?null:t],e}function fs(e,t){var i=qi();t=t===void 0?null:t;var n=i.memoizedState;return n!==null&&t!==null&&Wl(t,n[1])?n[0]:(i.memoizedState=[e,t],e)}function lf(e,t){var i=qi();t=t===void 0?null:t;var n=i.memoizedState;return n!==null&&t!==null&&Wl(t,n[1])?n[0]:(e=e(),i.memoizedState=[e,t],e)}function Zl(e,t,i){var n=$s();Xt(98>n?98:n,function(){e(!0)}),Xt(97<n?97:n,function(){var r=Ue.suspense;Ue.suspense=t===void 0?null:t;try{e(!1),i()}finally{Ue.suspense=r}})}function uf(e,t,i){var n=ut(),r=Pn.suspense;n=pi(n,e,r),r={expirationTime:n,suspenseConfig:r,action:i,eagerReducer:null,eagerState:null,next:null};var s=t.pending;if(s===null?r.next=r:(r.next=s.next,s.next=r),t.pending=r,s=e.alternate,e===ne||s!==null&&s===ne)hs=!0,r.expirationTime=Lt,ne.expirationTime=Lt;else{if(e.expirationTime===0&&(s===null||s.expirationTime===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,i);if(r.eagerReducer=s,r.eagerState=a,wi(a,o))return}catch{}finally{}Qt(e,n)}}var gs={readContext:We,useCallback:Ne,useContext:Ne,useEffect:Ne,useImperativeHandle:Ne,useLayoutEffect:Ne,useMemo:Ne,useReducer:Ne,useRef:Ne,useState:Ne,useDebugValue:Ne,useResponder:Ne,useDeferredValue:Ne,useTransition:Ne},Cx={readContext:We,useCallback:Vc,useContext:We,useEffect:Lc,useImperativeHandle:function(e,t,i){return i=i!=null?i.concat([e]):null,ma(4,2,of.bind(null,t,e),i)},useLayoutEffect:function(e,t){return ma(4,2,e,t)},useMemo:function(e,t){var i=$i();return t=t===void 0?null:t,e=e(),i.memoizedState=[e,t],e},useReducer:function(e,t,i){var n=$i();return t=i!==void 0?i(t):t,n.memoizedState=n.baseState=t,e=n.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},e=e.dispatch=uf.bind(null,ne,e),[n.memoizedState,e]},useRef:function(e){var t=$i();return e={current:e},t.memoizedState=e},useState:vo,useDebugValue:Ql,useResponder:Ul,useDeferredValue:function(e,t){var i=vo(e),n=i[0],r=i[1];return Lc(function(){var s=Ue.suspense;Ue.suspense=t===void 0?null:t;try{r(e)}finally{Ue.suspense=s}},[e,t]),n},useTransition:function(e){var t=vo(!1),i=t[0];return t=t[1],[Vc(Zl.bind(null,t,e),[t,e]),i]}},bx={readContext:We,useCallback:fs,useContext:We,useEffect:ps,useImperativeHandle:af,useLayoutEffect:sf,useMemo:lf,useReducer:xr,useRef:rf,useState:function(){return xr(ci)},useDebugValue:Ql,useResponder:Ul,useDeferredValue:function(e,t){var i=xr(ci),n=i[0],r=i[1];return ps(function(){var s=Ue.suspense;Ue.suspense=t===void 0?null:t;try{r(e)}finally{Ue.suspense=s}},[e,t]),n},useTransition:function(e){var t=xr(ci),i=t[0];return t=t[1],[fs(Zl.bind(null,t,e),[t,e]),i]}},Mx={readContext:We,useCallback:fs,useContext:We,useEffect:ps,useImperativeHandle:af,useLayoutEffect:sf,useMemo:lf,useReducer:Sr,useRef:rf,useState:function(){return Sr(ci)},useDebugValue:Ql,useResponder:Ul,useDeferredValue:function(e,t){var i=Sr(ci),n=i[0],r=i[1];return ps(function(){var s=Ue.suspense;Ue.suspense=t===void 0?null:t;try{r(e)}finally{Ue.suspense=s}},[e,t]),n},useTransition:function(e){var t=Sr(ci),i=t[0];return t=t[1],[fs(Zl.bind(null,t,e),[t,e]),i]}},Ct=null,Vt=null,di=!1;function cf(e,t){var i=at(5,null,null,0);i.elementType="DELETED",i.type="DELETED",i.stateNode=t,i.return=e,i.effectTag=8,e.lastEffect!==null?(e.lastEffect.nextEffect=i,e.lastEffect=i):e.firstEffect=e.lastEffect=i}function Rc(e,t){switch(e.tag){case 5:var i=e.type;return t=t.nodeType!==1||i.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,!0):!1;case 13:return!1;default:return!1}}function va(e){if(di){var t=Vt;if(t){var i=t;if(!Rc(e,t)){if(t=Oi(i.nextSibling),!t||!Rc(e,t)){e.effectTag=e.effectTag&-1025|2,di=!1,Ct=e;return}cf(Ct,i)}Ct=e,Vt=Oi(t.firstChild)}else e.effectTag=e.effectTag&-1025|2,di=!1,Ct=e}}function Bc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ct=e}function Cr(e){if(e!==Ct)return!1;if(!di)return Bc(e),di=!0,!1;var t=e.type;if(e.tag!==5||t!=="head"&&t!=="body"&&!oa(t,e.memoizedProps))for(t=Vt;t;)cf(e,t),t=Oi(t.nextSibling);if(Bc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(S(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var i=e.data;if(i===kp){if(t===0){Vt=Oi(e.nextSibling);break e}t--}else i!==Tp&&i!==kl&&i!==Tl||t++}e=e.nextSibling}Vt=null}}else Vt=Ct?Oi(e.stateNode.nextSibling):null;return!0}function wo(){Vt=Ct=null,di=!1}var Ix=Je.ReactCurrentOwner,ot=!1;function Pe(e,t,i,n){t.child=e===null?_l(t,null,i,n):Gi(t,e.child,i,n)}function Oc(e,t,i,n,r){i=i.render;var s=t.ref;return _i(t,r),n=Hl(e,t,i,n,s,r),e!==null&&!ot?(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=r&&(e.expirationTime=0),bt(e,t,r)):(t.effectTag|=1,Pe(e,t,n,r),t.child)}function _c(e,t,i,n,r,s){if(e===null){var o=i.type;return typeof o=="function"&&!Kl(o)&&o.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(t.tag=15,t.type=o,df(e,t,o,n,r,s)):(e=Hr(i.type,null,n,null,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}return o=e.child,r<s&&(r=o.memoizedProps,i=i.compare,i=i!==null?i:Un,i(r,n)&&e.ref===t.ref)?bt(e,t,s):(t.effectTag|=1,e=xi(o,n),e.ref=t.ref,e.return=t,t.child=e)}function df(e,t,i,n,r,s){return e!==null&&Un(e.memoizedProps,n)&&e.ref===t.ref&&(ot=!1,r<s)?(t.expirationTime=e.expirationTime,bt(e,t,s)):wa(e,t,i,n,s)}function hf(e,t){var i=t.ref;(e===null&&i!==null||e!==null&&e.ref!==i)&&(t.effectTag|=128)}function wa(e,t,i,n,r){var s=Ae(i)?yi:me.current;return s=Yi(t,s),_i(t,r),i=Hl(e,t,i,n,s,r),e!==null&&!ot?(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=r&&(e.expirationTime=0),bt(e,t,r)):(t.effectTag|=1,Pe(e,t,i,r),t.child)}function $c(e,t,i,n,r){if(Ae(i)){var s=!0;Br(t)}else s=!1;if(_i(t,r),t.stateNode===null)e!==null&&(e.alternate=null,t.alternate=null,t.effectTag|=2),tf(t,i,n),pa(t,i,n,r),n=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,u=i.contextType;typeof u=="object"&&u!==null?u=We(u):(u=Ae(i)?yi:me.current,u=Yi(t,u));var h=i.getDerivedStateFromProps,p=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function";p||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==n||l!==u)&&Dc(t,o,n,u),Pt=!1;var w=t.memoizedState;o.state=w,Wn(t,n,o,r),l=t.memoizedState,a!==n||w!==l||Ie.current||Pt?(typeof h=="function"&&(cs(t,i,h,n),l=t.memoizedState),(a=Pt||zc(t,i,a,n,w,l,u))?(p||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.effectTag|=4)):(typeof o.componentDidMount=="function"&&(t.effectTag|=4),t.memoizedProps=n,t.memoizedState=l),o.props=n,o.state=l,o.context=u,n=a):(typeof o.componentDidMount=="function"&&(t.effectTag|=4),n=!1)}else o=t.stateNode,Ol(e,t),a=t.memoizedProps,o.props=t.type===t.elementType?a:Ge(t.type,a),l=o.context,u=i.contextType,typeof u=="object"&&u!==null?u=We(u):(u=Ae(i)?yi:me.current,u=Yi(t,u)),h=i.getDerivedStateFromProps,(p=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==n||l!==u)&&Dc(t,o,n,u),Pt=!1,l=t.memoizedState,o.state=l,Wn(t,n,o,r),w=t.memoizedState,a!==n||l!==w||Ie.current||Pt?(typeof h=="function"&&(cs(t,i,h,n),w=t.memoizedState),(h=Pt||zc(t,i,a,n,l,w,u))?(p||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,w,u),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,w,u)),typeof o.componentDidUpdate=="function"&&(t.effectTag|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.effectTag|=256)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=256),t.memoizedProps=n,t.memoizedState=w),o.props=n,o.state=w,o.context=u,n=h):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=256),n=!1);return ya(e,t,i,n,s,r)}function ya(e,t,i,n,r,s){hf(e,t);var o=(t.effectTag&64)!==0;if(!n&&!o)return r&&Ac(t,i,!1),bt(e,t,s);n=t.stateNode,Ix.current=t;var a=o&&typeof i.getDerivedStateFromError!="function"?null:n.render();return t.effectTag|=1,e!==null&&o?(t.child=Gi(t,e.child,null,s),t.child=Gi(t,null,a,s)):Pe(e,t,a,s),t.memoizedState=n.state,r&&Ac(t,i,!0),t.child}function Uc(e){var t=e.stateNode;t.pendingContext?Ic(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ic(e,t.context,!1),fa(e,t.containerInfo)}var yo={dehydrated:null,retryTime:0};function Wc(e,t,i){var n=t.mode,r=t.pendingProps,s=K.current,o=!1,a;if((a=(t.effectTag&64)!==0)||(a=(s&2)!==0&&(e===null||e.memoizedState!==null)),a?(o=!0,t.effectTag&=-65):e!==null&&e.memoizedState===null||r.fallback===void 0||r.unstable_avoidThisFallback===!0||(s|=1),ie(K,s&1),e===null){if(r.fallback!==void 0&&va(t),o){if(o=r.fallback,r=Rt(null,n,0,null),r.return=t,(t.mode&2)===0)for(e=t.memoizedState!==null?t.child.child:t.child,r.child=e;e!==null;)e.return=r,e=e.sibling;return i=Rt(o,n,i,null),i.return=t,r.sibling=i,t.memoizedState=yo,t.child=r,i}return n=r.children,t.memoizedState=null,t.child=_l(t,null,n,i)}if(e.memoizedState!==null){if(e=e.child,n=e.sibling,o){if(r=r.fallback,i=xi(e,e.pendingProps),i.return=t,(t.mode&2)===0&&(o=t.memoizedState!==null?t.child.child:t.child,o!==e.child))for(i.child=o;o!==null;)o.return=i,o=o.sibling;return n=xi(n,r),n.return=t,i.sibling=n,i.childExpirationTime=0,t.memoizedState=yo,t.child=i,n}return i=Gi(t,e.child,r.children,i),t.memoizedState=null,t.child=i}if(e=e.child,o){if(o=r.fallback,r=Rt(null,n,0,null),r.return=t,r.child=e,e!==null&&(e.return=r),(t.mode&2)===0)for(e=t.memoizedState!==null?t.child.child:t.child,r.child=e;e!==null;)e.return=r,e=e.sibling;return i=Rt(o,n,i,null),i.return=t,r.sibling=i,i.effectTag|=2,r.childExpirationTime=0,t.memoizedState=yo,t.child=r,i}return t.memoizedState=null,t.child=Gi(t,e,r.children,i)}function Hc(e,t){e.expirationTime<t&&(e.expirationTime=t);var i=e.alternate;i!==null&&i.expirationTime<t&&(i.expirationTime=t),qp(e.return,t)}function xo(e,t,i,n,r,s){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:i,tailExpiration:0,tailMode:r,lastEffect:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=n,o.tail=i,o.tailExpiration=0,o.tailMode=r,o.lastEffect=s)}function Fc(e,t,i){var n=t.pendingProps,r=n.revealOrder,s=n.tail;if(Pe(e,t,n.children,i),n=K.current,(n&2)!==0)n=n&1|2,t.effectTag|=64;else{if(e!==null&&(e.effectTag&64)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Hc(e,i);else if(e.tag===19)Hc(e,i);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(ie(K,n),(t.mode&2)===0)t.memoizedState=null;else switch(r){case"forwards":for(i=t.child,r=null;i!==null;)e=i.alternate,e!==null&&ds(e)===null&&(r=i),i=i.sibling;i=r,i===null?(r=t.child,t.child=null):(r=i.sibling,i.sibling=null),xo(t,!1,r,i,s,t.lastEffect);break;case"backwards":for(i=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&ds(e)===null){t.child=r;break}e=r.sibling,r.sibling=i,i=r,r=e}xo(t,!0,i,null,s,t.lastEffect);break;case"together":xo(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function bt(e,t,i){e!==null&&(t.dependencies=e.dependencies);var n=t.expirationTime;if(n!==0&&Qs(n),t.childExpirationTime<i)return null;if(e!==null&&t.child!==e.child)throw Error(S(153));if(t.child!==null){for(e=t.child,i=xi(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=xi(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}var pf,xa,ff,gf;pf=function(e,t){for(var i=t.child;i!==null;){if(i.tag===5||i.tag===6)e.appendChild(i.stateNode);else if(i.tag!==4&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}};xa=function(){};ff=function(e,t,i,n,r){var s=e.memoizedProps;if(s!==n){var o=t.stateNode;switch(ri(lt.current),e=null,i){case"input":s=Qo(o,s),n=Qo(o,n),e=[];break;case"option":s=Go(o,s),n=Go(o,n),e=[];break;case"select":s=xe({},s,{value:void 0}),n=xe({},n,{value:void 0}),e=[];break;case"textarea":s=Xo(o,s),n=Xo(o,n),e=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(o.onclick=ns)}ia(i,n);var a,l;i=null;for(a in s)if(!n.hasOwnProperty(a)&&s.hasOwnProperty(a)&&s[a]!=null)if(a==="style")for(l in o=s[a],o)o.hasOwnProperty(l)&&(i||(i={}),i[l]="");else a!=="dangerouslySetInnerHTML"&&a!=="children"&&a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Fi.hasOwnProperty(a)?e||(e=[]):(e=e||[]).push(a,null));for(a in n){var u=n[a];if(o=s!=null?s[a]:void 0,n.hasOwnProperty(a)&&u!==o&&(u!=null||o!=null))if(a==="style")if(o){for(l in o)!o.hasOwnProperty(l)||u&&u.hasOwnProperty(l)||(i||(i={}),i[l]="");for(l in u)u.hasOwnProperty(l)&&o[l]!==u[l]&&(i||(i={}),i[l]=u[l])}else i||(e||(e=[]),e.push(a,i)),i=u;else a==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,o=o?o.__html:void 0,u!=null&&o!==u&&(e=e||[]).push(a,u)):a==="children"?o===u||typeof u!="string"&&typeof u!="number"||(e=e||[]).push(a,""+u):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&(Fi.hasOwnProperty(a)?(u!=null&&mt(r,a),e||o===u||(e=[])):(e=e||[]).push(a,u))}i&&(e=e||[]).push("style",i),r=e,(t.updateQueue=r)&&(t.effectTag|=4)}};gf=function(e,t,i,n){i!==n&&(t.effectTag|=4)};function br(e,t){switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var n=null;i!==null;)i.alternate!==null&&(n=i),i=i.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Ax(e,t,i){var n=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return Ae(t.type)&&os(),null;case 3:return Xi(),Y(Ie),Y(me),i=t.stateNode,i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),e!==null&&e.child!==null||!Cr(t)||(t.effectTag|=4),xa(t),null;case 5:$l(t),i=ri(Fn.current);var r=t.type;if(e!==null&&t.stateNode!=null)ff(e,t,r,n,i),e.ref!==t.ref&&(t.effectTag|=128);else{if(!n){if(t.stateNode===null)throw Error(S(166));return null}if(e=ri(lt.current),Cr(t)){n=t.stateNode,r=t.type;var s=t.memoizedProps;switch(n[Dt]=t,n[rs]=s,r){case"iframe":case"object":case"embed":X("load",n);break;case"video":case"audio":for(e=0;e<mn.length;e++)X(mn[e],n);break;case"source":X("error",n);break;case"img":case"image":case"link":X("error",n),X("load",n);break;case"form":X("reset",n),X("submit",n);break;case"details":X("toggle",n);break;case"input":ic(n,s),X("invalid",n),mt(i,"onChange");break;case"select":n._wrapperState={wasMultiple:!!s.multiple},X("invalid",n),mt(i,"onChange");break;case"textarea":rc(n,s),X("invalid",n),mt(i,"onChange")}ia(r,s),e=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?n.textContent!==a&&(e=["children",a]):typeof a=="number"&&n.textContent!==""+a&&(e=["children",""+a]):Fi.hasOwnProperty(o)&&a!=null&&mt(i,o)}switch(r){case"input":gr(n),nc(n,s,!0);break;case"textarea":gr(n),sc(n);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(n.onclick=ns)}i=e,t.updateQueue=i,i!==null&&(t.effectTag|=4)}else{switch(o=i.nodeType===9?i:i.ownerDocument,e===dc&&(e=ap(r)),e===dc?r==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[Dt]=t,e[rs]=n,pf(e,t,!1,!1),t.stateNode=e,o=na(r,n),r){case"iframe":case"object":case"embed":X("load",e),a=n;break;case"video":case"audio":for(a=0;a<mn.length;a++)X(mn[a],e);a=n;break;case"source":X("error",e),a=n;break;case"img":case"image":case"link":X("error",e),X("load",e),a=n;break;case"form":X("reset",e),X("submit",e),a=n;break;case"details":X("toggle",e),a=n;break;case"input":ic(e,n),a=Qo(e,n),X("invalid",e),mt(i,"onChange");break;case"option":a=Go(e,n);break;case"select":e._wrapperState={wasMultiple:!!n.multiple},a=xe({},n,{value:void 0}),X("invalid",e),mt(i,"onChange");break;case"textarea":rc(e,n),a=Xo(e,n),X("invalid",e),mt(i,"onChange");break;default:a=n}ia(r,a);var l=a;for(s in l)if(l.hasOwnProperty(s)){var u=l[s];s==="style"?Ap(e,u):s==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&lp(e,u)):s==="children"?typeof u=="string"?(r!=="textarea"||u!=="")&&Bn(e,u):typeof u=="number"&&Bn(e,""+u):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Fi.hasOwnProperty(s)?u!=null&&mt(i,s):u!=null&&vl(e,s,u,o))}switch(r){case"input":gr(e),nc(e,n,!1);break;case"textarea":gr(e),sc(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Yt(n.value));break;case"select":e.multiple=!!n.multiple,i=n.value,i!=null?Bi(e,!!n.multiple,i,!1):n.defaultValue!=null&&Bi(e,!!n.multiple,n.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=ns)}Np(r,n)&&(t.effectTag|=4)}t.ref!==null&&(t.effectTag|=128)}return null;case 6:if(e&&t.stateNode!=null)gf(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(S(166));i=ri(Fn.current),ri(lt.current),Cr(t)?(i=t.stateNode,n=t.memoizedProps,i[Dt]=t,i.nodeValue!==n&&(t.effectTag|=4)):(i=(i.nodeType===9?i:i.ownerDocument).createTextNode(n),i[Dt]=t,t.stateNode=i)}return null;case 13:return Y(K),n=t.memoizedState,(t.effectTag&64)!==0?(t.expirationTime=i,t):(i=n!==null,n=!1,e===null?t.memoizedProps.fallback!==void 0&&Cr(t):(r=e.memoizedState,n=r!==null,i||r===null||(r=e.child.sibling,r!==null&&(s=t.firstEffect,s!==null?(t.firstEffect=r,r.nextEffect=s):(t.firstEffect=t.lastEffect=r,r.nextEffect=null),r.effectTag=8))),i&&!n&&(t.mode&2)!==0&&(e===null&&t.memoizedProps.unstable_avoidThisFallback!==!0||(K.current&1)!==0?se===hi&&(se=ws):((se===hi||se===ws)&&(se=Ws),Zn!==0&&Le!==null&&(ai(Le,Ee),Lf(Le,Zn)))),(i||n)&&(t.effectTag|=4),null);case 4:return Xi(),xa(t),null;case 10:return Rl(t),null;case 17:return Ae(t.type)&&os(),null;case 19:if(Y(K),n=t.memoizedState,n===null)return null;if(r=(t.effectTag&64)!==0,s=n.rendering,s===null){if(r)br(n,!1);else if(se!==hi||e!==null&&(e.effectTag&64)!==0)for(s=t.child;s!==null;){if(e=ds(s),e!==null){for(t.effectTag|=64,br(n,!1),r=e.updateQueue,r!==null&&(t.updateQueue=r,t.effectTag|=4),n.lastEffect===null&&(t.firstEffect=null),t.lastEffect=n.lastEffect,n=t.child;n!==null;)r=n,s=i,r.effectTag&=2,r.nextEffect=null,r.firstEffect=null,r.lastEffect=null,e=r.alternate,e===null?(r.childExpirationTime=0,r.expirationTime=s,r.child=null,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null):(r.childExpirationTime=e.childExpirationTime,r.expirationTime=e.expirationTime,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,s=e.dependencies,r.dependencies=s===null?null:{expirationTime:s.expirationTime,firstContext:s.firstContext,responders:s.responders}),n=n.sibling;return ie(K,K.current&1|2),t.child}s=s.sibling}}else{if(!r)if(e=ds(s),e!==null){if(t.effectTag|=64,r=!0,i=e.updateQueue,i!==null&&(t.updateQueue=i,t.effectTag|=4),br(n,!0),n.tail===null&&n.tailMode==="hidden"&&!s.alternate)return t=t.lastEffect=n.lastEffect,t!==null&&(t.nextEffect=null),null}else 2*$e()-n.renderingStartTime>n.tailExpiration&&1<i&&(t.effectTag|=64,r=!0,br(n,!1),t.expirationTime=t.childExpirationTime=i-1);n.isBackwards?(s.sibling=t.child,t.child=s):(i=n.last,i!==null?i.sibling=s:t.child=s,n.last=s)}return n.tail!==null?(n.tailExpiration===0&&(n.tailExpiration=$e()+500),i=n.tail,n.rendering=i,n.tail=i.sibling,n.lastEffect=t.lastEffect,n.renderingStartTime=$e(),i.sibling=null,t=K.current,ie(K,r?t&1|2:t&1),i):null}throw Error(S(156,t.tag))}function Ex(e){switch(e.tag){case 1:Ae(e.type)&&os();var t=e.effectTag;return t&4096?(e.effectTag=t&-4097|64,e):null;case 3:if(Xi(),Y(Ie),Y(me),t=e.effectTag,(t&64)!==0)throw Error(S(285));return e.effectTag=t&-4097|64,e;case 5:return $l(e),null;case 13:return Y(K),t=e.effectTag,t&4096?(e.effectTag=t&-4097|64,e):null;case 19:return Y(K),null;case 4:return Xi(),null;case 10:return Rl(e),null;default:return null}}function Yl(e,t){return{value:e,source:t,stack:xl(t)}}var Tx=typeof WeakSet=="function"?WeakSet:Set;function Sa(e,t){var i=t.source,n=t.stack;n===null&&i!==null&&(n=xl(i)),i!==null&&Mt(i.type),t=t.value,e!==null&&e.tag===1&&Mt(e.type);try{console.error(t)}catch(r){setTimeout(function(){throw r})}}function kx(e,t){try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(i){fi(e,i)}}function Qc(e){var t=e.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(i){fi(e,i)}else t.current=null}function Nx(e,t){switch(t.tag){case 0:case 11:case 15:case 22:return;case 1:if(t.effectTag&256&&e!==null){var i=e.memoizedProps,n=e.memoizedState;e=t.stateNode,t=e.getSnapshotBeforeUpdate(t.elementType===t.type?i:Ge(t.type,i),n),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:case 5:case 6:case 4:case 17:return}throw Error(S(163))}function mf(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var i=t=t.next;do{if((i.tag&e)===e){var n=i.destroy;i.destroy=void 0,n!==void 0&&n()}i=i.next}while(i!==t)}}function vf(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var i=t=t.next;do{if((i.tag&e)===e){var n=i.create;i.destroy=n()}i=i.next}while(i!==t)}}function Px(e,t,i){switch(i.tag){case 0:case 11:case 15:case 22:vf(3,i);return;case 1:if(e=i.stateNode,i.effectTag&4)if(t===null)e.componentDidMount();else{var n=i.elementType===i.type?t.memoizedProps:Ge(i.type,t.memoizedProps);e.componentDidUpdate(n,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate)}t=i.updateQueue,t!==null&&Pc(i,t,e);return;case 3:if(t=i.updateQueue,t!==null){if(e=null,i.child!==null)switch(i.child.tag){case 5:e=i.child.stateNode;break;case 1:e=i.child.stateNode}Pc(i,t,e)}return;case 5:e=i.stateNode,t===null&&i.effectTag&4&&Np(i.type,i.memoizedProps)&&e.focus();return;case 6:return;case 4:return;case 12:return;case 13:i.memoizedState===null&&(i=i.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&Cp(i))));return;case 19:case 17:case 20:case 21:return}throw Error(S(163))}function Zc(e,t,i){switch(typeof ka=="function"&&ka(t),t.tag){case 0:case 11:case 14:case 15:case 22:if(e=t.updateQueue,e!==null&&(e=e.lastEffect,e!==null)){var n=e.next;Xt(97<i?97:i,function(){var r=n;do{var s=r.destroy;if(s!==void 0){var o=t;try{s()}catch(a){fi(o,a)}}r=r.next}while(r!==n)})}break;case 1:Qc(t),i=t.stateNode,typeof i.componentWillUnmount=="function"&&kx(t,i);break;case 5:Qc(t);break;case 4:yf(e,t,i)}}function wf(e){var t=e.alternate;e.return=null,e.child=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.alternate=null,e.firstEffect=null,e.lastEffect=null,e.pendingProps=null,e.memoizedProps=null,e.stateNode=null,t!==null&&wf(t)}function Yc(e){return e.tag===5||e.tag===3||e.tag===4}function Gc(e){e:{for(var t=e.return;t!==null;){if(Yc(t)){var i=t;break e}t=t.return}throw Error(S(160))}switch(t=i.stateNode,i.tag){case 5:var n=!1;break;case 3:t=t.containerInfo,n=!0;break;case 4:t=t.containerInfo,n=!0;break;default:throw Error(S(161))}i.effectTag&16&&(Bn(t,""),i.effectTag&=-17);e:t:for(i=e;;){for(;i.sibling===null;){if(i.return===null||Yc(i.return)){i=null;break e}i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.effectTag&2||i.child===null||i.tag===4)continue t;i.child.return=i,i=i.child}if(!(i.effectTag&2)){i=i.stateNode;break e}}n?Ca(e,i,t):ba(e,i,t)}function Ca(e,t,i){var n=e.tag,r=n===5||n===6;if(r)e=r?e.stateNode:e.stateNode.instance,t?i.nodeType===8?i.parentNode.insertBefore(e,t):i.insertBefore(e,t):(i.nodeType===8?(t=i.parentNode,t.insertBefore(e,i)):(t=i,t.appendChild(e)),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=ns));else if(n!==4&&(e=e.child,e!==null))for(Ca(e,t,i),e=e.sibling;e!==null;)Ca(e,t,i),e=e.sibling}function ba(e,t,i){var n=e.tag,r=n===5||n===6;if(r)e=r?e.stateNode:e.stateNode.instance,t?i.insertBefore(e,t):i.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(ba(e,t,i),e=e.sibling;e!==null;)ba(e,t,i),e=e.sibling}function yf(e,t,i){for(var n=t,r=!1,s,o;;){if(!r){r=n.return;e:for(;;){if(r===null)throw Error(S(160));switch(s=r.stateNode,r.tag){case 5:o=!1;break e;case 3:s=s.containerInfo,o=!0;break e;case 4:s=s.containerInfo,o=!0;break e}r=r.return}r=!0}if(n.tag===5||n.tag===6){e:for(var a=e,l=n,u=i,h=l;;)if(Zc(a,h,u),h.child!==null&&h.tag!==4)h.child.return=h,h=h.child;else{if(h===l)break e;for(;h.sibling===null;){if(h.return===null||h.return===l)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}o?(a=s,l=n.stateNode,a.nodeType===8?a.parentNode.removeChild(l):a.removeChild(l)):s.removeChild(n.stateNode)}else if(n.tag===4){if(n.child!==null){s=n.stateNode.containerInfo,o=!0,n.child.return=n,n=n.child;continue}}else if(Zc(e,n,i),n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return,n.tag===4&&(r=!1)}n.sibling.return=n.return,n=n.sibling}}function So(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:mf(3,t);return;case 1:return;case 5:var i=t.stateNode;if(i!=null){var n=t.memoizedProps,r=e!==null?e.memoizedProps:n;e=t.type;var s=t.updateQueue;if(t.updateQueue=null,s!==null){for(i[rs]=n,e==="input"&&n.type==="radio"&&n.name!=null&&rp(i,n),na(e,r),t=na(e,n),r=0;r<s.length;r+=2){var o=s[r],a=s[r+1];o==="style"?Ap(i,a):o==="dangerouslySetInnerHTML"?lp(i,a):o==="children"?Bn(i,a):vl(i,o,a,t)}switch(e){case"input":Zo(i,n);break;case"textarea":sp(i,n);break;case"select":t=i._wrapperState.wasMultiple,i._wrapperState.wasMultiple=!!n.multiple,e=n.value,e!=null?Bi(i,!!n.multiple,e,!1):t!==!!n.multiple&&(n.defaultValue!=null?Bi(i,!!n.multiple,n.defaultValue,!0):Bi(i,!!n.multiple,n.multiple?[]:"",!1))}}}return;case 6:if(t.stateNode===null)throw Error(S(162));t.stateNode.nodeValue=t.memoizedProps;return;case 3:t=t.stateNode,t.hydrate&&(t.hydrate=!1,Cp(t.containerInfo));return;case 12:return;case 13:if(i=t,t.memoizedState===null?n=!1:(n=!0,i=t.child,Jl=$e()),i!==null)e:for(e=i;;){if(e.tag===5)s=e.stateNode,n?(s=s.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(s=e.stateNode,r=e.memoizedProps.style,r=r!=null&&r.hasOwnProperty("display")?r.display:null,s.style.display=Ip("display",r));else if(e.tag===6)e.stateNode.nodeValue=n?"":e.memoizedProps;else if(e.tag===13&&e.memoizedState!==null&&e.memoizedState.dehydrated===null){s=e.child.sibling,s.return=e,e=s;continue}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===i)break;for(;e.sibling===null;){if(e.return===null||e.return===i)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}Xc(t);return;case 19:Xc(t);return;case 17:return}throw Error(S(163))}function Xc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new Tx),t.forEach(function(n){var r=$x.bind(null,e,n);i.has(n)||(i.add(n),n.then(r,r))})}}var zx=typeof WeakMap=="function"?WeakMap:Map;function xf(e,t,i){i=Wt(i,null),i.tag=3,i.payload={element:null};var n=t.value;return i.callback=function(){Ss||(Ss=!0,Ma=n),Sa(e,t)},i}function Sf(e,t,i){i=Wt(i,null),i.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var r=t.value;i.payload=function(){return Sa(e,t),n(r)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(i.callback=function(){typeof n!="function"&&(Ft===null?Ft=new Set([this]):Ft.add(this),Sa(e,t));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),i}var Dx=Math.ceil,ms=Je.ReactCurrentDispatcher,Cf=Je.ReactCurrentOwner,oe=0,Gl=8,Ke=16,ct=32,hi=0,vs=1,bf=2,ws=3,Ws=4,Xl=5,L=oe,Le=null,R=null,Ee=0,se=hi,Hs=null,St=1073741823,Qn=1073741823,ys=null,Zn=0,xs=!1,Jl=0,Mf=500,z=null,Ss=!1,Ma=null,Ft=null,Cs=!1,zn=null,wn=90,si=null,Dn=0,Ia=null,Ur=0;function ut(){return(L&(Ke|ct))!==oe?1073741821-($e()/10|0):Ur!==0?Ur:Ur=1073741821-($e()/10|0)}function pi(e,t,i){if(t=t.mode,(t&2)===0)return 1073741823;var n=$s();if((t&4)===0)return n===99?1073741823:1073741822;if((L&Ke)!==oe)return Ee;if(i!==null)e=_r(e,i.timeoutMs|0||5e3,250);else switch(n){case 99:e=1073741823;break;case 98:e=_r(e,150,100);break;case 97:case 96:e=_r(e,5e3,250);break;case 95:e=2;break;default:throw Error(S(326))}return Le!==null&&e===Ee&&--e,e}function Qt(e,t){if(50<Dn)throw Dn=0,Ia=null,Error(S(185));if(e=Fs(e,t),e!==null){var i=$s();t===1073741823?(L&Gl)!==oe&&(L&(Ke|ct))===oe?Aa(e):(Ve(e),L===oe&&dt()):Ve(e),(L&4)===oe||i!==98&&i!==99||(si===null?si=new Map([[e,t]]):(i=si.get(e),(i===void 0||i>t)&&si.set(e,t)))}}function Fs(e,t){e.expirationTime<t&&(e.expirationTime=t);var i=e.alternate;i!==null&&i.expirationTime<t&&(i.expirationTime=t);var n=e.return,r=null;if(n===null&&e.tag===3)r=e.stateNode;else for(;n!==null;){if(i=n.alternate,n.childExpirationTime<t&&(n.childExpirationTime=t),i!==null&&i.childExpirationTime<t&&(i.childExpirationTime=t),n.return===null&&n.tag===3){r=n.stateNode;break}n=n.return}return r!==null&&(Le===r&&(Qs(t),se===Ws&&ai(r,Ee)),Lf(r,t)),r}function Wr(e){var t=e.lastExpiredTime;if(t!==0||(t=e.firstPendingTime,!jf(e,t)))return t;var i=e.lastPingedTime;return e=e.nextKnownPendingLevel,e=i>e?i:e,2>=e&&t!==e?0:e}function Ve(e){if(e.lastExpiredTime!==0)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=kc(Aa.bind(null,e));else{var t=Wr(e),i=e.callbackNode;if(t===0)i!==null&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var n=ut();if(t===1073741823?n=99:t===1||t===2?n=95:(n=10*(1073741821-t)-10*(1073741821-n),n=0>=n?99:250>=n?98:5250>=n?97:95),i!==null){var r=e.callbackPriority;if(e.callbackExpirationTime===t&&r>=n)return;i!==Gp&&Hp(i)}e.callbackExpirationTime=t,e.callbackPriority=n,t=t===1073741823?kc(Aa.bind(null,e)):Jp(n,If.bind(null,e),{timeout:10*(1073741821-t)-$e()}),e.callbackNode=t}}}function If(e,t){if(Ur=0,t)return t=ut(),Na(e,t),Ve(e),null;var i=Wr(e);if(i!==0){if(t=e.callbackNode,(L&(Ke|ct))!==oe)throw Error(S(327));if(en(),e===Le&&i===Ee||oi(e,i),R!==null){var n=L;L|=Ke;var r=kf();do try{Vx();break}catch(a){Tf(e,a)}while(1);if(Vl(),L=n,ms.current=r,se===vs)throw t=Hs,oi(e,i),ai(e,i),Ve(e),t;if(R===null)switch(r=e.finishedWork=e.current.alternate,e.finishedExpirationTime=i,n=se,Le=null,n){case hi:case vs:throw Error(S(345));case bf:Na(e,2<i?2:i);break;case ws:if(ai(e,i),n=e.lastSuspendedTime,i===n&&(e.nextKnownPendingLevel=Ea(r)),St===1073741823&&(r=Jl+Mf-$e(),10<r)){if(xs){var s=e.lastPingedTime;if(s===0||s>=i){e.lastPingedTime=i,oi(e,i);break}}if(s=Wr(e),s!==0&&s!==i)break;if(n!==0&&n!==i){e.lastPingedTime=n;break}e.timeoutHandle=go(ti.bind(null,e),r);break}ti(e);break;case Ws:if(ai(e,i),n=e.lastSuspendedTime,i===n&&(e.nextKnownPendingLevel=Ea(r)),xs&&(r=e.lastPingedTime,r===0||r>=i)){e.lastPingedTime=i,oi(e,i);break}if(r=Wr(e),r!==0&&r!==i)break;if(n!==0&&n!==i){e.lastPingedTime=n;break}if(Qn!==1073741823?n=10*(1073741821-Qn)-$e():St===1073741823?n=0:(n=10*(1073741821-St)-5e3,r=$e(),i=10*(1073741821-i)-r,n=r-n,0>n&&(n=0),n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Dx(n/1960))-n,i<n&&(n=i)),10<n){e.timeoutHandle=go(ti.bind(null,e),n);break}ti(e);break;case Xl:if(St!==1073741823&&ys!==null){s=St;var o=ys;if(n=o.busyMinDurationMs|0,0>=n?n=0:(r=o.busyDelayMs|0,s=$e()-(10*(1073741821-s)-(o.timeoutMs|0||5e3)),n=s<=r?0:r+n-s),10<n){ai(e,i),e.timeoutHandle=go(ti.bind(null,e),n);break}}ti(e);break;default:throw Error(S(329))}if(Ve(e),e.callbackNode===t)return If.bind(null,e)}}return null}function Aa(e){var t=e.lastExpiredTime;if(t=t!==0?t:1073741823,(L&(Ke|ct))!==oe)throw Error(S(327));if(en(),e===Le&&t===Ee||oi(e,t),R!==null){var i=L;L|=Ke;var n=kf();do try{Lx();break}catch(r){Tf(e,r)}while(1);if(Vl(),L=i,ms.current=n,se===vs)throw i=Hs,oi(e,t),ai(e,t),Ve(e),i;if(R!==null)throw Error(S(261));e.finishedWork=e.current.alternate,e.finishedExpirationTime=t,Le=null,ti(e),Ve(e)}return null}function jx(){if(si!==null){var e=si;si=null,e.forEach(function(t,i){Na(i,t),Ve(i)}),dt()}}function Af(e,t){var i=L;L|=1;try{return e(t)}finally{L=i,L===oe&&dt()}}function Ef(e,t){var i=L;L&=-2,L|=Gl;try{return e(t)}finally{L=i,L===oe&&dt()}}function oi(e,t){e.finishedWork=null,e.finishedExpirationTime=0;var i=e.timeoutHandle;if(i!==-1&&(e.timeoutHandle=-1,D0(i)),R!==null)for(i=R.return;i!==null;){var n=i;switch(n.tag){case 1:n=n.type.childContextTypes,n!=null&&os();break;case 3:Xi(),Y(Ie),Y(me);break;case 5:$l(n);break;case 4:Xi();break;case 13:Y(K);break;case 19:Y(K);break;case 10:Rl(n)}i=i.return}Le=e,R=xi(e.current,null),Ee=t,se=hi,Hs=null,Qn=St=1073741823,ys=null,Zn=0,xs=!1}function Tf(e,t){do{try{if(Vl(),$r.current=gs,hs)for(var i=ne.memoizedState;i!==null;){var n=i.queue;n!==null&&(n.pending=null),i=i.next}if(Lt=0,fe=pe=ne=null,hs=!1,R===null||R.return===null)return se=vs,Hs=t,R=null;e:{var r=e,s=R.return,o=R,a=t;if(t=Ee,o.effectTag|=2048,o.firstEffect=o.lastEffect=null,a!==null&&typeof a=="object"&&typeof a.then=="function"){var l=a;if((o.mode&2)===0){var u=o.alternate;u?(o.updateQueue=u.updateQueue,o.memoizedState=u.memoizedState,o.expirationTime=u.expirationTime):(o.updateQueue=null,o.memoizedState=null)}var h=(K.current&1)!==0,p=s;do{var w;if(w=p.tag===13){var C=p.memoizedState;if(C!==null)w=C.dehydrated!==null;else{var E=p.memoizedProps;w=E.fallback===void 0?!1:E.unstable_avoidThisFallback!==!0?!0:!h}}if(w){var T=p.updateQueue;if(T===null){var c=new Set;c.add(l),p.updateQueue=c}else T.add(l);if((p.mode&2)===0){if(p.effectTag|=64,o.effectTag&=-2981,o.tag===1)if(o.alternate===null)o.tag=17;else{var d=Wt(1073741823,null);d.tag=2,Ht(o,d)}o.expirationTime=1073741823;break e}a=void 0,o=t;var f=r.pingCache;if(f===null?(f=r.pingCache=new zx,a=new Set,f.set(l,a)):(a=f.get(l),a===void 0&&(a=new Set,f.set(l,a))),!a.has(o)){a.add(o);var g=_x.bind(null,r,l,o);l.then(g,g)}p.effectTag|=4096,p.expirationTime=t;break e}p=p.return}while(p!==null);a=Error((Mt(o.type)||"A React component")+` suspended while rendering, but no fallback UI was specified.
|
152
|
-
|
153
|
-
Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`+xl(o))}se!==Xl&&(se=bf),a=Yl(a,o),p=s;do{switch(p.tag){case 3:l=a,p.effectTag|=4096,p.expirationTime=t;var m=xf(p,l,t);Nc(p,m);break e;case 1:l=a;var x=p.type,y=p.stateNode;if((p.effectTag&64)===0&&(typeof x.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Ft===null||!Ft.has(y)))){p.effectTag|=4096,p.expirationTime=t;var N=Sf(p,l,t);Nc(p,N);break e}}p=p.return}while(p!==null)}R=zf(R)}catch(D){t=D;continue}break}while(1)}function kf(){var e=ms.current;return ms.current=gs,e===null?gs:e}function Nf(e,t){e<St&&2<e&&(St=e),t!==null&&e<Qn&&2<e&&(Qn=e,ys=t)}function Qs(e){e>Zn&&(Zn=e)}function Lx(){for(;R!==null;)R=Pf(R)}function Vx(){for(;R!==null&&!xx();)R=Pf(R)}function Pf(e){var t=Df(e.alternate,e,Ee);return e.memoizedProps=e.pendingProps,t===null&&(t=zf(e)),Cf.current=null,t}function zf(e){R=e;do{var t=R.alternate;if(e=R.return,(R.effectTag&2048)===0){if(t=Ax(t,R,Ee),Ee===1||R.childExpirationTime!==1){for(var i=0,n=R.child;n!==null;){var r=n.expirationTime,s=n.childExpirationTime;r>i&&(i=r),s>i&&(i=s),n=n.sibling}R.childExpirationTime=i}if(t!==null)return t;e!==null&&(e.effectTag&2048)===0&&(e.firstEffect===null&&(e.firstEffect=R.firstEffect),R.lastEffect!==null&&(e.lastEffect!==null&&(e.lastEffect.nextEffect=R.firstEffect),e.lastEffect=R.lastEffect),1<R.effectTag&&(e.lastEffect!==null?e.lastEffect.nextEffect=R:e.firstEffect=R,e.lastEffect=R))}else{if(t=Ex(R),t!==null)return t.effectTag&=2047,t;e!==null&&(e.firstEffect=e.lastEffect=null,e.effectTag|=2048)}if(t=R.sibling,t!==null)return t;R=e}while(R!==null);return se===hi&&(se=Xl),null}function Ea(e){var t=e.expirationTime;return e=e.childExpirationTime,t>e?t:e}function ti(e){var t=$s();return Xt(99,Rx.bind(null,e,t)),null}function Rx(e,t){do en();while(zn!==null);if((L&(Ke|ct))!==oe)throw Error(S(327));var i=e.finishedWork,n=e.finishedExpirationTime;if(i===null)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,i===e.current)throw Error(S(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var r=Ea(i);if(e.firstPendingTime=r,n<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:n<=e.firstSuspendedTime&&(e.firstSuspendedTime=n-1),n<=e.lastPingedTime&&(e.lastPingedTime=0),n<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===Le&&(R=Le=null,Ee=0),1<i.effectTag?i.lastEffect!==null?(i.lastEffect.nextEffect=i,r=i.firstEffect):r=i:r=i.firstEffect,r!==null){var s=L;L|=ct,Cf.current=null,po=jr;var o=fc();if(sa(o)){if("selectionStart"in o)var a={start:o.selectionStart,end:o.selectionEnd};else e:{a=(a=o.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var u=l.anchorOffset,h=l.focusNode;l=l.focusOffset;try{a.nodeType,h.nodeType}catch{a=null;break e}var p=0,w=-1,C=-1,E=0,T=0,c=o,d=null;t:for(;;){for(var f;c!==a||u!==0&&c.nodeType!==3||(w=p+u),c!==h||l!==0&&c.nodeType!==3||(C=p+l),c.nodeType===3&&(p+=c.nodeValue.length),(f=c.firstChild)!==null;)d=c,c=f;for(;;){if(c===o)break t;if(d===a&&++E===u&&(w=p),d===h&&++T===l&&(C=p),(f=c.nextSibling)!==null)break;c=d,d=c.parentNode}c=f}a=w===-1||C===-1?null:{start:w,end:C}}else a=null}a=a||{start:0,end:0}}else a=null;fo={activeElementDetached:null,focusedElem:o,selectionRange:a},jr=!1,z=r;do try{Bx()}catch(P){if(z===null)throw Error(S(330));fi(z,P),z=z.nextEffect}while(z!==null);z=r;do try{for(o=e,a=t;z!==null;){var g=z.effectTag;if(g&16&&Bn(z.stateNode,""),g&128){var m=z.alternate;if(m!==null){var x=m.ref;x!==null&&(typeof x=="function"?x(null):x.current=null)}}switch(g&1038){case 2:Gc(z),z.effectTag&=-3;break;case 6:Gc(z),z.effectTag&=-3,So(z.alternate,z);break;case 1024:z.effectTag&=-1025;break;case 1028:z.effectTag&=-1025,So(z.alternate,z);break;case 4:So(z.alternate,z);break;case 8:u=z,yf(o,u,a),wf(u)}z=z.nextEffect}}catch(P){if(z===null)throw Error(S(330));fi(z,P),z=z.nextEffect}while(z!==null);if(x=fo,m=fc(),g=x.focusedElem,a=x.selectionRange,m!==g&&g&&g.ownerDocument&&Ep(g.ownerDocument.documentElement,g)){for(a!==null&&sa(g)&&(m=a.start,x=a.end,x===void 0&&(x=m),"selectionStart"in g?(g.selectionStart=m,g.selectionEnd=Math.min(x,g.value.length)):(x=(m=g.ownerDocument||document)&&m.defaultView||window,x.getSelection&&(x=x.getSelection(),u=g.textContent.length,o=Math.min(a.start,u),a=a.end===void 0?o:Math.min(a.end,u),!x.extend&&o>a&&(u=a,a=o,o=u),u=pc(g,o),h=pc(g,a),u&&h&&(x.rangeCount!==1||x.anchorNode!==u.node||x.anchorOffset!==u.offset||x.focusNode!==h.node||x.focusOffset!==h.offset)&&(m=m.createRange(),m.setStart(u.node,u.offset),x.removeAllRanges(),o>a?(x.addRange(m),x.extend(h.node,h.offset)):(m.setEnd(h.node,h.offset),x.addRange(m)))))),m=[],x=g;x=x.parentNode;)x.nodeType===1&&m.push({element:x,left:x.scrollLeft,top:x.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<m.length;g++)x=m[g],x.element.scrollLeft=x.left,x.element.scrollTop=x.top}jr=!!po,fo=po=null,e.current=i,z=r;do try{for(g=e;z!==null;){var y=z.effectTag;if(y&36&&Px(g,z.alternate,z),y&128){m=void 0;var N=z.ref;if(N!==null){var D=z.stateNode;switch(z.tag){case 5:m=D;break;default:m=D}typeof N=="function"?N(m):N.current=m}}z=z.nextEffect}}catch(P){if(z===null)throw Error(S(330));fi(z,P),z=z.nextEffect}while(z!==null);z=null,Sx(),L=s}else e.current=i;if(Cs)Cs=!1,zn=e,wn=t;else for(z=r;z!==null;)t=z.nextEffect,z.nextEffect=null,z=t;if(t=e.firstPendingTime,t===0&&(Ft=null),t===1073741823?e===Ia?Dn++:(Dn=0,Ia=e):Dn=0,typeof Ta=="function"&&Ta(i.stateNode,n),Ve(e),Ss)throw Ss=!1,e=Ma,Ma=null,e;return(L&Gl)!==oe||dt(),null}function Bx(){for(;z!==null;){var e=z.effectTag;(e&256)!==0&&Nx(z.alternate,z),(e&512)===0||Cs||(Cs=!0,Jp(97,function(){return en(),null})),z=z.nextEffect}}function en(){if(wn!==90){var e=97<wn?97:wn;return wn=90,Xt(e,Ox)}}function Ox(){if(zn===null)return!1;var e=zn;if(zn=null,(L&(Ke|ct))!==oe)throw Error(S(331));var t=L;for(L|=ct,e=e.current.firstEffect;e!==null;){try{var i=e;if((i.effectTag&512)!==0)switch(i.tag){case 0:case 11:case 15:case 22:mf(5,i),vf(5,i)}}catch(n){if(e===null)throw Error(S(330));fi(e,n)}i=e.nextEffect,e.nextEffect=null,e=i}return L=t,dt(),!0}function Jc(e,t,i){t=Yl(i,t),t=xf(e,t,1073741823),Ht(e,t),e=Fs(e,1073741823),e!==null&&Ve(e)}function fi(e,t){if(e.tag===3)Jc(e,e,t);else for(var i=e.return;i!==null;){if(i.tag===3){Jc(i,e,t);break}else if(i.tag===1){var n=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Ft===null||!Ft.has(n))){e=Yl(t,e),e=Sf(i,e,1073741823),Ht(i,e),i=Fs(i,1073741823),i!==null&&Ve(i);break}}i=i.return}}function _x(e,t,i){var n=e.pingCache;n!==null&&n.delete(t),Le===e&&Ee===i?se===Ws||se===ws&&St===1073741823&&$e()-Jl<Mf?oi(e,Ee):xs=!0:jf(e,i)&&(t=e.lastPingedTime,t!==0&&t<i||(e.lastPingedTime=i,Ve(e)))}function $x(e,t){var i=e.stateNode;i!==null&&i.delete(t),t=0,t===0&&(t=ut(),t=pi(t,e,null)),e=Fs(e,t),e!==null&&Ve(e)}var Df;Df=function(e,t,i){var n=t.expirationTime;if(e!==null){var r=t.pendingProps;if(e.memoizedProps!==r||Ie.current)ot=!0;else{if(n<i){switch(ot=!1,t.tag){case 3:Uc(t),wo();break;case 5:if(jc(t),t.mode&4&&i!==1&&r.hidden)return t.expirationTime=t.childExpirationTime=1,null;break;case 1:Ae(t.type)&&Br(t);break;case 4:fa(t,t.stateNode.containerInfo);break;case 10:n=t.memoizedProps.value,r=t.type._context,ie(as,r._currentValue),r._currentValue=n;break;case 13:if(t.memoizedState!==null)return n=t.child.childExpirationTime,n!==0&&n>=i?Wc(e,t,i):(ie(K,K.current&1),t=bt(e,t,i),t!==null?t.sibling:null);ie(K,K.current&1);break;case 19:if(n=t.childExpirationTime>=i,(e.effectTag&64)!==0){if(n)return Fc(e,t,i);t.effectTag|=64}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null),ie(K,K.current),!n)return null}return bt(e,t,i)}ot=!1}}else ot=!1;switch(t.expirationTime=0,t.tag){case 2:if(n=t.type,e!==null&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,r=Yi(t,me.current),_i(t,i),r=Hl(null,t,n,e,r,i),t.effectTag|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ae(n)){var s=!0;Br(t)}else s=!1;t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,Bl(t);var o=n.getDerivedStateFromProps;typeof o=="function"&&cs(t,n,o,e),r.updater=Us,t.stateNode=r,r._reactInternalFiber=t,pa(t,n,e,i),t=ya(null,t,n,!0,s,i)}else t.tag=0,Pe(null,t,r,i),t=t.child;return t;case 16:e:{if(r=t.elementType,e!==null&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,m0(r),r._status!==1)throw r._result;switch(r=r._result,t.type=r,s=t.tag=Hx(r),e=Ge(r,e),s){case 0:t=wa(null,t,r,e,i);break e;case 1:t=$c(null,t,r,e,i);break e;case 11:t=Oc(null,t,r,e,i);break e;case 14:t=_c(null,t,r,Ge(r.type,e),n,i);break e}throw Error(S(306,r,""))}return t;case 0:return n=t.type,r=t.pendingProps,r=t.elementType===n?r:Ge(n,r),wa(e,t,n,r,i);case 1:return n=t.type,r=t.pendingProps,r=t.elementType===n?r:Ge(n,r),$c(e,t,n,r,i);case 3:if(Uc(t),n=t.updateQueue,e===null||n===null)throw Error(S(282));if(n=t.pendingProps,r=t.memoizedState,r=r!==null?r.element:null,Ol(e,t),Wn(t,n,null,i),n=t.memoizedState.element,n===r)wo(),t=bt(e,t,i);else{if((r=t.stateNode.hydrate)&&(Vt=Oi(t.stateNode.containerInfo.firstChild),Ct=t,r=di=!0),r)for(i=_l(t,null,n,i),t.child=i;i;)i.effectTag=i.effectTag&-3|1024,i=i.sibling;else Pe(e,t,n,i),wo();t=t.child}return t;case 5:return jc(t),e===null&&va(t),n=t.type,r=t.pendingProps,s=e!==null?e.memoizedProps:null,o=r.children,oa(n,r)?o=null:s!==null&&oa(n,s)&&(t.effectTag|=16),hf(e,t),t.mode&4&&i!==1&&r.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(Pe(e,t,o,i),t=t.child),t;case 6:return e===null&&va(t),null;case 13:return Wc(e,t,i);case 4:return fa(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Gi(t,null,n,i):Pe(e,t,n,i),t.child;case 11:return n=t.type,r=t.pendingProps,r=t.elementType===n?r:Ge(n,r),Oc(e,t,n,r,i);case 7:return Pe(e,t,t.pendingProps,i),t.child;case 8:return Pe(e,t,t.pendingProps.children,i),t.child;case 12:return Pe(e,t,t.pendingProps.children,i),t.child;case 10:e:{n=t.type._context,r=t.pendingProps,o=t.memoizedProps,s=r.value;var a=t.type._context;if(ie(as,a._currentValue),a._currentValue=s,o!==null)if(a=o.value,s=wi(a,s)?0:(typeof n._calculateChangedBits=="function"?n._calculateChangedBits(a,s):1073741823)|0,s===0){if(o.children===r.children&&!Ie.current){t=bt(e,t,i);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var u=l.firstContext;u!==null;){if(u.context===n&&(u.observedBits&s)!==0){a.tag===1&&(u=Wt(i,null),u.tag=2,Ht(a,u)),a.expirationTime<i&&(a.expirationTime=i),u=a.alternate,u!==null&&u.expirationTime<i&&(u.expirationTime=i),qp(a.return,i),l.expirationTime<i&&(l.expirationTime=i);break}u=u.next}}else o=a.tag===10&&a.type===t.type?null:a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}Pe(e,t,r.children,i),t=t.child}return t;case 9:return r=t.type,s=t.pendingProps,n=s.children,_i(t,i),r=We(r,s.unstable_observedBits),n=n(r),t.effectTag|=1,Pe(e,t,n,i),t.child;case 14:return r=t.type,s=Ge(r,t.pendingProps),s=Ge(r.type,s),_c(e,t,r,s,n,i);case 15:return df(e,t,t.type,t.pendingProps,n,i);case 17:return n=t.type,r=t.pendingProps,r=t.elementType===n?r:Ge(n,r),e!==null&&(e.alternate=null,t.alternate=null,t.effectTag|=2),t.tag=1,Ae(n)?(e=!0,Br(t)):e=!1,_i(t,i),tf(t,n,r),pa(t,n,r,i),ya(null,t,n,!0,e,i);case 19:return Fc(e,t,i)}throw Error(S(156,t.tag))};var Ta=null,ka=null;function Ux(e){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined")return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)return!0;try{var i=t.inject(e);Ta=function(n){try{t.onCommitFiberRoot(i,n,void 0,(n.current.effectTag&64)===64)}catch{}},ka=function(n){try{t.onCommitFiberUnmount(i,n)}catch{}}}catch{}return!0}function Wx(e,t,i,n){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childExpirationTime=this.expirationTime=0,this.alternate=null}function at(e,t,i,n){return new Wx(e,t,i,n)}function Kl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Hx(e){if(typeof e=="function")return Kl(e)?1:0;if(e!=null){if(e=e.$$typeof,e===wl)return 11;if(e===yl)return 14}return 2}function xi(e,t){var i=e.alternate;return i===null?(i=at(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.effectTag=0,i.nextEffect=null,i.firstEffect=null,i.lastEffect=null),i.childExpirationTime=e.childExpirationTime,i.expirationTime=e.expirationTime,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{expirationTime:t.expirationTime,firstContext:t.firstContext,responders:t.responders},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i}function Hr(e,t,i,n,r,s){var o=2;if(n=e,typeof e=="function")Kl(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case ii:return Rt(i.children,r,s,t);case g0:o=8,r|=7;break;case Jh:o=8,r|=1;break;case Pr:return e=at(12,i,t,r|8),e.elementType=Pr,e.type=Pr,e.expirationTime=s,e;case zr:return e=at(13,i,t,r),e.type=zr,e.elementType=zr,e.expirationTime=s,e;case Fo:return e=at(19,i,t,r),e.elementType=Fo,e.expirationTime=s,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Kh:o=10;break e;case qh:o=9;break e;case wl:o=11;break e;case yl:o=14;break e;case ep:o=16,n=null;break e;case tp:o=22;break e}throw Error(S(130,e==null?e:typeof e,""))}return t=at(o,i,t,r),t.elementType=e,t.type=n,t.expirationTime=s,t}function Rt(e,t,i,n){return e=at(7,e,n,t),e.expirationTime=i,e}function Co(e,t,i){return e=at(6,e,null,t),e.expirationTime=i,e}function bo(e,t,i){return t=at(4,e.children!==null?e.children:[],e.key,t),t.expirationTime=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Fx(e,t,i){this.tag=t,this.current=null,this.containerInfo=e,this.pingCache=this.pendingChildren=null,this.finishedExpirationTime=0,this.finishedWork=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=i,this.callbackNode=null,this.callbackPriority=90,this.lastExpiredTime=this.lastPingedTime=this.nextKnownPendingLevel=this.lastSuspendedTime=this.firstSuspendedTime=this.firstPendingTime=0}function jf(e,t){var i=e.firstSuspendedTime;return e=e.lastSuspendedTime,i!==0&&i>=t&&e<=t}function ai(e,t){var i=e.firstSuspendedTime,n=e.lastSuspendedTime;i<t&&(e.firstSuspendedTime=t),(n>t||i===0)&&(e.lastSuspendedTime=t),t<=e.lastPingedTime&&(e.lastPingedTime=0),t<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function Lf(e,t){t>e.firstPendingTime&&(e.firstPendingTime=t);var i=e.firstSuspendedTime;i!==0&&(t>=i?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:t>=e.lastSuspendedTime&&(e.lastSuspendedTime=t+1),t>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=t))}function Na(e,t){var i=e.lastExpiredTime;(i===0||i>t)&&(e.lastExpiredTime=t)}function bs(e,t,i,n){var r=t.current,s=ut(),o=Pn.suspense;s=pi(s,r,o);e:if(i){i=i._reactInternalFiber;t:{if(Mi(i)!==i||i.tag!==1)throw Error(S(170));var a=i;do{switch(a.tag){case 3:a=a.stateNode.context;break t;case 1:if(Ae(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break t}}a=a.return}while(a!==null);throw Error(S(171))}if(i.tag===1){var l=i.type;if(Ae(l)){i=Wp(i,l,a);break e}}i=a}else i=Gt;return t.context===null?t.context=i:t.pendingContext=i,t=Wt(s,o),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),Ht(r,t),Qt(r,s),s}function Mo(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Kc(e,t){e=e.memoizedState,e!==null&&e.dehydrated!==null&&e.retryTime<t&&(e.retryTime=t)}function ql(e,t){Kc(e,t),(e=e.alternate)&&Kc(e,t)}function eu(e,t,i){i=i!=null&&i.hydrate===!0;var n=new Fx(e,t,i),r=at(3,null,null,t===2?7:t===1?3:0);n.current=r,r.stateNode=n,Bl(r),e[er]=n.current,i&&t!==0&&C0(e,e.nodeType===9?e:e.ownerDocument),this._internalRoot=n}eu.prototype.render=function(e){bs(e,this._internalRoot,null,null)};eu.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;bs(null,e,null,function(){t[er]=null})};function or(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Qx(e,t){if(t||(t=e?e.nodeType===9?e.documentElement:e.firstChild:null,t=!(!t||t.nodeType!==1||!t.hasAttribute("data-reactroot"))),!t)for(var i;i=e.lastChild;)e.removeChild(i);return new eu(e,0,t?{hydrate:!0}:void 0)}function Zs(e,t,i,n,r){var s=i._reactRootContainer;if(s){var o=s._internalRoot;if(typeof r=="function"){var a=r;r=function(){var u=Mo(o);a.call(u)}}bs(t,o,e,r)}else{if(s=i._reactRootContainer=Qx(i,n),o=s._internalRoot,typeof r=="function"){var l=r;r=function(){var u=Mo(o);l.call(u)}}Ef(function(){bs(t,o,e,r)})}return Mo(o)}function Zx(e,t,i){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ti,key:n==null?null:""+n,children:e,containerInfo:t,implementation:i}}xp=function(e){if(e.tag===13){var t=_r(ut(),150,100);Qt(e,t),ql(e,t)}};Ml=function(e){e.tag===13&&(Qt(e,3),ql(e,3))};Sp=function(e){if(e.tag===13){var t=ut();t=pi(t,e,null),Qt(e,t),ql(e,t)}};Ho=function(e,t,i){switch(t){case"input":if(Zo(e,i),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<i.length;t++){var n=i[t];if(n!==e&&n.form===e.form){var r=Pl(n);if(!r)throw Error(S(90));np(n),Zo(n,r)}}}break;case"textarea":sp(e,i);break;case"select":t=i.value,t!=null&&Bi(e,!!i.multiple,t,!1)}};hl=Af;Yh=function(e,t,i,n,r){var s=L;L|=4;try{return Xt(98,e.bind(null,t,i,n,r))}finally{L=s,L===oe&&dt()}};pl=function(){(L&(1|Ke|ct))===oe&&(jx(),en())};Gh=function(e,t){var i=L;L|=2;try{return e(t)}finally{L=i,L===oe&&dt()}};function Vf(e,t){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!or(t))throw Error(S(200));return Zx(e,t,null,i)}var Yx={Events:[ir,vi,Pl,Fh,Wo,Zi,function(e){Cl(e,L0)},Qh,Zh,Bs,Rs,en,{current:!1}]};(function(e){var t=e.findFiberByHostInstance;return Ux(xe({},e,{overrideHookState:null,overrideProps:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Je.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=gp(i),i===null?null:i.stateNode},findFiberByHostInstance:function(i){return t?t(i):null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null}))})({findFiberByHostInstance:tr,bundleType:0,version:"16.14.0",rendererPackageName:"react-dom"});He.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Yx;He.createPortal=Vf;He.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternalFiber;if(t===void 0)throw typeof e.render=="function"?Error(S(188)):Error(S(268,Object.keys(e)));return e=gp(t),e=e===null?null:e.stateNode,e};He.flushSync=function(e,t){if((L&(Ke|ct))!==oe)throw Error(S(187));var i=L;L|=1;try{return Xt(99,e.bind(null,t))}finally{L=i,dt()}};He.hydrate=function(e,t,i){if(!or(t))throw Error(S(200));return Zs(null,e,t,!0,i)};He.render=function(e,t,i){if(!or(t))throw Error(S(200));return Zs(null,e,t,!1,i)};He.unmountComponentAtNode=function(e){if(!or(e))throw Error(S(40));return e._reactRootContainer?(Ef(function(){Zs(null,null,e,!1,function(){e._reactRootContainer=null,e[er]=null})}),!0):!1};He.unstable_batchedUpdates=Af;He.unstable_createPortal=function(e,t){return Vf(e,t,2<arguments.length&&arguments[2]!==void 0?arguments[2]:null)};He.unstable_renderSubtreeIntoContainer=function(e,t,i,n){if(!or(i))throw Error(S(200));if(e==null||e._reactInternalFiber===void 0)throw Error(S(38));return Zs(e,t,i,!1,n)};He.version="16.14.0";function Rf(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Rf)}catch(e){console.error(e)}}Rf(),Oh.exports=He;var qc=Oh.exports,Gx=Object.defineProperty,Xx=Object.defineProperties,Jx=Object.getOwnPropertyDescriptors,ed=Object.getOwnPropertySymbols,Kx=Object.prototype.hasOwnProperty,qx=Object.prototype.propertyIsEnumerable,td=(e,t,i)=>t in e?Gx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,De=(e,t)=>{for(var i in t||(t={}))Kx.call(t,i)&&td(e,i,t[i]);if(ed)for(var i of ed(t))qx.call(t,i)&&td(e,i,t[i]);return e};const Bf={src:"",currentTime:0,hostTime:0,muted:!1,paused:!0,volume:1},Of={currentTimeMaxError:1,syncInterval:1e3,retryInterval:15e3,verbose:!1,log:console.log.bind(console)};let Nt=Of;function eS(e){Nt=De(De({},Of),e)}function Mr(e,t){if(e.paused)return e.currentTime;const i=function(n){if(n.player)return n.player.beginTimestamp+n.player.progressTime;if(n.room)return n.room.calibrationTimestamp}(t);return i?e.currentTime+(i-e.hostTime)/1e3:e.currentTime}const tS=navigator.userAgent.includes("Safari"),iS=[".aac",".mid",".midi",".mp3",".ogg",".oga",".wav",".weba"];var nS=typeof global=="object"&&global&&global.Object===Object&&global,rS=typeof self=="object"&&self&&self.Object===Object&&self,_f=nS||rS||Function("return this")(),Ms=_f.Symbol,$f=Object.prototype,sS=$f.hasOwnProperty,oS=$f.toString,hn=Ms?Ms.toStringTag:void 0,aS=Object.prototype.toString,id=Ms?Ms.toStringTag:void 0;function lS(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":id&&id in Object(e)?function(t){var i=sS.call(t,hn),n=t[hn];try{t[hn]=void 0;var r=!0}catch{}var s=oS.call(t);return r&&(i?t[hn]=n:delete t[hn]),s}(e):function(t){return aS.call(t)}(e)}var uS=/\s/,cS=/^\s+/;function dS(e){return e&&e.slice(0,function(t){for(var i=t.length;i--&&uS.test(t.charAt(i)););return i}(e)+1).replace(cS,"")}function Pa(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var hS=/^[-+]0x[0-9a-f]+$/i,pS=/^0b[01]+$/i,fS=/^0o[0-7]+$/i,gS=parseInt;function nd(e){if(typeof e=="number")return e;if(function(n){return typeof n=="symbol"||function(r){return r!=null&&typeof r=="object"}(n)&&lS(n)=="[object Symbol]"}(e))return NaN;if(Pa(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Pa(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=dS(e);var i=pS.test(e);return i||fS.test(e)?gS(e.slice(2),i?2:8):hS.test(e)?NaN:+e}var Io=function(){return _f.Date.now()},mS=Math.max,vS=Math.min;function Ir(e,t,i){var n,r,s,o,a,l,u=0,h=!1,p=!1,w=!0;if(typeof e!="function")throw new TypeError("Expected a function");function C(g){var m=n,x=r;return n=r=void 0,u=g,o=e.apply(x,m)}function E(g){return u=g,a=setTimeout(c,t),h?C(g):o}function T(g){var m=g-l;return l===void 0||m>=t||m<0||p&&g-u>=s}function c(){var g=Io();if(T(g))return d(g);a=setTimeout(c,function(m){var x=t-(m-l);return p?vS(x,s-(m-u)):x}(g))}function d(g){return a=void 0,w&&n?C(g):(n=r=void 0,o)}function f(){var g=Io(),m=T(g);if(n=arguments,r=this,l=g,m){if(a===void 0)return E(l);if(p)return clearTimeout(a),a=setTimeout(c,t),C(l)}return a===void 0&&(a=setTimeout(c,t)),o}return t=nd(t)||0,Pa(i)&&(h=!!i.leading,s=(p="maxWait"in i)?mS(nd(i.maxWait)||0,t):s,w="trailing"in i?!!i.trailing:w),f.cancel=function(){a!==void 0&&clearTimeout(a),u=0,n=l=r=a=void 0},f.flush=function(){return a===void 0?o:d(Io())},f}class rd extends bi.exports.Component{constructor(t){super(t),this.seeking=!1,this.mobileSeeking=!1,this.track=null,this.hoverTime=null,this.offset=0,this.secondsPrefix="00:00:",this.minutesPrefix="00:",this.seekPause=!1,this.handleTouchSeeking=i=>{let n=0;for(let r=0;r<i.changedTouches.length;r++)n=i.changedTouches[r].pageX;n=n<0?0:n,this.mobileSeeking&&this.changeCurrentTimePosition(n)},this.handleSeeking=i=>{this.seeking&&this.changeCurrentTimePosition(i.pageX)},this.setTrackWidthState=()=>{this.track&&this.setState({trackWidth:this.track.offsetWidth})},this.handleTrackHover=(i,n)=>{if(this.track){const r=this.props.scale||1;let s;s=i?0:(n.pageX-this.track.getBoundingClientRect().left)/r,this.setState({seekHoverPosition:s,trackWidth:this.track.offsetWidth})}},this.mouseSeekingHandler=i=>{this.setSeeking(!1,i),this.onMouseUp()},this.setSeeking=(i,n)=>{n.preventDefault(),this.handleSeeking(n),this.seeking=i,this.setState({seekHoverPosition:i?this.state.seekHoverPosition:0})},this.mobileTouchSeekingHandler=()=>{this.setMobileSeeking(!1)},this.setMobileSeeking=i=>{this.mobileSeeking=i,this.setState({seekHoverPosition:i?this.state.seekHoverPosition:0})},this.renderBufferProgress=()=>{if(this.props.buffered){const i=De(De({},this.getPositionStyle(this.props.buffered)),this.props.bufferColor&&{backgroundColor:this.props.bufferColor});return O.createElement("div",{className:"buffered",style:i})}return null},this.renderProgress=()=>{const i=De(De({},this.getPositionStyle(this.props.current)),this.props.sliderColor&&{backgroundColor:this.props.sliderColor});return O.createElement("div",{className:"connect",style:i})},this.renderHoverProgress=()=>{const i=De(De({},this.getSeekHoverPosition()),this.props.sliderHoverColor&&{backgroundColor:this.props.sliderHoverColor});return O.createElement("div",{className:"seek-hover",style:i})},this.renderThumb=()=>O.createElement("div",{className:this.isThumbActive()?"thumb active":"thumb",style:this.getThumbHandlerPosition()},O.createElement("div",{style:{backgroundColor:this.props.thumbColor},className:"handler"})),this.onMouseDown=i=>{var n,r;this.props.pause&&!this.props.paused&&(this.props.pause(),this.seekPause=!0),this.setSeeking(!0,i),(r=(n=this.props).onSeekStart)==null||r.call(n)},this.onMouseUp=()=>{var i,n;this.props.play&&this.seekPause&&(this.props.play(),this.seekPause=!1),(n=(i=this.props).onSeekEnd)==null||n.call(i)},this.props.secondsPrefix&&(this.secondsPrefix=this.props.secondsPrefix),this.props.minutesPrefix&&(this.minutesPrefix=this.props.minutesPrefix),this.state={ready:!1,trackWidth:0,seekHoverPosition:0}}componentDidMount(){this.setTrackWidthState(),window.addEventListener("resize",this.setTrackWidthState),window.addEventListener("mousemove",this.handleSeeking),window.addEventListener("mouseup",this.mouseSeekingHandler),window.addEventListener("touchmove",this.handleTouchSeeking),window.addEventListener("touchend",this.mobileTouchSeekingHandler)}componentWillUnmount(){window.removeEventListener("resize",this.setTrackWidthState),window.removeEventListener("mousemove",this.handleSeeking),window.removeEventListener("mouseup",this.mouseSeekingHandler),window.removeEventListener("touchmove",this.handleTouchSeeking),window.removeEventListener("touchend",this.mobileTouchSeekingHandler)}changeCurrentTimePosition(t){if(this.track){const i=this.props.scale||1;let n=(t-this.track.getBoundingClientRect().left)/i;n=Math.min(this.state.trackWidth,Math.max(0,n)),this.setState({seekHoverPosition:n});const r=+(n/this.state.trackWidth*this.props.total).toFixed(0);this.props.onChange(r)}}getPositionStyle(t){return{transform:`scaleX(${100*t/this.props.total/100})`}}getThumbHandlerPosition(){return{transform:`translateX(${this.state.trackWidth/(this.props.total/this.props.current)}px)`}}getSeekHoverPosition(){return{transform:`scaleX(${100*this.state.seekHoverPosition/this.state.trackWidth/100})`}}getHoverTimePosition(){let t=0;return this.hoverTime&&(t=this.state.seekHoverPosition-this.hoverTime.offsetWidth/2,this.props.limitTimeTooltipBySides&&(t<0?t=0:t+this.hoverTime.offsetWidth>this.state.trackWidth&&(t=this.state.trackWidth-this.hoverTime.offsetWidth))),{transform:`translateX(${t}px)`}}secondsToTime(t){t=Math.round(t+this.offset);const i=Math.floor(t/3600),n=t%3600,r=Math.floor(n/60),s=Math.ceil(n%60);return{hh:i.toString(),mm:r<10?"0"+r:r.toString(),ss:s<10?"0"+s:s.toString()}}getHoverTime(){const t=100*this.state.seekHoverPosition/this.state.trackWidth,i=Math.floor(+t*(this.props.total/100)),n=this.secondsToTime(i);return this.props.total+this.offset<60?this.secondsPrefix+n.ss:this.props.total+this.offset<3600?this.minutesPrefix+n.mm+":"+n.ss:n.hh+":"+n.mm+":"+n.ss}isThumbActive(){return this.state.seekHoverPosition>0||this.seeking}drawHoverTime(){return this.props.hideHoverTime?null:O.createElement("div",{className:this.isThumbActive()?"hover-time active":"hover-time",style:this.getHoverTimePosition(),ref:t=>this.hoverTime=t},this.getHoverTime())}render(){return O.createElement("div",{className:"seek-slider"},O.createElement("div",{className:"track",ref:t=>this.track=t,onMouseMove:t=>this.handleTrackHover(!1,t),onMouseLeave:t=>this.handleTrackHover(!0,t),onMouseDown:this.onMouseDown,onTouchStart:t=>{this.setMobileSeeking(!0),this.onMouseDown(t)},onMouseUp:this.onMouseUp,onTouchEnd:this.onMouseUp},O.createElement("div",{className:"main"},this.renderBufferProgress(),this.renderHoverProgress(),this.renderProgress())),this.drawHoverTime(),this.renderThumb())}}class wS extends bi.exports.Component{constructor(t){super(t),this.stageVolume=0,this.updateVolumeTimer=0,this.onVolumeSeeking=!1,this.onClickOperationButton=()=>{const{paused:i}=this.props;i?this.props.play():this.props.pause()},this.operationButton=()=>{const{paused:i}=this.props;return i?O.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNOCA1LjE0djE0bDExLTdsLTExLTd6IiBmaWxsPSIjZmZmIj48L3BhdGg+PC9zdmc+Cg=="}):O.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTQgMTloNFY1aC00TTYgMTloNFY1SDZ2MTR6IiBmaWxsPSIjZmZmIj48L3BhdGg+PC9zdmc+Cg=="})},this.operationVolumeButton=()=>this.props.volume>.9?O.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTQgMy4yM3YyLjA2YzIuODkuODYgNSAzLjU0IDUgNi43MXMtMi4xMSA1Ljg0LTUgNi43djIuMDdjNC0uOTEgNy00LjQ5IDctOC43N2MwLTQuMjgtMy03Ljg2LTctOC43N00xNi41IDEyYzAtMS43Ny0xLTMuMjktMi41LTQuMDNWMTZjMS41LS43MSAyLjUtMi4yNCAyLjUtNE0zIDl2Nmg0bDUgNVY0TDcgOUgzeiIgZmlsbD0iI2ZmZiI+PC9wYXRoPjwvc3ZnPgo="}):this.props.volume===0?O.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNyA5djZoNGw1IDVWNGwtNSA1SDd6IiBmaWxsPSIjZmZmIj48L3BhdGg+PC9zdmc+Cg=="}):O.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNSA5djZoNGw1IDVWNEw5IDltOS41IDNjMC0xLjc3LTEtMy4yOS0yLjUtNC4wM1YxNmMxLjUtLjcxIDIuNS0yLjI0IDIuNS00eiIgZmlsbD0iI2ZmZiI+PC9wYXRoPjwvc3ZnPgo="}),this.handleClickVolume=()=>{this.props.volume===0?this.stageVolume!==0?this.props.setVolume(this.stageVolume):this.props.setVolume(1):(this.stageVolume=this.props.volume,this.props.setVolume(0))},this.onChange=i=>{this.setState({currentTime:i}),i&&this.changeTime(i)},this.changeTime=Ir(i=>{this.props.setCurrentTime(i)},50),this.onVolumeChange=i=>{this.changeVolume(i),this.setState({seekVolume:i/100})},this.changeVolume=Ir(i=>{this.props.setVolume(i/100)},50),this.onVolumeSeekStart=()=>{this.onVolumeSeeking=!0},this.onVolumeSeekEnd=Ir(()=>{this.onVolumeSeeking=!1},500),this.onProgressSeekStart=()=>this.setState({isPlayerSeeking:!0}),this.onProgressSeekEnd=Ir(()=>{this.setState({isPlayerSeeking:!1})},500),this.state={isPlayerSeeking:!1,isVolumeHover:!1,seekVolume:1,visible:!0,currentTime:0},this.stageVolume=t.volume}componentDidMount(){this.updateVolumeTimer=setInterval(()=>{this.onVolumeSeeking||this.setState({seekVolume:this.props.volume}),this.state.isPlayerSeeking||this.setState({currentTime:this.props.currentTime})},100)}componentWillUnmount(){this.updateVolumeTimer&&clearInterval(this.updateVolumeTimer)}render(){const{duration:t,currentTime:i}=this.props;return O.createElement("div",{className:"player-controller",style:{opacity:this.props.visible?"1":"0"}},O.createElement("div",{className:"player-controller-progress"},O.createElement(rd,{total:t,current:this.state.currentTime,onChange:this.onChange,buffered:this.props.buffered,bufferColor:"rgba(255,255,255,0.3)",hideHoverTime:!0,limitTimeTooltipBySides:!0,onSeekStart:this.onProgressSeekStart,onSeekEnd:this.onProgressSeekEnd,play:this.props.play,pause:this.props.pause,paused:this.props.paused,scale:this.props.scale})),O.createElement("div",{className:"player-controller-actions"},O.createElement("div",{className:"player-controller-actions-left"},O.createElement("div",{onClick:this.onClickOperationButton,className:"player-controller-play"},this.operationButton()),O.createElement("div",{className:"player-volume-box",onMouseEnter:()=>this.setState({isVolumeHover:!0}),onMouseLeave:()=>this.setState({isVolumeHover:!1})},O.createElement("div",{onClick:this.handleClickVolume,className:"player-volume"},this.operationVolumeButton()),O.createElement("div",{className:"player-volume-slider"},O.createElement(rd,{total:100,current:100*this.state.seekVolume,onChange:this.onVolumeChange,onSeekStart:this.onVolumeSeekStart,onSeekEnd:this.onVolumeSeekEnd,scale:this.props.scale,limitTimeTooltipBySides:!0,hideHoverTime:!0})))),O.createElement("div",{className:"player-mid-box-time"},sd(Math.floor(i/1e3))," /"," ",sd(Math.floor(t/1e3)))))}}function sd(e){const t=e%60,i=(e-t)/60;if(i>=60){const n=i%60;return`${pn((i-n)/60)}:${pn(n)}:${pn(t)}`}return`${pn(i)}:${pn(t)}`}function pn(e){return e<=9?`0${e}`:`${e}`}class yS extends bi.exports.Component{constructor(){super(...arguments),this.putAttributes=t=>{const{context:i}=this.props,n=i.getAttributes()||{};for(const r in t)n[r]!==t[r]&&i.updateAttributes([r],t[r])}}render(){const{context:t}=this.props,i=t.getRoom(),n=i?void 0:t.getDisplayer(),r=this.putAttributes;return O.createElement(xS,{room:i,player:n,context:t,plugin:{putAttributes:r}})}}class xS extends bi.exports.Component{constructor(t){super(t),this.alertMask=null,this.container=O.createRef(),this.controllerHiddenTimer=0,this.syncPlayerTimer=0,this.retryCount=0,this.decreaseRetryTimer=0,this.noSoundSyncCount=0,this.showController=()=>{this.setState({controllerVisible:!0}),this.debounceHidingController()},this.play=()=>{var i;const n=(i=this.props.room)==null?void 0:i.calibrationTimestamp;this.debug(">>> play",{paused:!1,hostTime:n}),this.isEnabled()&&this.props.plugin.putAttributes({paused:!1,hostTime:n})},this.pause=()=>{const i=Mr(this.getAttributes(),this.props);this.debug(">>> pause",{paused:!0,currentTime:i}),this.isEnabled()&&this.props.plugin.putAttributes({paused:!0,currentTime:i})},this.setVolume=i=>{this.debug(">>> volume",{volume:i}),this.isEnabled()&&this.props.plugin.putAttributes({volume:i}),this.isEnabled()&&this.props.plugin.putAttributes({volume:i,muted:i===0})},this.setCurrentTime=i=>{var n;const r=(n=this.props.room)==null?void 0:n.calibrationTimestamp;this.debug(">>> seek",{currentTime:i/1e3,hostTime:r}),this.isEnabled()&&this.props.plugin.putAttributes({currentTime:i/1e3,hostTime:r})},this.resetPlayer=()=>{var i;(i=this.player)==null||i.autoplay(!1),this.state.NoSound||(this.debug(">>> ended",{paused:!0,currentTime:0}),this.isEnabled()&&this.props.plugin.putAttributes({paused:!0,currentTime:0}))},this.syncPlayerWithAttributes=()=>{var i;const n=this.getAttributes();if(!n)return;const r=this.player;if(!r||this.state.NoSound&&(this.noSoundSyncCount+=1)%8!=0)return;r.paused()!==n.paused&&(this.debug("<<< paused -> %o",n.paused),n.paused?r.pause():(i=r.play())==null||i.catch(this.catchPlayFail)),r.muted()!==n.muted&&(this.debug("<<< muted -> %o",n.muted),r.muted(n.muted)),r.volume()!==n.volume&&(this.debug("<<< volume -> %o",n.volume),r.volume(n.volume));const s=Mr(n,this.props);let o=Nt.currentTimeMaxError;this.state.NoSound&&(o*=3),s>r.duration()?this.resetPlayer():Math.abs(r.currentTime()-s)>o&&(this.debug("<<< currentTime -> %o",s),r.currentTime(s))},this.debounceHidingController=()=>{this.controllerHiddenTimer&&(clearTimeout(this.controllerHiddenTimer),this.controllerHiddenTimer=0),this.controllerHiddenTimer=setTimeout(()=>{this.setState({controllerVisible:!1}),this.controllerHiddenTimer=0},3e3)},this.decreaseRetryCount=()=>{this.player&&this.retryCount>0&&(this.retryCount=this.retryCount-1)},this.catchPlayFail=i=>{var n,r;const s=String(i);if(tS&&s.includes("NotAllowedError")||s.includes("interact"))(n=this.player)==null||n.autoplay("any"),this.setState({NoSound:!0});else{const o=(r=this.player)==null?void 0:r.error();o&&(this.retryCount<=3?(this.initPlayer(),this.retryCount=this.retryCount+1):(this.debug("catch videojs media error",o),this.setState({MediaError:!0}))),this.debug("catch error",i)}},this.fixPlayFail=()=>{this.debug("try to fix play state"),this.setState({NoSound:!1});const{muted:i,volume:n}=this.getAttributes();this.player&&(this.player.muted(i),this.player.volume(n))},this.initPlayer=async()=>{var i;(i=this.player)==null||i.dispose(),this.player=void 0,this.debug("creating elements ...");const{type:n,src:r,poster:s}=this.getAttributes(),o=document.createElement("div");o.setAttribute("data-vjs-player","");const a=document.createElement("video");a.className="video-js",s&&(a.poster=s),a.setAttribute("playsInline",""),a.setAttribute("webkit-playsinline","");const l=document.createElement("source");new URL(r).pathname.endsWith(".m3u8")?l.type="application/x-mpegURL":a.src=r,l.src=r,n&&(l.type=n),a.appendChild(l),o.appendChild(a),this.container.current.appendChild(o),await new Promise(h=>(window.requestAnimationFrame||window.setTimeout)(h)),this.debug("initializing videojs() ...");const u=su.default(a);this.player=u,window.player=u,u.one("loadedmetadata",this.gracefullyUpdate),u.on("ready",()=>{var h;(h=Nt.onPlayer)==null||h.call(Nt,u),u.on("timeupdate",this.gracefullyUpdate),u.on("volumechange",this.gracefullyUpdate),u.on("seeked",this.gracefullyUpdate),u.on("play",this.gracefullyUpdate),u.on("pause",this.gracefullyUpdate),u.on("ended",this.resetPlayer)}),u.on("error",this.catchPlayFail),this.setState({MediaError:!1})},this.gracefullyUpdate=()=>this.setState({updater:!this.state.updater}),this.setupAlert=i=>{i&&(i.addEventListener("touchstart",this.fixPlayFail),i.addEventListener("click",this.fixPlayFail)),this.alertMask=i},this.setupReload=i=>{i&&(i.addEventListener("touchstart",this.initPlayer),i.addEventListener("click",this.initPlayer))},this.state={NoSound:!1,MediaError:!1,updater:!1,controllerVisible:!1},t.room&&function(i){if(!i.calibrationTimestamp)throw new Error("@netless/app-media-player@0.1.0-alpha.5 requires white-web-sdk@^2.13.8 to work properly.")}(t.room)}getAttributes(){const{context:t}=this.props;let i=t.getAttributes();if(i){if(i=De(De({},Bf),i),this.player){let r=Mr(i,this.props),s=this.player.duration();!i.paused&&r>s&&(n=De({},i),i=Xx(n,Jx({currentTime:0,paused:!0})),this.resetPlayer())}var n;return i}}isShowingPoster(){const t=this.getAttributes();return!(t!=null&&t.src)||iS.some(i=>t.src.endsWith(i))}render(){var t,i;if(!this.props.room&&!this.props.player)return null;const n=this.getAttributes();if(!n)return null;const r=1e3*(((t=this.player)==null?void 0:t.duration())||1e3),s=((i=this.player)==null?void 0:i.bufferedPercent())||0;return O.createElement("div",{className:this.isEnabled()?"vjs-p":"vjs-p disabled",onMouseEnter:this.showController,onMouseMove:this.showController},O.createElement("div",{className:"video-js-plugin-player",ref:this.container}),this.isShowingPoster()&&O.createElement("div",{className:"video-js-plugin-poster"},n.poster&&O.createElement("img",{src:n.poster,alt:"",draggable:!1})),O.createElement(wS,{duration:r,volume:n.volume,setVolume:this.setVolume,paused:n.paused,play:this.play,pause:this.pause,currentTime:1e3*Mr(n,this.props),setCurrentTime:this.setCurrentTime,buffered:r*s,visible:!0}),this.state.NoSound&&O.createElement("div",{ref:this.setupAlert,className:"videojs-plugin-muted-alert"}),this.state.MediaError&&O.createElement("div",{className:"videojs-plugin-recovery-mode"},O.createElement("button",{ref:this.setupReload},"Reload Player")))}debug(t,...i){Nt.verbose&&Nt.log(`[MediaPlayer] ${t}`,...i)}componentDidMount(){this.debug("app version =","0.1.0-alpha.5"),this.debug("video.js version =",su.default.VERSION),this.initPlayer(),this.props.context.emitter.on("attributesUpdate",this.syncPlayerWithAttributes),this.syncPlayerTimer=setInterval(this.syncPlayerWithAttributes,Nt.syncInterval),this.decreaseRetryTimer=setInterval(this.decreaseRetryCount,Nt.retryInterval)}componentWillUnmount(){var t;this.debug("unmount"),this.props.context.emitter.off("attributesUpdate",this.syncPlayerWithAttributes),(t=this.player)==null||t.dispose(),clearInterval(this.syncPlayerTimer),clearInterval(this.decreaseRetryTimer)}isEnabled(){return this.props.context.getIsWritable()}}const Is={kind:"MediaPlayer",setup(e){let t=e.getAttributes();if(!t||!t.src)return e.emitter.emit("destroy",{error:new Error("[MediaPlayer]: Missing 'attributes'.'src'.")});t=De(De({},Bf),t);const i=e.getBox();i.mountStyles(`.vjs-p{display:flex;flex-grow:1}.vjs-p *{pointer-events:auto}.vjs-p.disabled *{pointer-events:none}.vjs-p .video-js-plugin-poster{position:absolute;top:0;left:0;right:0;bottom:0;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgQAAACACAYAAAB0vHFxAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAACBKADAAQAAAABAAAAgAAAAACE3oPTAAAKXUlEQVR4Ae3dYW4ktxEG0LW9FwkC2McycokAOUGAXMLwtQwYvomdP4akHUnNnm6SVUU+/xqpe8ji+yiDWz3a/e7L5v/98se//3pL8K9//O+7t19Hv85eX7RP9vnllz2h4/rkd+wz+ir/0cLfjv/9t1/6igABAgQIENhRwIFgx9StmQABAgQIPAg4EDyA+JIAAQIECOwo8HXHRVvzPIHRzwBHjz9PKudMo31Hj59TdZ2qsueXvb5sO0GHIFsi6iFAgAABAgECOgQB6KbsJ5Dtt0L6rWyPkeRXO+fs+WWvL1v6OgTZElEPAQIECBAIENAhCEA3ZT8Bzwj7WUaMJL8I9X5zZs8ve339kugzkg5BH0ejECBAgACB0gIOBKXjUzwBAgQIEOgj4EDQx9EoBAgQIECgtIADQen4FE+AAAECBPoIOBD0cTQKAQIECBAoLeC3DErHp/iWgE8Zt4RyX5df7nxa1Y3Ob/T4rfWtdl2HYLVErYcAAQIECFwQWL5DsPoJcvX1XdjTpd4iv1JxvStWfu9IfCORwLP7U4cgUXhKIUCAAAECUQIOBFHy5iVAgAABAokEHAgShaEUAgQIECAQJXD7MwTPPqOIWujVeUevb/T4V9ftfecE5HfOKetd8suajLoiBHQIItTNSYAAAQIEkgnc7hAkW0/3ckb/e9qjx+8OYsBvBOT3DUe5L+RXLjIFDxTQIRiIa2gCBAgQIFBFoNkh2P0Z2+j1jx4/+0asvv7q9d/dH9XXX73+3fO7u/7W+3fbHzoErR3hOgECBAgQ2ECg2SHwjG2DXRC4xOj9tdufAHpHLb/eonPHk9+xd7TPcXX9r+oQ9Dc1IgECBAgQKCfgQFAuMgUTIECAAIH+Ag4E/U2NSIAAAQIEygk0P0MQvaLsz3hb9bWu840WOJ5ffsc+2a/KL3tC6jsSmL1/dQiO0nCNAAECBAhsItDsEMw+oTzrHl1f61OorevPrvfZ+6N9WvVmr09+xwnKr7ZP9vyOdcdfze7Tuz4dgvF7ygwECBAgQCC9QLNDkH0F0X+C45NdoHZ99rf8aguofqRA7/8/6BCMTMvYBAgQIECgiED5DkHvZyhFcjtdJp/TVClvlF/KWE4XJb/TVG68INB7f+kQXAjBWwgQIECAwGoCDgSrJWo9BAgQIEDggoADwQU0byFAgAABAqsJfO39DGI1IOuJFbA/Y/3vzi6/u4Kx7189v7vru/v+2HTfz65D8N7EdwgQIECAwHYCw3/LYLUT1HY7pLFg+TaAkl+WX/KAGuXJrwEUfLlaPjoEwRvG9AQIECBAIIPA8A5B779JKQOaGl4F5PtqUfGV/Cqm9lqz/F4tMr6qlo8OQcZdpCYCBAgQIDBZYHiHoNozlMn+5aeTb+0I5Se/2gK5q6/286VDkHs/qY4AAQIECEwRcCCYwmwSAgQIECCQW8CBIHc+qiNAgAABAlMEhn+GYMoqTEKAAAEC7wSqPcN+twDfmCqgQzCV22QECBAgQCCnQHiHoPoJtlV/63rObfFaVfX6X1dy7VX19Vev/1pqr++qvv7q9b8m4dVHAtny1SH4KCXfI0CAAAECmwmEdwiq/U1Om+2PL/Kpnbj85FdbYO3qs/186hCsvd+sjgABAgQInBJwIDjF5CYCBAgQILC2gAPB2vlaHQECBAgQOCUQ/hmCbJ+yPKW20U3yqR22/ORXW2Dt6qN/Ph/n1yFYe79ZHQECBAgQOCXgQHCKyU0ECBAgQGBtAQeCtfO1OgIECBAgcErAgeAUk5sIECBAgMDaAg4Ea+drdQQIECBA4JTA1+///OGnoztd52N/fC7g58PPx+e748sX+8P+qLQ/dAiO0nKNAAECBAhsIuBAsEnQlkmAAAECBI4EHAiOdFwjQIAAAQKbCDgQbBK0ZRIgQIAAgSMBB4IjHdcIECBAgMAmAuH/lsHP//zvb5tYl1ymfErG9lK0/F4oSr6QX8nYThcdne/j/DoEp6NzIwECBAgQWFfAgWDdbK2MAAECBAicFnAgOE3lRgIECBAgsK5A+GcIfv39Pz++5X18pvH2mtfzBeQz37znjPLrqTl/LPnNN585Y7Z8dQhmpm8uAgQIECCQVCC8Q1C9I9Cqv3U96b54Kat6/S8Lufii+vqr138xtpe3VV9/9fpfgvDiQ4Fs+eoQfBiTbxIgQIAAgb0EwjsEe3FbLQECBOYJZPsT6LyVm+mKgA7BFTXvIUCAAAECiwk4ECwWqOUQIECAAIErAg4EV9S8hwABAgQILCYw/DMEnmEttmMeliPfB5BiX8qvWGAP5crvASTZl9Xy0SFItoGUQ4AAAQIEIgSGdwiy/U1MEcgrzynf2unKT361BXJXX+3nS4cg935SHQECBAgQmCIwvENQ7RnKFPWFJpFv7TDlJ7/aArmrr/bzpUOQez+pjgABAgQITBH4Wu0EM0XFJGkE7M80UVwqRH6X2NK8afX87q7v7vvTBP13IToE2RJRDwECBAgQCBBwIAhANyUBAgQIEMgm4ECQLRH1ECBAgACBAIHhv2Uwek2rPcPp7cWnt+jc8eQ317v3bPLrLWq8twK995cOwVtdrwkQIECAwKYC5TsE1f4mqNn7jM9s8b7zya+v5+zR5DdbfK/5eu8vHYK99o/VEiBAgACBDwWaHYLezyg+rOLGN6Pra53QWtdvLP3UW6N9WkVmr09+xwnKr7ZP9vyOdcdfze7Tuz4dgvF7ygwECBAgQCC9QLNDEL2C3ieg3utp1de63rueZ8fLXt+z6+l9f3af7PX1zuPZ8bL7ZK/vWW/39xWYvT90CPrmZzQCBAgQIFBSwIGgZGyKJkCAAAECfQUcCPp6Go0AAQIECJQUaH6GIPpT1iVVFX1aIHp/zX5GdxqmyI3yKxLUJ2XK7xOYv78d7XNcXf+rOgT9TY1IgAABAgTKCTQ7BLv/CWr0+kePn31HVl9/9frv7o/q669e/+753V1/6/277Q8dgtaOcJ0AAQIECGwg0OwQbGBwuMTRz5BGj3+4OBdvC8jvNmHoAPIL5Td5MgEdgmSBKIcAAQIECEQI3O4QrP6MZfT6Ro8fsal2mlN+tdOWX+38VN9XQIegr6fRCBAgQIBASQEHgpKxKZoAAQIECPQVcCDo62k0AgQIECBQUuD2Zwiyr3r1Z4Srry/7/rpbn/zuCsa+X36x/mY/Fnh2f+oQHHu6SoAAAQIEthBYvkOwRYoW+anAsyfkTwdyIURAfiHs3SYdnd/o8btBFBlIh6BIUMokQIAAAQIjBRwIRuoamwABAgQIFBFwICgSlDIJECBAgMBIAQeCkbrGJkCAAAECRQQcCIoEpUwCBAgQIDBSwG8ZjNQ19nABnzIeTjx0AvkN5R0+ePb8stc3PKAnJ9AheBLM7QQIECBAYEUBHYIVU91oTf49+9phy09+IwXsr+d0dQie83I3AQIECBBYUkCHYMlY8yxq9DO80ePnkYypZLTv6PFj1PaZNXt+2evLtlN0CLIloh4CBAgQIBAg4EAQgG5KAgQIECCQTcCBIFsi6iFAgAABAgEC/wdVfx9UuC8B6AAAAABJRU5ErkJggg==);background-repeat:repeat-x;background-position:0 50%;display:flex;align-items:center;justify-content:center}.vjs-p .video-js-plugin-poster img{box-shadow:0 0 5px 10px #0006}.vjs-p .player-controller,.vjs-p .videojs-plugin-muted-alert{pointer-events:auto}.vjs-p.disabled .videojs-plugin-close-icon,.vjs-p.disabled .player-controller{pointer-events:none}.vjs-p .video-js-plugin-player{position:absolute;top:0;left:0;right:0;bottom:0}.video-js,[data-vjs-player]{width:100%;height:100%}.vjs-p .videojs-plugin-muted-alert{pointer-events:auto;cursor:pointer;position:absolute;top:0;left:0;right:0;bottom:0;z-index:43}.vjs-p .videojs-plugin-muted-alert:before{pointer-events:auto;cursor:pointer;position:absolute;top:0;left:0;right:0;bottom:0;z-index:43;content:"\\f104";background:rgba(0,0,0,.3);font-family:VideoJS;font-size:2em;display:flex;align-items:center;justify-content:center;color:#fff}.vjs-p .videojs-plugin-recovery-mode{pointer-events:auto;cursor:pointer;position:absolute;top:0;left:0;right:0;bottom:0;z-index:44}.vjs-p .videojs-plugin-recovery-mode button{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.vjs-p .seek-slider{position:relative;width:100%}.vjs-p .seek-slider:focus{outline:none}.vjs-p .seek-slider .track{padding:10px 0;cursor:pointer;outline:none}.vjs-p .seek-slider .track:focus{border:0;outline:none}.vjs-p .seek-slider .track .main{width:100%;height:3px;background-color:#ffffff4d;border-radius:30px;position:absolute;left:0;top:8.5px;transition:transform .4s;outline:none}.vjs-p .seek-slider .track .main:focus{border:0;outline:none}.vjs-p .seek-slider .track .main .buffered{position:absolute;background-color:#ffffff4d;width:100%;height:100%;transform:scaleX(.8);z-index:2;transform-origin:0 0}.vjs-p .seek-slider .track .main .seek-hover{position:absolute;background-color:#ffffff80;width:100%;height:100%;z-index:1;transform:scaleX(.6);transform-origin:0 0;opacity:0;transition:opacity .4s}.vjs-p .seek-slider .track .main .connect{position:absolute;background-color:#fff;width:100%;height:100%;z-index:3;left:0;transform:scaleX(.13);transform-origin:0 0}.vjs-p .seek-slider .track.active .main{transform:scaleY(2)}.vjs-p .seek-slider .thumb{pointer-events:none;position:absolute;width:12px;height:12px;left:-6px;top:4px;z-index:4;transform:translate(100px)}.vjs-p .seek-slider .thumb .handler{border-radius:100%;width:100%;height:100%;background-color:#fff;opacity:0;transform:scale(.4);cursor:pointer;transition:transform .2s;pointer-events:none}.vjs-p .seek-slider .thumb.active .handler{opacity:1;transform:scale(1)}.vjs-p .seek-slider .hover-time{position:absolute;background-color:#0000004d;line-height:18px;font-size:16px;color:#ddd;top:-25px;left:0;padding:5px 10px;border-radius:5px;box-shadow:0 0 5px #0000004d;opacity:0;transform:translate(150px);pointer-events:none}.vjs-p .seek-slider .hover-time.active{opacity:1}.vjs-p .seek-slider:hover .track .main .seek-hover{opacity:1}.vjs-p .player-controller{position:absolute;z-index:100;bottom:0px;left:0;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:stretch;height:64px;background-image:linear-gradient(0deg,#000,transparent);transition:opacity .2s;color:#fff}.vjs-p .player-menu-box{display:flex;align-items:center;justify-content:center;flex-direction:column;margin-bottom:40px}.vjs-p .player-menu-cell{width:100%;text-align:center;font-size:12px;color:#7a7b7c}.vjs-p .player-multiple-play{width:64px;height:120px}.vjs-p .player-controller-actions-left{display:flex;justify-content:center;align-items:center;flex-shrink:0}.vjs-p .player-right-box{font-size:14px;color:#7a7b7c;cursor:pointer;margin-right:12px}.vjs-p .player-controller-actions{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding-left:8px;padding-right:8px;margin-top:2px}.vjs-p .player-mid-box-time{font-size:9px;display:flex;justify-content:center;align-items:center;color:#fff;flex-shrink:0;margin-right:8px;font-family:monospace}.vjs-p .player-controller-play{display:flex;align-items:center;justify-content:center;cursor:pointer;padding-right:4px}.vjs-p .player-controller-progress{width:calc(100% - 28px);margin-left:14px;display:flex;align-items:center;justify-content:center;margin-top:8px}.vjs-p .player-volume{display:flex;align-items:center;justify-content:center;cursor:pointer;margin-right:16px;margin-left:8px}.vjs-p .player-volume-slider{width:60px;margin-right:12px;display:flex;align-items:center}.vjs-p .player-volume-box{display:flex;flex-direction:row}.netless-app-media-player-container{display:flex;position:relative;height:100%}
|
154
|
-
`);const n=document.createElement("div");n.classList.add("netless-app-media-player-container"),qc.render(O.createElement(yS,{context:e}),n),i.mountContent(n),e.emitter.on("destroy",()=>{console.log("[MediaPlayer]: destroy"),qc.unmountComponentAtNode(n)})}},SS=()=>{ge.debug&&eS({verbose:!0}),ge.register({kind:Xr.kind,src:Xr}),ge.register({kind:Is.kind,src:Is})},za={DocsViewer:Xr.kind,MediaPlayer:Is.kind},CS={[za.DocsViewer]:Xr,[za.MediaPlayer]:Is};const Uf=new kv({emitter:j}),B=class extends I.InvisiblePlugin{constructor(e){super(e);this.version="1.0.0-canary.32",this.dependencies={dependencies:{"@juggle/resize-observer":"^3.3.1","@netless/telebox-insider":"1.0.0-alpha.29",emittery:"^0.11.0",lodash:"^4.17.21","p-retry":"^4.6.1","side-effect-manager":"^1.1.0",uuid:"^7.0.3","value-enhancer":"^1.3.0","video.js":">=7"},peerDependencies:{"white-web-sdk":"^2.16.0"},devDependencies:{"@netless/app-docs-viewer":"^0.2.9","@netless/app-media-player":"0.1.0-beta.5","@playwright/test":"^1.23.0","@rollup/plugin-commonjs":"^20.0.0","@rollup/plugin-node-resolve":"^13.0.4","@rollup/plugin-url":"^6.1.0","@sveltejs/vite-plugin-svelte":"^1.0.0-next.22","@tsconfig/svelte":"^2.0.1","@types/debug":"^4.1.7","@types/lodash":"^4.14.182","@types/lodash-es":"^4.17.4","@types/node":"^18.0.0","@types/uuid":"^8.3.1","@typescript-eslint/eslint-plugin":"^4.30.0","@typescript-eslint/parser":"^4.30.0","@vitest/ui":"^0.14.1",cypress:"^8.7.0",dotenv:"^10.0.0",eslint:"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-svelte3":"^3.2.0",jsdom:"^19.0.0",less:"^4.1.1",prettier:"^2.3.2","prettier-plugin-svelte":"^2.4.0","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-styles":"^3.14.1",svelte:"^3.42.4",typescript:"^4.5.5",vite:"^2.5.3","vite-plugin-dts":"^1.2.0",vitest:"^0.14.1","white-web-sdk":"2.16.10"}},this.emitter=te,this.viewMode=I.ViewMode.Broadcaster,this.viewMode$=new M.Val(I.ViewMode.Broadcaster),this.isReplay=I.isPlayer(this.displayer),this.containerSizeRatio=B.containerSizeRatio,B.displayer=e.displayer,window.NETLESS_DEPS={dependencies:{"@juggle/resize-observer":"^3.3.1","@netless/telebox-insider":"1.0.0-alpha.29",emittery:"^0.11.0",lodash:"^4.17.21","p-retry":"^4.6.1","side-effect-manager":"^1.1.0",uuid:"^7.0.3","value-enhancer":"^1.3.0","video.js":">=7"},peerDependencies:{"white-web-sdk":"^2.16.0"},devDependencies:{"@netless/app-docs-viewer":"^0.2.9","@netless/app-media-player":"0.1.0-beta.5","@playwright/test":"^1.23.0","@rollup/plugin-commonjs":"^20.0.0","@rollup/plugin-node-resolve":"^13.0.4","@rollup/plugin-url":"^6.1.0","@sveltejs/vite-plugin-svelte":"^1.0.0-next.22","@tsconfig/svelte":"^2.0.1","@types/debug":"^4.1.7","@types/lodash":"^4.14.182","@types/lodash-es":"^4.17.4","@types/node":"^18.0.0","@types/uuid":"^8.3.1","@typescript-eslint/eslint-plugin":"^4.30.0","@typescript-eslint/parser":"^4.30.0","@vitest/ui":"^0.14.1",cypress:"^8.7.0",dotenv:"^10.0.0",eslint:"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-svelte3":"^3.2.0",jsdom:"^19.0.0",less:"^4.1.1",prettier:"^2.3.2","prettier-plugin-svelte":"^2.4.0","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-styles":"^3.14.1",svelte:"^3.42.4",typescript:"^4.5.5",vite:"^2.5.3","vite-plugin-dts":"^1.2.0",vitest:"^0.14.1","white-web-sdk":"2.16.10"}}}static async mount(e){var s;const t=e.room;B.container=e.container;const i=e.debug,n=e.cursor;B.params=e,B.displayer=e.room,_g();let r;if(I.isRoom(t)){if(t.phase!==I.RoomPhase.Connected)throw new Error("[WindowManager]: Room only Connected can be mount");t.phase===I.RoomPhase.Connected&&t.isWritable&&(t.disableSerialization=!1),r=await this.initManager(t)}if(B.isCreated)throw new Error("[WindowManager]: Already created cannot be created again");if(this.debug=Boolean(i),zt("Already insert room",r),I.isRoom(this.displayer)){if(!r)throw new Error("[WindowManager]: init InvisiblePlugin failed")}else await lg.default(async o=>{if(r=await t.getInvisiblePlugin(B.kind),!r)throw zt(`manager is empty. retrying ${o}`),new Error},{retries:10});if(!r)throw new Error("[WindowManager]: create manager failed");e.containerSizeRatio&&(B.containerSizeRatio=e.containerSizeRatio),r.containerSizeRatio=B.containerSizeRatio,await r.ensureAttributes(),r.appManager=new Xg(r),r._pageState=new Tv(r.appManager),r.cursorManager=new Ev(r.appManager,Boolean(n),e.applianceIcons),r.boxManager=tv(r,te,j,wt,{collectorContainer:e.collectorContainer,collectorStyles:e.collectorStyles,prefersColorScheme:e.prefersColorScheme,stageRatio:B.containerSizeRatio,containerStyle:e.containerStyle,stageStyle:e.stageStyle,fullscreen:e.fullscreen}),(s=r.appManager)==null||s.setBoxManager(r.boxManager),e.container&&r.bindContainer(e.container),Nv(t,r),j.emit("onCreated"),B.isCreated=!0;try{await fg()}catch(o){console.warn("[WindowManager]: indexedDB open failed"),console.log(o)}return r}static async initManager(e){let t=e.getInvisiblePlugin(B.kind);if(!t&&I.isRoom(e))if(e.isWritable===!1){try{await e.setWritable(!0)}catch{throw new Error("[WindowManger]: room must be switched to be writable")}t=await gu(e),t==null||t.ensureAttributes(),await Fr(500),await e.setWritable(!1)}else t=await gu(e);return t}static initContainer(e,t,i){B.container||(B.container=e);const{playground:n,mainViewElement:r}=Og(e,t);if(B.playground=n,i){const s=document.createElement("style");s.textContent=i,n.appendChild(s)}return r}static get registered(){return Me.registered}bindContainer(e){var t,i,n,r,s,o;if(I.isRoom(this.displayer)&&this.room.phase!==I.RoomPhase.Connected)throw new vd;if(B.isCreated&&B.container)B.container.firstChild&&e.appendChild(B.container.firstChild);else{const a=(t=this.boxManager)==null?void 0:t.teleBoxManager.$stage;if(B.params&&a){const l=B.params,u=B.initContainer(e,a,l.overwriteStyles);this.boxManager&&B.playground&&this.boxManager.setRoot(B.playground),this.bindMainView(u,l.disableCameraTransform),B.playground&&((i=this.cursorManager)==null||i.setupWrapper(B.playground))}}j.emit("updateManagerRect"),(n=this.appManager)==null||n.refresh(),(r=this.appManager)==null||r.resetMaximized(),(s=this.appManager)==null||s.resetMinimized(),(o=this.appManager)==null||o.displayerWritableListener(!this.room.isWritable),B.container=e}bindCollectorContainer(e){B.isCreated&&this.boxManager?this.boxManager.setCollector(e):B.params&&(B.params.collectorContainer=e)}static register(e){return Me.register(e)}static unregister(e){return Me.unregister(e)}async addApp(e){if(this.appManager)return this.appManager.rootDirRemoving?new Promise((t,i)=>{j.once("rootDirRemoved").then(async()=>{try{const n=await this._addApp(e);t(n)}catch(n){i(n.message)}})}):this._addApp(e);throw new Ce}async _addApp(e){var t,i,n;if(this.appManager){if(!e.kind||typeof e.kind!="string")throw new pd;const r=await((t=Me.appClasses.get(e.kind))==null?void 0:t());if(r&&((i=r.config)==null?void 0:i.singleton)&&this.appManager.appProxies.has(e.kind))throw new dd;const s=this.setupScenePath(e,this.appManager);return s===void 0?void 0:((n=e==null?void 0:e.options)!=null&&n.scenePath&&(e.options.scenePath=Pg(e.options.scenePath)),await this.appManager.addApp(e,Boolean(s)))}else throw new Ce}setupScenePath(e,t){let i=!1;if(e.options){const{scenePath:n,scenes:r}=e.options;if(n){if(!Ng(n))throw new gd;const s=Object.keys(this.apps||{});for(const o of s){const a=t.store.getAppScenePath(o);if(a&&a===n){if(console.warn(`[WindowManager]: ScenePath ${n} Already opened`),this.boxManager){const l=this.boxManager.getTopBox();l&&this.boxManager.setZIndex(o,l.zIndex+1,!1)}return}}}n&&r&&r.length>0&&(this.isDynamicPPT(r)?(i=!0,mi(this.displayer)[n]||ji(this.room,n,r)):mi(this.displayer)[n]||ji(this.room,n,[{name:r[0].name}])),n&&r===void 0&&ji(this.room,n,[{}])}return i}async setMainViewScenePath(e){this.appManager&&await this.appManager.setMainViewScenePath(e)}async setMainViewSceneIndex(e){this.appManager&&await this.appManager.setMainViewSceneIndex(e)}async nextPage(){if(this.appManager){const e=this.mainViewSceneIndex+1;return e>=this.mainViewScenesLength?(console.warn("[WindowManager]: current page is the last page"),!1):(await this.appManager.setMainViewSceneIndex(e),!0)}else return!1}async prevPage(){if(this.appManager){const e=this.mainViewSceneIndex-1;return e<0?(console.warn("[WindowManager]: current page is the first page"),!1):(await this.appManager.setMainViewSceneIndex(e),!0)}else return!1}async jumpPage(e){return this.appManager?e<0||e>=this.pageState.length?(console.warn(`[WindowManager]: index ${e} out of range`),!1):(await this.appManager.setMainViewSceneIndex(e),!0):!1}async addPage(e){if(this.appManager){const t=e==null?void 0:e.after,i=e==null?void 0:e.scene;if(t){const n=this.mainViewSceneIndex+1;this.room.putScenes(ze,[i||{}],n)}else this.room.putScenes(ze,[i||{}])}}async removePage(e){if(this.appManager){const t=e===void 0?this.pageState.index:e;return this.pageState.length===1?(console.warn("[WindowManager]: can not remove the last page"),!1):t<0||t>=this.pageState.length?(console.warn(`[WindowManager]: index ${e} out of range`),!1):this.appManager.removeSceneByIndex(t)}else return!1}getMainViewScenePath(){var e;return(e=this.appManager)==null?void 0:e.store.getMainViewScenePath()}getMainViewSceneIndex(){var e;return(e=this.appManager)==null?void 0:e.store.getMainViewSceneIndex()}setReadonly(e){var t;this.readonly=e,(t=this.boxManager)==null||t.setReadonly(e),j.emit("setReadonly",e)}switchMainViewToWriter(){var e;return(e=this.appManager)==null?void 0:e.mainViewProxy.mainViewClickHandler()}onAppDestroy(e,t){Tg(`destroy-${e}`,t)}setViewMode(e){var i;zt("setViewMode",e);const t=(i=this.appManager)==null?void 0:i.mainViewProxy;e===I.ViewMode.Broadcaster&&(this.canOperate&&(t==null||t.storeCurrentCamera()),t==null||t.start()),e===I.ViewMode.Freedom&&(t==null||t.stop()),this.viewMode=e,this.viewMode$.setValue(e)}setBoxState(e){if(!!this.canOperate)switch(e){case"normal":this.setMaximized(!1),this.setMinimized(!1);break;case"maximized":this.setMaximized(!0),this.setMinimized(!1);break;case"minimized":this.setMinimized(!0);break}}setMaximized(e){var t;!this.canOperate||(t=this.boxManager)==null||t.setMaximized(e,!1)}setMinimized(e){var t;!this.canOperate||(t=this.boxManager)==null||t.setMinimized(e,!1)}get mainView(){if(this.appManager)return this.appManager.mainViewProxy.view;throw new Ce}get camera(){if(this.appManager)return this.appManager.mainViewProxy.view.camera;throw new Ce}get baseCamera$(){if(this.appManager)return this.appManager.mainViewProxy.camera$;throw new Ce}get baseSize$(){if(this.appManager)return this.appManager.mainViewProxy.size$;throw new Ce}get cameraState(){if(this.appManager)return this.appManager.mainViewProxy.cameraState;throw new Ce}get apps(){var e;return(e=this.appManager)==null?void 0:e.store.apps()}get boxState(){var e;if(this.appManager)return(e=this.appManager.boxManager)==null?void 0:e.boxState;throw new Ce}get darkMode(){var e,t;return Boolean((t=(e=this.appManager)==null?void 0:e.boxManager)==null?void 0:t.darkMode)}get prefersColorScheme(){var e;if(this.appManager)return(e=this.appManager.boxManager)==null?void 0:e.prefersColorScheme;throw new Ce}get fullscreen(){var e;if(this.appManager)return(e=this.appManager.boxManager)==null?void 0:e.teleBoxManager.fullscreen;throw new Ce}get focused(){return this.attributes.focus}get focusedView(){var e,t;return((t=(e=this.appManager)==null?void 0:e.focusApp)==null?void 0:t.view)||this.mainView}get mainViewSceneIndex(){var e;return((e=this._pageState)==null?void 0:e.index)||0}get mainViewSceneDir(){var e;if(this.appManager)return(e=this.appManager)==null?void 0:e.getMainViewSceneDir();throw new Ce}get topApp(){var e,t;return(t=(e=this.boxManager)==null?void 0:e.getTopBox())==null?void 0:t.id}get mainViewScenesLength(){var e;return((e=this._pageState)==null?void 0:e.length)||0}get canRedoSteps(){var e;return((e=this.focusedView)==null?void 0:e.canRedoSteps)||0}get canUndoSteps(){var e;return((e=this.focusedView)==null?void 0:e.canUndoSteps)||0}get sceneState(){if(this.appManager)return this.appManager.sceneState;throw new Ce}get pageState(){if(this._pageState)return this._pageState.toObject();throw new Ce}queryAll(){var e;return Array.from(((e=this.appManager)==null?void 0:e.appProxies.values())||[])}queryOne(e){var t;return(t=this.appManager)==null?void 0:t.appProxies.get(e)}async closeApp(e){var t;return(t=this.appManager)==null?void 0:t.closeApp(e)}moveCamera(e){const t=H({},this.mainView.camera),i=H(H({},t),e);A.isEqual(i,t)||!this.appManager||this.appManager.mainViewProxy.storeCamera(H({id:this.appManager.uid},i))}moveCameraToContain(e){if(!this.appManager)return;const t=this.appManager.mainViewProxy.size$.value;if(t){const i=t.width/e.width,n=t.height/e.height,r=Math.min(i,n);this.appManager.mainViewProxy.storeCamera({id:this.appManager.uid,scale:r,centerX:e.originX,centerY:e.originY})}}convertToPointInWorld(e){return this.mainView.convertToPointInWorld(e)}setCameraBound(e){this.mainView.setCameraBound(e)}onDestroy(){this._destroy()}destroy(){this._destroy()}_destroy(){var e,t,i;(e=this.appManager)==null||e.destroy(),(t=this.cursorManager)==null||t.destroy(),B.container=void 0,B.isCreated=!1,B.playground&&((i=B.playground.parentNode)==null||i.removeChild(B.playground)),B.params=void 0,zt("Destroyed")}bindMainView(e,t){var i;this.appManager&&(this.appManager.bindMainView(e,Boolean(t)),(i=this.cursorManager)==null||i.setMainViewDivElement(e))}get canOperate(){return I.isRoom(this.displayer)?this.displayer.isWritable&&this.displayer.phase===I.RoomPhase.Connected:!1}get room(){return this.displayer}safeSetAttributes(e){this.canOperate&&this.setAttributes(e)}safeUpdateAttributes(e,t){this.canOperate&&this.updateAttributes(e,t)}setPrefersColorScheme(e){var t,i;(i=(t=this.appManager)==null?void 0:t.boxManager)==null||i.setPrefersColorScheme(e)}setFullscreen(e){var t,i;(i=(t=this.appManager)==null?void 0:t.boxManager)==null||i.teleBoxManager.setFullscreen(e)}cleanCurrentScene(){var e;(e=this.focusedView)==null||e.cleanCurrentScene()}redo(){var e;return((e=this.focusedView)==null?void 0:e.redo())||0}undo(){var e;return((e=this.focusedView)==null?void 0:e.undo())||0}delete(){var e;(e=this.focusedView)==null||e.delete()}copy(){var e;(e=this.focusedView)==null||e.copy()}paste(){var e;(e=this.focusedView)==null||e.paste()}duplicate(){var e;(e=this.focusedView)==null||e.duplicate()}insertText(e,t,i){var n;return((n=this.focusedView)==null?void 0:n.insertText(e,t,i))||""}insertImage(e){var t;return(t=this.focusedView)==null?void 0:t.insertImage(e)}completeImageUpload(e,t){var i;return(i=this.focusedView)==null?void 0:i.completeImageUpload(e,t)}lockImage(e,t){var i;return(i=this.focusedView)==null?void 0:i.lockImage(e,t)}lockImages(e){var t;return(t=this.focusedView)==null?void 0:t.lockImages(e)}refresh(){var e;this._refresh(),(e=this.appManager)==null||e.dispatchInternalEvent(Z.Refresh)}_refresh(){var e,t;(e=this.appManager)==null||e.mainViewProxy.rebind(),B.container&&this.bindContainer(B.container),(t=this.appManager)==null||t.refresher.refresh()}setContainerSizeRatio(e){if(!A.isNumber(e))throw new Error(`[WindowManager]: updateContainerSizeRatio error, ratio must be a number. but got ${e}`);B.containerSizeRatio=e,this.containerSizeRatio=e,j.emit("containerSizeRatioUpdate",e)}setContainerStyle(e){var t;(t=this.boxManager)==null||t.teleBoxManager.setContainerStyle(e)}setStageStyle(e){var t;(t=this.boxManager)==null||t.teleBoxManager.setStageStyle(e)}createPPTHandler(){return{onPageJumpTo:(e,t)=>{var i,n,r,s;(s=(r=(n=(i=this.appManager)==null?void 0:i.focusApp)==null?void 0:n.appContext)==null?void 0:r.whiteBoardView)==null||s.jumpPage(t)},onPageToNext:()=>{var e,t,i,n;this.focused&&((n=(i=(t=(e=this.appManager)==null?void 0:e.focusApp)==null?void 0:t.appContext)==null?void 0:i.whiteBoardView)==null||n.nextPage())},onPageToPrev:()=>{var e,t,i,n;this.focused&&((n=(i=(t=(e=this.appManager)==null?void 0:e.focusApp)==null?void 0:t.appContext)==null?void 0:i.whiteBoardView)==null||n.prevPage())}}}isDynamicPPT(e){var i,n;const t=(n=(i=e[0])==null?void 0:i.ppt)==null?void 0:n.src;return t==null?void 0:t.startsWith("pptx://")}async ensureAttributes(){A.isNull(this.attributes)&&await Fr(50),A.isObject(this.attributes)&&(this.attributes[re.Apps]||this.safeSetAttributes({[re.Apps]:{}}),this.attributes[re.Cursors]||this.safeSetAttributes({[re.Cursors]:{}}),this.attributes._mainScenePath||this.safeSetAttributes({_mainScenePath:ud}),this.attributes._mainSceneIndex||this.safeSetAttributes({_mainSceneIndex:0}),this.attributes[re.Registered]||this.safeSetAttributes({[re.Registered]:{}}))}};let ge=B;ge.kind="WindowManager";ge.debug=!1;ge.containerSizeRatio=dg;ge.isCreated=!1;SS();exports.AppCreateError=dd;exports.AppManagerNotInitError=Ce;exports.AppNotRegisterError=jg;exports.BindContainerRoomPhaseInvalidError=vd;exports.BoxManagerNotFoundError=md;exports.BoxNotCreatedError=fd;exports.BuiltinApps=za;exports.BuiltinAppsMap=CS;exports.InvalidScenePath=gd;exports.ParamsInvalidError=pd;exports.WhiteWebSDKInvalidError=hd;exports.WindowManager=ge;exports.calculateNextIndex=ja;exports.reconnectRefresher=Uf;
|
123
|
+
}`)(),Ua=(t=>(t.Light="light",t.Dark="dark",t.Auto="auto",t))(Ua||{}),se=(t=>(t.Normal="normal",t.Minimized="minimized",t.Maximized="maximized",t))(se||{}),de=(t=>(t.DarkMode="dark_mode",t.PrefersColorScheme="prefers_color_scheme",t.Close="close",t.Focus="focus",t.Blur="blur",t.IntrinsicMove="intrinsic_move",t.IntrinsicResize="intrinsic_resize",t.ZIndex="z_index",t.State="state",t.Minimized="minimized",t.Maximized="maximized",t.Readonly="readonly",t.Destroyed="destroyed",t))(de||{}),je=(t=>(t.Close="close",t.Maximize="maximize",t.Minimize="minimize",t))(je||{}),De=(t=>(t.North="n",t.South="s",t.West="w",t.East="e",t.NorthWest="nw",t.NorthEast="ne",t.SouthEast="se",t.SouthWest="sw",t))(De||{});const ss="dh";function wt(t,e,i){return Math.min(Math.max(t,e),i)}function Rt(t){t.stopPropagation(),t.cancelable&&t.preventDefault()}let gc=1;function mc(){return`New Box ${gc++}`}class Wa{constructor({readonly$:e,state$:i,title$:s,buttons:r,onEvent:a,onDragStart:n,namespace:o="telebox"}){this.sideEffect=new ve.SideEffectManager,this.lastTitleBarClick={timestamp:0,clientX:-100,clientY:-100},this.handleTitleBarClick=c=>{var l;if(!c.isPrimary||this.readonly$.value||c.button!==0||(l=c.target.dataset)!=null&&l.teleTitleBarNoDblClick)return;Rt(c);const d=Date.now();d-this.lastTitleBarClick.timestamp<=500?Math.abs(c.clientX-this.lastTitleBarClick.clientX)<=5&&Math.abs(c.clientY-this.lastTitleBarClick.clientY)<=5&&this.onEvent&&this.onEvent({type:je.Maximize}):this.onDragStart&&this.onDragStart(c),this.lastTitleBarClick.timestamp=d,this.lastTitleBarClick.clientX=c.clientX,this.lastTitleBarClick.clientY=c.clientY},this.readonly$=e,this.state$=i,this.title$=s,this.onEvent=a,this.onDragStart=n,this.namespace=o,this.buttons=r||[{type:je.Minimize,iconClassName:this.wrapClassName("titlebar-icon-minimize")},{type:je.Maximize,iconClassName:this.wrapClassName("titlebar-icon-maximize"),isActive:c=>c===se.Maximized},{type:je.Close,iconClassName:this.wrapClassName("titlebar-icon-close")}],this.$dragArea=this.renderDragArea()}render(){if(!this.$titleBar){this.$titleBar=document.createElement("div"),this.$titleBar.className=this.wrapClassName("titlebar");const e=document.createElement("div");e.className=this.wrapClassName("title-area"),e.dataset.teleBoxHandle=ss;const i=document.createElement("h1");i.className=this.wrapClassName("title"),i.dataset.teleBoxHandle=ss,e.appendChild(i),e.appendChild(this.$dragArea);const s=document.createElement("div");s.className=this.wrapClassName("titlebar-btns"),this.buttons.forEach(({iconClassName:r},a)=>{const n=String(a),o=document.createElement("button");o.className=`${this.wrapClassName("titlebar-btn")} ${r}`,o.dataset.teleTitleBarBtnIndex=n,o.dataset.teleTitleBarNoDblClick="true",s.appendChild(o)}),this.sideEffect.addDisposer(this.title$.subscribe(r=>{i.textContent=r,i.title=r}),"render-title"),this.sideEffect.addDisposer(this.state$.subscribe(r=>{this.buttons.forEach((a,n)=>{var o;a.isActive&&((o=s.children[n])==null||o.classList.toggle("is-active",a.isActive(r)))})}),"render-state-btns"),this.sideEffect.addEventListener(s,"click",r=>{var a;if(this.readonly$.value)return;const n=r.target,o=Number((a=n.dataset)==null?void 0:a.teleTitleBarBtnIndex);if(!Number.isNaN(o)&&o<this.buttons.length){Rt(r);const c=this.buttons[o];this.onEvent&&this.onEvent({type:c.type,value:c.value})}},{},"render-btns-container-click"),this.$titleBar.appendChild(e),this.$titleBar.appendChild(s)}return this.$titleBar}renderDragArea(){const e=document.createElement("div");return e.className=this.wrapClassName("drag-area"),e.dataset.teleBoxHandle=ss,this.sideEffect.addEventListener(e,"pointerdown",this.handleTitleBarClick),e}dragHandle(){return this.$titleBar}wrapClassName(e){return`${this.namespace}-${e}`}destroy(){this.sideEffect.flushAll(),this.$titleBar&&(this.$titleBar=void 0,this.onDragStart=void 0,this.onEvent=void 0)}}function Ha([t,e]){if(e<=0||t.width<=0||t.height<=0)return t;const i=t.width*e;if(i===t.height)return t;if(i<t.height)return{x:0,y:(t.height-i)/2,width:t.width,height:i};const s=t.height/e;return{x:(t.width-s)/2,y:0,width:s,height:t.height}}const fc=window.ResizeObserver||la.ResizeObserver;class bc{constructor({id:e=ve.genUID(),title:i=mc(),namespace:s="telebox",visible:r=!0,width:a=.5,height:n=.5,minWidth:o=0,minHeight:c=0,x:l=.1,y:d=.1,resizable:u=!0,draggable:p=!0,boxRatio:m=-1,focus:g=!1,zIndex:f=100,stageRatio:b=null,enableShadowDOM:v=!0,titleBar:x,content:y,stage:k,footer:z,styles:T,userStyles:R,bodyStyle:te=null,stageStyle:Q=null,darkMode$:xe,fence$:Re,root:ge,rootRect$:Ie,managerMinimized$:me,managerMaximized$:_e,managerReadonly$:fe,managerStageRect$:be,managerStageRatio$:Me,defaultBoxBodyStyle$:Ae,defaultBoxStageStyle$:Se,collectorRect$:ot}){this.events=new rt.default,this._delegateEvents=new rt.default,this.handleTrackStart=D=>{var U;return(U=this._handleTrackStart)==null?void 0:U.call(this,D)},this._sideEffect=new ve.SideEffectManager,this.id=e,this.namespace=s,this.enableShadowDOM=v;const Oe=new w.ValManager;this._sideEffect.addDisposer(()=>Oe.destroy());const Qe=new w.Val(i),bt=new w.Val(r),A=new w.Val(u),B=new w.Val(p),ke=new w.Val(m),Ce=new w.Val(f),Tt=new w.Val(g),yt=new w.Val(null),dr=new w.Val(null),ur=new w.Val(null),Wi=w.combine([yt,_e],([D,U])=>D!=null?D:U),ai=w.combine([dr,me],([D,U])=>D!=null?D:U),Hi=w.combine([ur,fe],([D,U])=>D!=null?D:U),Fi=w.combine([ai,Wi],([D,U])=>D?se.Minimized:U?se.Maximized:se.Normal),Zi=new w.Val({width:wt(o,0,1),height:wt(c,0,1)},{compare:Ne}),po=w.combine([Zi,be],([D,U])=>({width:D.width*U.width,height:D.height*U.height}),{compare:Ne}),ni=new w.Val({width:a,height:n},{compare:Ne});this._sideEffect.addDisposer(Zi.reaction((D,U)=>{ni.setValue({width:Math.max(a,D.width),height:Math.max(n,D.height)},U)}));const Yi=new w.Val({x:l,y:d},{compare:Ne}),Qi=w.combine([ni,be],([D,U])=>({width:U.width*D.width,height:U.height*D.height}),{compare:Ne}),Nt=w.combine([Yi,be],([D,U])=>({x:D.x*U.width,y:D.y*U.height}),{compare:Ne}),go=new w.Val(te),mo=new w.Val(Q),fo=new w.Val(null),pr=new w.Val(be.value,{compare:Ne}),gr=new w.Val(b),bo=w.combine([gr,Me],([D,U])=>D!=null?D:U),yo=w.combine([pr,bo],Ha,{compare:Ne}),wo={darkMode:xe,fence:Re,rootRect:Ie,managerMinimized:me,managerMaximized:_e,managerReadonly:fe,managerStageRect:be,managerStageRatio:Me,defaultBoxBodyStyle:Ae,defaultBoxStageStyle:Se,collectorRect:ot};w.withReadonlyValueEnhancer(this,wo);const vo={zIndex:Ce,focus:Tt,state:Fi,minSize:Zi,pxMinSize:po,intrinsicSize:ni,intrinsicCoord:Yi,pxIntrinsicSize:Qi,pxIntrinsicCoord:Nt,bodyRect:pr,stageRect:yo,minimized:ai,maximized:Wi,readonly:Hi};w.withReadonlyValueEnhancer(this,vo,Oe);const xo={title:Qe,visible:bt,resizable:A,draggable:B,boxRatio:ke,boxMinimized:dr,boxMaximized:yt,boxReadonly:ur,stageRatio:gr,bodyStyle:go,stageStyle:mo};w.withValueEnhancer(this,xo,Oe),this.titleBar=x||new Wa({readonly$:Hi,state$:Fi,title$:Qe,namespace:this.namespace,onDragStart:D=>{var U;return(U=this._handleTrackStart)==null?void 0:U.call(this,D)},onEvent:D=>this._delegateEvents.emit(D.type)}),this._sideEffect.addDisposer(w.combine([ke,ai]).subscribe(([D,U])=>{!U&&D>0&&this.transform(Nt.value.x,Nt.value.y,Qi.value.width,Qi.value.height)})),this._sideEffect.addDisposer(Re.subscribe(D=>{D&&this.move(Nt.value.x,Nt.value.y)})),this.$box=this._render(),fo.setValue(this.$content.parentElement),y&&this.mountContent(y),k&&this.mountStage(k),z&&this.mountFooter(z),T&&this.mountStyles(T),R&&this.mountUserStyles(R),ge.appendChild(this.$box);const Ge=(D,U)=>{this._sideEffect.addDisposer(D.reaction((Mo,So)=>{So||this.events.emit(U,Mo)}))};Ge(xe,de.DarkMode),Ge(Hi,de.Readonly),Ge(Ce,de.ZIndex),Ge(ai,de.Minimized),Ge(Wi,de.Maximized),Ge(Fi,de.State),Ge(ni,de.IntrinsicResize),Ge(Yi,de.IntrinsicMove),this._sideEffect.addDisposer([bt.reaction((D,U)=>{!U&&!D&&this.events.emit(de.Close)}),Tt.reaction((D,U)=>{U||this.events.emit(D?de.Focus:de.Blur)})])}get minWidth(){return this._minSize$.value.width}get minHeight(){return this._minSize$.value.height}setMinWidth(e,i=!1){this._minSize$.setValue({width:e,height:this.minHeight},i)}setMinHeight(e,i=!1){this._minSize$.setValue({width:this.minWidth,height:e},i)}resize(e,i,s=!1){this._intrinsicSize$.setValue({width:Math.max(e,this.minWidth),height:Math.max(i,this.minHeight)},s)}get intrinsicX(){return this._intrinsicCoord$.value.x}get intrinsicY(){return this._intrinsicCoord$.value.y}get intrinsicWidth(){return this._intrinsicSize$.value.width}get intrinsicHeight(){return this._intrinsicSize$.value.height}move(e,i,s=!1){let r,a;const n=this.managerStageRect,o=this.pxIntrinsicSize;this.fence?(r=wt(e,0,n.width-o.width),a=wt(i,0,n.height-o.height)):(r=wt(e,-(o.width-120),0+n.width-20),a=wt(i,0,0+n.height-20)),this._intrinsicCoord$.setValue({x:r/n.width,y:a/n.height},s)}transform(e,i,s,r,a=!1){const n=this.managerStageRect;if(s=Math.max(s,this.pxMinSize.width),r=Math.max(r,this.pxMinSize.height),this.boxRatio>0){const o=this.boxRatio*s;i!==this.pxIntrinsicCoord.y&&(i-=o-r),r=o}i<0&&(i=0,r=this.pxIntrinsicSize.height),this.move(e,i,a),this._intrinsicSize$.setValue({width:s/n.width,height:r/n.height},a)}mountContent(e){var i;(i=this.$authorContent)==null||i.remove(),this.$authorContent=e,this.$content.appendChild(e)}unmountContent(){this.$authorContent&&(this.$authorContent.remove(),this.$authorContent=void 0)}mountStage(e){var i;(i=this.$authorStage)==null||i.remove(),this.$authorStage=e,this.$stage||(this.$stage=this._renderStage()),this.$stage.appendChild(e),this.$stage.parentElement||this.$body.appendChild(this.$stage)}unmountStage(){var e;this.$authorStage&&(this.$authorStage.remove(),this.$authorStage=void 0),(e=this.$stage)==null||e.remove()}mountFooter(e){var i;(i=this.$authorFooter)==null||i.remove(),this.$authorFooter=e,this.$footer.appendChild(e)}unmountFooter(){this.$authorFooter&&(this.$authorFooter.remove(),this.$authorFooter=void 0)}mountStyles(e){this.$styles.textContent=e}unmountStyles(){this.$styles.textContent=""}mountUserStyles(e){this.$userStyles.textContent=e}unmountUserStyles(){this.$userStyles.textContent=""}_render(){if(this.$box)return this.$box;const e=(b,v)=>this._sideEffect.addDisposer([this._readonly$.subscribe(x=>b.classList.toggle(this.wrapClassName("readonly"),x)),this._draggable$.subscribe(x=>b.classList.toggle(this.wrapClassName("no-drag"),!x)),this._resizable$.subscribe(x=>b.classList.toggle(this.wrapClassName("no-resize"),!x)),this._focus$.subscribe(x=>b.classList.toggle(this.wrapClassName("blur"),!x)),this._darkMode$.subscribe(x=>{b.classList.toggle(this.wrapClassName("color-scheme-dark"),x),b.classList.toggle(this.wrapClassName("color-scheme-light"),!x)})],v);this.$box=document.createElement("div"),this.$box.classList.add(this.wrapClassName("box")),e(this.$box,"bind-box-state"),this._sideEffect.add(()=>{const b=this.wrapClassName("minimized"),v=this.wrapClassName("maximized"),x="box-maximized-timer";return this._state$.subscribe(y=>{this.$box.classList.toggle(b,y===se.Minimized),y===se.Maximized?(this._sideEffect.flush(x),this.$box.classList.toggle(v,!0)):this._sideEffect.setTimeout(()=>{this.$box.classList.toggle(v,!1)},0,x)})}),this._sideEffect.addDisposer(this._visible$.subscribe(b=>{this.$box.style.display=b?"block":"none"})),this._sideEffect.addDisposer(this._zIndex$.subscribe(b=>{this.$box.style.zIndex=String(b)})),this.$box.dataset.teleBoxID=this.id;const i=uc(this.$box),s=w.combine([this._maximized$,this._minimized$,this._pxIntrinsicSize$,this._pxIntrinsicCoord$,this._collectorRect$,this._rootRect$,this._managerStageRect$],([b,v,x,y,k,z,T])=>{const R=b?{x:-T.x,y:-T.y,width:z.width,height:z.height,scaleX:1,scaleY:1}:{x:y.x,y:y.y,width:x.width,height:x.height,scaleX:1,scaleY:1};if(v&&k){const{width:te,height:Q}=b?this.rootRect:x;R.x=k.x-te/2+k.width/2-T.x,R.y=k.y-Q/2+k.height/2-T.y,R.scaleX=k.width/te,R.scaleY=k.height/Q}return R},{compare:Ne}),r=s.value;this.$box.style.width=r.width+"px",this.$box.style.height=r.height+"px",this.$box.style.transform=`translate(${r.x-10}px,${r.y-10}px)`,this._sideEffect.addDisposer(s.subscribe(b=>{i.set(b)}));const a=document.createElement("div");a.className=this.wrapClassName("box-main"),this.$box.appendChild(a);const n=document.createElement("div");n.className=this.wrapClassName("titlebar-wrap"),n.appendChild(this.titleBar.render()),this.$titleBar=n;const o=document.createElement("div");o.className=this.wrapClassName("body-wrap"),this.$body=o;const c=document.createElement("style");this.$styles=c,o.appendChild(c);const l=document.createElement("style");this.$userStyles=l,o.appendChild(l);const d=document.createElement("div");d.className=this.wrapClassName("content")+" tele-fancy-scrollbar",this.$content=d,this._sideEffect.addDisposer(w.combine([this._bodyStyle$,this._defaultBoxBodyStyle$],([b,v])=>b!=null?b:v).subscribe(b=>d.style.cssText=b||"")),o.appendChild(d);const u=document.createElement("div");u.className=this.wrapClassName("footer-wrap"),this.$footer=u,a.appendChild(n);const p=document.createElement("div");p.className=this.wrapClassName("main"),this.$main=p,a.appendChild(p);const m=document.createElement("div");m.className=this.wrapClassName("quarantine-outer"),p.appendChild(m);const g=document.createElement("div");if(g.className=this.wrapClassName("quarantine"),g.appendChild(o),g.appendChild(u),this.enableShadowDOM){e(g,"bind-quarantine-state");const b=document.createElement("style");b.textContent=pc,g.insertBefore(b,g.firstChild),m.attachShadow({mode:"open"}).appendChild(g)}else m.appendChild(g);this._renderResizeHandlers();const f=()=>{const b=o.getBoundingClientRect();this._bodyRect$.setValue({x:0,y:0,width:b.width,height:b.height})};return this._sideEffect.add(()=>{const b=new fc(()=>{this.minimized||f()});return b.observe(o),()=>b.disconnect()}),this._sideEffect.addDisposer(this._minimized$.reaction(b=>{b||this._sideEffect.setTimeout(f,400,"minimized-content-rect-fix")})),this.$box}_renderStage(){const e=document.createElement("div");e.className=this.wrapClassName("box-stage");const i=s=>{e.style.top=s.y+"px",e.style.left=s.x+"px",e.style.width=s.width+"px",e.style.height=s.height+"px"};return this._sideEffect.addDisposer([w.combine([this._stageStyle$,this._defaultBoxStageStyle$],([s,r])=>s!=null?s:r).subscribe(s=>{e.style.cssText=s||"",i(this._stageRect$.value)}),this._stageRect$.subscribe(i)],"box-stage-styles"),e}_renderResizeHandlers(){const e=document.createElement("div");e.className=this.wrapClassName("resize-handles"),Object.values(De).forEach(f=>{const b=document.createElement("div");b.className=this.wrapClassName(f)+" "+this.wrapClassName("resize-handle"),b.dataset.teleBoxHandle=f,e.appendChild(b)}),this.$box.appendChild(e);const i="handle-tracking-listener",s=this.wrapClassName("transforming");let r,a=0,n=0,o=0,c=0,l=0,d=0,u;const p=f=>{if(!f.isPrimary||this.state!==se.Normal)return;Rt(f);let{pageX:b,pageY:v}=f;v<0&&(v=0);const x=b-l,y=v-d;let{x:k,y:z}=this.pxIntrinsicCoord,{width:T,height:R}=this.pxIntrinsicSize;switch(u){case De.North:{z=n+y,R=c-y;break}case De.South:{R=c+y;break}case De.West:{k=a+x,T=o-x;break}case De.East:{T=o+x;break}case De.NorthWest:{k=a+x,z=n+y,T=o-x,R=c-y;break}case De.NorthEast:{z=n+y,T=o+x,R=c-y;break}case De.SouthEast:{T=o+x,R=c+y;break}case De.SouthWest:{k=a+x,T=o-x,R=c+y;break}default:{this.move(a+x,n+y);return}}this.transform(k,z,T,R)},m=f=>{!f.isPrimary||(u=void 0,r&&(Rt(f),this.$box.classList.toggle(s,!1),this._sideEffect.flush(i),r.remove()))},g=f=>{var b;if(!f.isPrimary||this.readonly||f.button!=null&&f.button!==0||!this.draggable||u||this.state!==se.Normal)return;const v=f.target;if((b=v.dataset)!=null&&b.teleBoxHandle){Rt(f),{x:a,y:n}=this.pxIntrinsicCoord,{width:o,height:c}=this.pxIntrinsicSize,{pageX:l,pageY:d}=f,u=v.dataset.teleBoxHandle,r||(r=document.createElement("div"));const x=u?this.wrapClassName(`cursor-${u}`):"";r.className=this.wrapClassName(`track-mask${x?` ${x}`:""}`),this.$box.appendChild(r),this.$box.classList.add(s),this._sideEffect.add(()=>(window.addEventListener("pointermove",p,{passive:!1}),window.addEventListener("pointerup",m,{passive:!1}),window.addEventListener("pointercancel",m,{passive:!1}),()=>{window.removeEventListener("pointermove",p),window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m)}),i)}};this._handleTrackStart=g,this._sideEffect.addEventListener(e,"pointerdown",g,{},"box-resizeHandles-pointerdown")}async destroy(){this.$box.remove(),this._sideEffect.flushAll(),this._sideEffect.flushAll(),await this.events.emit(de.Destroyed),this.events.clearListeners(),this._delegateEvents.clearListeners()}wrapClassName(e){return`${this.namespace}-${e}`}}var yc="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxOCAxNiI+CiAgICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxwYXRoIHN0cm9rZT0iIzdCODhBMCIgc3Ryb2tlLXdpZHRoPSIxLjQiIGQ9Ik0uNyAxLjJoMTYuNnYxMy42SC43eiIgLz4KICAgICAgICA8cGF0aCBmaWxsPSIjN0I4OEEwIiBkPSJNNCA1LjVoNnYxLjRINHpNNCA5LjVoMTB2MS40SDR6IiAvPgogICAgPC9nPgo8L3N2Zz4K";class wc{constructor({minimized$:e,readonly$:i,darkMode$:s,namespace:r="telebox",styles:a={},root:n,onClick:o}){this._sideEffect=new ve.SideEffectManager,this.namespace=r;const c=new w.ValManager;this._sideEffect.addDisposer(()=>c.destroy());const l=new w.Val(void 0),d=w.derive(e),u=new w.Val(a),p=new w.Val(document.createElement("button")),m={styles:u,$collector:p};w.withValueEnhancer(this,m,c);const g={rect:l,visible:d};w.withReadonlyValueEnhancer(this,g,c),p.value.className=this.wrapClassName("collector"),p.value.style.backgroundImage=`url('${yc}')`,this._sideEffect.addDisposer(p.subscribe(f=>{this._sideEffect.add(()=>(n.appendChild(f),()=>f.remove()),"telebox-collector-mount"),this._sideEffect.addEventListener(f,"click",()=>{i.value||o==null||o()},{},"telebox-collector-click"),this._sideEffect.addDisposer([d.subscribe(b=>{f.classList.toggle(this.wrapClassName("collector-visible"),b)}),i.subscribe(b=>{f.classList.toggle(this.wrapClassName("collector-readonly"),b)}),s.subscribe(b=>{f.classList.toggle(this.wrapClassName("color-scheme-dark"),b),f.classList.toggle(this.wrapClassName("color-scheme-light"),!b)}),u.subscribe(b=>{Object.keys(b).forEach(v=>{const x=b[v];x!=null&&(f.style[v]=x)})}),e.subscribe(b=>{if(b){const{x:v,y:x,width:y,height:k}=f.getBoundingClientRect(),z=n.getBoundingClientRect();l.setValue({x:v-z.x,y:x-z.y,width:y,height:k})}})],"telebox-collector-el")}))}destroy(){this._sideEffect.flushAll()}wrapClassName(e){return`${this.namespace}-${e}`}}var oe=(t=>(t.Focused="focused",t.Blurred="blurred",t.Created="created",t.Removed="removed",t.State="state",t.Maximized="maximized",t.Minimized="minimized",t.IntrinsicMove="intrinsic_move",t.IntrinsicResize="intrinsic_resize",t.ZIndex="z_index",t.PrefersColorScheme="prefers_color_scheme",t.DarkMode="dark_mode",t))(oe||{});class vc extends Wa{constructor(e){super(e);this.boxes$=e.boxes$,this.rootRect$=e.rootRect$,this.darkMode$=e.darkMode$,e.root.appendChild(this.render())}focusBox(e){var i;if(!(this.focusedBox&&this.focusedBox===e)){if(this.$titles&&this.state$.value===se.Maximized){const{children:s}=this.$titles.firstElementChild;for(let r=s.length-1;r>=0;r-=1){const a=s[r],n=(i=a.dataset)==null?void 0:i.teleBoxID;n&&(e&&n===e.id?a.classList.toggle(this.wrapClassName("titles-tab-focus"),!0):this.focusedBox&&n===this.focusedBox.id&&a.classList.toggle(this.wrapClassName("titles-tab-focus"),!1))}}this.focusedBox=e}}render(){if(this.$titleBar)return this.$titleBar;const e=super.render();e.classList.add(this.wrapClassName("max-titlebar")),this.sideEffect.addDisposer([this.state$.subscribe(s=>{e.classList.toggle(this.wrapClassName("max-titlebar-maximized"),s===se.Maximized)}),this.readonly$.subscribe(s=>{e.classList.toggle(this.wrapClassName("readonly"),s)}),w.combine([this.state$,this.boxes$]).subscribe(([s,r])=>{s===se.Maximized&&(e.classList.toggle(this.wrapClassName("max-titlebar-single-title"),r.length===1),r.length!==1&&e.replaceChild(this.renderTitles(),e.firstElementChild))})],"max-render");const i=document.createElement("div");return i.classList.add(this.wrapClassName("titles-area")),e.insertBefore(i,e.firstElementChild),e}destroy(){super.destroy(),this.$titles=void 0,this.focusedBox=void 0}renderTitles(){this.$titles=document.createElement("div"),this.$titles.className=this.wrapClassName("titles"),this.sideEffect.addEventListener(this.$titles,"wheel",s=>{s.currentTarget.scrollBy({left:s.deltaY>0?250:-250,behavior:"smooth"})},{passive:!1},"max-render-wheel-titles");const e=document.createElement("div");e.className=this.wrapClassName("titles-content"),this.$titles.appendChild(e);const i=this.boxes$.value.map(s=>{const r=document.createElement("button");return r.className=this.wrapClassName("titles-tab"),r.textContent=s.title,r.dataset.teleBoxID=s.id,r.dataset.teleTitleBarNoDblClick="true",this.focusedBox&&s.id===this.focusedBox.id&&r.classList.add(this.wrapClassName("titles-tab-focus")),e.appendChild(r),s._title$.reaction(a=>r.textContent=a)});return this.sideEffect.addDisposer(()=>i.forEach(s=>s()),"max-render-tab-titles"),this.$titles}}const xc=window.ResizeObserver||la.ResizeObserver;class Mc{constructor({root:e=null,fullscreen:i=!1,prefersColorScheme:s=Ua.Light,minimized:r=!1,maximized:a=!1,fence:n=!0,collector:o,namespace:c="telebox",readonly:l=!1,stageRatio:d=-1,containerStyle:u="",stageStyle:p="",defaultBoxBodyStyle:m=null,defaultBoxStageStyle:g=null,theme:f={}}={}){this.events=new rt.default,this._sideEffect=new ve.SideEffectManager,this.namespace=c;const b=new w.ValManager;this._sideEffect.addDisposer(()=>b.destroy());const v=new w.Val(e),x=new w.Val(l),y=new w.Val(n),k=new w.Val(u),z=new w.Val(p),T=new w.Val(d),R=new w.Val(m),te=new w.Val(g),Q=new w.Val(i),xe=new w.Val(r),Re=new w.Val(a),ge=w.combine([Re,Q],([A,B])=>B?!0:A),Ie=w.combine([xe,Q],([A,B])=>B?!1:A);this.setMaximized=(A,B)=>Re.setValue(A,B),this.setMinimized=(A,B)=>xe.setValue(A,B);const me=new w.Val({x:0,y:0,width:window.innerWidth,height:window.innerHeight},{compare:Ne});this._sideEffect.addDisposer(v.subscribe(A=>{this._sideEffect.add(()=>{if(!A)return()=>{};const B=new xc(()=>{const ke=A.getBoundingClientRect();me.setValue({x:0,y:0,width:ke.width,height:ke.height})});return B.observe(A),()=>B.disconnect()},"calc-root-rect")}));const _e=w.combine([me,T],Ha,{compare:Ne});this.boxes$=new w.Val([]),this.topBox$=new w.Val(void 0),this._sideEffect.addDisposer(this.boxes$.subscribe(A=>{if(A.length>0){const B=A.reduce((ke,Ce)=>ke.zIndex>Ce.zIndex?ke:Ce);this.topBox$.setValue(B)}else this.topBox$.setValue(void 0)}));const fe=window.matchMedia("(prefers-color-scheme: dark)"),be=new w.Val(!1);fe&&(be.setValue(fe.matches),this._sideEffect.add(()=>{const A=B=>{be.setValue(B.matches)};return fe.addEventListener("change",A),()=>fe.removeEventListener("change",A)}));const Me=new w.Val(s);this._sideEffect.addDisposer(Me.reaction((A,B)=>{B||this.events.emit(oe.PrefersColorScheme,A)}));const Ae=w.combine([be,Me],([A,B])=>B==="auto"?A:B==="dark"),Se=w.combine([Ie,ge],([A,B])=>A?se.Minimized:B?se.Maximized:se.Normal),ot={darkMode:Ae,state:Se,root:v,rootRect:me,stageRect:_e,minimized:Ie,maximized:ge};w.withReadonlyValueEnhancer(this,ot,b);const Oe={fullscreen:Q,prefersColorScheme:Me,readonly:x,fence:y,stageRatio:T,containerStyle:k,stageStyle:z,defaultBoxBodyStyle:R,defaultBoxStageStyle:te};w.withValueEnhancer(this,Oe,b);const Qe=this.wrapClassName("titlebar-icon-close"),bt=A=>{var B;if(!A.isPrimary||x.value)return;const ke=A.target;if(!!ke.tagName)for(let Ce=ke;Ce;Ce=Ce.parentElement){if(Ce.classList&&Ce.classList.contains(Qe))return;const Tt=(B=Ce.dataset)==null?void 0:B.teleBoxID;if(Tt){const yt=this.getBox(Tt);if(yt){this.focusBox(yt),this.makeBoxTop(yt);return}}}};this._sideEffect.addEventListener(window,"pointerdown",bt,!0),this.$container=document.createElement("div"),this.$container.className=this.wrapClassName("manager-container"),this.setTheme(f),this.$stage=document.createElement("div"),this.$stage.className=this.wrapClassName("manager-stage"),this.$container.appendChild(this.$stage),this._sideEffect.addDisposer([Ae.subscribe(A=>{this.$container.classList.toggle(this.wrapClassName("color-scheme-dark"),A),this.$container.classList.toggle(this.wrapClassName("color-scheme-light"),!A)}),Q.subscribe(A=>{this.$container.classList.toggle(this.wrapClassName("is-fullscreen"),Boolean(A))}),w.combine([this.boxes$,Q],([A,B])=>B==="no-titlebar"||B===!0&&A.length<=1).subscribe(A=>{this.$container.classList.toggle(this.wrapClassName("hide-fullscreen-titlebar"),A)}),ge.subscribe(A=>{this.$container.classList.toggle(this.wrapClassName("is-maximized"),A)}),Ie.subscribe(A=>{this.$container.classList.toggle(this.wrapClassName("is-minimized"),A)}),k.subscribe(A=>{this.$container.style.cssText=A}),z.subscribe(A=>{this.$stage.style.cssText=A,this.$stage.style.width=_e.value.width+"px",this.$stage.style.height=_e.value.height+"px"}),_e.subscribe(A=>{this.$stage.style.width=A.width+"px",this.$stage.style.height=A.height+"px"}),v.subscribe(A=>{A?A.appendChild(this.$container):this.$container.parentElement&&this.$container.remove()})]),this.collector=o!=null?o:new wc({minimized$:Ie,readonly$:x,darkMode$:Ae,namespace:c,root:this.$container,onClick:()=>xe.setValue(!1)}),this.titleBar=new vc({namespace:this.namespace,title$:w.derive(this.topBox$,A=>(A==null?void 0:A.title)||""),boxes$:this.boxes$,darkMode$:Ae,readonly$:x,state$:Se,rootRect$:me,root:this.$container,onEvent:A=>{switch(A.type){case je.Maximize:{this.setMaximized(!ge.value);break}case je.Minimize:{this.setMinimized(!0);break}case de.Close:{this.removeTopBox(),this.focusTopBox();break}}}}),this._sideEffect.addDisposer([Se.reaction((A,B)=>{B||this.events.emit(oe.State,A)}),ge.reaction((A,B)=>{B||this.events.emit(oe.Maximized,A)}),Ie.reaction((A,B)=>{B||this.events.emit(oe.Minimized,A)}),Ae.reaction((A,B)=>{B||this.events.emit(oe.DarkMode,A)})])}get boxes(){return this.boxes$.value}get topBox(){return this.topBox$.value}setState(e,i=!1){switch(e){case se.Maximized:{this.setMinimized(!1,i),this.setMaximized(!0,i);break}case se.Minimized:{this.setMinimized(!0,i),this.setMaximized(!1,i);break}default:{this.setMinimized(!1,i),this.setMaximized(!1,i);break}}return this}create(e={},i=!0){const s=new bc(ye(O(O({zIndex:this.topBox?this.topBox.zIndex+1:100},e),i?this.smartPosition(e):{}),{namespace:this.namespace,root:this.$stage,darkMode$:this._darkMode$,fence$:this._fence$,rootRect$:this._rootRect$,managerStageRect$:this._stageRect$,managerStageRatio$:this._stageRatio$,managerMaximized$:this._maximized$,managerMinimized$:this._minimized$,managerReadonly$:this._readonly$,collectorRect$:this.collector._rect$,defaultBoxBodyStyle$:this._defaultBoxBodyStyle$,defaultBoxStageStyle$:this._defaultBoxStageStyle$}));return s.focus&&(this.focusBox(s),i&&this.makeBoxTop(s)),this.boxes$.setValue([...this.boxes,s]),this._sideEffect.addDisposer([s._delegateEvents.on(je.Maximize,()=>{this.setMaximized(!this.maximized)}),s._delegateEvents.on(je.Minimize,()=>{this.setMinimized(!0)}),s._delegateEvents.on(je.Close,()=>{this.remove(s),this.focusTopBox()}),s._intrinsicCoord$.reaction((r,a)=>{a||this.events.emit(oe.IntrinsicMove,s)}),s._intrinsicSize$.reaction((r,a)=>{a||this.events.emit(oe.IntrinsicResize,s)}),s._zIndex$.reaction((r,a)=>{if(this.boxes.length>0){const n=this.boxes.reduce((o,c)=>o.zIndex>c.zIndex?o:c);this.topBox$.setValue(n)}a||this.events.emit(oe.ZIndex,s)})]),this.events.emit(oe.Created,s),s}query(e){return e?this.boxes.filter(this.teleBoxMatcher(e)):[...this.boxes]}queryOne(e){return e?this.boxes.find(this.teleBoxMatcher(e)):this.boxes[0]}update(e,i,s=!1){const r=this.boxes.find(a=>a.id===e);if(r)return this.updateBox(r,i,s)}updateAll(e,i=!1){this.boxes.forEach(s=>{this.updateBox(s,e,i)})}remove(e,i=!1){const s=this.getBoxIndex(e);if(s>=0){const r=this.boxes.slice(),a=r.splice(s,1);return this.boxes$.setValue(r),a.forEach(n=>n.destroy()),i||(this.boxes.length<=0&&(this.setMaximized(!1),this.setMinimized(!1)),this.events.emit(oe.Removed,a)),a[0]}}removeTopBox(){if(this.topBox)return this.remove(this.topBox)}removeAll(e=!1){const i=this.boxes$.value;return this.boxes$.setValue([]),i.forEach(s=>s.destroy()),e||(this.boxes.length<=0&&(this.setMaximized(!1),this.setMinimized(!1)),this.events.emit(oe.Removed,i)),i}setTheme(e){Object.keys(e).forEach(i=>{var s;this.$container.style.setProperty(`--tele-${i}`,(s=e[i])!=null?s:null)})}mount(e){this._root$.setValue(e)}unmount(){this._root$.setValue(null)}destroy(e=!1){this.events.clearListeners(),this._sideEffect.flushAll(),this.removeAll(e),this.collector.destroy(),this.titleBar.destroy()}wrapClassName(e){return`${this.namespace}-${e}`}focusBox(e,i=!1){const s=this.getBox(e);s&&(this.boxes.forEach(r=>{if(s===r){let a=!1;s.focus||(a=!0,s._focus$.setValue(!0,i)),a&&!i&&this.events.emit(oe.Focused,s)}else r.focus&&this.blurBox(r,i)}),this.titleBar.focusBox(s))}focusTopBox(){if(this.topBox&&!this.topBox.focus)return this.focusBox(this.topBox)}blurBox(e,i=!1){const s=this.getBox(e);s&&(s.focus&&(s._focus$.setValue(!1,i),i||this.events.emit(oe.Blurred,s)),this.titleBar.focusedBox===s&&this.titleBar.focusBox())}blurAll(e=!1){this.boxes.forEach(i=>{i.focus&&(i._focus$.setValue(!1,e),e||this.events.emit(oe.Blurred,i))}),this.titleBar.focusedBox&&this.titleBar.focusBox()}teleBoxMatcher(e){const i=Object.keys(e);return s=>i.every(r=>e[r]===s[r])}updateBox(e,i,s=!1){var r,a,n,o,c,l;(i.x!=null||i.y!=null)&&e._intrinsicCoord$.setValue({x:(r=i.x)!=null?r:e.intrinsicX,y:(a=i.y)!=null?a:e.intrinsicY},s),(i.width!=null||i.height!=null)&&e._intrinsicSize$.setValue({width:(n=i.width)!=null?n:e.intrinsicWidth,height:(o=i.height)!=null?o:e.intrinsicHeight},s),i.title!=null&&e._title$.setValue(i.title),i.visible!=null&&e._visible$.setValue(i.visible,s),i.resizable!=null&&e._resizable$.setValue(i.resizable,s),i.draggable!=null&&e._draggable$.setValue(i.draggable,s),i.boxRatio!=null&&e._boxRatio$.setValue(i.boxRatio,s),i.zIndex!=null&&e._zIndex$.setValue(i.zIndex,s),i.stageRatio!==void 0&&e.setStageRatio(i.stageRatio,s),i.content!=null&&e.mountContent(i.content),i.footer!=null&&e.mountFooter(i.footer),(i.minHeight!=null||i.minWidth!=null)&&e._minSize$.setValue({width:(c=i.minWidth)!=null?c:e.minWidth,height:(l=i.minHeight)!=null?l:e.minHeight},s)}smartPosition(e){let{x:i,y:s}=e;const{width:r=.5,height:a=.5}=e,n=this.stageRect,o=this.topBox;if(i==null){let c=20;if(o){const l=o.pxIntrinsicCoord.x+20,d=r*n.width;l+d<=n.width&&(c=l)}i=c/n.width}if(s==null){let c=20;if(o){const l=o.pxIntrinsicCoord.y+20,d=a*n.height;l+d<=n.height&&(c=l)}s=c/n.height}return{x:i,y:s,width:r,height:a}}makeBoxTop(e,i=!1){this.topBox&&e!==this.topBox&&e._zIndex$.setValue(this.topBox.zIndex+1,i)}getBoxIndex(e){return typeof e=="string"?this.boxes.findIndex(i=>i.id===e):this.boxes.findIndex(i=>i===e)}getBox(e){return typeof e=="string"?this.boxes.find(i=>i.id===e):e}}const Sc=(t,e,i,s,r)=>new Cc({safeSetAttributes:a=>t.safeSetAttributes(a),updateAppState:(...a)=>{var n;return(n=t.appManager)==null?void 0:n.store.updateAppState(...a)},canOperate:()=>t.canOperate,notifyContainerRectUpdate:a=>{var n;return(n=t.appManager)==null?void 0:n.notifyContainerRectUpdate(a)},cleanFocus:()=>{var a;return(a=t.appManager)==null?void 0:a.store.cleanFocus()},setAppFocus:a=>{var n;return(n=t.appManager)==null?void 0:n.store.setAppFocus(a,!0)},callbacks:e,emitter:i,boxEmitter:s},r);class Cc{constructor(e,i){this.context=e,this.sideEffectManager=new ve.SideEffectManager;const{emitter:s,callbacks:r,boxEmitter:a}=e;this.teleBoxManager=this.setupBoxManager(i),this.sideEffectManager.add(()=>[this.teleBoxManager.onValChanged("state",n=>{r.emit("boxStateChange",n),s.emit("boxStateChange",n)}),this.teleBoxManager.onValChanged("darkMode",n=>{r.emit("darkModeChange",n)}),this.teleBoxManager.onValChanged("prefersColorScheme",n=>{r.emit("prefersColorSchemeChange",n)}),this.teleBoxManager.onValChanged("minimized",(n,o)=>{if(!o)if(this.context.safeSetAttributes({minimized:n}),n)this.context.cleanFocus(),this.blurAllBox();else{const c=this.getTopBox();c&&(this.context.setAppFocus(c.id),this.focusBox({appId:c.id},!1))}}),this.teleBoxManager.onValChanged("maximized",(n,o)=>{o||this.context.safeSetAttributes({maximized:n})}),this.teleBoxManager.events.on("removed",n=>{n.forEach(o=>{a.emit("close",{appId:o.id})})}),this.teleBoxManager.events.on("intrinsic_move",I.debounce(n=>{a.emit("move",{appId:n.id,x:n.intrinsicX,y:n.intrinsicY})},50)),this.teleBoxManager.events.on("intrinsic_resize",I.debounce(n=>{a.emit("resize",{appId:n.id,width:n.intrinsicWidth,height:n.intrinsicHeight})},200)),this.teleBoxManager.events.on("focused",n=>{n&&(this.canOperate?a.emit("focus",{appId:n.id}):this.teleBoxManager.blurBox(n.id))}),this.teleBoxManager.events.on("z_index",n=>{this.context.updateAppState(n.id,Ee.ZIndex,n.zIndex)}),s.on("containerSizeRatioUpdate",n=>{this.teleBoxManager._stageRatio$.setValue(n)})])}get canOperate(){return this.context.canOperate()}get boxState(){return this.teleBoxManager.state}get maximized(){return this.teleBoxManager.maximized}get minimized(){return this.teleBoxManager.minimized}get darkMode(){return this.teleBoxManager.darkMode}get prefersColorScheme(){return this.teleBoxManager.prefersColorScheme}get boxSize(){return this.teleBoxManager.boxes.length}get stageRect(){return this.teleBoxManager.stageRect}get stageRect$(){return this.teleBoxManager._stageRect$}createBox(e){var u,p,m;if(!this.teleBoxManager)return;let{minwidth:i=Eo,minheight:s=Po,enableShadowDOM:r=!0}=(u=e.app.config)!=null?u:{};const{width:a,height:n}=(p=e.app.config)!=null?p:{},o=((m=e.options)==null?void 0:m.title)||e.appId,c=this.teleBoxManager.rootRect;i>1&&(i=i/c.width),s>1&&(s=s/c.height);const l={title:o,minWidth:i,minHeight:s,width:a,height:n,id:e.appId,enableShadowDOM:r},d=this.teleBoxManager.create(l,e.smartPosition);return this.context.emitter.emit(`${e.appId}${Y.WindowCreated}`),d}setupBoxManager(e){const i=le.playground,s={stageRatio:e==null?void 0:e.stageRatio,root:i,fence:!1,prefersColorScheme:e==null?void 0:e.prefersColorScheme};e!=null&&e.containerStyle&&(s.containerStyle=e.containerStyle),e!=null&&e.stageStyle&&(s.stageStyle=e.stageStyle),e!=null&&e.fullscreen&&(s.fullscreen=e.fullscreen);const r=new Mc(s);this.teleBoxManager&&this.teleBoxManager.destroy(),this.teleBoxManager=r;const a=e==null?void 0:e.collectorContainer;return a&&this.teleBoxManager.collector.set$collector(a),e!=null&&e.collectorStyles&&this.teleBoxManager.collector.setStyles(e.collectorStyles),r}getBox(e){return this.teleBoxManager.queryOne({id:e})}closeBox(e,i=!1){return this.teleBoxManager.remove(e,i)}boxIsFocus(e){const i=this.getBox(e);return i==null?void 0:i.focus}getFocusBox(){return this.teleBoxManager.query({focus:!0})[0]}getTopBox(){return this.teleBoxManager.topBox}updateBoxState(e){if(!e)return;const i=this.getBox(e.id);i&&(e.size&&i._intrinsicSize$.setValue(e.size,!0),e.position&&i._intrinsicCoord$.setValue(e.position,!0),e.zIndex&&i._zIndex$.setValue(e.zIndex,!0),setTimeout(()=>{e.focus&&this.teleBoxManager.focusBox(i.id,!0),e.maximized!=null&&this.teleBoxManager.setMaximized(Boolean(e.maximized),!0),e.minimized!=null&&this.teleBoxManager.setMinimized(Boolean(e.minimized),!0)},50),this.context.callbacks.emit("boxStateChange",this.teleBoxManager.state))}moveBox({appId:e,x:i,y:s}){const r=this.getBox(e);r&&r._intrinsicCoord$.setValue({x:i,y:s},!0)}focusBox({appId:e},i=!0){this.teleBoxManager.focusBox(e,i)}resizeBox({appId:e,width:i,height:s,skipUpdate:r}){const a=this.getBox(e);a&&a._intrinsicSize$.setValue({width:i,height:s},r)}setBoxMinSize(e){this.teleBoxManager.update(e.appId,{minWidth:e.minWidth,minHeight:e.minHeight},!0)}setBoxTitle(e){this.teleBoxManager.update(e.appId,{title:e.title},!0)}blurAllBox(){this.teleBoxManager.blurAll()}updateAll(e){this.teleBoxManager.updateAll(e)}setMaximized(e,i=!0){e!==this.maximized&&this.teleBoxManager.setMaximized(e,i)}setMinimized(e,i=!0){this.teleBoxManager.setMinimized(e,i)}focusTopBox(){if(this.teleBoxManager.query().length>=1){const i=this.getTopBox();i&&this.focusBox({appId:i.id},!1)}}updateBox(e,i,s=!0){this.teleBoxManager.update(e,i,s)}setReadonly(e){this.teleBoxManager.setReadonly(e)}setPrefersColorScheme(e){this.teleBoxManager.setPrefersColorScheme(e)}setZIndex(e,i,s=!0){this.teleBoxManager.update(e,{zIndex:i},s)}setRoot(e){this.teleBoxManager._root$.setValue(e)}setCollector(e){this.teleBoxManager.collector.set$collector(e)}destroy(){this.sideEffectManager.flushAll(),this.teleBoxManager.destroy()}}function Si(){}function Fa(t){return t()}function Lr(){return Object.create(null)}function zi(t){t.forEach(Fa)}function Ic(t){return typeof t=="function"}function _c(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let ci;function Ci(t,e){return ci||(ci=document.createElement("a")),ci.href=e,t===ci.href}function Ac(t){return Object.keys(t).length===0}function We(t,e){t.appendChild(e)}function Di(t,e,i){t.insertBefore(e,i||null)}function Kt(t){t.parentNode.removeChild(t)}function et(t){return document.createElement(t)}function Zs(t){return document.createTextNode(t)}function ws(){return Zs(" ")}function ie(t,e,i){i==null?t.removeAttribute(e):t.getAttribute(e)!==i&&t.setAttribute(e,i)}function kc(t){return Array.from(t.childNodes)}function Za(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function ne(t,e,i,s){i===null?t.style.removeProperty(e):t.style.setProperty(e,i,s?"important":"")}let Ys;function Ot(t){Ys=t}const Dt=[],Vr=[],fi=[],$r=[],Tc=Promise.resolve();let vs=!1;function Nc(){vs||(vs=!0,Tc.then(Ya))}function xs(t){fi.push(t)}const rs=new Set;let hi=0;function Ya(){const t=Ys;do{for(;hi<Dt.length;){const e=Dt[hi];hi++,Ot(e),Ec(e.$$)}for(Ot(null),Dt.length=0,hi=0;Vr.length;)Vr.pop()();for(let e=0;e<fi.length;e+=1){const i=fi[e];rs.has(i)||(rs.add(i),i())}fi.length=0}while(Dt.length);for(;$r.length;)$r.pop()();vs=!1,rs.clear(),Ot(t)}function Ec(t){if(t.fragment!==null){t.update(),zi(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(xs)}}const Pc=new Set;function zc(t,e){t&&t.i&&(Pc.delete(t),t.i(e))}function Dc(t,e,i,s){const{fragment:r,on_mount:a,on_destroy:n,after_update:o}=t.$$;r&&r.m(e,i),s||xs(()=>{const c=a.map(Fa).filter(Ic);n?n.push(...c):zi(c),t.$$.on_mount=[]}),o.forEach(xs)}function Lc(t,e){const i=t.$$;i.fragment!==null&&(zi(i.on_destroy),i.fragment&&i.fragment.d(e),i.on_destroy=i.fragment=null,i.ctx=[])}function Vc(t,e){t.$$.dirty[0]===-1&&(Dt.push(t),Nc(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function $c(t,e,i,s,r,a,n,o=[-1]){const c=Ys;Ot(t);const l=t.$$={fragment:null,ctx:null,props:a,update:Si,not_equal:r,bound:Lr(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:Lr(),dirty:o,skip_bound:!1,root:e.target||c.$$.root};n&&n(l.root);let d=!1;if(l.ctx=i?i(t,e.props||{},(u,p,...m)=>{const g=m.length?m[0]:p;return l.ctx&&r(l.ctx[u],l.ctx[u]=g)&&(!l.skip_bound&&l.bound[u]&&l.bound[u](g),d&&Vc(t,u)),p}):[],l.update(),d=!0,zi(l.before_update),l.fragment=s?s(l.ctx):!1,e.target){if(e.hydrate){const u=kc(e.target);l.fragment&&l.fragment.l(u),u.forEach(Kt)}else l.fragment&&l.fragment.c();e.intro&&zc(t.$$.fragment),Dc(t,e.target,e.anchor,e.customElement),Ya()}Ot(c)}class jc{$destroy(){Lc(this,1),this.$destroy=Si}$on(e,i){const s=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return s.push(i),()=>{const r=s.indexOf(i);r!==-1&&s.splice(r,1)}}$set(e){this.$$set&&!Ac(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function jr(t){let e,i,s,r,a,n,o=t[14]&&Br(t),c=t[15]&&Rr(t);return{c(){e=et("div"),i=et("div"),o&&o.c(),s=ws(),r=et("span"),a=Zs(t[0]),n=ws(),c&&c.c(),ne(r,"overflow","hidden"),ne(r,"white-space","nowrap"),ne(r,"text-overflow","ellipsis"),ne(r,"max-width","80px"),ie(i,"class",t[8]),ne(i,"background-color",t[2]),ne(i,"color",t[9]),ne(i,"opacity",t[11]),ie(e,"class","netless-window-manager-cursor-name")},m(l,d){Di(l,e,d),We(e,i),o&&o.m(i,null),We(i,s),We(i,r),We(r,a),We(i,n),c&&c.m(i,null)},p(l,d){l[14]?o?o.p(l,d):(o=Br(l),o.c(),o.m(i,s)):o&&(o.d(1),o=null),d&1&&Za(a,l[0]),l[15]?c?c.p(l,d):(c=Rr(l),c.c(),c.m(i,null)):c&&(c.d(1),c=null),d&256&&ie(i,"class",l[8]),d&4&&ne(i,"background-color",l[2]),d&512&&ne(i,"color",l[9]),d&2048&&ne(i,"opacity",l[11])},d(l){l&&Kt(e),o&&o.d(),c&&c.d()}}}function Br(t){let e,i;return{c(){e=et("img"),ie(e,"class","netless-window-manager-cursor-selector-avatar"),ie(e,"style",t[16]()),Ci(e.src,i=t[7])||ie(e,"src",i),ie(e,"alt","avatar")},m(s,r){Di(s,e,r)},p(s,r){r&128&&!Ci(e.src,i=s[7])&&ie(e,"src",i)},d(s){s&&Kt(e)}}}function Rr(t){let e,i;return{c(){e=et("span"),i=Zs(t[1]),ie(e,"class","netless-window-manager-cursor-tag-name"),ne(e,"background-color",t[10])},m(s,r){Di(s,e,r),We(e,i)},p(s,r){r&2&&Za(i,s[1]),r&1024&&ne(e,"background-color",s[10])},d(s){s&&Kt(e)}}}function Bc(t){let e,i,s,r,a,n,o=!t[12]&&jr(t);return{c(){e=et("div"),o&&o.c(),i=ws(),s=et("div"),r=et("img"),ie(r,"class",a="netless-window-manager-cursor-"+t[3]+"-image"),Ci(r.src,n=t[6])||ie(r,"src",n),ie(r,"alt",t[3]),ie(s,"class","cursor-image-wrapper"),ie(e,"class","netless-window-manager-cursor-mid"),ne(e,"transform","translateX("+t[4]+"px) translateY("+t[5]+"px)"),ne(e,"display",t[13])},m(c,l){Di(c,e,l),o&&o.m(e,null),We(e,i),We(e,s),We(s,r)},p(c,[l]){c[12]?o&&(o.d(1),o=null):o?o.p(c,l):(o=jr(c),o.c(),o.m(e,i)),l&8&&a!==(a="netless-window-manager-cursor-"+c[3]+"-image")&&ie(r,"class",a),l&64&&!Ci(r.src,n=c[6])&&ie(r,"src",n),l&8&&ie(r,"alt",c[3]),l&48&&ne(e,"transform","translateX("+c[4]+"px) translateY("+c[5]+"px)"),l&8192&&ne(e,"display",c[13])},i:Si,o:Si,d(c){c&&Kt(e),o&&o.d()}}}function Rc(t,e,i){let s,r,a,n,o,{cursorName:c}=e,{tagName:l}=e,{backgroundColor:d}=e,{appliance:u}=e,{x:p}=e,{y:m}=e,{src:g}=e,{visible:f}=e,{avatar:b}=e,{theme:v}=e,{color:x}=e,{cursorTagBackgroundColor:y}=e,{opacity:k}=e;const z=()=>Object.entries({width:(s?19:28)+"px",height:(s?19:28)+"px",position:s?"initial":"absolute","border-color":s?"white":d,"margin-right":(s?4:0)+"px"}).map(([T,R])=>`${T}: ${R}`).join(";");return t.$$set=T=>{"cursorName"in T&&i(0,c=T.cursorName),"tagName"in T&&i(1,l=T.tagName),"backgroundColor"in T&&i(2,d=T.backgroundColor),"appliance"in T&&i(3,u=T.appliance),"x"in T&&i(4,p=T.x),"y"in T&&i(5,m=T.y),"src"in T&&i(6,g=T.src),"visible"in T&&i(17,f=T.visible),"avatar"in T&&i(7,b=T.avatar),"theme"in T&&i(8,v=T.theme),"color"in T&&i(9,x=T.color),"cursorTagBackgroundColor"in T&&i(10,y=T.cursorTagBackgroundColor),"opacity"in T&&i(11,k=T.opacity)},t.$$.update=()=>{t.$$.dirty&1&&(s=!I.isEmpty(c)),t.$$.dirty&2&&i(15,r=!I.isEmpty(l)),t.$$.dirty&128&&i(14,a=!I.isEmpty(b)),t.$$.dirty&131072&&i(13,n=f?"initial":"none"),t.$$.dirty&8&&i(12,o=u===M.ApplianceNames.laserPointer)},[c,l,d,u,p,m,g,b,v,x,y,k,o,n,a,r,z,f]}class Oc extends jc{constructor(e){super();$c(this,e,Rc,Bc,_c,{cursorName:0,tagName:1,backgroundColor:2,appliance:3,x:4,y:5,src:6,visible:17,avatar:7,theme:8,color:9,cursorTagBackgroundColor:10,opacity:11})}}class Uc{constructor(e,i,s,r){this.manager=e,this.memberId=i,this.cursorManager=s,this.wrapper=r,this.move=a=>{var n,o;if(a.type==="main"){const c=(n=this.manager.boxManager)==null?void 0:n.stageRect;this.component&&c&&(this.autoHidden(),this.moveCursor(a,c,this.manager.mainView))}else{const c=this.cursorManager.focusView,l=(o=c==null?void 0:c.divElement)==null?void 0:o.getBoundingClientRect(),d=c==null?void 0:c.camera;c&&l&&d&&this.component&&(this.autoHidden(),this.moveCursor(a,l,c))}},this.leave=()=>{this.hide()},this.updateMember(),this.createCursor(),this.autoHidden()}moveCursor(e,i,s){var c,l;const{x:r,y:a,type:n}=e,o=s==null?void 0:s.screen.convertPointToScreen(r,a);if(o){let d=o.x-2,u=o.y-18;if(n==="app"){const p=this.cursorManager.playgroundRect;p&&(d=d+i.x-p.x,u=u+i.y-p.y)}else d=d+i.x,u=u+i.y;o.x<0||o.x>i.width||o.y<0||o.y>i.height?(c=this.component)==null||c.$set({visible:!1,x:d,y:u}):(l=this.component)==null||l.$set({visible:!0,x:d,y:u})}}get memberApplianceName(){var e,i;return(i=(e=this.member)==null?void 0:e.memberState)==null?void 0:i.currentApplianceName}get memberColor(){var i,s;return`rgb(${(s=(i=this.member)==null?void 0:i.memberState)==null?void 0:s.strokeColor.join(",")})`}get payload(){var e;return(e=this.member)==null?void 0:e.payload}get memberCursorName(){var e,i;return((e=this.payload)==null?void 0:e.nickName)||((i=this.payload)==null?void 0:i.cursorName)||this.memberId}get memberTheme(){var e;return(e=this.payload)!=null&&e.theme?"netless-window-manager-cursor-inner-mellow":"netless-window-manager-cursor-inner"}get memberCursorTextColor(){var e;return((e=this.payload)==null?void 0:e.cursorTextColor)||"#FFFFFF"}get memberCursorTagBackgroundColor(){var e;return((e=this.payload)==null?void 0:e.cursorTagBackgroundColor)||this.memberColor}get memberAvatar(){var e;return(e=this.payload)==null?void 0:e.avatar}get memberOpacity(){return!this.memberCursorName&&!this.memberAvatar?0:1}get memberTagName(){var e;return(e=this.payload)==null?void 0:e.cursorTagName}autoHidden(){this.timer&&clearTimeout(this.timer),this.timer=window.setTimeout(()=>{this.hide()},1e3*10)}async createCursor(){this.member&&this.wrapper&&(this.component=new Oc({target:this.wrapper,props:this.initProps()}))}initProps(){return{x:0,y:0,appliance:this.memberApplianceName,avatar:this.memberAvatar,src:this.getIcon(),visible:!1,backgroundColor:this.memberColor,cursorName:this.memberCursorName,theme:this.memberTheme,color:this.memberCursorTextColor,cursorTagBackgroundColor:this.memberCursorTagBackgroundColor,opacity:this.memberOpacity,tagName:this.memberTagName}}getIcon(){if(this.member){const e=this.cursorManager.applianceIcons;return e[this.memberApplianceName||M.ApplianceNames.shape]||e[M.ApplianceNames.shape]}}updateMember(){return this.member=Sa(this.manager.room,this.memberId),this.updateComponent(),this.member}updateComponent(){var e;(e=this.component)==null||e.$set(I.omit(this.initProps(),["x","y"]))}destroy(){this.component&&this.component.$destroy(),this.cursorManager.cursorInstances.delete(this.memberId),this.timer&&clearTimeout(this.timer)}hide(){this.component&&(this.component.$set({visible:!1}),this.destroy())}}var Wc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAYISURBVHgB7ZpNSCtXFIBPEuvz+dMGpYUKD/sWFX+Qti6kK7Hqpm6e9q0rIoIUFUShPLV10VZx4+JZqa9v20LBhdq9fyBUCtKNPH8qYl2IOw3G38Rkek4y15y5uTOZJDOWggcOSSYzN/ebc+45554JwIM8iBCPyTEP+86T4vyMfsRN4b+nQTKIJp0vzuGvlpID7os8EQNEIBD4oKio6Bm9DwaDv/v9/n/076JgbtWUYPchwrW8qD7UnOvr6wFNkpubm+/wu7f0c7y6mrnlvQufxB0Iau7V1dX3BDA/P6/V1dVpzc3N2uLiIofK1c8VYHys/wRKBUN3/hGHqaysNOjc3FwMis6hc0FtLTHuvYLxCCZgci8uLn4wg5Gh6Fy8Jk+/NkcCAlAAuUkoW4g0B+d5tLS05O/r67O8eGxsDNra2uDy8nKsoKCAwCIQDxQa0yTxgrvCYXyTk5Ml+Orf2dlJeeHIyAigFSE/P38ELfUNqNdSkjgF5FF89jL1TU1NlQwODl5gZPujp6cHWltbUw7Koc7Pz8mkZpHPFeFrJuZeqLnoMoPoZqe0JjDP/IZgnyLUG/o8NDRkuo5Ua2pjY6MC4oFCFf1cA0oKzRSOp6enRfTaGh0d/QxBt+1CUVgnOTs7+xrHfQzGyOcKkK3QTJMnQffZ6e/v/xwttmsHqqmpKXbdycnJCxy7ABLh3FEgVZ6hZJhnFZoFFMF0d3c/w7v+dyookXBnZ2c/xvHfhriVcvXfdBRItsxjnOhYqjwjoAimq6vrCysoGofk+Ph4Esd/F/UdiFtJAGUd2DygTpp5dmBUUJ2dnc9VUALm8PDwJY7/BPU9VD8k3M4RC6kskxZMKigKIMLN9vf3p3H8DyWgfEhEOwOQD9IXOTz7EObbwsLC4YWFBRgeHrY9ECXYo6MjaGlpKWlsbPxkYGDgRW1tbSEWquVlZWXBzc3Nl1VVVa8hXiXc6ioqBqGaPDk7AACJTRZ3NS9lcUp86cJwoSQ7Pj4Op6enfxUXF3/V0NCQv7q6GsCvwrqGUG/01xAD4+VQTOxaSF43d5bBOisrGBJRCtXX17+/trb268rKSgASFgmz97KFkmo6OztWuVyPweiWGc4WRkhFRQVEIpHg8vJyQAIQVlLBROVxvBYQHsXnO8tk62ZcyN0wecLBwcEvYHSzEPscBqOLCRhLC4n9uqaA8UAWAcAKhtbQ3t7eTHl5+Y9gtAp3twhT056CDMQ7MRzIFTeTYKb1yYYVQFH9VdzsqNmYKpfTJBDX3Ixgdnd3XyHMT2AMALJlBBSPaMpNngrIsTyTCgaj288YDGakictrxizvKFNOjgSSBLS+vv6UYHDb7DgMVgsChjTEgCIKGG4ZU+EWkgNBzN1qamq+pAMTExPgFMzW1tZrhHkFyWE5KxgSszx0527RaDRmOSpRshEOU11dPQPG8CwHARHJlMnTSrwSRFIlfXt7m3V5ngJGuJtqzaQtZkFBVNJezN5ZAdmwjKo2k9tVtrcI3OXk4tPgcg7ChCDZ1URgMOu72Xa5VFHOkymQhWVU60YVmjN6wiC7k6p+S1syCACOwJBYFaexV+yhBekNPsMBO6KAEeE4BMaCU67RsoYhSbXgaT//ht709vZCaWmp6YkEbLFmVJWzas04+iBL7EKpm0J7duqu0B7+CTUpNJuyvb1NCfMj1CqI9wLKUOlOUMeG+gGFkHii4HizUF4z/KFUrPsJ8WbEIyx7nnZ0dDynME6BAuce09iFHo+GrnmGltltb2//E4wVAN82y7vOjKOZXSBhJdHNiT3TYWD8OY2PTUJkdd7MkJMnT5wZVQF2RFX6yBMUdzPMvvfqxz3sXHF+GNT9ANXit/10O1sgHkZvdQAOKvs9B5L7ARELGAAXLSTvM8QExTE+YbHe+HURhZp1aRyF4CJXClbbWwGketgkW9VsY+YaiBCVhfgE+XvxRwgZSM4jUVCDZFQ9pytmXR8hUTB2gnidx4XffVWydN0yQjwmx/jkAZJBrIBI5J7ZvQGZWUgVSuU/EqmOAzicKNMVu816DdRWUV1/7xAP8n+SfwF3Du3NF2sYhwAAAABJRU5ErkJggg==",Hc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADEAAAAxCAYAAABznEEcAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAZoSURBVHgB7VlLSCRXFL3ljNEhEXTGhMQJmOjCz8ZNVLKICz9xIYhCNi7UgINkGEk2En8hW5cBUQNxo05GAoKikuCAmvGzGMdPcCUGjDPxD/4Vv/3JvWW97luvq7ur+hMZ8MKlqrteNfe8e965970GuLVbC5kpJr53+hjHx9yY3TUxJgLMAQG4ITARfp5T4Mri4uL9q6urnxwOxz/oY5eXl1/Pzs7e195X2FX4jZsIhAK7gx5ps9m6nGj9/f3OtbU1pzAE0318fPwVjYHrrN7R3AjU/wpOBwA9Cmf/9ejoqDMtLU31iooKGdA+ATo4OMiXAEWAHhBAGEApXj4rPAik0vPt7e0vCgoKPH4gMzMTSktLIS8vD2JiYgABvcHMTZyennbHxsaOg3udOJmLzwqEYB0ZgRCZENm4u7e39yQuLq65srISZmZmvP5Ybm4u5OfnQ0lJyXWUCAgzNLS+vt6SnJz8WgvYwV5xSlcRgyVg3ha2Dkxzc3MvfZmVlQW+bGxsDBobGyE7O1u94uJPjIqKqklKSvrbbrfPnp+ff7e8vJwMnlSTKWfJjDKhywJo6wLp0YcZ+dyIUr7s4cOHLsrRlQwBTSBFuzc2NiZYhjjVAIyzZBqEwgCQv0OOM/gNzuiP/ijlDxBRjgClpqa6AF1cXDydmpoaLCws3JcAGYHyC4JMzoKaibKysvienp6FtrY2IA/WCFB5ebkqCHSvARo8Ozt7igIxwIJ2gJ+seFMnDoIyEUV+dHT0G3qWVUr5M043DdAB0m2IKZwAYpgZX+qkywR6NFbuR0iDxmAoZRUQKRxSLTMnJ8eIaqqSeVMnIYUOdu+sq6vrp4f+VCoYo8khZaNs01VRlERUu2/BrWAA7sl2Anink1Ao18JGjyY/PDx8hq1GZqgp5c2mp6chMjLy2b179x7hRzvoqeUUwXIzqq4O5nZsNUaEbIbLqPLTou/s7FTvT05OpsA9sXJG1AVsZDwjutqBIN6gUlWjxod8XRBNKXgsrqpqYZfwEqX9h8TExD7wbFm8LmzxHQ0QHSlXKZVSqFC/hkqlaKapTaGgCQTK7PHW1lb/wsLC86KiokkccoV+qV1tcE0pO7AWxmhTxBszDzqRr66ujqanp2cRpQLNBgUsCh8BwQ54bn5+/s+mpqa+4eHhfS1gb52vwuP0trPjhSZCBtLQ0NA3MDDQQIFYAUHBYhuvzjpVbJr1lZWVP3p7e19UVVXNgHumXYrI4uBx6Yqevz02b0FcRQ8CoBQF3dXVpQLZ3d39C7n+ora29vfJyclDYFnWgFyxK3cxhss/+KoT/N6DVkQpKypFGUCp3Ozo6HgSHx//GLW/BwHsg57zl5pzADajwLn52mPL1ZHPloMoRYPMFL6EhAR18e7s7MxVV1fPsAAp4Avteq7dC/c1+wKI4g+EfGzDM+EYHBw8RDrNiA2QL6upqVGvKJ2/gHu2L1nA5wwEB2YDfSYMO1x/px0cgEc2zBY+eo67u6H29vZ/wU2VC8l58JxKNjDOgojNEp08aFVfX++3l6JMEdDx8fEB0FNIBsDXBc8ArwuW1EkeI1RKdLWmCx+1DhkZGRvR0dFfSsHKxYtnW0iqvJAN9xNm6MR/QO5sfapUSkqKmqW5ubmfwVgyZdpw/vPZl2kUEAinBMSUStG+gwra0NDQSynQKyloIxnlewafjDFLJzLRBJqiFMnqyMgIbG5uDuD996Dnv8iAPOMAPmbcm5lVJwA/vZRMKZGZlpaWVtAvUL4GZMqE1fjRJrUd76LHoX+InlhcXPwZnWW2tra6jjrpiBM3UK/weQr6J+gfodMh9HtwncG7YLA3CMSsLmxx5WuDCt8B7vZeicInTjCWlpb6wc15mfey7oc9E8LElpVmMgb9AXoC+qcTExOPKRu4NlTHs6Q10GfhgfYOvRsJQZ76BWMKuDtaolQs+gfoH6Mn436gDg+e+5BKXUQx/C5Je/a+NpbeiQJPKgUdlNXx/BCBKxVdxW5Q0I3XBqFKRhU4KLtjYawi3csuTKdc4FnIXNvKUJkVEGRG20QZAAUpA5DbaYAQLmQzfzxyk/ffdnCD4NWVnGdE7kQBQvQHC5lVEDxgMaM29lkxGCNLKrDnIbFAMkFmBIaDkHstU41coGZ1TZD5UjReCGUAYbNgdNqoXZB/T67yYbFAMiGML3BhYeH8rb0t9h/zgcTBcTNGiQAAAABJRU5ErkJggg==",Fc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAgrSURBVHgB7ZprTBRXFIDP7gIt8lQppTwE5V0KaAn6o1pqNGkDDTEmTUhsgKRp+gNJw68CFkLbVC2QkDS+gD8KJdWmARvbFBNNWpuIRGPFWBXQRMPDqIki+KLATs+ZnTvcvXtnX8w2beJJToaduTP3fHPOPffcOwC8kP+2WCDwIvahGFxTuN8KmNSZmULPNjLeqF9F8rdPkIEGEn+r+vjx46LQ0NA8/Dsader58+e/h4WFDWntFO7ot6fMFAt3JLWi2lCDpqamCux2+2+KROj82NhYGrXT2lu5Z/DP/deFByElA4Pv3LlTiHY/nJ6eVnbv3q1s2bJFyc7OVrZu3arU1dUp4+PjxPUQoT+g9tp9PkMFgpo9kxljHRoaWp2Xl3duYmIiurKyEvDoclNCQgIcPnxYPc7MzHwcGRnZhaft4Ag7O9fUbRhaITCie4lgcnNzT7qDIaHz27dvh+vXr0NEREQneqoCHKFnAR+8ZCaQGGq2CxcurCGYycnJZHcwTNAzUFFRoUJFRUV1IFQ5OKBsXB9uxSwgl0TQ3d29Yt26dccwoyVXV1d7hGEiQmGi2AzOUHx/hob4K2yuYS9G987s7OwPISEh7xPM6dOnwVfBsIMjR45AZmbmo5s3b76Xnp7+J55egMVxBSAZT0v1ED+76yn66dOnLQSzd+9ev2BIyFP0MjBco1JTU/sxfFeDazp3cYgZHmKqdoaGNISHh9fv378fSJcqlPV6e3sBJ+I/goOD34VFL0k95Y+HxPHCYGxmw5DQ2NuzZw8EBQVtunXr1jvgwUP+hhz/QDXMMCNVE8zx48dNg2FCz6QQjI2N/RA8VBFmANnu3btXihnpG8pM9fX1EAi5du0aeWkVOAMBCF7yN+R0z4yOjq6NiYlpp9CgdBtIwXpPH6vgDKWLt0CygtM6MDCwBuUYZSKaOCksAiVY9wFOBePgDOOytPAGSKzNVCCC2bBhw69YdK7ypgpYimzbtk2dl7CM+hFcveOUHDylbTFO1YdhFbByx44dA1QFUP0VSJj4+Hjo6+sDq9U6iEmHKvFZTedQ50GYbN15SITVlwNlZWUnLRZL8s6dOwMOQ9UCTtKTra2ttdppt9V2kMF5cbmsjxuM43bMNrmUzc6fP6+GQiDGDoOJi4ubwb4qm5ubafyIE6nLxGqTPEsGo1cBOGNX0TyDYafC0CyOaxcVziyh53Z2dkJycvLMvn37PmpoaBgFR4jxYSbWdVIgI89Iq4CjR48CZjlYv369+tssqI6ODsjPz4f+/v668vLycxrEHHfkYdwC8SB6mGEV8Cl64cuuri5oa2tTG+EyGjZu3AiXLl1qefDgwV8lJSUFZkDV1tZCcXExXLx4sbWoqKgPFj0zx8GI9ZwO5W4M6ekZYeqpaqbqmaSqqkpNpcPDw4dwzfM9nrLduHEjEs+X0XV/Sx96LnqE1kLtBQUF3eDwCO8dGQyzV5rl+JyuegfXI29jRotiRlKnpFghHMzKyjqotVXS0tLacKPjF3bdHxjSq1evduAkepAD+ZsDYlC8V5w8ZBVg+PPq2MGMlkInqE4joTf45MmT4YyMjAPcA+ltLSQlJX2BafxnX6HI29QeK44TOTk57mCYZ0QoJ8OBM4yB6dkNkwGlSygsLFQvYtYB3BTMxFL+M+0eFgZqp4mJiU2+QKGX1fGIk/QIrn0aYXGsyDxjmAyMhO2jhaCGoUbX1NSkLSwsPMJqV8Fspu6lIZS6OYhjiOLwdU7fQM1HfRPD7wS1obZ0j0xpb4726Z49ezaJf2/S7s9ATUGNR41BjdJseRnke3WGwhrRTS9pD1mOGoeG15BxOOfoxuCkp0Ih6NeaEaSZGlieJyiCoc1FgsGldokGk8nBvAKOrWIGQ5uPsm0tt0BWDiicAaGuGhkZ+YqMw9StGzU4OKhCnT179hNsswY1FTXdE5QEJhc1S3tGogazXLOBwQSBl3tzIhQPtAL1VQJCTcNx8y1vHIUghSKFZE9PT7H2dlM1b+Wgrr1y5Uq77J75+fnplpaWMg2ch4nlYEI5z7hdensDpI4hrYNErcMMXJ32koG4ztf3pultz83NjWG99Ra2WQ0OL2VjZjwgeufUqVOqV8+cOdPIwdBLSNJeHg8TAh5WqJ6EfSmgt7IMNRJ1JThiOlnrOAMHshprmMKdoGSCpb9s3B3SYLIFGIqICJB7xisYi+RvfiypXw40DWGdlJaWRmMd141hk8V2OWm7ieYTXhBc3+BgaZyqAISjOYxSMVvXsBTNlzdiNQDgRao2AtK3pjggpmrqbGpqSsLPIN/dv38/gaBwUjTshMHcvn27JyUlpRmc5xpPMD599LIYnLNyUKKndKjGxsakXbt2deMCLIE8IVvs0YRM1fjdu3d/wrXN5+BcnzEgvor2uN3rjzAYMp5lPEoQlE5fA0fWo8GfhlCbKVFQ1pKNIfzcOHH58mWqaimVUwJI0+6n59D4pIlzmdZPMPiZzXjDjX47Le5g0Uu8x2zgPqWyKpjVe7x3+AUbq9NYjQbgp2dsBud5o8TP7d5kHAWcQchQfoEmLgn8HjOiBIF7o5hI1x6CEbLNP3bdqYAF44JzyWLzcN1i8DcT/o3awbm8Fz3DAy2A62INwPV/E3wWdx5inmBHuwChCBD6R2JwHge80TIQRQLjt7e8DTkGZgfX8cUMZTDAteFDkveaIlzjX9ySQs8X18r2t2VHUURPKoICmDR+eCO9aSdmOIub3/w9RgpgUpiJhvraXpa6jZKHGEqyusw0GLFzX+5RhN/8kYnMSNMMfyH/V/kHST6OYVElTPAAAAAASUVORK5CYII=",Zc="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDBweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDAgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT5zaGFwZS1jdXJzb3I8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZGVmcz4KICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0icGF0aC0xIj48L3BhdGg+CiAgICAgICAgPGZpbHRlciB4PSItNjQuNiUiIHk9Ii01OS41JSIgd2lkdGg9IjIyOS4zJSIgaGVpZ2h0PSIyNDYuMSUiIGZpbHRlclVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgaWQ9ImZpbHRlci0yIj4KICAgICAgICAgICAgPGZlTW9ycGhvbG9neSByYWRpdXM9IjEiIG9wZXJhdG9yPSJkaWxhdGUiIGluPSJTb3VyY2VBbHBoYSIgcmVzdWx0PSJzaGFkb3dTcHJlYWRPdXRlcjEiPjwvZmVNb3JwaG9sb2d5PgogICAgICAgICAgICA8ZmVPZmZzZXQgZHg9IjAiIGR5PSIyIiBpbj0ic2hhZG93U3ByZWFkT3V0ZXIxIiByZXN1bHQ9InNoYWRvd09mZnNldE91dGVyMSI+PC9mZU9mZnNldD4KICAgICAgICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMyIgaW49InNoYWRvd09mZnNldE91dGVyMSIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlR2F1c3NpYW5CbHVyPgogICAgICAgICAgICA8ZmVDb21wb3NpdGUgaW49InNoYWRvd0JsdXJPdXRlcjEiIGluMj0iU291cmNlQWxwaGEiIG9wZXJhdG9yPSJvdXQiIHJlc3VsdD0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbXBvc2l0ZT4KICAgICAgICAgICAgPGZlQ29sb3JNYXRyaXggdmFsdWVzPSIwIDAgMCAwIDAgICAwIDAgMCAwIDAgICAwIDAgMCAwIDAgIDAgMCAwIDAuMTYgMCIgdHlwZT0ibWF0cml4IiBpbj0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbG9yTWF0cml4PgogICAgICAgIDwvZmlsdGVyPgogICAgPC9kZWZzPgogICAgPGcgaWQ9Iumhtemdoi00IiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iV2hpdGVib2FyZC1HdWlkZWxpbmVzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzQ0LjAwMDAwMCwgLTc1MS4wMDAwMDApIj4KICAgICAgICAgICAgPGcgaWQ9InNoYXBlLWN1cnNvciIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzQ0LjAwMDAwMCwgNzUxLjAwMDAwMCkiPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9ouWkh+S7vS00NCIgZmlsbD0iI0ZGRkZGRiIgb3BhY2l0eT0iMC4wMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjQwIiBoZWlnaHQ9IjQwIiByeD0iMiI+PC9yZWN0PgogICAgICAgICAgICAgICAgPGcgaWQ9IuW9oueKtue7k+WQiCIgZmlsbC1ydWxlPSJub256ZXJvIj4KICAgICAgICAgICAgICAgICAgICA8dXNlIGZpbGw9ImJsYWNrIiBmaWxsLW9wYWNpdHk9IjEiIGZpbHRlcj0idXJsKCNmaWx0ZXItMikiIHhsaW5rOmhyZWY9IiNwYXRoLTEiPjwvdXNlPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIHN0cm9rZT0iI0ZGRkZGRiIgc3Ryb2tlLXdpZHRoPSIxIiBkPSJNMjAsMjEgQzIwLjQ4NTQxMDMsMjEgMjAuODk4MDg1LDIxLjM0Nzk5OTMgMjAuOTg5OTQ3OSwyMS44NjU0ODc3IEwyMSwyMiBMMjEsMjcgQzIxLDI3LjU1MjI4NDcgMjAuNTUyMjg0NywyOCAyMCwyOCBDMTkuNTE0NTg5NywyOCAxOS4xMDE5MTUsMjcuNjUyMDAwNyAxOS4wMTAwNTIxLDI3LjEzNDUxMjMgTDE5LDI3IEwxOSwyMiBDMTksMjEuNDQ3NzE1MyAxOS40NDc3MTUzLDIxIDIwLDIxIFogTTI3LDE5IEMyNy41NTIyODQ3LDE5IDI4LDE5LjQ0NzcxNTMgMjgsMjAgQzI4LDIwLjQ4NTQxMDMgMjcuNjUyMDAwNywyMC44OTgwODUgMjcuMTM0NTEyMywyMC45ODk5NDc5IEwyNywyMSBMMjIsMjEgQzIxLjQ0NzcxNTMsMjEgMjEsMjAuNTUyMjg0NyAyMSwyMCBDMjEsMTkuNTE0NTg5NyAyMS4zNDc5OTkzLDE5LjEwMTkxNSAyMS44NjU0ODc3LDE5LjAxMDA1MjEgTDIyLDE5IEwyNywxOSBaIE0xOCwxOSBDMTguNTUyMjg0NywxOSAxOSwxOS40NDc3MTUzIDE5LDIwIEMxOSwyMC40ODU0MTAzIDE4LjY1MjAwMDcsMjAuODk4MDg1IDE4LjEzNDUxMjMsMjAuOTg5OTQ3OSBMMTgsMjEgTDEzLDIxIEMxMi40NDc3MTUzLDIxIDEyLDIwLjU1MjI4NDcgMTIsMjAgQzEyLDE5LjUxNDU4OTcgMTIuMzQ3OTk5MywxOS4xMDE5MTUgMTIuODY1NDg3NywxOS4wMTAwNTIxIEwxMywxOSBMMTgsMTkgWiBNMjAsMTIgQzIwLjQ4NTQxMDMsMTIgMjAuODk4MDg1LDEyLjM0Nzk5OTMgMjAuOTg5OTQ3OSwxMi44NjU0ODc3IEwyMSwxMyBMMjEsMTggQzIxLDE4LjU1MjI4NDcgMjAuNTUyMjg0NywxOSAyMCwxOSBDMTkuNTE0NTg5NywxOSAxOS4xMDE5MTUsMTguNjUyMDAwNyAxOS4wMTAwNTIxLDE4LjEzNDUxMjMgTDE5LDE4IEwxOSwxMyBDMTksMTIuNDQ3NzE1MyAxOS40NDc3MTUzLDEyIDIwLDEyIFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9oiIgZmlsbD0iI0ZGRkZGRiIgeD0iMTguNSIgeT0iMTciIHdpZHRoPSIzIiBoZWlnaHQ9IjYiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaIiIGZpbGw9IiNGRkZGRkYiIHg9IjE3IiB5PSIxOC41IiB3aWR0aD0iNiIgaGVpZ2h0PSIzIj48L3JlY3Q+CiAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0i5b2i54q257uT5ZCIIiBmaWxsPSIjMjEyMzI0IiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+",Yc="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDdweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDcgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT50ZXh0LWN1cnNvcjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPgogICAgICAgIDxwYXRoIGQ9Ik0xNiwyNi41IEMxNS43MjM4NTc2LDI2LjUgMTUuNSwyNi4yNzYxNDI0IDE1LjUsMjYgQzE1LjUsMjUuNzU0NTQwMSAxNS42NzY4NzUyLDI1LjU1MDM5MTYgMTUuOTEwMTI0NCwyNS41MDgwNTU3IEwxNiwyNS41IEwxOS41LDI1LjUgTDE5LjUsMTQuNSBMMTYsMTQuNSBDMTUuNzIzODU3NiwxNC41IDE1LjUsMTQuMjc2MTQyNCAxNS41LDE0IEMxNS41LDEzLjc1NDU0MDEgMTUuNjc2ODc1MiwxMy41NTAzOTE2IDE1LjkxMDEyNDQsMTMuNTA4MDU1NyBMMTYsMTMuNSBMMjQsMTMuNSBDMjQuMjc2MTQyNCwxMy41IDI0LjUsMTMuNzIzODU3NiAyNC41LDE0IEMyNC41LDE0LjI0NTQ1OTkgMjQuMzIzMTI0OCwxNC40NDk2MDg0IDI0LjA4OTg3NTYsMTQuNDkxOTQ0MyBMMjQsMTQuNSBMMjAuNSwxNC41IEwyMC41LDI1LjUgTDI0LDI1LjUgQzI0LjI3NjE0MjQsMjUuNSAyNC41LDI1LjcyMzg1NzYgMjQuNSwyNiBDMjQuNSwyNi4yNDU0NTk5IDI0LjMyMzEyNDgsMjYuNDQ5NjA4NCAyNC4wODk4NzU2LDI2LjQ5MTk0NDMgTDI0LDI2LjUgTDE2LDI2LjUgWiIgaWQ9InBhdGgtMSI+PC9wYXRoPgogICAgICAgIDxmaWx0ZXIgeD0iLTI4NC4wJSIgeT0iLTgxLjUlIiB3aWR0aD0iNjY4LjElIiBoZWlnaHQ9IjI5My45JSIgZmlsdGVyVW5pdHM9Im9iamVjdEJvdW5kaW5nQm94IiBpZD0iZmlsdGVyLTIiPgogICAgICAgICAgICA8ZmVNb3JwaG9sb2d5IHJhZGl1cz0iMSIgb3BlcmF0b3I9ImRpbGF0ZSIgaW49IlNvdXJjZUFscGhhIiByZXN1bHQ9InNoYWRvd1NwcmVhZE91dGVyMSI+PC9mZU1vcnBob2xvZ3k+CiAgICAgICAgICAgIDxmZU9mZnNldCBkeD0iMCIgZHk9IjIiIGluPSJzaGFkb3dTcHJlYWRPdXRlcjEiIHJlc3VsdD0ic2hhZG93T2Zmc2V0T3V0ZXIxIj48L2ZlT2Zmc2V0PgogICAgICAgICAgICA8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSIzIiBpbj0ic2hhZG93T2Zmc2V0T3V0ZXIxIiByZXN1bHQ9InNoYWRvd0JsdXJPdXRlcjEiPjwvZmVHYXVzc2lhbkJsdXI+CiAgICAgICAgICAgIDxmZUNvbXBvc2l0ZSBpbj0ic2hhZG93Qmx1ck91dGVyMSIgaW4yPSJTb3VyY2VBbHBoYSIgb3BlcmF0b3I9Im91dCIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29tcG9zaXRlPgogICAgICAgICAgICA8ZmVDb2xvck1hdHJpeCB2YWx1ZXM9IjAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgMCAwIDAgMC4xNiAwIiB0eXBlPSJtYXRyaXgiIGluPSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29sb3JNYXRyaXg+CiAgICAgICAgPC9maWx0ZXI+CiAgICA8L2RlZnM+CiAgICA8ZyBpZD0i6aG16Z2iLTQiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSJXaGl0ZWJvYXJkLUd1aWRlbGluZXMiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0zODguMDAwMDAwLCAtNjcyLjAwMDAwMCkiPgogICAgICAgICAgICA8ZyBpZD0idGV4dC1jdXJzb3IiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDM5Mi4wMDAwMDAsIDY3Mi4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaLlpIfku70tNDAiIGZpbGw9IiNGRkZGRkYiIG9wYWNpdHk9IjAuMDEiIHg9IjAiIHk9IjAiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcng9IjIiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxnIGlkPSLlvaLnirbnu5PlkIgiIGZpbGwtcnVsZT0ibm9uemVybyI+CiAgICAgICAgICAgICAgICAgICAgPHVzZSBmaWxsPSJibGFjayIgZmlsbC1vcGFjaXR5PSIxIiBmaWx0ZXI9InVybCgjZmlsdGVyLTIpIiB4bGluazpocmVmPSIjcGF0aC0xIj48L3VzZT4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBzdHJva2U9IiNGRkZGRkYiIHN0cm9rZS13aWR0aD0iMSIgZD0iTTE5LDI1IEwxOSwxNSBMMTYsMTUgQzE1LjQ0NzcxNTMsMTUgMTUsMTQuNTUyMjg0NyAxNSwxNCBDMTUsMTMuNTE0NTg5NyAxNS4zNDc5OTkzLDEzLjEwMTkxNSAxNS44NjU0ODc3LDEzLjAxMDA1MjEgTDE2LDEzIEwyNCwxMyBDMjQuNTUyMjg0NywxMyAyNSwxMy40NDc3MTUzIDI1LDE0IEMyNSwxNC40ODU0MTAzIDI0LjY1MjAwMDcsMTQuODk4MDg1IDI0LjEzNDUxMjMsMTQuOTg5OTQ3OSBMMjQsMTUgTDIxLDE1IEwyMSwyNSBMMjQsMjUgQzI0LjU1MjI4NDcsMjUgMjUsMjUuNDQ3NzE1MyAyNSwyNiBDMjUsMjYuNDg1NDEwMyAyNC42NTIwMDA3LDI2Ljg5ODA4NSAyNC4xMzQ1MTIzLDI2Ljk4OTk0NzkgTDI0LDI3IEwxNiwyNyBDMTUuNDQ3NzE1MywyNyAxNSwyNi41NTIyODQ3IDE1LDI2IEMxNSwyNS41MTQ1ODk3IDE1LjM0Nzk5OTMsMjUuMTAxOTE1IDE1Ljg2NTQ4NzcsMjUuMDEwMDUyMSBMMTYsMjUgTDE5LDI1IFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=",Qc="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjhweCIgaGVpZ2h0PSIyOHB4IiB2aWV3Qm94PSIwIDAgMjggMjgiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDU1LjEgKDc4MTM2KSAtIGh0dHBzOi8vc2tldGNoYXBwLmNvbSAtLT4KICAgIDx0aXRsZT7nvJbnu4QgMjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPgogICAgICAgIDxmaWx0ZXIgeD0iLTEyMC4wJSIgeT0iLTEyMC4wJSIgd2lkdGg9IjM0MC4wJSIgaGVpZ2h0PSIzNDAuMCUiIGZpbHRlclVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgaWQ9ImZpbHRlci0xIj4KICAgICAgICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iNCIgaW49IlNvdXJjZUdyYXBoaWMiPjwvZmVHYXVzc2lhbkJsdXI+CiAgICAgICAgPC9maWx0ZXI+CiAgICA8L2RlZnM+CiAgICA8ZyBpZD0i6aG16Z2iMSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9Iue8lue7hC0yIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg5LjAwMDAwMCwgOS4wMDAwMDApIiBmaWxsPSIjRkYwMTAwIj4KICAgICAgICAgICAgPGNpcmNsZSBpZD0i5qSt5ZyG5b2iIiBmaWx0ZXI9InVybCgjZmlsdGVyLTEpIiBjeD0iNSIgY3k9IjUiIHI9IjUiPjwvY2lyY2xlPgogICAgICAgICAgICA8cGF0aCBkPSJNNSw4IEM2LjY1Njg1NDI1LDggOCw2LjY1Njg1NDI1IDgsNSBDOCwzLjM0MzE0NTc1IDYuNjU2ODU0MjUsMiA1LDIgQzMuMzQzMTQ1NzUsMiAyLDMuMzQzMTQ1NzUgMiw1IEMyLDYuNjU2ODU0MjUgMy4zNDMxNDU3NSw4IDUsOCBaIE01LDYuMjg1NzE0MjkgQzQuMjg5OTE5NjEsNi4yODU3MTQyOSAzLjcxNDI4NTcxLDUuNzEwMDgwMzkgMy43MTQyODU3MSw1IEMzLjcxNDI4NTcxLDQuMjg5OTE5NjEgNC4yODk5MTk2MSwzLjcxNDI4NTcxIDUsMy43MTQyODU3MSBDNS43MTAwODAzOSwzLjcxNDI4NTcxIDYuMjg1NzE0MjksNC4yODk5MTk2MSA2LjI4NTcxNDI5LDUgQzYuMjg1NzE0MjksNS43MTAwODAzOSA1LjcxMDA4MDM5LDYuMjg1NzE0MjkgNSw2LjI4NTcxNDI5IFoiIGlkPSLmpK3lnIblvaIiIGZpbGwtcnVsZT0ibm9uemVybyI+PC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+";const Or={[M.ApplianceNames.pencil]:Wc,[M.ApplianceNames.selector]:Hc,[M.ApplianceNames.eraser]:Fc,[M.ApplianceNames.shape]:Zc,[M.ApplianceNames.text]:Yc,[M.ApplianceNames.laserPointer]:Qc};class Gc{constructor(e,i,s){var a;this.manager=e,this.enableCursor=i,this.cursorInstances=new Map,this.sideEffectManager=new ve.SideEffectManager,this.store=this.manager.store,this.applianceIcons=Or,this.onCursorMove=n=>{const o=this.initCursorInstance(n.uid);if(n.state===da.Leave)o.leave();else{const c=o.updateMember();this.canMoveCursor(c)&&o.move(n.position)}},this.initCursorInstance=n=>{let o=this.cursorInstances.get(n);return o||(o=new Uc(this.manager,n,this,le.playground),this.cursorInstances.set(n,o)),o},this.mouseMoveListener=I.throttle(n=>{n.pointerType==="touch"&&!n.isPrimary||this.updateCursor(this.getType(n),n.clientX,n.clientY)},48),this.getPoint=(n,o,c)=>{var d;const l=(d=n==null?void 0:n.divElement)==null?void 0:d.getBoundingClientRect();if(l)return n==null?void 0:n.convertToPointInWorld({x:o-l.x,y:c-l.y})},this.getType=n=>{var l;const o=n.target,c=this.manager.focusApp;switch(o.parentElement){case this.mainViewElement:return{type:"main"};case((l=c==null?void 0:c.view)==null?void 0:l.divElement):return{type:"app"};default:return{type:"main"}}},this.mouseLeaveListener=()=>{this.hideCursor(this.manager.uid)},this.roomMembers=(a=this.manager.room)==null?void 0:a.state.roomMembers;const r=le.playground;r&&this.setupWrapper(r),this.sideEffectManager.add(()=>P.on("cursorMove",this.onCursorMove)),this.sideEffectManager.add(()=>P.on("playgroundSizeChange",()=>this.updateContainerRect())),s&&(this.applianceIcons=O(O({},Or),s))}canMoveCursor(e){const i=(e==null?void 0:e.memberState.currentApplianceName)===M.ApplianceNames.laserPointer;return this.enableCursor||i}setupWrapper(e){this.sideEffectManager.add(()=>(e.addEventListener("pointerenter",this.mouseMoveListener),e.addEventListener("pointermove",this.mouseMoveListener),e.addEventListener("pointerleave",this.mouseLeaveListener),()=>{e.removeEventListener("pointerenter",this.mouseMoveListener),e.removeEventListener("pointermove",this.mouseMoveListener),e.removeEventListener("pointerleave",this.mouseLeaveListener)})),this.updateContainerRect()}setMainViewDivElement(e){this.mainViewElement=e}get boxState(){return this.store.getBoxState()}get focusView(){var e;return(e=this.manager.focusApp)==null?void 0:e.view}updateCursor(e,i,s){if(this.wrapperRect&&this.manager.canOperate){const r=e.type==="main"?this.manager.mainView:this.focusView,a=this.getPoint(r,i,s);a&&this.manager.dispatchInternalEvent(Y.CursorMove,{uid:this.manager.uid,position:{x:a.x,y:a.y,type:e.type}})}}updateContainerRect(){var e,i;this.wrapperRect=(e=this.manager.boxManager)==null?void 0:e.stageRect,this.playgroundRect=(i=le.playground)==null?void 0:i.getBoundingClientRect()}deleteCursor(e){this.store.cleanCursor(e);const i=this.cursorInstances.get(e);i&&i.destroy()}hideCursor(e){const i=this.cursorInstances.get(e);i&&i.hide()}destroy(){this.sideEffectManager.flushAll(),this.cursorInstances.size&&(this.cursorInstances.forEach(e=>{e.destroy()}),this.cursorInstances.clear())}}class qc{constructor(e){this.manager=e,P.on("changePageState",()=>{J.emit("pageStateChange",this.toObject())})}get index(){var e;return((e=this.manager)==null?void 0:e.store.getMainViewSceneIndex())||0}get length(){var e;return((e=this.manager)==null?void 0:e.mainViewScenesLength)||0}toObject(){return{index:this.index>=this.length?this.length-1:this.index,length:this.length}}}class Jc{constructor(e){this.ctx=e,this.reactors=new Map,this.disposers=new Map,this.onPhaseChanged=i=>{var s,r;i===M.RoomPhase.Reconnecting&&this.ctx.emitter.emit("startReconnect"),i===M.RoomPhase.Connected&&this.phase===M.RoomPhase.Reconnecting&&((s=this.room)!=null&&s.isWritable?(r=this.room)==null||r.dispatchMagixEvent(Gi,{}):this.onReconnected()),this.phase=i},this.onReconnected=I.debounce(()=>{this._onReconnected()},1e3),this._onReconnected=()=>{Je("onReconnected refresh reactors"),this.releaseDisposers(),this.reactors.forEach((i,s)=>{I.isFunction(i)&&this.disposers.set(s,i())}),this.ctx.emitter.emit("onReconnected")}}setRoom(e){this.room=e,this.phase=e==null?void 0:e.phase,e&&(e.callbacks.off("onPhaseChanged",this.onPhaseChanged),e.callbacks.on("onPhaseChanged",this.onPhaseChanged),e.addMagixEventListener(Gi,i=>{i.authorId===e.observerId&&this.onReconnected()},{fireSelfEventAfterCommit:!0}))}setContext(e){this.ctx=e}releaseDisposers(){this.disposers.forEach(e=>{I.isFunction(e)&&e()}),this.disposers.clear()}refresh(){this._onReconnected()}add(e,i){const s=this.disposers.get(e);return s&&I.isFunction(s)&&s(),I.isFunction(i)&&(this.reactors.set(e,i),this.disposers.set(e,i())),()=>this.remove(e)}remove(e){this.reactors.has(e)&&this.reactors.delete(e);const i=this.disposers.get(e);i&&(I.isFunction(i)&&i(),this.disposers.delete(e))}hasReactor(e){return this.reactors.has(e)}destroy(){var e,i;(e=this.room)==null||e.callbacks.off("onPhaseChanged",this.onPhaseChanged),(i=this.room)==null||i.removeMagixEventListener(Gi,this.onReconnected),this.releaseDisposers()}}const Xc=(t,e)=>{if(M.isPlayer(t))eh(t);else{if(t=t,Object.getOwnPropertyDescriptor(t,"disableCameraTransform"))return;Object.defineProperty(t,"disableCameraTransform",{get(){return e.mainView.disableCameraTransform},set(s){e.mainView.disableCameraTransform=s}}),Object.defineProperty(t,"canUndoSteps",{get(){return e.canUndoSteps}}),Object.defineProperty(t,"canRedoSteps",{get(){return e.canRedoSteps}}),t.moveCamera=s=>e.moveCamera(s),t.moveCameraToContain=(...s)=>e.moveCameraToContain(...s),t.convertToPointInWorld=(...s)=>e.mainView.convertToPointInWorld(...s),t.setCameraBound=(...s)=>e.mainView.setCameraBound(...s),t.scenePreview=(...s)=>e.mainView.scenePreview(...s),t.fillSceneSnapshot=(...s)=>e.mainView.fillSceneSnapshot(...s),t.generateScreenshot=(...s)=>e.mainView.generateScreenshot(...s),t.setMemberState=(...s)=>e.mainView.setMemberState(...s),t.redo=()=>e.redo(),t.undo=()=>e.undo(),t.cleanCurrentScene=()=>e.cleanCurrentScene(),t.delete=()=>e.delete(),t.copy=()=>e.copy(),t.paste=()=>e.paste(),t.duplicate=()=>e.duplicate(),t.insertImage=(...s)=>e.insertImage(...s),t.completeImageUpload=(...s)=>e.completeImageUpload(...s),t.insertText=(...s)=>e.insertText(...s),t.lockImage=(...s)=>e.lockImage(...s),t.lockImages=(...s)=>e.lockImages(...s),Kc(t,e),t.dynamicPpt.slideStateAdapter.pptHandler||(t.dynamicPpt.slideStateAdapter.pptHandler=e.createPPTHandler())}},Kc=(t,e)=>{const i=t.removeScenes;t.removeScenes=(s,r)=>{var n;s===we&&((n=e.appManager)==null||n.updateRootDirRemoving(!0));const a=i.call(t,s);return P.emit("removeScenes",{scenePath:s,index:r}),a}},eh=t=>{const e=t.seekToProgressTime;async function i(s){await P.emit("seekStart");const r=await e.call(t,s);return P.emit("seek",s),r}t.seekToProgressTime=i};var th=(()=>`.netless-app-docs-viewer-footer{box-sizing:border-box;height:26px;display:flex;align-items:center;padding:0 16px;border-top:1px solid #eeeef7;font-family:PingFang SC,Source Han Sans SC,Microsoft YaHei,Helvetica Neue,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif}.netless-app-docs-viewer-footer-btn{box-sizing:border-box;width:26px;height:26px;font-size:0;margin:0;padding:3px;border:none;border-radius:1px;outline:none;color:currentColor;background:transparent;transition:background .4s;cursor:pointer;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-docs-viewer-footer-btn:hover{background:rgba(237,237,240,.9)}@media (hover: none){.netless-app-docs-viewer-footer-btn:hover{background:transparent!important}}.netless-app-docs-viewer-footer-btn>svg{width:100%;height:100%}.netless-app-docs-viewer-footer-btn>svg:nth-of-type(2){display:none}.netless-app-docs-viewer-footer-btn.netless-app-docs-viewer-footer-btn-playing>svg:nth-of-type(1){display:none}.netless-app-docs-viewer-footer-btn.netless-app-docs-viewer-footer-btn-playing>svg:nth-of-type(2){display:initial}.netless-app-docs-viewer-footer-btn~.netless-app-docs-viewer-footer-btn{margin-left:15px}.netless-app-docs-viewer-page-jumps{flex:1;display:flex;justify-content:center;align-items:center}.netless-app-docs-viewer-page-number{display:flex;align-items:center;height:26px;margin-left:auto;font-size:13px;user-select:none;white-space:nowrap;word-break:keep-all}.netless-app-docs-viewer-page-number-input{border:none;outline:none;width:3em;margin:0;padding:0 .5em 0 2px;text-align:right;font-size:13px;line-height:1;font-weight:400;font-family:inherit;border-radius:2px;color:currentColor;font-family:PingFang SC,Source Han Sans SC,Microsoft YaHei,Helvetica Neue,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif;background:transparent;transition:background .4s;user-select:text;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-docs-viewer-page-number-input:hover,.netless-app-docs-viewer-page-number-input:focus,.netless-app-docs-viewer-page-number-input:active{background:#fff;box-shadow:#63636333 0 2px 8px}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-footer-btn{cursor:not-allowed}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-footer-btn:hover{background:transparent}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input{cursor:not-allowed}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:hover,.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:focus,.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:active{background:transparent;box-shadow:none}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:disabled{color:inherit}.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input:active,.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input:focus,.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input:hover{color:currentColor;background:#25282e}.telebox-color-scheme-dark .netless-app-docs-viewer-footer{border-top:none}.telebox-color-scheme-dark .netless-app-docs-viewer-footer-btn:hover{background:#212126}.netless-app-docs-viewer-preview.netless-app-docs-viewer-preview-active{transform:translate(0)}.netless-app-docs-viewer-content{position:relative;height:100%;overflow:hidden}.netless-app-docs-viewer-preview-mask{position:absolute;z-index:10200;top:0;left:0;width:100%;height:100%}.netless-app-docs-viewer-preview{box-sizing:border-box;display:flex;flex-direction:column;align-items:center;position:absolute;z-index:10300;top:0;left:0;width:33%;max-width:200px;height:100%;padding-top:10px;transform:translate(-100%);background:rgba(237,237,240,.9);box-shadow:inset -1px 0 #0000001c;transition:transform .4s}.netless-app-docs-viewer-preview-active .netless-app-docs-viewer-preview-mask{display:block}.netless-app-docs-viewer-preview-active .netless-app-docs-viewer-preview{transform:translate(0)}.netless-app-docs-viewer-preview-page{position:relative;display:block;width:55%;margin-bottom:10px;font-size:0;color:transparent;outline:none;border:7px solid transparent;border-radius:4px;transition:border-color .3s;user-select:none}.netless-app-docs-viewer-preview-page:hover,.netless-app-docs-viewer-preview-page.netless-app-docs-viewer-preview-page-active{border-color:#444e601a}.netless-app-docs-viewer-preview-page>img{width:100%;height:auto;box-sizing:border-box;border:1px solid rgba(0,0,0,.5);border-radius:1px;background-color:#fff;box-shadow:0 2px 8px #0000004d}.netless-app-docs-viewer-preview-page-name{position:absolute;top:1px;left:-10px;transform:translate(-100%);text-align:right;font-size:12px;user-select:none}.telebox-color-scheme-dark .netless-app-docs-viewer-preview{background:rgba(50,50,50,.9)}.netless-app-docs-viewer-static-scrollbar{box-sizing:border-box;position:absolute;top:0;right:0;z-index:2147483647;width:16px;min-height:30px;margin:0;padding:0 0 0 8px;border:none;outline:none;opacity:0;background:transparent;transition:opacity .4s 3s,transform .1s;user-select:none;touch-action:none}.netless-app-docs-viewer-static-scrollbar:after{content:"";display:block;width:8px;height:100%;border-radius:4px;background:rgba(68,78,96,.4);box-shadow:1px 1px 8px #ffffffb3;transition:background .4s}.netless-app-docs-viewer-static-scrollbar.netless-app-docs-viewer-static-scrolling{opacity:1;transition:opacity .4s,transform .1s}.netless-app-docs-viewer-static-scrollbar.netless-app-docs-viewer-static-scrollbar-dragging{opacity:1;transition:opacity .4s 3s!important}.netless-app-docs-viewer-static-scrollbar.netless-app-docs-viewer-static-scrollbar-dragging:after{background:rgba(68,78,96,.6)}.netless-app-docs-viewer-static-scrollbar:hover:after,.netless-app-docs-viewer-static-scrollbar:focus:after{background:rgba(68,78,96,.5)}.netless-app-docs-viewer-static-scrollbar:active:after{background:rgba(68,78,96,.6)}.telebox-body-wrap:hover .netless-app-docs-viewer-static-scrollbar{opacity:1;transition:opacity .4s,transform .1s}.telebox-readonly .netless-app-docs-viewer-static-scrollbar{display:none}.page-renderer-pages-container{position:relative;width:100%;height:100%}.page-renderer-page{position:absolute;top:0;left:0;background-position:center;background-size:cover;background-repeat:no-repeat}.page-renderer-pages-container.is-hwa .page-renderer-page{will-change:transform}.page-renderer-page-img{display:block;width:100%;height:auto;user-select:none}.netless-app-docs-viewer-static-pages{overflow:hidden;position:relative;height:100%;user-select:none}.netless-app-docs-viewer-static-page{display:block;width:100%;height:auto;user-select:none}.netless-app-docs-viewer-dynamic-wb-view{position:absolute;top:0;left:0;width:100%;height:100%;z-index:100;overflow:hidden}.netless-app-docs-viewer-dynamic-wb-view .cursor-clicker .ppt-event-source{cursor:pointer}
|
124
|
+
`)();const Qa="!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",ih=Qa.length,Ur=Array(20),sh=()=>{for(let t=0;t<20;t++)Ur[t]=Qa.charAt(Math.random()*ih);return Ur.join("")};function Wr(t){try{return t()}catch(e){console.error(e)}}class gt{constructor(){this.disposers=new Map}addDisposer(e,i=this.genUID()){return this.flush(i),this.disposers.set(i,Array.isArray(e)?()=>e.forEach(Wr):e),i}add(e,i=this.genUID()){const s=e();return s?this.addDisposer(s,i):i}addEventListener(e,i,s,r,a=this.genUID()){return e.addEventListener(i,s,r),this.addDisposer(()=>e.removeEventListener(i,s,r),a),a}setTimeout(e,i,s=this.genUID()){const r=window.setTimeout(()=>{this.remove(s),e()},i);return this.addDisposer(()=>window.clearTimeout(r),s)}setInterval(e,i,s=this.genUID()){const r=window.setInterval(e,i);return this.addDisposer(()=>window.clearInterval(r),s)}remove(e){const i=this.disposers.get(e);return this.disposers.delete(e),i}flush(e){const i=this.remove(e);if(i)try{i()}catch(s){console.error(s)}}flushAll(){this.disposers.forEach(Wr),this.disposers.clear()}genUID(){let e;do e=sh();while(this.disposers.has(e));return e}}var rh=Object.defineProperty,ah=Object.defineProperties,nh=Object.getOwnPropertyDescriptors,Hr=Object.getOwnPropertySymbols,oh=Object.prototype.hasOwnProperty,lh=Object.prototype.propertyIsEnumerable,Ms=(t,e,i)=>e in t?rh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Ga=(t,e)=>{for(var i in e||(e={}))oh.call(e,i)&&Ms(t,i,e[i]);if(Hr)for(var i of Hr(e))lh.call(e,i)&&Ms(t,i,e[i]);return t},qa=(t,e)=>ah(t,nh(e)),tt=(t,e,i)=>(Ms(t,typeof e!="symbol"?e+"":e,i),i);class ch{constructor(e){tt(this,"_subscribers"),tt(this,"_bSub"),tt(this,"_bSubDisposer"),this._bSub=e}get size(){return this._subscribers?this._subscribers.size:0}invoke(e,i){this._subscribers&&this._subscribers.forEach(s=>s(e,i))}add(e){this._bSub&&(!this._subscribers||this._subscribers.size<=0)&&(this._bSubDisposer=this._bSub()),this._subscribers||(this._subscribers=new Set),this._subscribers.add(e)}remove(e){if(this._subscribers&&this._subscribers.delete(e),this._subscribers&&this._subscribers.size<=0&&this._bSubDisposer){const i=this._bSubDisposer;this._bSubDisposer=null,i()}}clear(){if(this._subscribers&&this._subscribers.clear(),this._bSubDisposer){const e=this._bSubDisposer;this._bSubDisposer=null,e()}}destroy(){this.clear()}}class Qs{constructor(e,i){tt(this,"_subscribers"),tt(this,"_value"),this._value=e;let s;if(i&&(i.compare&&(this.compare=i.compare),i.beforeSubscribe)){const r=i.beforeSubscribe,a=this._setValue.bind(this);s=()=>r(a)}this._subscribers=new ch(s)}_setValue(e,i){this.compare(e,this._value)||(this._value=e,this._subscribers.invoke(e,i))}get value(){return this._value}reaction(e){return this._subscribers.add(e),()=>{this._subscribers.remove(e)}}subscribe(e,i){const s=this.reaction(e);return e(this._value,i),s}destroy(){this._subscribers.destroy()}unsubscribe(e){this._subscribers.remove(e)}get size(){return this._subscribers.size}compare(e,i){return e===i}}class Fe extends Qs{constructor(){super(...arguments);tt(this,"setValue",this._setValue)}}class hh extends Qs{constructor(e,i,s={}){super(i(e.value),qa(Ga({},s),{beforeSubscribe:r=>{const a=e.subscribe((n,o)=>r(i(n),o));if(s.beforeSubscribe){const n=s.beforeSubscribe(r);if(n)return()=>{a(),n()}}return a}}));tt(this,"_srcValue"),this._srcValue=()=>i(e.value)}get value(){if(this.size<=0){const e=this._srcValue();return this.compare(e,this._value)?this._value:e}return this._value}}function Ut(t,e=s=>s,i={}){return new hh(t,e,i)}class dh extends Qs{constructor(e,i,s={}){super(i(as(e)),qa(Ga({},s),{beforeSubscribe:r=>{let a=as(e);r(i(a));const n=e.map((c,l)=>c.reaction((d,u)=>{a=a.slice(),a[l]=d,r(i(a),u)})),o=()=>n.forEach(c=>c());if(s.beforeSubscribe){const c=s.beforeSubscribe(r);if(c)return()=>{o(),c()}}return o}}));tt(this,"_srcValue"),this._srcValue=()=>i(as(e))}get value(){if(this.size<=0){const e=this._srcValue();return this.compare(e,this._value)?this._value:e}return this._value}}function as(t){return t.map(uh)}function uh(t){return t.value}function Pe(t,e=s=>s,i={}){return new dh(t,e,i)}function Ja(t){t.onValChanged||(t.onValChanged=ph)}function ph(t,e){const i=this[`_${t}$`]||this[t];if(!(i!=null&&i.reaction))throw new TypeError(`"${t}" is not related to a Val in this instance`);return i.reaction(e)}function gh(t,e,i){Object.keys(e).forEach(s=>{mh(t,s,e[s]),i&&i.attach(e[s])}),Ja(t)}function mh(t,e,i){return Object.defineProperties(t,{[e]:{get(){return i.value}},[`_${e}$`]:{value:i}}),t}function fh(t,e,i){Object.keys(e).forEach(s=>{bh(t,s,e[s]),i&&i.attach(e[s])}),Ja(t)}function bh(t,e,i){return Object.defineProperties(t,{[e]:{get(){return i.value},set(s){i.setValue(s)}},[`_${e}$`]:{value:i},[`set${yh(e)}`]:{value:(s,r)=>i.setValue(s,r)}}),t}function yh(t){return t[0].toUpperCase()+t.slice(1)}const at=typeof window!="undefined",Xa=at&&!("onscroll"in window)||typeof navigator!="undefined"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),Ka=at&&"IntersectionObserver"in window,en=at&&"classList"in document.createElement("p"),tn=at&&window.devicePixelRatio>1,wh={elements_selector:".lazy",container:Xa||at?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_bg_set:"bg-set",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1,restore_on_error:!1},sn=t=>Object.assign({},wh,t),Fr=function(t,e){let i;const s="LazyLoad::Initialized",r=new t(e);try{i=new CustomEvent(s,{detail:{instance:r}})}catch{i=document.createEvent("CustomEvent"),i.initCustomEvent(s,!1,!1,{instance:r})}window.dispatchEvent(i)},vh=(t,e)=>{if(!!e)if(!e.length)Fr(t,e);else for(let i=0,s;s=e[i];i+=1)Fr(t,s)},Ze="src",Gs="srcset",qs="sizes",rn="poster",ei="llOriginalAttrs",an="data",Js="loading",nn="loaded",on="applied",xh="entered",Xs="error",ln="native",cn="data-",hn="ll-status",pe=(t,e)=>t.getAttribute(cn+e),Mh=(t,e,i)=>{var s=cn+e;if(i===null){t.removeAttribute(s);return}t.setAttribute(s,i)},ti=t=>pe(t,hn),mt=(t,e)=>Mh(t,hn,e),Li=t=>mt(t,null),Ks=t=>ti(t)===null,Sh=t=>ti(t)===Js,Ch=t=>ti(t)===Xs,er=t=>ti(t)===ln,Ih=[Js,nn,on,Xs],_h=t=>Ih.indexOf(ti(t))>=0,nt=(t,e,i,s)=>{if(!!t){if(s!==void 0){t(e,i,s);return}if(i!==void 0){t(e,i);return}t(e)}},_t=(t,e)=>{if(en){t.classList.add(e);return}t.className+=(t.className?" ":"")+e},$e=(t,e)=>{if(en){t.classList.remove(e);return}t.className=t.className.replace(new RegExp("(^|\\s+)"+e+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},Ah=t=>{t.llTempImage=document.createElement("IMG")},kh=t=>{delete t.llTempImage},dn=t=>t.llTempImage,Vi=(t,e)=>{if(!e)return;const i=e._observer;!i||i.unobserve(t)},Th=t=>{t.disconnect()},Nh=(t,e,i)=>{e.unobserve_entered&&Vi(t,i)},tr=(t,e)=>{!t||(t.loadingCount+=e)},Eh=t=>{!t||(t.toLoadCount-=1)},un=(t,e)=>{!t||(t.toLoadCount=e)},Ph=t=>t.loadingCount>0,zh=t=>t.toLoadCount>0,pn=t=>{let e=[];for(let i=0,s;s=t.children[i];i+=1)s.tagName==="SOURCE"&&e.push(s);return e},ir=(t,e)=>{const i=t.parentNode;if(!i||i.tagName!=="PICTURE")return;pn(i).forEach(e)},gn=(t,e)=>{pn(t).forEach(e)},$i=[Ze],mn=[Ze,rn],Gt=[Ze,Gs,qs],fn=[an],ji=t=>!!t[ei],bn=t=>t[ei],yn=t=>delete t[ei],St=(t,e)=>{if(ji(t))return;const i={};e.forEach(s=>{i[s]=t.getAttribute(s)}),t[ei]=i},Dh=t=>{ji(t)||(t[ei]={backgroundImage:t.style.backgroundImage})},Lh=(t,e,i)=>{if(!i){t.removeAttribute(e);return}t.setAttribute(e,i)},pt=(t,e)=>{if(!ji(t))return;const i=bn(t);e.forEach(s=>{Lh(t,s,i[s])})},Vh=t=>{if(!ji(t))return;const e=bn(t);t.style.backgroundImage=e.backgroundImage},wn=(t,e,i)=>{_t(t,e.class_applied),mt(t,on),i&&(e.unobserve_completed&&Vi(t,e),nt(e.callback_applied,t,i))},vn=(t,e,i)=>{_t(t,e.class_loading),mt(t,Js),i&&(tr(i,1),nt(e.callback_loading,t,i))},it=(t,e,i)=>{!i||t.setAttribute(e,i)},Zr=(t,e)=>{it(t,qs,pe(t,e.data_sizes)),it(t,Gs,pe(t,e.data_srcset)),it(t,Ze,pe(t,e.data_src))},$h=(t,e)=>{ir(t,i=>{St(i,Gt),Zr(i,e)}),St(t,Gt),Zr(t,e)},jh=(t,e)=>{St(t,$i),it(t,Ze,pe(t,e.data_src))},Bh=(t,e)=>{gn(t,i=>{St(i,$i),it(i,Ze,pe(i,e.data_src))}),St(t,mn),it(t,rn,pe(t,e.data_poster)),it(t,Ze,pe(t,e.data_src)),t.load()},Rh=(t,e)=>{St(t,fn),it(t,an,pe(t,e.data_src))},Oh=(t,e,i)=>{const s=pe(t,e.data_bg),r=pe(t,e.data_bg_hidpi),a=tn&&r?r:s;!a||(t.style.backgroundImage=`url("${a}")`,dn(t).setAttribute(Ze,a),vn(t,e,i))},Uh=(t,e,i)=>{const s=pe(t,e.data_bg_multi),r=pe(t,e.data_bg_multi_hidpi),a=tn&&r?r:s;!a||(t.style.backgroundImage=a,wn(t,e,i))},Wh=(t,e,i)=>{const s=pe(t,e.data_bg_set);if(!s)return;const r=s.split("|");let a=r.map(n=>`image-set(${n})`);t.style.backgroundImage=a.join(),t.style.backgroundImage===""&&(a=r.map(n=>`-webkit-image-set(${n})`),t.style.backgroundImage=a.join()),wn(t,e,i)},xn={IMG:$h,IFRAME:jh,VIDEO:Bh,OBJECT:Rh},Hh=(t,e)=>{const i=xn[t.tagName];!i||i(t,e)},Fh=(t,e,i)=>{const s=xn[t.tagName];!s||(s(t,e),vn(t,e,i))},Zh=["IMG","IFRAME","VIDEO","OBJECT"],Yh=t=>Zh.indexOf(t.tagName)>-1,Mn=(t,e)=>{e&&!Ph(e)&&!zh(e)&&nt(t.callback_finish,e)},Yr=(t,e,i)=>{t.addEventListener(e,i),t.llEvLisnrs[e]=i},Qh=(t,e,i)=>{t.removeEventListener(e,i)},sr=t=>!!t.llEvLisnrs,Gh=(t,e,i)=>{sr(t)||(t.llEvLisnrs={});const s=t.tagName==="VIDEO"?"loadeddata":"load";Yr(t,s,e),Yr(t,"error",i)},Ss=t=>{if(!sr(t))return;const e=t.llEvLisnrs;for(let i in e){const s=e[i];Qh(t,i,s)}delete t.llEvLisnrs},Sn=(t,e,i)=>{kh(t),tr(i,-1),Eh(i),$e(t,e.class_loading),e.unobserve_completed&&Vi(t,i)},qh=(t,e,i,s)=>{const r=er(e);Sn(e,i,s),_t(e,i.class_loaded),mt(e,nn),nt(i.callback_loaded,e,s),r||Mn(i,s)},Jh=(t,e,i,s)=>{const r=er(e);Sn(e,i,s),_t(e,i.class_error),mt(e,Xs),nt(i.callback_error,e,s),i.restore_on_error&&pt(e,Gt),r||Mn(i,s)},rr=(t,e,i)=>{const s=dn(t)||t;if(sr(s))return;Gh(s,n=>{qh(n,t,e,i),Ss(s)},n=>{Jh(n,t,e,i),Ss(s)})},Xh=(t,e,i)=>{Ah(t),rr(t,e,i),Dh(t),Oh(t,e,i),Uh(t,e,i),Wh(t,e,i)},Kh=(t,e,i)=>{rr(t,e,i),Fh(t,e,i)},ar=(t,e,i)=>{Yh(t)?Kh(t,e,i):Xh(t,e,i)},ed=(t,e,i)=>{t.setAttribute("loading","lazy"),rr(t,e,i),Hh(t,e),mt(t,ln)},Qr=t=>{t.removeAttribute(Ze),t.removeAttribute(Gs),t.removeAttribute(qs)},td=t=>{ir(t,e=>{Qr(e)}),Qr(t)},Cn=t=>{ir(t,e=>{pt(e,Gt)}),pt(t,Gt)},id=t=>{gn(t,e=>{pt(e,$i)}),pt(t,mn),t.load()},sd=t=>{pt(t,$i)},rd=t=>{pt(t,fn)},ad={IMG:Cn,IFRAME:sd,VIDEO:id,OBJECT:rd},nd=t=>{const e=ad[t.tagName];if(!e){Vh(t);return}e(t)},od=(t,e)=>{Ks(t)||er(t)||($e(t,e.class_entered),$e(t,e.class_exited),$e(t,e.class_applied),$e(t,e.class_loading),$e(t,e.class_loaded),$e(t,e.class_error))},ld=(t,e)=>{nd(t),od(t,e),Li(t),yn(t)},cd=(t,e,i,s)=>{!i.cancel_on_exit||!Sh(t)||t.tagName==="IMG"&&(Ss(t),td(t),Cn(t),$e(t,i.class_loading),tr(s,-1),Li(t),nt(i.callback_cancel,t,e,s))},hd=(t,e,i,s)=>{const r=_h(t);mt(t,xh),_t(t,i.class_entered),$e(t,i.class_exited),Nh(t,i,s),nt(i.callback_enter,t,e,s),!r&&ar(t,i,s)},dd=(t,e,i,s)=>{Ks(t)||(_t(t,i.class_exited),cd(t,e,i,s),nt(i.callback_exit,t,e,s))},ud=["IMG","IFRAME","VIDEO"],In=t=>t.use_native&&"loading"in HTMLImageElement.prototype,pd=(t,e,i)=>{t.forEach(s=>{ud.indexOf(s.tagName)!==-1&&ed(s,e,i)}),un(i,0)},gd=t=>t.isIntersecting||t.intersectionRatio>0,md=t=>({root:t.container===document?null:t.container,rootMargin:t.thresholds||t.threshold+"px"}),fd=(t,e,i)=>{t.forEach(s=>gd(s)?hd(s.target,s,e,i):dd(s.target,s,e,i))},bd=(t,e)=>{e.forEach(i=>{t.observe(i)})},yd=(t,e)=>{Th(t),bd(t,e)},wd=(t,e)=>{!Ka||In(t)||(e._observer=new IntersectionObserver(i=>{fd(i,t,e)},md(t)))},_n=t=>Array.prototype.slice.call(t),Ii=t=>t.container.querySelectorAll(t.elements_selector),vd=t=>_n(t).filter(Ks),xd=t=>Ch(t),Md=t=>_n(t).filter(xd),Gr=(t,e)=>vd(t||Ii(e)),Sd=(t,e)=>{Md(Ii(t)).forEach(s=>{$e(s,t.class_error),Li(s)}),e.update()},Cd=(t,e)=>{!at||(e._onlineHandler=()=>{Sd(t,e)},window.addEventListener("online",e._onlineHandler))},Id=t=>{!at||window.removeEventListener("online",t._onlineHandler)},ii=function(t,e){const i=sn(t);this._settings=i,this.loadingCount=0,wd(i,this),Cd(i,this),this.update(e)};ii.prototype={update:function(t){const e=this._settings,i=Gr(t,e);if(un(this,i.length),Xa||!Ka){this.loadAll(i);return}if(In(e)){pd(i,e,this);return}yd(this._observer,i)},destroy:function(){this._observer&&this._observer.disconnect(),Id(this),Ii(this._settings).forEach(t=>{yn(t)}),delete this._observer,delete this._settings,delete this._onlineHandler,delete this.loadingCount,delete this.toLoadCount},loadAll:function(t){const e=this._settings;Gr(t,e).forEach(s=>{Vi(s,this),ar(s,e,this)})},restoreAll:function(){const t=this._settings;Ii(t).forEach(e=>{ld(e,t)})}};ii.load=(t,e)=>{const i=sn(e);ar(t,i)};ii.resetStatus=t=>{Li(t)};at&&vh(ii,window.lazyLoadOptions);class _d{constructor({namespace:e,pages$:i,sideEffect:s,readonly$:r,events:a,wrapClassName:n,root:o,pagesIndex$:c}){this.showPreview$=new Fe(!1),this.namespace=e,this.pages$=i,this.sideEffect=s,this.readonly$=r,this.events=a,this.wrapClassName=n,this.sideEffect.addDisposer(this.events.on("togglePreview",()=>{this.showPreview$.setValue(!this.showPreview$.value)})),this.sideEffect.addDisposer(this.showPreview$.subscribe(l=>{this.sideEffect.add(()=>{const d=this.renderPreview(),u=this.renderPreviewMask();if(l){o.appendChild(d),o.appendChild(u),d.scrollTop;const p=d.querySelector("."+this.wrapClassName(`preview-page-${c.value}`));return p&&d.scrollTo({top:p.offsetTop-16}),d.classList.toggle(this.wrapClassName("preview-active"),!0),this.previewLazyLoad=new ii({container:this.$preview,elements_selector:"."+this.wrapClassName("preview-page>img")}),()=>{var m;return(m=this.previewLazyLoad)==null?void 0:m.destroy()}}else return d.classList.toggle(this.wrapClassName("preview-active"),!1),this.sideEffect.setTimeout(()=>{d.remove(),u.remove()},500,"preview-remove"),null},"preview-lazyload")}))}destroy(){var e,i;(e=this.$preview)==null||e.remove(),(i=this.$previewMask)==null||i.remove()}renderPreview(){if(this.$preview)return this.$preview;const e=document.createElement("div");return e.className=this.wrapClassName("preview")+" tele-fancy-scrollbar",this.$preview=e,this.sideEffect.addEventListener(e,"wheel",i=>i.stopPropagation(),{passive:!1}),this.sideEffect.addDisposer(this.pages$.subscribe(i=>{var s;this.sideEffect.add(()=>{const r=i.map((a,n)=>{var o;const c=(o=a.thumbnail)!=null?o:a.src.startsWith("ppt")?void 0:a.src;if(!c)return;const l=String(n),d=document.createElement("a");d.className=this.wrapClassName("preview-page")+" "+this.wrapClassName(`preview-page-${n}`),d.setAttribute("href","#"),d.dataset.pageIndex=l;const u=document.createElement("span");u.className=this.wrapClassName("preview-page-name"),u.textContent=String(n+1),u.dataset.pageIndex=l;const p=document.createElement("img");return p.width=a.width,p.height=a.height,p.dataset.src=c,p.dataset.pageIndex=l,d.appendChild(p),d.appendChild(u),e.appendChild(d),d});return()=>r.forEach(a=>a==null?void 0:a.remove())},"render-preview-pages"),(s=this.previewLazyLoad)==null||s.update()})),this.sideEffect.addEventListener(e,"click",i=>{var s;if(this.readonly$.value)return;const r=(s=i.target.dataset)==null?void 0:s.pageIndex;r&&(i.preventDefault(),i.stopPropagation(),i.stopImmediatePropagation(),this.events.emit("jumpPage",Number(r)),this.showPreview$.setValue(!1))}),e}renderPreviewMask(){if(this.$previewMask)return this.$previewMask;const e=document.createElement("div");return e.className=this.wrapClassName("preview-mask"),this.$previewMask=e,this.sideEffect.addEventListener(e,"click",i=>{this.readonly$.value||i.target===e&&this.showPreview$.setValue(!1)}),e}}function Ad(t){const e="http://www.w3.org/2000/svg",i=document.createElementNS(e,"svg");i.setAttribute("class",`${t}-footer-icon-sidebar`),i.setAttribute("viewBox","0 0 64 64");const s=document.createElementNS(e,"path");return s.setAttribute("fill","currentColor"),s.setAttribute("d","M50 8H14c-3.309 0-6 2.691-6 6v36c0 3.309 2.691 6 6 6h36c3.309 0 6-2.691 6-6V14c0-3.309-2.691-6-6-6zM12 50V14c0-1.103.897-2 2-2h8v40h-8c-1.103 0-2-.897-2-2zm40 0c0 1.103-.897 2-2 2H26V12h24c1.103 0 2 .897 2 2z"),i.appendChild(s),i}function kd(t){const e="http://www.w3.org/2000/svg",i=document.createElementNS(e,"svg");i.setAttribute("class",`${t}-footer-icon-arrow-left`),i.setAttribute("viewBox","0 0 500 500");const s=document.createElementNS(e,"path");return s.setAttribute("fill","currentColor"),s.setAttribute("d","M177.81 249.959L337.473 90.295c2.722-2.865 2.651-7.378-.143-10.1-2.793-2.65-7.163-2.65-9.956 0l-164.75 164.75c-2.793 2.793-2.793 7.306 0 10.1l164.75 164.75c2.865 2.722 7.378 2.65 10.099-.143 2.651-2.794 2.651-7.163 0-9.957L177.809 249.959z"),i.appendChild(s),i}function Td(t){const e="http://www.w3.org/2000/svg",i=document.createElementNS(e,"svg");i.setAttribute("class",`${t}-footer-icon-arrow-right`),i.setAttribute("viewBox","0 0 500 500");const s=document.createElementNS(e,"path");return s.setAttribute("fill","currentColor"),s.setAttribute("d","M322.19 250.041L162.527 409.705c-2.722 2.865-2.651 7.378.143 10.1 2.793 2.65 7.163 2.65 9.956 0l164.75-164.75c2.793-2.793 2.793-7.306 0-10.1l-164.75-164.75c-2.865-2.722-7.378-2.65-10.099.143-2.651 2.794-2.651 7.163 0 9.957l159.664 159.736z"),i.appendChild(s),i}function Nd(t){const e="http://www.w3.org/2000/svg",i=document.createElementNS(e,"svg");i.setAttribute("class",`${t}-footer-icon-play`),i.setAttribute("viewBox","0 0 500 500");const s=document.createElementNS(e,"path");return s.setAttribute("fill","currentColor"),s.setAttribute("d","M418.158 257.419L174.663 413.33c-6.017 3.919-15.708 3.772-21.291-.29-2.791-2.018-4.295-4.483-4.295-7.084V94.109c0-5.65 6.883-10.289 15.271-10.289 4.298 0 8.391 1.307 11.181 3.332l242.629 155.484c6.016 3.917 6.451 10.292.649 14.491-.216.154-.432.154-.649.292zM170.621 391.288l223.116-141.301L170.71 107.753l-.089 283.535z"),i.appendChild(s),i}function Ed(t){const e="http://www.w3.org/2000/svg",i=document.createElementNS(e,"svg");i.setAttribute("class",`${t}-footer-icon-pause`),i.setAttribute("viewBox","0 0 500 500");const s=document.createElementNS(e,"path");return s.setAttribute("fill","currentColor"),s.setAttribute("d","M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z"),i.appendChild(s),i}class Pd{constructor({namespace:e,pages$:i,sideEffect:s,readonly$:r,events:a,playable:n,wrapClassName:o,pagesIndex$:c,root:l}){this.namespace=e,this.pages$=i,this.sideEffect=s,this.readonly$=r,this.events=a,this.wrapClassName=o,this.pagesIndex$=c,this.playable=n,this.$footer=this.render(),l.appendChild(this.$footer)}destroy(){this.$footer.remove()}render(){const e=document.createElement("div");e.className=this.wrapClassName("footer"),this.sideEffect.addDisposer(this.readonly$.subscribe(l=>e.classList.toggle(this.wrapClassName("readonly"),l)));const i=this.renderFooterBtn("btn-sidebar",Ad(this.namespace));this.sideEffect.addEventListener(i,"click",()=>{this.readonly$.value||this.events.emit("togglePreview")}),e.appendChild(i),this.sideEffect.addDisposer(this.pages$.subscribe(l=>{const d=l.some(u=>u.thumbnail||!u.src.startsWith("ppt"));i.style.display=d?"":"none"}));const s=document.createElement("div");s.className=this.wrapClassName("page-jumps");const r=this.renderFooterBtn("btn-page-back",kd(this.namespace));if(this.sideEffect.addEventListener(r,"click",()=>{this.readonly$.value||this.events.emit("back")}),s.appendChild(r),this.playable){const l=this.renderFooterBtn("btn-page-play",Nd(this.namespace),Ed(this.namespace));this.sideEffect.addEventListener(l,"click",()=>{this.readonly$.value||(l.classList.toggle(this.wrapClassName("footer-btn-playing"),!0),this.events.emit("play"),this.sideEffect.setTimeout(()=>l.classList.toggle(this.wrapClassName("footer-btn-playing"),!1),500,"returnPlay"))}),s.appendChild(l)}const a=this.renderFooterBtn("btn-page-next",Td(this.namespace));this.sideEffect.addEventListener(a,"click",()=>{this.readonly$.value||this.events.emit("next")}),s.appendChild(a);const n=document.createElement("div");n.className=this.wrapClassName("page-number");const o=document.createElement("input");o.className=this.wrapClassName("page-number-input"),this.sideEffect.addDisposer(this.readonly$.subscribe(l=>o.disabled=l)),this.sideEffect.addDisposer(this.pagesIndex$.subscribe(l=>o.value=String(l+1))),this.sideEffect.addEventListener(o,"focus",()=>{o.select()}),this.sideEffect.addEventListener(o,"change",()=>{if(this.readonly$.value)return;const l=Number(o.value)-1;l>=0&&this.events.emit("jumpPage",l)});const c=document.createElement("span");return this.sideEffect.addDisposer(this.pages$.subscribe(l=>{c.textContent=" / "+l.length})),n.appendChild(o),n.appendChild(c),e.appendChild(s),e.appendChild(n),e}renderFooterBtn(e,i,s){const r=document.createElement("button");return r.className=this.wrapClassName("footer-btn")+" "+this.wrapClassName(e),r.appendChild(i),s&&r.appendChild(s),r}}class zd{constructor(){this.listeners=new Map,this.relayListeners=new Set}emit(e,i){var s;(s=this.listeners.get(e))==null||s.forEach(r=>r(i))}on(e,i){let s=this.listeners.get(e);return s||(s=new Set,this.listeners.set(e,s)),s.add(i),s.size===1&&this.relayListeners.forEach(r=>r.start(e)),()=>{this.off(e,i)}}off(e,i){const s=this.listeners.get(e);if(s){const r=s.delete(i);return s.size<=0&&(this.listeners.delete(e),this.relayListeners.forEach(a=>a.dispose(e))),r}return!1}clear(e){var i;e?(i=this.listeners.get(e))==null||i.clear():this.listeners.clear()}count(e){var i;if(e)return((i=this.listeners.get(e))==null?void 0:i.size)||0;{let s=0;return this.listeners.forEach(r=>{s+=r.size}),s}}remit(e,i){let s;const r={start:a=>{a===e&&(s=i(this))},dispose:a=>{s&&(!a||a===e)&&s()}};return this.relayListeners.add(r),()=>{this.relayListeners.delete(r),s&&s()}}destroy(){this.clear(),this.relayListeners.forEach(e=>e.dispose()),this.relayListeners.clear()}}class An{constructor({readonly$:e,pagesIndex$:i,box:s,pages:r=[],playable:a}){this.wrapClassName=o=>`${this.namespace}-${o}`,this.namespace="netless-app-docs-viewer",this.sideEffect=new gt,this.events=new zd;const n=new Fe(r);fh(this,{pages:n}),this.preview=new _d({pages$:n,readonly$:e,pagesIndex$:i,root:s.$body,sideEffect:this.sideEffect,events:this.events,namespace:this.namespace,wrapClassName:this.wrapClassName}),this.footer=new Pd({pages$:n,readonly$:e,playable:a,pagesIndex$:i,root:s.$footer,namespace:this.namespace,sideEffect:this.sideEffect,events:this.events,wrapClassName:this.wrapClassName})}destroy(){this.preview.destroy(),this.footer.destroy(),this.sideEffect.flushAll(),this.events.destroy()}}function Xe(t,e,i){return Math.min(Math.max(t,e),i)}function qr(t){return t.touches?t.touches[0]:t}function kn(t){t.stopPropagation(),t.cancelable&&t.preventDefault()}function Tn(t,e){return t.width===e.width&&t.height===e.height}class Dd{constructor(e){var i,s,r;this.velocity=0,this._paused=!0,this._animationFrameID=null,this._loopTimestamp=0,this.looper=a=>{var n;if(this._paused)return;let o=Math.floor((a-this._loopTimestamp)/1e3*60)+1;for(this._loopTimestamp=a;o-- >0;)this.stepper();(n=this.onStep)==null||n.call(this,this.current),this._paused?this._animationFrameID=null:this._animationFrameID=window.requestAnimationFrame(this.looper)},this.current=(i=e.start)!=null?i:0,this.target=this.current,this.stiffness=(s=e.stiffness)!=null?s:170,this.damping=(r=e.damping)!=null?r:26,this.onStep=e.onStep}get paused(){return this._paused}stepTo(e,i){var s;this._paused&&i!=null&&(this.current=i),this._paused=!1,this.target=e,(s=this.onStep)==null||s.call(this,this.current),this._loopTimestamp=Date.now(),this._animationFrameID=window.requestAnimationFrame(this.looper)}pause(){this._paused=!0,this._animationFrameID!=null&&window.cancelAnimationFrame(this._animationFrameID)}destroy(){this.pause(),this.onStep=void 0}stepper(){const e=-this.stiffness*(this.current-this.target),i=-this.damping*this.velocity,s=this.velocity+(e+i)/60,r=this.current+s/60;Math.abs(s-0)<.01&&Math.abs(r-this.target)<.01?(this.current=this.target,this.velocity=0,this._paused=!0):(this.current=r,this.velocity=s)}}class Ld{constructor(e,i,s,r,a,n){this.index=e,this.lastVisit=Date.now(),this.sideEffect=new gt;const o=Ut(i,p=>p[e]||{width:0,height:0}),c=Pe([o,s],([p,m])=>(m.width-p.width)/2),l=Pe([a,n],([p,m])=>(p[e]||0)-m),d=document.createElement("div");d.className="page-renderer-page",d.dataset.index=`${e}`;const u=document.createElement("img");u.className="page-renderer-page-img",d.appendChild(u),this.sideEffect.addDisposer([Pe([o,r]).subscribe(([p,m])=>{d.style.width=`${p.width*m}px`,d.style.height=`${p.height*m}px`}),o.subscribe(p=>{p.thumbnail&&(d.style.backgroundImage=`url("${p.thumbnail}")`),u.width=p.width,u.height=p.height,u.src=p.src}),Pe([c,l,r]).subscribe(([p,m,g])=>{d.style.transform=`translate(${p*g}px, ${m*g}px)`})]),this.$page=d}destroy(){this.sideEffect.flushAll(),this.$page.remove()}}const Vd=window.requestIdleCallback||(t=>window.setTimeout(t,5e3)),$d=window.cancelIdleCallback||window.clearTimeout;class jd{constructor(e,i,s,r,a){this.pages$=e,this.pagesSize$=i,this.scale$=s,this.pagesYs$=r,this.pagesScrollTop$=a,this.els=new Map,this.maxElCount=200,this.gcTimer=null,this.gc=()=>{var n;if(this.gcTimer=null,this.els.size>this.maxElCount){const o=[...this.els.values()].sort((c,l)=>l.lastVisit-c.lastVisit);for(let c=Math.floor(this.maxElCount/4);c<o.length;c++)(n=this.els.get(o[c].index))==null||n.destroy(),this.els.delete(o[c].index)}}}getEl(e){let i=this.els.get(e);return i||(i=new Ld(e,this.pages$,this.pagesSize$,this.scale$,this.pagesYs$,this.pagesScrollTop$),this.els.set(e,i)),i.lastVisit=Date.now(),this.els.size>this.maxElCount&&this.gcTimer===null&&(this.gcTimer=Vd(this.gc)),i}destroy(){this.els.forEach(e=>e.destroy()),this.els.clear(),this.gcTimer!==null&&($d(this.gcTimer),this.gcTimer=null)}}class Bd{constructor({pagesScrollTop$:e,containerRect$:i,pages$:s,pagesSize$:r}){this.sideEffect=new gt,s=Ut(s,m=>m.map(g=>{if(g.thumbnail)return g;try{const f=new URL(g.src);return f.searchParams.set("x-oss-process","image/resize,l_50"),ye(O({},g),{thumbnail:f.toString()})}catch(f){return console.error(f),g}}));const a=Ut(s,m=>{const g=Array(m.length);for(let f=0;f<m.length;f++)g[f]=f>0?g[f-1]+m[f-1].height:0;return g}),n=Ut(s,m=>{let g=1/0;for(let f=m.length-1;f>=0;f--)m[f].height<=g&&(g=m[f].height);return g}),o=Pe([e,a,s],([m,g,f])=>{for(let b=0;b<g.length;b++)if(g[b]+f[b].height-m>=.001)return b;return g.length-1}),c=Pe([i,r],([m,g])=>m.width/g.width||1),l=Pe([s,i,n,c],([m,g,f,b])=>Xe(Math.ceil(g.height/b/f/2),1,m.length));gh(this,{pagesScrollTop:e,containerRect:i,pages:s,pagesSize:r,pagesIndex:o,pagesYs:a,pagesMinHeight:n,scale:c}),this.pageElManager=new jd(s,r,c,a,e),this.$pages=this.renderPages();const d=new Fe(!1);this.sideEffect.addDisposer(d.subscribe(m=>this.$pages.classList.toggle("is-hwa",m)));const u=()=>d.setValue(!1),p=()=>{this.sideEffect.setTimeout(u,1e3,"turn-off-hwa"),d.setValue(!0)};this.sideEffect.addDisposer(Pe([o,l,s]).subscribe(([m,g,f])=>{p();const b=Math.max(m-g,0),v=Math.min(m+g,f.length-1);for(let x=0;x<this.$pages.children.length;x++){const y=this.$pages.children[x],k=Number(y.dataset.index);k>=b&&k<=v||(y.remove(),x--)}for(let x=b;x<=v;x++){const y=this.pageElManager.getEl(x);y.$page.parentElement!==this.$pages&&this.$pages.appendChild(y.$page)}}))}renderPages(){const e=document.createElement("div");return e.className="page-renderer-pages-container",this.sideEffect.addDisposer(this._containerRect$.subscribe(i=>{e.style.width=`${i.width}px`,e.style.height=`${i.height}px`}),"render-pages-size"),e}destroy(){this.sideEffect.flushAll(),this.$pages.remove(),this.pageElManager.destroy()}}const Rd=30;class Od{constructor({pagesScrollTop$:e,containerRect$:i,stageRect$:s,pagesSize$:r,readonly$:a,scrollbarMinHeight:n=Rd,wrapClassName:o,onDragScroll:c}){this.sideEffect=new gt,this.scrolling$=new Fe(!1),this.pagesScrollTop$=e,this.containerRect$=i,this.stageRect$=s,this.pagesSize$=r,this.scrollbarMinHeight=n,this.readonly$=a,this.wrapClassName=o,this.onDragScroll=c,this.scrollbarHeight$=Pe([i,s,r],([l,d,u])=>Xe(d.height/(d.width/u.width*u.height)*l.height,n,l.height)),this.scrollTop$=Pe([i,s,r,this.scrollbarHeight$,this.pagesScrollTop$],([l,d,u,p,m])=>Xe(m/(u.height-u.width/d.width*d.height)*(l.height-p),0,l.height-p)),this.$scrollbar=this.renderScrollbar()}mount(e){e.appendChild(this.$scrollbar)}destroy(){this.$scrollbar.remove(),this.onDragScroll=void 0,this.sideEffect.flushAll()}renderScrollbar(){const e=document.createElement("button");e.className=this.wrapClassName("scrollbar"),e.style.minHeight=`${this.scrollbarMinHeight}px`,this.sideEffect.addDisposer([this.scrollbarHeight$.subscribe(s=>{e.style.height=`${s}px`}),this.scrollTop$.subscribe(s=>{this.scrolling$.setValue(!0),this.sideEffect.setTimeout(()=>this.scrolling$.setValue(!1),100,"reset-scrolling");const r=()=>e.style.transform=`translateY(${s}px)`;window.requestAnimationFrame?window.requestAnimationFrame(r):r()}),this.scrolling$.subscribe(s=>{e.classList.toggle(this.wrapClassName("scrolling"),s)})]);const i=s=>{if(!s.isPrimary||this.readonly$.value||s.button!=null&&s.button!==0)return;kn(s);const r=this.wrapClassName("scrollbar-dragging");e.classList.toggle(r,!0);const a=this.pagesScrollTop$.value,{clientY:n}=qr(s),o=l=>{if(!l.isPrimary||this.readonly$.value)return;const{clientY:d}=qr(l),u=d-n;Math.abs(u)>0&&this.onDragScroll&&this.onDragScroll(a+u/this.containerRect$.value.height*this.pagesSize$.value.height)},c=l=>{!l.isPrimary||(e.classList.toggle(r,!1),window.removeEventListener("pointermove",o,!0),window.removeEventListener("pointerup",c,!0),window.removeEventListener("pointercancel",c,!0))};window.addEventListener("pointermove",o,!0),window.addEventListener("pointerup",c,!0),window.addEventListener("pointercancel",c,!0)};return this.sideEffect.addEventListener(e,"pointerdown",i),e}}class Ud{constructor({whiteboard:e,readonly$:i,box:s,pages:r,pagesScrollTop:a=0,onUserScroll:n}){this.sideEffect=new gt,this.userScrolling=!1,this.whiteboard=e,this.readonly$=i,this.box=s,this.pages=r,this.onUserScroll=n;const o=()=>{var l;this.userScrolling=!1,(l=this.onUserScroll)==null||l.call(this,this.pagesScrollTop$.value)};this.debounceOnUserScroll=()=>{this.userScrolling=!0,this.sideEffect.setTimeout(o,80,"debounceOnUserScroll")};const c=new Fe(r);this.pagesScrollTop$=new Fe(a),this.pagesSize$=Ut(c,l=>{let d=0,u=0;for(let p=l.length-1;p>=0;p--){const m=l[p];m.width>d&&(d=m.width),u+=m.height}return{width:Math.max(1,d),height:Math.max(1,u)}},{compare:Tn}),this.pageRenderer=new Bd({pagesScrollTop$:this.pagesScrollTop$,containerRect$:s._stageRect$,pages$:c,pagesSize$:this.pagesSize$}),this.viewer=new An({readonly$:i,pagesIndex$:this.pageRenderer._pagesIndex$,box:s,pages:r,playable:!1}),this.sideEffect.addDisposer([this.viewer.events.on("next",()=>{this.userScrollByPercent(.8)}),this.viewer.events.on("back",()=>{this.userScrollByPercent(-.8)})]),this.scrollbar=new Od({pagesScrollTop$:this.pagesScrollTop$,containerRect$:s._bodyRect$,stageRect$:s._stageRect$,pagesSize$:this.pagesSize$,readonly$:i,wrapClassName:this.wrapClassName.bind(this),onDragScroll:l=>{this.pageScrollTo(l),this.debounceOnUserScroll()}}),this.pageScrollStepper=new Dd({start:this.pagesScrollTop$.value,onStep:l=>{this.pageScrollTo(l)}}),this.sideEffect.addDisposer(this.viewer.events.on("jumpPage",l=>this.userScrollToPageIndex(l))),this.render(),this.setupScrollListener(),this.sideEffect.setTimeout(()=>{this.userScrolling||this.pageScrollTo(this.pageRenderer.pagesScrollTop)},100)}get pagesScrollTop(){return this.pagesScrollTop$.value}destroy(){this.sideEffect.flushAll(),this.pageScrollStepper.destroy(),this.onUserScroll=void 0,this.viewer.destroy(),this.pageRenderer.destroy(),this.scrollbar.destroy()}syncPageScrollTop(e){!this.userScrolling&&e>=0&&Math.abs(this.pagesScrollTop$.value-e)>.01&&this.pageScrollStepper.stepTo(e,this.pagesScrollTop$.value)}render(){this.box.$content.style.overflow="hidden",this.box.mountStage(this.pageRenderer.$pages),this.scrollbar.mount(this.box.$body)}pageScrollTo(e){const i=this.whiteboard.view.size.height/2/this.pageRenderer.scale;this.whiteboard.view.moveCamera({centerY:Xe(e+i,i,this.pagesSize$.value.height-i),animationMode:"immediately"})}userScrollToPageIndex(e){var i;if(e=Xe(e,0,this.pages.length-1),!this.readonly$.value&&!Number.isNaN(e)){const s=this.pageRenderer.pagesYs[e];s>=0&&((i=this.onUserScroll)==null||i.call(this,s+5/this.pageRenderer.scale))}}userScrollByPercent(e){var i;this.readonly$.value||(i=this.onUserScroll)==null||i.call(this,Xe(this.pageRenderer.pagesScrollTop+this.pageRenderer.containerRect.height/this.pageRenderer.scale*Xe(e,-1,1),0,this.pageRenderer.pagesSize.height-this.pageRenderer.containerRect.height/this.pageRenderer.scale))}setupScrollListener(){this.sideEffect.addEventListener(this.box.$main,"wheel",e=>{kn(e),!this.readonly$.value&&this.pageScrollStepper.paused&&(this.pageScrollTo(this.pagesScrollTop+e.deltaY),this.debounceOnUserScroll())},{passive:!1}),this.sideEffect.addEventListener(this.box.$main,"touchmove",e=>{!this.readonly$.value&&e.touches.length>1&&this.debounceOnUserScroll()},{passive:!0,capture:!0}),this.sideEffect.add(()=>{const e=i=>{const{width:s,height:r}=this.whiteboard.view.size;if(s<=0||r<=0)return;const a=i.centerY-this.pageRenderer.containerRect.height/this.pageRenderer.scale/2;this.pagesScrollTop$.setValue(a)};return this.whiteboard.view.callbacks.on("onCameraUpdated",e),()=>this.whiteboard.view.callbacks.off("onCameraUpdated",e)}),this.sideEffect.addDisposer(this.box._stageRect$.subscribe(e=>{const{width:i,height:s}=this.pagesSize$.value;this.whiteboard.view.moveCameraToContain({originX:0,originY:this.pageRenderer.pagesScrollTop,width:i,height:e.height/this.pageRenderer.scale,animationMode:"immediately"}),this.whiteboard.view.setCameraBound({damping:1,maxContentMode:()=>this.pageRenderer.scale,minContentMode:()=>this.pageRenderer.scale,centerX:i/2,centerY:s/2,width:i,height:s})}),"whiteboard-size-update"),this.sideEffect.addEventListener(window,"keyup",e=>{if(!(this.readonly$.value||!this.box.focus||this.box.minimized))switch(e.key){case"PageDown":{this.userScrollByPercent(.8);break}case"PageUp":{this.userScrollByPercent(-.8);break}case"ArrowLeft":{this.userScrollByPercent(-.25);break}case"ArrowRight":{this.userScrollByPercent(.25);break}case"ArrowDown":{this.userScrollByPercent(.5);break}case"ArrowUp":{this.userScrollByPercent(-.5);break}}},{capture:!0})}wrapClassName(e){return"netless-app-docs-viewer-static-"+e}}class Wd{constructor({readonly$:e,context:i,whiteboard:s,box:r,pages:a}){this.sideEffect=new gt,this.context=i,this.whiteboard=s,this.box=r,this.pages=a;const n=new Fe(i.displayer.state.sceneState.index||0);this.pagesIndex$=n,this.sideEffect.add(()=>{const o=c=>{this.jumpToPage(c.index)};return this.context.emitter.on("sceneStateChange",o),()=>this.context.emitter.off("sceneStateChange",o)}),this.viewer=new An({readonly$:e,pagesIndex$:n,box:r,pages:a,playable:!0}),this.sideEffect.addDisposer([this.viewer.events.on("jumpPage",o=>this.jumpToPage(o,!0)),this.viewer.events.on("play",()=>{var o;return(o=this.context.room)==null?void 0:o.pptNextStep()}),this.viewer.events.on("back",()=>this.prevPage()),this.viewer.events.on("next",()=>this.nextPage())]),this.render(),this.sideEffect.addDisposer(n.subscribe((o,c)=>{var l,d;if(e.value)return;const u=this.context.getInitScenePath(),p=(d=(l=this.context.getScenes())==null?void 0:l[o])==null?void 0:d.name;if(u&&p&&this.context.setScenePath(`${u}/${p}`),c){const m=this.context.room;if(m){const g=m.state.globalState.__pptState;m.setGlobalState({__pptState:g&&{uuid:g.uuid,pageIndex:o,disableAutoPlay:g.disableAutoPlay}})}}}))}destroy(){this.sideEffect.flushAll(),this.viewer.destroy()}nextPage(){this.jumpToPage(this.pagesIndex$.value+1,!0)}prevPage(){this.jumpToPage(this.pagesIndex$.value-1,!0)}jumpToPage(e,i=!1){this.pagesIndex$.setValue(Xe(e,0,this.pages.length-1),i)}render(){var e;this.box.mountStage(document.createElement("div")),this.sideEffect.addEventListener(window,"keydown",s=>{var r;if(this.box.focus)switch(s.key){case"ArrowUp":case"ArrowLeft":{this.prevPage();break}case"ArrowRight":case"ArrowDown":{(r=this.context.room)==null||r.pptNextStep();break}}});const i=(e=this.whiteboard.view.divElement)==null?void 0:e.parentElement;i&&this.sideEffect.addEventListener(i,"click",s=>{var r;const a=this.context.room;if(a&&a.state.memberState.currentApplianceName==="clicker"){for(let n=s.target;n;n=n.parentElement)if((r=n.classList)!=null&&r.contains("ppt-event-source"))return;a.pptNextStep()}})}wrapClassName(e){return"netless-app-docs-viewer-dynamic-"+e}}const Hd="DocsViewer",_i={kind:Hd,setup(t){const e=t.box,i=t.getScenes();if(!i)throw new Error("[Docs Viewer]: scenes not found.");const s=new gt,r=i.map(({ppt:n})=>n?{width:n.width,height:n.height,src:n.src,thumbnail:n.previewURL}:null).filter(n=>Boolean(n));if(r.length<=0)throw new Error("[Docs Viewer]: empty scenes.");e.mountStyles(th);const a=new Fe(!t.isWritable);s.addDisposer(t.emitter.on("writableChange",n=>{a.setValue(!n)})),r[0].src.startsWith("ppt")?Zd(s,t,e,r,a):Fd(s,t,e,r,a),s.addDisposer(t.emitter.on("destroy",()=>{s.flushAll()}))}};function Fd(t,e,i,s,r){const a=e.createWhiteBoardView({syncCamera:!1});t.addDisposer(r.subscribe(l=>{a.view.disableCameraTransform=l}));const n=e.createStorage("static-docs-viewer",{pagesScrollTop:0}),o=new Ud({whiteboard:a,readonly$:r,box:i,pages:s,pagesScrollTop:n.state.pagesScrollTop,onUserScroll:l=>{e.isWritable&&n.setState({pagesScrollTop:l})}});t.addDisposer(()=>o.destroy()),t.addDisposer(n.addStateChangedListener(l=>{l.pagesScrollTop&&o.syncPageScrollTop(l.pagesScrollTop.newValue||0)}));let c=1;if(s.length>0){const{width:l,height:d}=s[0];d<=l?c=d/l:c=1/2*d/l}t.addDisposer(Pe([i._maximized$,i._managerStageRect$,i._intrinsicSize$],([l,d,u])=>l?c:u.height*(d.height/d.width)/u.width).subscribe(l=>{i.setStageRatio(l)}))}function Zd(t,e,i,s,r){const a=e.createWhiteBoardView();a.view.disableCameraTransform=!0;const n=new Wd({context:e,whiteboard:a,box:i,pages:s,readonly$:r});t.addDisposer(()=>n.destroy());const o=new Fe({width:s[0].width,height:s[0].height},{compare:Tn});if(t.addDisposer(n.pagesIndex$.subscribe(c=>{const l=s[c];l&&o.setValue({width:l.width,height:l.height})})),t.addDisposer(o.subscribe(c=>{r.value||a.setBaseRect(c)})),e.isAddApp){const c=t.add(()=>{const l=({width:d,height:u})=>{if(s.length>0&&i.state!=="maximized"){const{width:p,height:m}=s[0],f=m/p*d-u;f!==0&&e.isWritable&&e.emitter.emit("setBoxSize",{width:i.intrinsicWidth,height:i.intrinsicHeight+f/i.rootRect.height})}t.remove(c)};return a.view.callbacks.once("onSizeUpdated",l),()=>a.view.callbacks.off("onSizeUpdated",l)})}}function st(){}function Nn(t){return t()}function Jr(){return Object.create(null)}function Bi(t){t.forEach(Nn)}function Yd(t){return typeof t=="function"}function En(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let di;function Pn(t,e){return di||(di=document.createElement("a")),di.href=e,t===di.href}function Qd(t){return Object.keys(t).length===0}function V(t,e){t.appendChild(e)}function At(t,e,i){t.insertBefore(e,i||null)}function ft(t){t.parentNode.removeChild(t)}function Ct(t){return document.createElement(t)}function j(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Cs(t){return document.createTextNode(t)}function Gd(){return Cs(" ")}function C(t,e,i){i==null?t.removeAttribute(e):t.getAttribute(e)!==i&&t.setAttribute(e,i)}function qd(t){return Array.from(t.childNodes)}function Jd(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}let qt;function Wt(t){qt=t}function zn(){if(!qt)throw new Error("Function called outside component initialization");return qt}function Xd(t){zn().$$.on_mount.push(t)}function Kd(t){zn().$$.on_destroy.push(t)}const Lt=[],Ht=[],bi=[],Xr=[],eu=Promise.resolve();let Is=!1;function tu(){Is||(Is=!0,eu.then(Dn))}function _s(t){bi.push(t)}const ns=new Set;let ui=0;function Dn(){const t=qt;do{for(;ui<Lt.length;){const e=Lt[ui];ui++,Wt(e),iu(e.$$)}for(Wt(null),Lt.length=0,ui=0;Ht.length;)Ht.pop()();for(let e=0;e<bi.length;e+=1){const i=bi[e];ns.has(i)||(ns.add(i),i())}bi.length=0}while(Lt.length);for(;Xr.length;)Xr.pop()();Is=!1,ns.clear(),Wt(t)}function iu(t){if(t.fragment!==null){t.update(),Bi(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(_s)}}const yi=new Set;let su;function Ln(t,e){t&&t.i&&(yi.delete(t),t.i(e))}function ru(t,e,i,s){if(t&&t.o){if(yi.has(t))return;yi.add(t),su.c.push(()=>{yi.delete(t),s&&(i&&t.d(1),s())}),t.o(e)}}function au(t){t&&t.c()}function Vn(t,e,i,s){const{fragment:r,on_mount:a,on_destroy:n,after_update:o}=t.$$;r&&r.m(e,i),s||_s(()=>{const c=a.map(Nn).filter(Yd);n?n.push(...c):Bi(c),t.$$.on_mount=[]}),o.forEach(_s)}function $n(t,e){const i=t.$$;i.fragment!==null&&(Bi(i.on_destroy),i.fragment&&i.fragment.d(e),i.on_destroy=i.fragment=null,i.ctx=[])}function nu(t,e){t.$$.dirty[0]===-1&&(Lt.push(t),tu(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function jn(t,e,i,s,r,a,n,o=[-1]){const c=qt;Wt(t);const l=t.$$={fragment:null,ctx:null,props:a,update:st,not_equal:r,bound:Jr(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(c?c.$$.context:[])),callbacks:Jr(),dirty:o,skip_bound:!1,root:e.target||c.$$.root};n&&n(l.root);let d=!1;if(l.ctx=i?i(t,e.props||{},(u,p,...m)=>{const g=m.length?m[0]:p;return l.ctx&&r(l.ctx[u],l.ctx[u]=g)&&(!l.skip_bound&&l.bound[u]&&l.bound[u](g),d&&nu(t,u)),p}):[],l.update(),d=!0,Bi(l.before_update),l.fragment=s?s(l.ctx):!1,e.target){if(e.hydrate){const u=qd(e.target);l.fragment&&l.fragment.l(u),u.forEach(ft)}else l.fragment&&l.fragment.c();e.intro&&Ln(t.$$.fragment),Vn(t,e.target,e.anchor,e.customElement),Dn()}Wt(c)}class Bn{$destroy(){$n(this,1),this.$destroy=st}$on(e,i){const s=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return s.push(i),()=>{const r=s.indexOf(i);r!==-1&&s.splice(r,1)}}$set(e){this.$$set&&!Qd(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const ou={"3g2":"video/3gpp2","3gp":"video/3gpp","3gpp":"audio/3gpp",aac:"audio/x-aac",adp:"audio/adpcm",aif:"audio/x-aiff",aifc:"audio/x-aiff",aiff:"audio/x-aiff",amr:"audio/amr",asf:"video/x-ms-asf",asx:"video/x-ms-asf",au:"audio/basic",avi:"video/x-msvideo",caf:"audio/x-caf",dra:"audio/vnd.dra",dts:"audio/vnd.dts",dtshd:"audio/vnd.dts.hd",dvb:"video/vnd.dvb.file",eol:"audio/vnd.digital-winds",f4v:"video/x-f4v",flac:"audio/x-flac",fli:"video/x-fli",flv:"video/x-flv",fvt:"video/vnd.fvt",h261:"video/h261",h263:"video/h263",h264:"video/h264",jpgm:"video/jpm",jpgv:"video/jpeg",kar:"audio/midi",lvp:"audio/vnd.lucent.voice",m1v:"video/mpeg",m2a:"audio/mpeg",m2v:"video/mpeg",m3a:"audio/mpeg",m3u:"audio/x-mpegurl",m4a:"audio/mp4",m4s:"video/iso.segment",m4u:"video/vnd.mpegurl",m4v:"video/x-m4v",mid:"audio/midi",midi:"audio/midi",mj2:"video/mj2",mjp2:"video/mj2",mk3d:"video/x-matroska",mka:"audio/x-matroska",mks:"video/x-matroska",mkv:"video/x-matroska",mng:"video/x-mng",mov:"video/quicktime",movie:"video/x-sgi-movie",mp2:"audio/mpeg",mp2a:"audio/mpeg",mp3:"audio/mp3",mp4:"video/mp4",mp4a:"audio/mp4",mp4v:"video/mp4",mpe:"video/mpeg",mpeg:"video/mpeg",mpg:"video/mpeg",mpg4:"video/mp4",mpga:"audio/mpeg",mxmf:"audio/mobile-xmf",mxu:"video/vnd.mpegurl",oga:"audio/ogg",ogg:"audio/ogg",ogv:"video/ogg",opus:"audio/ogg",pya:"audio/vnd.ms-playready.media.pya",pyv:"video/vnd.ms-playready.media.pyv",qt:"video/quicktime",ra:"audio/x-pn-realaudio",ram:"audio/x-pn-realaudio",rip:"audio/vnd.rip",rmi:"audio/midi",rmp:"audio/x-pn-realaudio-plugin",s3m:"audio/s3m",sil:"audio/silk",smv:"video/x-smv",snd:"audio/basic",spx:"audio/ogg",ts:"video/mp2t",uva:"audio/vnd.dece.audio",uvh:"video/vnd.dece.hd",uvm:"video/vnd.dece.mobile",uvp:"video/vnd.dece.pd",uvs:"video/vnd.dece.sd",uvu:"video/vnd.uvvu.mp4",uvv:"video/vnd.dece.video",uvva:"audio/vnd.dece.audio",uvvh:"video/vnd.dece.hd",uvvm:"video/vnd.dece.mobile",uvvp:"video/vnd.dece.pd",uvvs:"video/vnd.dece.sd",uvvu:"video/vnd.uvvu.mp4",uvvv:"video/vnd.dece.video",viv:"video/vnd.vivo",vob:"video/x-ms-vob",wav:"audio/wav",wax:"audio/x-ms-wax",weba:"audio/webm",webm:"video/webm",wm:"video/x-ms-wm",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",wmx:"video/x-ms-wmx",wvx:"video/x-ms-wvx",xm:"audio/xm",m3u8:"application/vnd.apple.mpegurl"},lu=["application/x-mpegurl","application/vnd.apple.mpegurl"];function cu(t){if(!t)return;const e=t.lastIndexOf(".");if(!~e)return;const i=t.slice(e+1);return ou[i]}async function hu(t){try{return await t.play(),!0}catch(e){return t.muted=!0,await t.play(),console.debug(e),!1}}function du(t){const e=document.createElement("script");return new Promise((i,s)=>{e.onload=()=>i(),e.onerror=s,e.src=t,document.head.appendChild(e)})}async function uu(){const t={loadSource(i){},attachMedia(i){}};let e=window.Hls;if(e===null||e===!1)return t;if(e===void 0&&(await du("https://cdn.jsdelivr.net/npm/hls.js"),e=window.Hls),typeof e=="function")try{return new e}catch(i){return console.debug(i),t}else return t}function pu(t){return"canPlayType"in t&&!t.canPlayType("application/vnd.apple.mpegurl")}function gu(t,e,i){return t<e?e:t>i?i:t}function mu(t){return Array.isArray(t)?t[0]:t}function fu(t){let e,i,s,r,a,n,o,c,l,d,u,p,m,g,f,b,v,x,y,k,z,T,R,te,Q,xe,Re,ge,Ie,me,_e,fe,be,Me,Ae,Se,ot,Oe;return{c(){e=j("svg"),i=j("symbol"),s=j("path"),r=j("path"),a=j("symbol"),n=j("path"),o=j("symbol"),c=j("path"),l=j("symbol"),d=j("path"),u=j("symbol"),p=j("path"),m=j("symbol"),g=j("path"),f=j("symbol"),b=j("path"),v=j("symbol"),x=j("path"),y=j("symbol"),k=j("path"),z=j("symbol"),T=j("path"),R=j("symbol"),te=j("path"),Q=j("symbol"),xe=j("path"),Re=j("path"),ge=j("symbol"),Ie=j("path"),me=j("symbol"),_e=j("path"),fe=j("symbol"),be=j("path"),Me=j("symbol"),Ae=j("path"),Se=j("symbol"),ot=j("path"),Oe=j("path"),C(s,"d","M16 1H2a1 1 0 00-1 1v10a1 1 0 001 1h3v-2H3V3h12v8h-2v2h3a1 1 0 001-1V2a1 1 0 00-1-1z"),C(r,"d","M4 17h10l-5-6z"),C(i,"id","plyr-airplay"),C(i,"viewBox","0 0 18 18"),C(n,"d","M1 1c-.6 0-1 .4-1 1v11c0 .6.4 1 1 1h4.6l2.7 2.7c.2.2.4.3.7.3.3 0 .5-.1.7-.3l2.7-2.7H17c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1H1zm4.52 10.15c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41C8.47 4.96 7.46 3.76 5.5 3.76c-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69zm7.57 0c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41c-.28-1.15-1.29-2.35-3.25-2.35-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69z"),C(n,"fill-rule","evenodd"),C(n,"fill-opacity",".5"),C(a,"id","plyr-captions-off"),C(a,"viewBox","0 0 18 18"),C(c,"d","M1 1c-.6 0-1 .4-1 1v11c0 .6.4 1 1 1h4.6l2.7 2.7c.2.2.4.3.7.3.3 0 .5-.1.7-.3l2.7-2.7H17c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1H1zm4.52 10.15c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41C8.47 4.96 7.46 3.76 5.5 3.76c-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69zm7.57 0c1.99 0 3.01-1.32 3.28-2.41l-1.29-.39c-.19.66-.78 1.45-1.99 1.45-1.14 0-2.2-.83-2.2-2.34 0-1.61 1.12-2.37 2.18-2.37 1.23 0 1.78.75 1.95 1.43l1.3-.41c-.28-1.15-1.29-2.35-3.25-2.35-1.9 0-3.61 1.44-3.61 3.7 0 2.26 1.65 3.69 3.63 3.69z"),C(c,"fill-rule","evenodd"),C(o,"id","plyr-captions-on"),C(o,"viewBox","0 0 18 18"),C(d,"d","M9 13c.3 0 .5-.1.7-.3L15.4 7 14 5.6l-4 4V1H8v8.6l-4-4L2.6 7l5.7 5.7c.2.2.4.3.7.3zm-7 2h14v2H2z"),C(l,"id","plyr-download"),C(l,"viewBox","0 0 18 18"),C(p,"d","M10 3h3.6l-4 4L11 8.4l4-4V8h2V1h-7zM7 9.6l-4 4V10H1v7h7v-2H4.4l4-4z"),C(u,"id","plyr-enter-fullscreen"),C(u,"viewBox","0 0 18 18"),C(g,"d","M1 12h3.6l-4 4L2 17.4l4-4V17h2v-7H1zM16 .6l-4 4V1h-2v7h7V6h-3.6l4-4z"),C(m,"id","plyr-exit-fullscreen"),C(m,"viewBox","0 0 18 18"),C(b,"d","M7.875 7.171L0 1v16l7.875-6.171V17L18 9 7.875 1z"),C(f,"id","plyr-fast-forward"),C(f,"viewBox","0 0 18 18"),C(x,"d","M17 5.3c-.1 1.6-1.2 3.7-3.3 6.4-2.2 2.8-4 4.2-5.5 4.2-.9 0-1.7-.9-2.4-2.6C5 10.9 4.4 6 3 6c-.1 0-.5.3-1.2.8l-.8-1c.8-.7 3.5-3.4 4.7-3.5 1.2-.1 2 .7 2.3 2.5.3 2 .8 6.1 1.8 6.1.9 0 2.5-3.4 2.6-4 .1-.9-.3-1.9-2.3-1.1.8-2.6 2.3-3.8 4.5-3.8 1.7.1 2.5 1.2 2.4 3.3z"),C(v,"id","plyr-logo-vimeo"),C(v,"viewBox","0 0 18 18"),C(k,"d","M16.8 5.8c-.2-1.3-.8-2.2-2.2-2.4C12.4 3 9 3 9 3s-3.4 0-5.6.4C2 3.6 1.3 4.5 1.2 5.8 1 7.1 1 9 1 9s0 1.9.2 3.2c.2 1.3.8 2.2 2.2 2.4C5.6 15 9 15 9 15s3.4 0 5.6-.4c1.4-.3 2-1.1 2.2-2.4.2-1.3.2-3.2.2-3.2s0-1.9-.2-3.2zM7 12V6l5 3-5 3z"),C(y,"id","plyr-logo-youtube"),C(y,"viewBox","0 0 18 18"),C(T,"d","M12.4 12.5l2.1-2.1 2.1 2.1 1.4-1.4L15.9 9 18 6.9l-1.4-1.4-2.1 2.1-2.1-2.1L11 6.9 13.1 9 11 11.1zM3.786 6.008H.714C.286 6.008 0 6.31 0 6.76v4.512c0 .452.286.752.714.752h3.072l4.071 3.858c.5.3 1.143 0 1.143-.602V2.752c0-.601-.643-.977-1.143-.601L3.786 6.008z"),C(z,"id","plyr-muted"),C(z,"viewBox","0 0 18 18"),C(te,"d","M6 1H3c-.6 0-1 .4-1 1v14c0 .6.4 1 1 1h3c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1zm6 0c-.6 0-1 .4-1 1v14c0 .6.4 1 1 1h3c.6 0 1-.4 1-1V2c0-.6-.4-1-1-1h-3z"),C(R,"id","plyr-pause"),C(R,"viewBox","0 0 18 18"),C(xe,"d","M13.293 3.293L7.022 9.564l1.414 1.414 6.271-6.271L17 7V1h-6z"),C(Re,"d","M13 15H3V5h5V3H2a1 1 0 00-1 1v12a1 1 0 001 1h12a1 1 0 001-1v-6h-2v5z"),C(Q,"id","plyr-pip"),C(Q,"viewBox","0 0 18 18"),C(Ie,"d","M15.562 8.1L3.87.225c-.818-.562-1.87 0-1.87.9v15.75c0 .9 1.052 1.462 1.87.9L15.563 9.9c.584-.45.584-1.35 0-1.8z"),C(ge,"id","plyr-play"),C(ge,"viewBox","0 0 18 18"),C(_e,"d","M9.7 1.2l.7 6.4 2.1-2.1c1.9 1.9 1.9 5.1 0 7-.9 1-2.2 1.5-3.5 1.5-1.3 0-2.6-.5-3.5-1.5-1.9-1.9-1.9-5.1 0-7 .6-.6 1.4-1.1 2.3-1.3l-.6-1.9C6 2.6 4.9 3.2 4 4.1 1.3 6.8 1.3 11.2 4 14c1.3 1.3 3.1 2 4.9 2 1.9 0 3.6-.7 4.9-2 2.7-2.7 2.7-7.1 0-9.9L16 1.9l-6.3-.7z"),C(me,"id","plyr-restart"),C(me,"viewBox","0 0 18 18"),C(be,"d","M10.125 1L0 9l10.125 8v-6.171L18 17V1l-7.875 6.171z"),C(fe,"id","plyr-rewind"),C(fe,"viewBox","0 0 18 18"),C(Ae,"d","M16.135 7.784a2 2 0 01-1.23-2.969c.322-.536.225-.998-.094-1.316l-.31-.31c-.318-.318-.78-.415-1.316-.094a2 2 0 01-2.969-1.23C10.065 1.258 9.669 1 9.219 1h-.438c-.45 0-.845.258-.997.865a2 2 0 01-2.969 1.23c-.536-.322-.999-.225-1.317.093l-.31.31c-.318.318-.415.781-.093 1.317a2 2 0 01-1.23 2.969C1.26 7.935 1 8.33 1 8.781v.438c0 .45.258.845.865.997a2 2 0 011.23 2.969c-.322.536-.225.998.094 1.316l.31.31c.319.319.782.415 1.316.094a2 2 0 012.969 1.23c.151.607.547.865.997.865h.438c.45 0 .845-.258.997-.865a2 2 0 012.969-1.23c.535.321.997.225 1.316-.094l.31-.31c.318-.318.415-.781.094-1.316a2 2 0 011.23-2.969c.607-.151.865-.547.865-.997v-.438c0-.451-.26-.846-.865-.997zM9 12a3 3 0 110-6 3 3 0 010 6z"),C(Me,"id","plyr-settings"),C(Me,"viewBox","0 0 18 18"),C(ot,"d","M15.6 3.3c-.4-.4-1-.4-1.4 0-.4.4-.4 1 0 1.4C15.4 5.9 16 7.4 16 9c0 1.6-.6 3.1-1.8 4.3-.4.4-.4 1 0 1.4.2.2.5.3.7.3.3 0 .5-.1.7-.3C17.1 13.2 18 11.2 18 9s-.9-4.2-2.4-5.7z"),C(Oe,"d","M11.282 5.282a.909.909 0 000 1.316c.735.735.995 1.458.995 2.402 0 .936-.425 1.917-.995 2.487a.909.909 0 000 1.316c.145.145.636.262 1.018.156a.725.725 0 00.298-.156C13.773 11.733 14.13 10.16 14.13 9c0-.17-.002-.34-.011-.51-.053-.992-.319-2.005-1.522-3.208a.909.909 0 00-1.316 0zm-7.496.726H.714C.286 6.008 0 6.31 0 6.76v4.512c0 .452.286.752.714.752h3.072l4.071 3.858c.5.3 1.143 0 1.143-.602V2.752c0-.601-.643-.977-1.143-.601L3.786 6.008z"),C(Se,"id","plyr-volume"),C(Se,"viewBox","0 0 18 18"),C(e,"xmlns","http://www.w3.org/2000/svg"),C(e,"xmlns:xlink","http://www.w3.org/1999/xlink")},m(Qe,bt){At(Qe,e,bt),V(e,i),V(i,s),V(i,r),V(e,a),V(a,n),V(e,o),V(o,c),V(e,l),V(l,d),V(e,u),V(u,p),V(e,m),V(m,g),V(e,f),V(f,b),V(e,v),V(v,x),V(e,y),V(y,k),V(e,z),V(z,T),V(e,R),V(R,te),V(e,Q),V(Q,xe),V(Q,Re),V(e,ge),V(ge,Ie),V(e,me),V(me,_e),V(e,fe),V(fe,be),V(e,Me),V(Me,Ae),V(e,Se),V(Se,ot),V(Se,Oe)},p:st,i:st,o:st,d(Qe){Qe&&ft(e)}}}class bu extends Bn{constructor(e){super();jn(this,e,null,fu,En,{})}}function _(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function yu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Kr(t,e){for(var i=0;i<e.length;i++){var s=e[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,s.key,s)}}function wu(t,e,i){return e&&Kr(t.prototype,e),i&&Kr(t,i),t}function vu(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function ea(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),i.push.apply(i,s)}return i}function ta(t){for(var e=1;e<arguments.length;e++){var i=arguments[e]!=null?arguments[e]:{};e%2?ea(Object(i),!0).forEach(function(s){vu(t,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ea(Object(i)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(i,s))})}return t}var ia={addCSS:!0,thumbWidth:15,watch:!0};function xu(t,e){return function(){return Array.from(document.querySelectorAll(e)).includes(this)}.call(t,e)}function Mu(t,e){if(t&&e){var i=new Event(e,{bubbles:!0});t.dispatchEvent(i)}}var si=function(t){return t!=null?t.constructor:null},nr=function(t,e){return!!(t&&e&&t instanceof e)},Rn=function(t){return t==null},On=function(t){return si(t)===Object},Su=function(t){return si(t)===Number&&!Number.isNaN(t)},Un=function(t){return si(t)===String},Cu=function(t){return si(t)===Boolean},Iu=function(t){return si(t)===Function},Wn=function(t){return Array.isArray(t)},Hn=function(t){return nr(t,NodeList)},_u=function(t){return nr(t,Element)},Au=function(t){return nr(t,Event)},ku=function(t){return Rn(t)||(Un(t)||Wn(t)||Hn(t))&&!t.length||On(t)&&!Object.keys(t).length},ae={nullOrUndefined:Rn,object:On,number:Su,string:Un,boolean:Cu,function:Iu,array:Wn,nodeList:Hn,element:_u,event:Au,empty:ku};function Tu(t){var e="".concat(t).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return e?Math.max(0,(e[1]?e[1].length:0)-(e[2]?+e[2]:0)):0}function Nu(t,e){if(1>e){var i=Tu(e);return parseFloat(t.toFixed(i))}return Math.round(t/e)*e}var Eu=function(){function t(e,i){yu(this,t),ae.element(e)?this.element=e:ae.string(e)&&(this.element=document.querySelector(e)),ae.element(this.element)&&ae.empty(this.element.rangeTouch)&&(this.config=ta({},ia,{},i),this.init())}return wu(t,[{key:"init",value:function(){t.enabled&&(this.config.addCSS&&(this.element.style.userSelect="none",this.element.style.webKitUserSelect="none",this.element.style.touchAction="manipulation"),this.listeners(!0),this.element.rangeTouch=this)}},{key:"destroy",value:function(){t.enabled&&(this.config.addCSS&&(this.element.style.userSelect="",this.element.style.webKitUserSelect="",this.element.style.touchAction=""),this.listeners(!1),this.element.rangeTouch=null)}},{key:"listeners",value:function(e){var i=this,s=e?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach(function(r){i.element[s](r,function(a){return i.set(a)},!1)})}},{key:"get",value:function(e){if(!t.enabled||!ae.event(e))return null;var i,s=e.target,r=e.changedTouches[0],a=parseFloat(s.getAttribute("min"))||0,n=parseFloat(s.getAttribute("max"))||100,o=parseFloat(s.getAttribute("step"))||1,c=s.getBoundingClientRect(),l=100/c.width*(this.config.thumbWidth/2)/100;return 0>(i=100/c.width*(r.clientX-c.left))?i=0:100<i&&(i=100),50>i?i-=(100-2*i)*l:50<i&&(i+=2*(i-50)*l),a+Nu(i/100*(n-a),o)}},{key:"set",value:function(e){t.enabled&&ae.event(e)&&!e.target.disabled&&(e.preventDefault(),e.target.value=this.get(e),Mu(e.target,e.type==="touchend"?"change":"input"))}}],[{key:"setup",value:function(e){var i=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{},s=null;if(ae.empty(e)||ae.string(e)?s=Array.from(document.querySelectorAll(ae.string(e)?e:'input[type="range"]')):ae.element(e)?s=[e]:ae.nodeList(e)?s=Array.from(e):ae.array(e)&&(s=e.filter(ae.element)),ae.empty(s))return null;var r=ta({},ia,{},i);if(ae.string(e)&&r.watch){var a=new MutationObserver(function(n){Array.from(n).forEach(function(o){Array.from(o.addedNodes).forEach(function(c){ae.element(c)&&xu(c,e)&&new t(c,r)})})});a.observe(document.body,{childList:!0,subtree:!0})}return s.map(function(n){return new t(n,i)})}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}]),t}();const kt=t=>t!=null?t.constructor:null,Ye=(t,e)=>Boolean(t&&e&&t instanceof e),or=t=>t==null,Fn=t=>kt(t)===Object,Pu=t=>kt(t)===Number&&!Number.isNaN(t),Ri=t=>kt(t)===String,zu=t=>kt(t)===Boolean,Zn=t=>kt(t)===Function,Yn=t=>Array.isArray(t),Du=t=>Ye(t,WeakMap),Qn=t=>Ye(t,NodeList),Lu=t=>kt(t)===Text,Vu=t=>Ye(t,Event),$u=t=>Ye(t,KeyboardEvent),ju=t=>Ye(t,window.TextTrackCue)||Ye(t,window.VTTCue),Bu=t=>Ye(t,TextTrack)||!or(t)&&Ri(t.kind),Ru=t=>Ye(t,Promise)&&Zn(t.then),Ou=t=>t!==null&&typeof t=="object"&&t.nodeType===1&&typeof t.style=="object"&&typeof t.ownerDocument=="object",Gn=t=>or(t)||(Ri(t)||Yn(t)||Qn(t))&&!t.length||Fn(t)&&!Object.keys(t).length,Uu=t=>{if(Ye(t,window.URL))return!0;if(!Ri(t))return!1;let e=t;t.startsWith("http://")&&t.startsWith("https://")||(e=`http://${t}`);try{return!Gn(new URL(e).hostname)}catch{return!1}};var h={nullOrUndefined:or,object:Fn,number:Pu,string:Ri,boolean:zu,function:Zn,array:Yn,weakMap:Du,nodeList:Qn,element:Ou,textNode:Lu,event:Vu,keyboardEvent:$u,cue:ju,track:Bu,promise:Ru,url:Uu,empty:Gn};const As=(()=>{const t=document.createElement("span"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},i=Object.keys(e).find(s=>t.style[s]!==void 0);return!!h.string(i)&&e[i]})();function qn(t,e){setTimeout(()=>{try{t.hidden=!0,t.offsetHeight,t.hidden=!1}catch{}},e)}const re={isIE:Boolean(window.document.documentMode),isEdge:window.navigator.userAgent.includes("Edge"),isWebkit:"WebkitAppearance"in document.documentElement.style&&!/Edge/.test(navigator.userAgent),isIPhone:/(iPhone|iPod)/gi.test(navigator.platform),isIos:navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1||/(iPad|iPhone|iPod)/gi.test(navigator.platform)};function Wu(t){return JSON.parse(JSON.stringify(t))}function Jn(t,e){return e.split(".").reduce((i,s)=>i&&i[s],t)}function q(t={},...e){if(!e.length)return t;const i=e.shift();return h.object(i)?(Object.keys(i).forEach(s=>{h.object(i[s])?(Object.keys(t).includes(s)||Object.assign(t,{[s]:{}}),q(t[s],i[s])):Object.assign(t,{[s]:i[s]})}),q(t,...e)):t}function Xn(t,e){const i=t.length?t:[t];Array.from(i).reverse().forEach((s,r)=>{const a=r>0?e.cloneNode(!0):e,n=s.parentNode,o=s.nextSibling;a.appendChild(s),o?n.insertBefore(a,o):n.appendChild(a)})}function ks(t,e){h.element(t)&&!h.empty(e)&&Object.entries(e).filter(([,i])=>!h.nullOrUndefined(i)).forEach(([i,s])=>t.setAttribute(i,s))}function N(t,e,i){const s=document.createElement(t);return h.object(e)&&ks(s,e),h.string(i)&&(s.innerText=i),s}function Hu(t,e){h.element(t)&&h.element(e)&&e.parentNode.insertBefore(t,e.nextSibling)}function sa(t,e,i,s){h.element(e)&&e.appendChild(N(t,i,s))}function He(t){h.nodeList(t)||h.array(t)?Array.from(t).forEach(He):h.element(t)&&h.element(t.parentNode)&&t.parentNode.removeChild(t)}function wi(t){if(!h.element(t))return;let{length:e}=t.childNodes;for(;e>0;)t.removeChild(t.lastChild),e-=1}function Ai(t,e){return h.element(e)&&h.element(e.parentNode)&&h.element(t)?(e.parentNode.replaceChild(t,e),t):null}function Le(t,e){if(!h.string(t)||h.empty(t))return{};const i={},s=q({},e);return t.split(",").forEach(r=>{const a=r.trim(),n=a.replace(".",""),o=a.replace(/[[\]]/g,"").split("="),[c]=o,l=o.length>1?o[1].replace(/["']/g,""):"";switch(a.charAt(0)){case".":h.string(s.class)?i.class=`${s.class} ${n}`:i.class=n;break;case"#":i.id=a.replace("#","");break;case"[":i[c]=l}}),q(s,i)}function ct(t,e){if(!h.element(t))return;let i=e;h.boolean(i)||(i=!t.hidden),t.hidden=i}function W(t,e,i){if(h.nodeList(t))return Array.from(t).map(s=>W(s,e,i));if(h.element(t)){let s="toggle";return i!==void 0&&(s=i?"add":"remove"),t.classList[s](e),t.classList.contains(e)}return!1}function ki(t,e){return h.element(t)&&t.classList.contains(e)}function ht(t,e){const{prototype:i}=Element;return(i.matches||i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector||function(){return Array.from(document.querySelectorAll(e)).includes(this)}).call(t,e)}function Fu(t,e){const{prototype:i}=Element;return(i.closest||function(){let s=this;do{if(ht.matches(s,e))return s;s=s.parentElement||s.parentNode}while(s!==null&&s.nodeType===1);return null}).call(t,e)}function xt(t){return this.elements.container.querySelectorAll(t)}function X(t){return this.elements.container.querySelector(t)}function os(t=null,e=!1){h.element(t)&&(t.focus({preventScroll:!0}),e&&W(t,this.config.classNames.tabFocus))}const ra={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},G={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check(t,e,i){const s=re.isIPhone&&i&&G.playsinline,r=G[t]||e!=="html5";return{api:r,ui:r&&G.rangeInput&&(t!=="video"||!re.isIPhone||s)}},pip:!(re.isIPhone||!h.function(N("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||N("video").disablePictureInPicture)),airplay:h.function(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime(t){if(h.empty(t))return!1;const[e]=t.split("/");let i=t;if(!this.isHTML5||e!==this.type)return!1;Object.keys(ra).includes(i)&&(i+=`; codecs="${ra[t]}"`);try{return Boolean(i&&this.media.canPlayType(i).replace(/no/,""))}catch{return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(()=>{const t=document.createElement("input");return t.type="range",t.type==="range"})(),touch:"ontouchstart"in document.documentElement,transitions:As!==!1,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},Zu=(()=>{let t=!1;try{const e=Object.defineProperty({},"passive",{get:()=>(t=!0,null)});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch{}return t})();function Mt(t,e,i,s=!1,r=!0,a=!1){if(!t||!("addEventListener"in t)||h.empty(e)||!h.function(i))return;const n=e.split(" ");let o=a;Zu&&(o={passive:r,capture:a}),n.forEach(c=>{this&&this.eventListeners&&s&&this.eventListeners.push({element:t,type:c,callback:i,options:o}),t[s?"addEventListener":"removeEventListener"](c,i,o)})}function H(t,e="",i,s=!0,r=!1){Mt.call(this,t,e,i,!0,s,r)}function Oi(t,e="",i,s=!0,r=!1){Mt.call(this,t,e,i,!1,s,r)}function lr(t,e="",i,s=!0,r=!1){const a=(...n)=>{Oi(t,e,a,s,r),i.apply(this,n)};Mt.call(this,t,e,a,!0,s,r)}function E(t,e="",i=!1,s={}){if(!h.element(t)||h.empty(e))return;const r=new CustomEvent(e,{bubbles:i,detail:ye(O({},s),{plyr:this})});t.dispatchEvent(r)}function Yu(){this&&this.eventListeners&&(this.eventListeners.forEach(t=>{const{element:e,type:i,callback:s,options:r}=t;e.removeEventListener(i,s,r)}),this.eventListeners=[])}function Qu(){return new Promise(t=>this.ready?setTimeout(t,0):H.call(this,this.elements.container,"ready",t)).then(()=>{})}function Be(t){h.promise(t)&&t.then(null,()=>{})}function Ts(t){return h.array(t)?t.filter((e,i)=>t.indexOf(e)===i):t}function Kn(t,e){return h.array(t)&&t.length?t.reduce((i,s)=>Math.abs(s-e)<Math.abs(i-e)?s:i):null}function eo(t){return!(!window||!window.CSS)&&window.CSS.supports(t)}const aa=[[1,1],[4,3],[3,4],[5,4],[4,5],[3,2],[2,3],[16,10],[10,16],[16,9],[9,16],[21,9],[9,21],[32,9],[9,32]].reduce((t,[e,i])=>ye(O({},t),{[e/i]:[e,i]}),{});function to(t){return h.array(t)||h.string(t)&&t.includes(":")?(h.array(t)?t:t.split(":")).map(Number).every(h.number):!1}function Ti(t){if(!h.array(t)||!t.every(h.number))return null;const[e,i]=t,s=(a,n)=>n===0?a:s(n,a%n),r=s(e,i);return[e/r,i/r]}function cr(t){const e=s=>to(s)?s.split(":").map(Number):null;let i=e(t);if(i===null&&(i=e(this.config.ratio)),i===null&&!h.empty(this.embed)&&h.array(this.embed.ratio)&&({ratio:i}=this.embed),i===null&&this.isHTML5){const{videoWidth:s,videoHeight:r}=this.media;i=[s,r]}return Ti(i)}function It(t){if(!this.isVideo)return{};const{wrapper:e}=this.elements,i=cr.call(this,t);if(!h.array(i))return{};const[s,r]=Ti(i),a=100/s*r;if(eo(`aspect-ratio: ${s}/${r}`)?e.style.aspectRatio=`${s}/${r}`:e.style.paddingBottom=`${a}%`,this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){const n=100/this.media.offsetWidth*parseInt(window.getComputedStyle(this.media).paddingBottom,10),o=(n-a)/(n/50);this.fullscreen.active?e.style.paddingBottom=null:this.media.style.transform=`translateY(-${o}%)`}else this.isHTML5&&e.classList.add(this.config.classNames.videoFixedRatio);return{padding:a,ratio:i}}function io(t,e,i=.05){const s=t/e,r=Kn(Object.keys(aa),s);return Math.abs(r-s)<=i?aa[r]:[t,e]}function Gu(){return[Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)]}const Ke={getSources(){return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter(t=>{const e=t.getAttribute("type");return!!h.empty(e)||G.mime.call(this,e)}):[]},getQualityOptions(){return this.config.quality.forced?this.config.quality.options:Ke.getSources.call(this).map(t=>Number(t.getAttribute("size"))).filter(Boolean)},setup(){if(!this.isHTML5)return;const t=this;t.options.speed=t.config.speed.options,h.empty(this.config.ratio)||It.call(t),Object.defineProperty(t.media,"quality",{get(){const e=Ke.getSources.call(t).find(i=>i.getAttribute("src")===t.source);return e&&Number(e.getAttribute("size"))},set(e){if(t.quality!==e){if(t.config.quality.forced&&h.function(t.config.quality.onChange))t.config.quality.onChange(e);else{const i=Ke.getSources.call(t).find(c=>Number(c.getAttribute("size"))===e);if(!i)return;const{currentTime:s,paused:r,preload:a,readyState:n,playbackRate:o}=t.media;t.media.src=i.getAttribute("src"),(a!=="none"||n)&&(t.once("loadedmetadata",()=>{t.speed=o,t.currentTime=s,r||Be(t.play())}),t.media.load())}E.call(t,t.media,"qualitychange",!1,{quality:e})}}})},cancelRequests(){this.isHTML5&&(He(Ke.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function qu(t){return`${t}-${Math.floor(1e4*Math.random())}`}function Ns(t,...e){return h.empty(t)?t:t.toString().replace(/{(\d+)}/g,(i,s)=>e[s].toString())}function Ju(t,e){return t===0||e===0||Number.isNaN(t)||Number.isNaN(e)?0:(t/e*100).toFixed(2)}const Ft=(t="",e="",i="")=>t.replace(new RegExp(e.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),i.toString()),so=(t="")=>t.toString().replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase());function Xu(t=""){let e=t.toString();return e=Ft(e,"-"," "),e=Ft(e,"_"," "),e=so(e),Ft(e," ","")}function Ku(t=""){let e=t.toString();return e=Xu(e),e.charAt(0).toLowerCase()+e.slice(1)}function ep(t){const e=document.createDocumentFragment(),i=document.createElement("div");return e.appendChild(i),i.innerHTML=t,e.firstChild.innerText}function tp(t){const e=document.createElement("div");return e.appendChild(t),e.innerHTML}const na={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},K={get(t="",e={}){if(h.empty(t)||h.empty(e))return"";let i=Jn(e.i18n,t);if(h.empty(i))return Object.keys(na).includes(t)?na[t]:"";const s={"{seektime}":e.seekTime,"{title}":e.title};return Object.entries(s).forEach(([r,a])=>{i=Ft(i,r,a)}),i}};class Jt{constructor(e){_(this,"get",i=>{if(!Jt.supported||!this.enabled)return null;const s=window.localStorage.getItem(this.key);if(h.empty(s))return null;const r=JSON.parse(s);return h.string(i)&&i.length?r[i]:r}),_(this,"set",i=>{if(!Jt.supported||!this.enabled||!h.object(i))return;let s=this.get();h.empty(s)&&(s={}),q(s,i);try{window.localStorage.setItem(this.key,JSON.stringify(s))}catch{}}),this.enabled=e.config.storage.enabled,this.key=e.config.storage.key}static get supported(){try{if(!("localStorage"in window))return!1;const e="___test";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch{return!1}}}function ri(t,e="text"){return new Promise((i,s)=>{try{const r=new XMLHttpRequest;if(!("withCredentials"in r))return;r.addEventListener("load",()=>{if(e==="text")try{i(JSON.parse(r.responseText))}catch{i(r.responseText)}else i(r.response)}),r.addEventListener("error",()=>{throw new Error(r.status)}),r.open("GET",t,!0),r.responseType=e,r.send()}catch(r){s(r)}})}function ro(t,e){if(!h.string(t))return;const i=h.string(e);let s=!1;const r=()=>document.getElementById(e)!==null,a=(n,o)=>{n.innerHTML=o,i&&r()||document.body.insertAdjacentElement("afterbegin",n)};if(!i||!r()){const n=Jt.supported,o=document.createElement("div");if(o.setAttribute("hidden",""),i&&o.setAttribute("id",e),n){const c=window.localStorage.getItem(`cache-${e}`);if(s=c!==null,s){const l=JSON.parse(c);a(o,l.content)}}ri(t).then(c=>{if(!h.empty(c)){if(n)try{window.localStorage.setItem(`cache-${e}`,JSON.stringify({content:c}))}catch{}a(o,c)}}).catch(()=>{})}}const ao=t=>Math.trunc(t/60/60%60,10),ip=t=>Math.trunc(t%60,10);function Ui(t=0,e=!1,i=!1){if(!h.number(t))return Ui(void 0,e,i);const s=c=>`0${c}`.slice(-2);let r=ao(t);const a=(n=t,Math.trunc(n/60%60,10));var n;const o=ip(t);return r=e||r>0?`${r}:`:"",`${i&&t>0?"-":""}${r}${s(a)}:${s(o)}`}const S={getIconUrl(){const t=new URL(this.config.iconUrl,window.location),e=window.location.host?window.location.host:window.top.location.host,i=t.host!==e||re.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:i}},findElements(){try{return this.elements.controls=X.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:xt.call(this,this.config.selectors.buttons.play),pause:X.call(this,this.config.selectors.buttons.pause),restart:X.call(this,this.config.selectors.buttons.restart),rewind:X.call(this,this.config.selectors.buttons.rewind),fastForward:X.call(this,this.config.selectors.buttons.fastForward),mute:X.call(this,this.config.selectors.buttons.mute),pip:X.call(this,this.config.selectors.buttons.pip),airplay:X.call(this,this.config.selectors.buttons.airplay),settings:X.call(this,this.config.selectors.buttons.settings),captions:X.call(this,this.config.selectors.buttons.captions),fullscreen:X.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=X.call(this,this.config.selectors.progress),this.elements.inputs={seek:X.call(this,this.config.selectors.inputs.seek),volume:X.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:X.call(this,this.config.selectors.display.buffer),currentTime:X.call(this,this.config.selectors.display.currentTime),duration:X.call(this,this.config.selectors.display.duration)},h.element(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(`.${this.config.classNames.tooltip}`)),!0}catch(t){return this.debug.warn("It looks like there is a problem with your custom controls HTML",t),this.toggleNativeControls(!0),!1}},createIcon(t,e){const i="http://www.w3.org/2000/svg",s=S.getIconUrl.call(this),r=`${s.cors?"":s.url}#${this.config.iconPrefix}`,a=document.createElementNS(i,"svg");ks(a,q(e,{"aria-hidden":"true",focusable:"false"}));const n=document.createElementNS(i,"use"),o=`${r}-${t}`;return"href"in n&&n.setAttributeNS("http://www.w3.org/1999/xlink","href",o),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o),a.appendChild(n),a},createLabel(t,e={}){const i=K.get(t,this.config);return N("span",ye(O({},e),{class:[e.class,this.config.classNames.hidden].filter(Boolean).join(" ")}),i)},createBadge(t){if(h.empty(t))return null;const e=N("span",{class:this.config.classNames.menu.value});return e.appendChild(N("span",{class:this.config.classNames.menu.badge},t)),e},createButton(t,e){const i=q({},e);let s=Ku(t);const r={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach(n=>{Object.keys(i).includes(n)&&(r[n]=i[n],delete i[n])}),r.element!=="button"||Object.keys(i).includes("type")||(i.type="button"),Object.keys(i).includes("class")?i.class.split(" ").some(n=>n===this.config.classNames.control)||q(i,{class:`${i.class} ${this.config.classNames.control}`}):i.class=this.config.classNames.control,t){case"play":r.toggle=!0,r.label="play",r.labelPressed="pause",r.icon="play",r.iconPressed="pause";break;case"mute":r.toggle=!0,r.label="mute",r.labelPressed="unmute",r.icon="volume",r.iconPressed="muted";break;case"captions":r.toggle=!0,r.label="enableCaptions",r.labelPressed="disableCaptions",r.icon="captions-off",r.iconPressed="captions-on";break;case"fullscreen":r.toggle=!0,r.label="enterFullscreen",r.labelPressed="exitFullscreen",r.icon="enter-fullscreen",r.iconPressed="exit-fullscreen";break;case"play-large":i.class+=` ${this.config.classNames.control}--overlaid`,s="play",r.label="play",r.icon="play";break;default:h.empty(r.label)&&(r.label=s),h.empty(r.icon)&&(r.icon=t)}const a=N(r.element);return r.toggle?(a.appendChild(S.createIcon.call(this,r.iconPressed,{class:"icon--pressed"})),a.appendChild(S.createIcon.call(this,r.icon,{class:"icon--not-pressed"})),a.appendChild(S.createLabel.call(this,r.labelPressed,{class:"label--pressed"})),a.appendChild(S.createLabel.call(this,r.label,{class:"label--not-pressed"}))):(a.appendChild(S.createIcon.call(this,r.icon)),a.appendChild(S.createLabel.call(this,r.label))),q(i,Le(this.config.selectors.buttons[s],i)),ks(a,i),s==="play"?(h.array(this.elements.buttons[s])||(this.elements.buttons[s]=[]),this.elements.buttons[s].push(a)):this.elements.buttons[s]=a,a},createRange(t,e){const i=N("input",q(Le(this.config.selectors.inputs[t]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":K.get(t,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},e));return this.elements.inputs[t]=i,S.updateRangeFill.call(this,i),Eu.setup(i),i},createProgress(t,e){const i=N("progress",q(Le(this.config.selectors.display[t]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},e));if(t!=="volume"){i.appendChild(N("span",null,"0"));const s={played:"played",buffer:"buffered"}[t],r=s?K.get(s,this.config):"";i.innerText=`% ${r.toLowerCase()}`}return this.elements.display[t]=i,i},createTime(t,e){const i=Le(this.config.selectors.display[t],e),s=N("div",q(i,{class:`${i.class?i.class:""} ${this.config.classNames.display.time} `.trim(),"aria-label":K.get(t,this.config)}),"00:00");return this.elements.display[t]=s,s},bindMenuItemShortcuts(t,e){H.call(this,t,"keydown keyup",i=>{if(!["Space","ArrowUp","ArrowDown","ArrowRight"].includes(i.key)||(i.preventDefault(),i.stopPropagation(),i.type==="keydown"))return;const s=ht(t,'[role="menuitemradio"]');if(!s&&["Space","ArrowRight"].includes(i.key))S.showMenuPanel.call(this,e,!0);else{let r;i.key!=="Space"&&(i.key==="ArrowDown"||s&&i.key==="ArrowRight"?(r=t.nextElementSibling,h.element(r)||(r=t.parentNode.firstElementChild)):(r=t.previousElementSibling,h.element(r)||(r=t.parentNode.lastElementChild)),os.call(this,r,!0))}},!1),H.call(this,t,"keyup",i=>{i.key==="Return"&&S.focusFirstMenuItem.call(this,null,!0)})},createMenuItem({value:t,list:e,type:i,title:s,badge:r=null,checked:a=!1}){const n=Le(this.config.selectors.inputs[i]),o=N("button",q(n,{type:"button",role:"menuitemradio",class:`${this.config.classNames.control} ${n.class?n.class:""}`.trim(),"aria-checked":a,value:t})),c=N("span");c.innerHTML=s,h.element(r)&&c.appendChild(r),o.appendChild(c),Object.defineProperty(o,"checked",{enumerable:!0,get:()=>o.getAttribute("aria-checked")==="true",set(l){l&&Array.from(o.parentNode.children).filter(d=>ht(d,'[role="menuitemradio"]')).forEach(d=>d.setAttribute("aria-checked","false")),o.setAttribute("aria-checked",l?"true":"false")}}),this.listeners.bind(o,"click keyup",l=>{if(!h.keyboardEvent(l)||l.key==="Space"){switch(l.preventDefault(),l.stopPropagation(),o.checked=!0,i){case"language":this.currentTrack=Number(t);break;case"quality":this.quality=t;break;case"speed":this.speed=parseFloat(t)}S.showMenuPanel.call(this,"home",h.keyboardEvent(l))}},i,!1),S.bindMenuItemShortcuts.call(this,o,i),e.appendChild(o)},formatTime(t=0,e=!1){return h.number(t)?Ui(t,ao(this.duration)>0,e):t},updateTimeDisplay(t=null,e=0,i=!1){h.element(t)&&h.number(e)&&(t.innerText=S.formatTime(e,i))},updateVolume(){this.supported.ui&&(h.element(this.elements.inputs.volume)&&S.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),h.element(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||this.volume===0))},setRange(t,e=0){h.element(t)&&(t.value=e,S.updateRangeFill.call(this,t))},updateProgress(t){if(!this.supported.ui||!h.event(t))return;let e=0;const i=(s,r)=>{const a=h.number(r)?r:0,n=h.element(s)?s:this.elements.display.buffer;if(h.element(n)){n.value=a;const o=n.getElementsByTagName("span")[0];h.element(o)&&(o.childNodes[0].nodeValue=a)}};if(t)switch(t.type){case"timeupdate":case"seeking":case"seeked":e=Ju(this.currentTime,this.duration),t.type==="timeupdate"&&S.setRange.call(this,this.elements.inputs.seek,e);break;case"playing":case"progress":i(this.elements.display.buffer,100*this.buffered)}},updateRangeFill(t){const e=h.event(t)?t.target:t;if(h.element(e)&&e.getAttribute("type")==="range"){if(ht(e,this.config.selectors.inputs.seek)){e.setAttribute("aria-valuenow",this.currentTime);const i=S.formatTime(this.currentTime),s=S.formatTime(this.duration),r=K.get("seekLabel",this.config);e.setAttribute("aria-valuetext",r.replace("{currentTime}",i).replace("{duration}",s))}else if(ht(e,this.config.selectors.inputs.volume)){const i=100*e.value;e.setAttribute("aria-valuenow",i),e.setAttribute("aria-valuetext",`${i.toFixed(1)}%`)}else e.setAttribute("aria-valuenow",e.value);re.isWebkit&&e.style.setProperty("--value",e.value/e.max*100+"%")}},updateSeekTooltip(t){var e,i;if(!this.config.tooltips.seek||!h.element(this.elements.inputs.seek)||!h.element(this.elements.display.seekTooltip)||this.duration===0)return;const s=this.elements.display.seekTooltip,r=`${this.config.classNames.tooltip}--visible`,a=d=>W(s,r,d);if(this.touch)return void a(!1);let n=0;const o=this.elements.progress.getBoundingClientRect();if(h.event(t))n=100/o.width*(t.pageX-o.left);else{if(!ki(s,r))return;n=parseFloat(s.style.left,10)}n<0?n=0:n>100&&(n=100);const c=this.duration/100*n;s.innerText=S.formatTime(c);const l=(e=this.config.markers)===null||e===void 0||(i=e.points)===null||i===void 0?void 0:i.find(({time:d})=>d===Math.round(c));l&&s.insertAdjacentHTML("afterbegin",`${l.label}<br>`),s.style.left=`${n}%`,h.event(t)&&["mouseenter","mouseleave"].includes(t.type)&&a(t.type==="mouseenter")},timeUpdate(t){const e=!h.element(this.elements.display.duration)&&this.config.invertTime;S.updateTimeDisplay.call(this,this.elements.display.currentTime,e?this.duration-this.currentTime:this.currentTime,e),t&&t.type==="timeupdate"&&this.media.seeking||S.updateProgress.call(this,t)},durationUpdate(){if(!this.supported.ui||!this.config.invertTime&&this.currentTime)return;if(this.duration>=2**32)return ct(this.elements.display.currentTime,!0),void ct(this.elements.progress,!0);h.element(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);const t=h.element(this.elements.display.duration);!t&&this.config.displayDuration&&this.paused&&S.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),t&&S.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),this.config.markers.enabled&&S.setMarkers.call(this),S.updateSeekTooltip.call(this)},toggleMenuButton(t,e){ct(this.elements.settings.buttons[t],!e)},updateSetting(t,e,i){const s=this.elements.settings.panels[t];let r=null,a=e;if(t==="captions")r=this.currentTrack;else{if(r=h.empty(i)?this[t]:i,h.empty(r)&&(r=this.config[t].default),!h.empty(this.options[t])&&!this.options[t].includes(r))return void this.debug.warn(`Unsupported value of '${r}' for ${t}`);if(!this.config[t].options.includes(r))return void this.debug.warn(`Disabled value of '${r}' for ${t}`)}if(h.element(a)||(a=s&&s.querySelector('[role="menu"]')),!h.element(a))return;this.elements.settings.buttons[t].querySelector(`.${this.config.classNames.menu.value}`).innerHTML=S.getLabel.call(this,t,r);const n=a&&a.querySelector(`[value="${r}"]`);h.element(n)&&(n.checked=!0)},getLabel(t,e){switch(t){case"speed":return e===1?K.get("normal",this.config):`${e}×`;case"quality":if(h.number(e)){const i=K.get(`qualityLabel.${e}`,this.config);return i.length?i:`${e}p`}return so(e);case"captions":return F.getLabel.call(this);default:return null}},setQualityMenu(t){if(!h.element(this.elements.settings.panels.quality))return;const e="quality",i=this.elements.settings.panels.quality.querySelector('[role="menu"]');h.array(t)&&(this.options.quality=Ts(t).filter(a=>this.config.quality.options.includes(a)));const s=!h.empty(this.options.quality)&&this.options.quality.length>1;if(S.toggleMenuButton.call(this,e,s),wi(i),S.checkMenu.call(this),!s)return;const r=a=>{const n=K.get(`qualityBadge.${a}`,this.config);return n.length?S.createBadge.call(this,n):null};this.options.quality.sort((a,n)=>{const o=this.config.quality.options;return o.indexOf(a)>o.indexOf(n)?1:-1}).forEach(a=>{S.createMenuItem.call(this,{value:a,list:i,type:e,title:S.getLabel.call(this,"quality",a),badge:r(a)})}),S.updateSetting.call(this,e,i)},setCaptionsMenu(){if(!h.element(this.elements.settings.panels.captions))return;const t="captions",e=this.elements.settings.panels.captions.querySelector('[role="menu"]'),i=F.getTracks.call(this),s=Boolean(i.length);if(S.toggleMenuButton.call(this,t,s),wi(e),S.checkMenu.call(this),!s)return;const r=i.map((a,n)=>({value:n,checked:this.captions.toggled&&this.currentTrack===n,title:F.getLabel.call(this,a),badge:a.language&&S.createBadge.call(this,a.language.toUpperCase()),list:e,type:"language"}));r.unshift({value:-1,checked:!this.captions.toggled,title:K.get("disabled",this.config),list:e,type:"language"}),r.forEach(S.createMenuItem.bind(this)),S.updateSetting.call(this,t,e)},setSpeedMenu(){if(!h.element(this.elements.settings.panels.speed))return;const t="speed",e=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter(s=>s>=this.minimumSpeed&&s<=this.maximumSpeed);const i=!h.empty(this.options.speed)&&this.options.speed.length>1;S.toggleMenuButton.call(this,t,i),wi(e),S.checkMenu.call(this),i&&(this.options.speed.forEach(s=>{S.createMenuItem.call(this,{value:s,list:e,type:t,title:S.getLabel.call(this,"speed",s)})}),S.updateSetting.call(this,t,e))},checkMenu(){const{buttons:t}=this.elements.settings,e=!h.empty(t)&&Object.values(t).some(i=>!i.hidden);ct(this.elements.settings.menu,!e)},focusFirstMenuItem(t,e=!1){if(this.elements.settings.popup.hidden)return;let i=t;h.element(i)||(i=Object.values(this.elements.settings.panels).find(r=>!r.hidden));const s=i.querySelector('[role^="menuitem"]');os.call(this,s,e)},toggleMenu(t){const{popup:e}=this.elements.settings,i=this.elements.buttons.settings;if(!h.element(e)||!h.element(i))return;const{hidden:s}=e;let r=s;if(h.boolean(t))r=t;else if(h.keyboardEvent(t)&&t.key==="Escape")r=!1;else if(h.event(t)){const a=h.function(t.composedPath)?t.composedPath()[0]:t.target,n=e.contains(a);if(n||!n&&t.target!==i&&r)return}i.setAttribute("aria-expanded",r),ct(e,!r),W(this.elements.container,this.config.classNames.menu.open,r),r&&h.keyboardEvent(t)?S.focusFirstMenuItem.call(this,null,!0):r||s||os.call(this,i,h.keyboardEvent(t))},getMenuSize(t){const e=t.cloneNode(!0);e.style.position="absolute",e.style.opacity=0,e.removeAttribute("hidden"),t.parentNode.appendChild(e);const i=e.scrollWidth,s=e.scrollHeight;return He(e),{width:i,height:s}},showMenuPanel(t="",e=!1){const i=this.elements.container.querySelector(`#plyr-settings-${this.id}-${t}`);if(!h.element(i))return;const s=i.parentNode,r=Array.from(s.children).find(a=>!a.hidden);if(G.transitions&&!G.reducedMotion){s.style.width=`${r.scrollWidth}px`,s.style.height=`${r.scrollHeight}px`;const a=S.getMenuSize.call(this,i),n=o=>{o.target===s&&["width","height"].includes(o.propertyName)&&(s.style.width="",s.style.height="",Oi.call(this,s,As,n))};H.call(this,s,As,n),s.style.width=`${a.width}px`,s.style.height=`${a.height}px`}ct(r,!0),ct(i,!1),S.focusFirstMenuItem.call(this,i,e)},setDownloadUrl(){const t=this.elements.buttons.download;h.element(t)&&t.setAttribute("href",this.download)},create(t){const{bindMenuItemShortcuts:e,createButton:i,createProgress:s,createRange:r,createTime:a,setQualityMenu:n,setSpeedMenu:o,showMenuPanel:c}=S;this.elements.controls=null,h.array(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(i.call(this,"play-large"));const l=N("div",Le(this.config.selectors.controls.wrapper));this.elements.controls=l;const d={class:"plyr__controls__item"};return Ts(h.array(this.config.controls)?this.config.controls:[]).forEach(u=>{if(u==="restart"&&l.appendChild(i.call(this,"restart",d)),u==="rewind"&&l.appendChild(i.call(this,"rewind",d)),u==="play"&&l.appendChild(i.call(this,"play",d)),u==="fast-forward"&&l.appendChild(i.call(this,"fast-forward",d)),u==="progress"){const p=N("div",{class:`${d.class} plyr__progress__container`}),m=N("div",Le(this.config.selectors.progress));if(m.appendChild(r.call(this,"seek",{id:`plyr-seek-${t.id}`})),m.appendChild(s.call(this,"buffer")),this.config.tooltips.seek){const g=N("span",{class:this.config.classNames.tooltip},"00:00");m.appendChild(g),this.elements.display.seekTooltip=g}this.elements.progress=m,p.appendChild(this.elements.progress),l.appendChild(p)}if(u==="current-time"&&l.appendChild(a.call(this,"currentTime",d)),u==="duration"&&l.appendChild(a.call(this,"duration",d)),u==="mute"||u==="volume"){let{volume:p}=this.elements;if(h.element(p)&&l.contains(p)||(p=N("div",q({},d,{class:`${d.class} plyr__volume`.trim()})),this.elements.volume=p,l.appendChild(p)),u==="mute"&&p.appendChild(i.call(this,"mute")),u==="volume"&&!re.isIos){const m={max:1,step:.05,value:this.config.volume};p.appendChild(r.call(this,"volume",q(m,{id:`plyr-volume-${t.id}`})))}}if(u==="captions"&&l.appendChild(i.call(this,"captions",d)),u==="settings"&&!h.empty(this.config.settings)){const p=N("div",q({},d,{class:`${d.class} plyr__menu`.trim(),hidden:""}));p.appendChild(i.call(this,"settings",{"aria-haspopup":!0,"aria-controls":`plyr-settings-${t.id}`,"aria-expanded":!1}));const m=N("div",{class:"plyr__menu__container",id:`plyr-settings-${t.id}`,hidden:""}),g=N("div"),f=N("div",{id:`plyr-settings-${t.id}-home`}),b=N("div",{role:"menu"});f.appendChild(b),g.appendChild(f),this.elements.settings.panels.home=f,this.config.settings.forEach(v=>{const x=N("button",q(Le(this.config.selectors.buttons.settings),{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--forward`,role:"menuitem","aria-haspopup":!0,hidden:""}));e.call(this,x,v),H.call(this,x,"click",()=>{c.call(this,v,!1)});const y=N("span",null,K.get(v,this.config)),k=N("span",{class:this.config.classNames.menu.value});k.innerHTML=t[v],y.appendChild(k),x.appendChild(y),b.appendChild(x);const z=N("div",{id:`plyr-settings-${t.id}-${v}`,hidden:""}),T=N("button",{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--back`});T.appendChild(N("span",{"aria-hidden":!0},K.get(v,this.config))),T.appendChild(N("span",{class:this.config.classNames.hidden},K.get("menuBack",this.config))),H.call(this,z,"keydown",R=>{R.key==="ArrowLeft"&&(R.preventDefault(),R.stopPropagation(),c.call(this,"home",!0))},!1),H.call(this,T,"click",()=>{c.call(this,"home",!1)}),z.appendChild(T),z.appendChild(N("div",{role:"menu"})),g.appendChild(z),this.elements.settings.buttons[v]=x,this.elements.settings.panels[v]=z}),m.appendChild(g),p.appendChild(m),l.appendChild(p),this.elements.settings.popup=m,this.elements.settings.menu=p}if(u==="pip"&&G.pip&&l.appendChild(i.call(this,"pip",d)),u==="airplay"&&G.airplay&&l.appendChild(i.call(this,"airplay",d)),u==="download"){const p=q({},d,{element:"a",href:this.download,target:"_blank"});this.isHTML5&&(p.download="");const{download:m}=this.config.urls;!h.url(m)&&this.isEmbed&&q(p,{icon:`logo-${this.provider}`,label:this.provider}),l.appendChild(i.call(this,"download",p))}u==="fullscreen"&&l.appendChild(i.call(this,"fullscreen",d))}),this.isHTML5&&n.call(this,Ke.getQualityOptions.call(this)),o.call(this),l},inject(){if(this.config.loadSprite){const r=S.getIconUrl.call(this);r.cors&&ro(r.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());let t=null;this.elements.controls=null;const e={id:this.id,seektime:this.config.seekTime,title:this.config.title};let i=!0;h.function(this.config.controls)&&(this.config.controls=this.config.controls.call(this,e)),this.config.controls||(this.config.controls=[]),h.element(this.config.controls)||h.string(this.config.controls)?t=this.config.controls:(t=S.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:F.getLabel.call(this)}),i=!1);let s;if(i&&h.string(this.config.controls)&&(t=(r=>{let a=r;return Object.entries(e).forEach(([n,o])=>{a=Ft(a,`{${n}}`,o)}),a})(t)),h.string(this.config.selectors.controls.container)&&(s=document.querySelector(this.config.selectors.controls.container)),h.element(s)||(s=this.elements.container),s[h.element(t)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",t),h.element(this.elements.controls)||S.findElements.call(this),!h.empty(this.elements.buttons)){const r=a=>{const n=this.config.classNames.controlPressed;Object.defineProperty(a,"pressed",{enumerable:!0,get:()=>ki(a,n),set(o=!1){W(a,n,o)}})};Object.values(this.elements.buttons).filter(Boolean).forEach(a=>{h.array(a)||h.nodeList(a)?Array.from(a).filter(Boolean).forEach(r):r(a)})}if(re.isEdge&&qn(s),this.config.tooltips.controls){const{classNames:r,selectors:a}=this.config,n=`${a.controls.wrapper} ${a.labels} .${r.hidden}`,o=xt.call(this,n);Array.from(o).forEach(c=>{W(c,this.config.classNames.hidden,!1),W(c,this.config.classNames.tooltip,!0)})}},setMediaMetadata(){try{"mediaSession"in navigator&&(navigator.mediaSession.metadata=new window.MediaMetadata({title:this.config.mediaMetadata.title,artist:this.config.mediaMetadata.artist,album:this.config.mediaMetadata.album,artwork:this.config.mediaMetadata.artwork}))}catch{}},setMarkers(){var t,e;if(!this.duration||this.elements.markers)return;const i=(t=this.config.markers)===null||t===void 0||(e=t.points)===null||e===void 0?void 0:e.filter(({time:c})=>c>0&&c<this.duration);if(i==null||!i.length)return;const s=document.createDocumentFragment(),r=document.createDocumentFragment();let a=null;const n=`${this.config.classNames.tooltip}--visible`,o=c=>W(a,n,c);i.forEach(c=>{const l=N("span",{class:this.config.classNames.marker},""),d=c.time/this.duration*100+"%";a&&(l.addEventListener("mouseenter",()=>{c.label||(a.style.left=d,a.innerHTML=c.label,o(!0))}),l.addEventListener("mouseleave",()=>{o(!1)})),l.addEventListener("click",()=>{this.currentTime=c.time}),l.style.left=d,r.appendChild(l)}),s.appendChild(r),this.config.tooltips.seek||(a=N("span",{class:this.config.classNames.tooltip},""),s.appendChild(a)),this.elements.markers={points:r,tip:a},this.elements.progress.appendChild(s)}};function no(t,e=!0){let i=t;if(e){const s=document.createElement("a");s.href=i,i=s.href}try{return new URL(i)}catch{return null}}function oo(t){const e=new URLSearchParams;return h.object(t)&&Object.entries(t).forEach(([i,s])=>{e.set(i,s)}),e}const F={setup(){if(!this.supported.ui)return;if(!this.isVideo||this.isYouTube||this.isHTML5&&!G.textTracks)return void(h.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&S.setCaptionsMenu.call(this));if(h.element(this.elements.captions)||(this.elements.captions=N("div",Le(this.config.selectors.captions)),Hu(this.elements.captions,this.elements.wrapper)),re.isIE&&window.URL){const s=this.media.querySelectorAll("track");Array.from(s).forEach(r=>{const a=r.getAttribute("src"),n=no(a);n!==null&&n.hostname!==window.location.href.hostname&&["http:","https:"].includes(n.protocol)&&ri(a,"blob").then(o=>{r.setAttribute("src",window.URL.createObjectURL(o))}).catch(()=>{He(r)})})}const t=Ts((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map(s=>s.split("-")[0]));let e=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();e==="auto"&&([e]=t);let i=this.storage.get("captions");if(h.boolean(i)||({active:i}=this.config.captions),Object.assign(this.captions,{toggled:!1,active:i,language:e,languages:t}),this.isHTML5){const s=this.config.captions.update?"addtrack removetrack":"removetrack";H.call(this,this.media.textTracks,s,F.update.bind(this))}setTimeout(F.update.bind(this),0)},update(){const t=F.getTracks.call(this,!0),{active:e,language:i,meta:s,currentTrackNode:r}=this.captions,a=Boolean(t.find(n=>n.language===i));this.isHTML5&&this.isVideo&&t.filter(n=>!s.get(n)).forEach(n=>{this.debug.log("Track added",n),s.set(n,{default:n.mode==="showing"}),n.mode==="showing"&&(n.mode="hidden"),H.call(this,n,"cuechange",()=>F.updateCues.call(this))}),(a&&this.language!==i||!t.includes(r))&&(F.setLanguage.call(this,i),F.toggle.call(this,e&&a)),this.elements&&W(this.elements.container,this.config.classNames.captions.enabled,!h.empty(t)),h.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&S.setCaptionsMenu.call(this)},toggle(t,e=!0){if(!this.supported.ui)return;const{toggled:i}=this.captions,s=this.config.classNames.captions.active,r=h.nullOrUndefined(t)?!i:t;if(r!==i){if(e||(this.captions.active=r,this.storage.set({captions:r})),!this.language&&r&&!e){const a=F.getTracks.call(this),n=F.findTrack.call(this,[this.captions.language,...this.captions.languages],!0);return this.captions.language=n.language,void F.set.call(this,a.indexOf(n))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=r),W(this.elements.container,s,r),this.captions.toggled=r,S.updateSetting.call(this,"captions"),E.call(this,this.media,r?"captionsenabled":"captionsdisabled")}setTimeout(()=>{r&&this.captions.toggled&&(this.captions.currentTrackNode.mode="hidden")})},set(t,e=!0){const i=F.getTracks.call(this);if(t!==-1)if(h.number(t))if(t in i){if(this.captions.currentTrack!==t){this.captions.currentTrack=t;const s=i[t],{language:r}=s||{};this.captions.currentTrackNode=s,S.updateSetting.call(this,"captions"),e||(this.captions.language=r,this.storage.set({language:r})),this.isVimeo&&this.embed.enableTextTrack(r),E.call(this,this.media,"languagechange")}F.toggle.call(this,!0,e),this.isHTML5&&this.isVideo&&F.updateCues.call(this)}else this.debug.warn("Track not found",t);else this.debug.warn("Invalid caption argument",t);else F.toggle.call(this,!1,e)},setLanguage(t,e=!0){if(!h.string(t))return void this.debug.warn("Invalid language argument",t);const i=t.toLowerCase();this.captions.language=i;const s=F.getTracks.call(this),r=F.findTrack.call(this,[i]);F.set.call(this,s.indexOf(r),e)},getTracks(t=!1){return Array.from((this.media||{}).textTracks||[]).filter(e=>!this.isHTML5||t||this.captions.meta.has(e)).filter(e=>["captions","subtitles"].includes(e.kind))},findTrack(t,e=!1){const i=F.getTracks.call(this),s=n=>Number((this.captions.meta.get(n)||{}).default),r=Array.from(i).sort((n,o)=>s(o)-s(n));let a;return t.every(n=>(a=r.find(o=>o.language===n),!a)),a||(e?r[0]:void 0)},getCurrentTrack(){return F.getTracks.call(this)[this.currentTrack]},getLabel(t){let e=t;return!h.track(e)&&G.textTracks&&this.captions.toggled&&(e=F.getCurrentTrack.call(this)),h.track(e)?h.empty(e.label)?h.empty(e.language)?K.get("enabled",this.config):t.language.toUpperCase():e.label:K.get("disabled",this.config)},updateCues(t){if(!this.supported.ui)return;if(!h.element(this.elements.captions))return void this.debug.warn("No captions element to render to");if(!h.nullOrUndefined(t)&&!Array.isArray(t))return void this.debug.warn("updateCues: Invalid input",t);let e=t;if(!e){const s=F.getCurrentTrack.call(this);e=Array.from((s||{}).activeCues||[]).map(r=>r.getCueAsHTML()).map(tp)}const i=e.map(s=>s.trim()).join(`
|
125
|
+
`);if(i!==this.elements.captions.innerHTML){wi(this.elements.captions);const s=N("span",Le(this.config.selectors.caption));s.innerHTML=i,this.elements.captions.appendChild(s),E.call(this,this.media,"cuechange")}}},lo={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:null,clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.7.2/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240],forced:!1,onChange:null},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2,4]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",pip:"PIP",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"}},urls:{download:null,vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/oembed.json?url={0}"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","download","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',download:'[data-plyr="download"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption"},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",videoFixedRatio:"plyr__video-wrapper--fixed-ratio",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",marker:"plyr__progress__marker",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isIos:"plyr--is-ios",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},tabFocus:"plyr__tab-focus",previewThumbnails:{thumbContainer:"plyr__preview-thumb",thumbContainerShown:"plyr__preview-thumb--is-shown",imageContainer:"plyr__preview-thumb__image-container",timeContainer:"plyr__preview-thumb__time-container",scrubbingContainer:"plyr__preview-scrubbing",scrubbingContainerShown:"plyr__preview-scrubbing--is-shown"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id",hash:"data-plyr-embed-hash"}},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:""},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,referrerPolicy:null,premium:!1},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!1},mediaMetadata:{title:"",artist:"",album:"",artwork:[]},markers:{enabled:!1,points:[]}},ls={active:"picture-in-picture",inactive:"inline"},qe={html5:"html5",youtube:"youtube",vimeo:"vimeo"},cs={audio:"audio",video:"video"};function sp(t){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(t)?qe.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(t)?qe.vimeo:null}const hs=()=>{};class rp{constructor(e=!1){this.enabled=window.console&&e,this.enabled&&this.log("Debugging enabled")}get log(){return this.enabled?Function.prototype.bind.call(console.log,console):hs}get warn(){return this.enabled?Function.prototype.bind.call(console.warn,console):hs}get error(){return this.enabled?Function.prototype.bind.call(console.error,console):hs}}class Ve{constructor(e){_(this,"onChange",()=>{if(!this.enabled)return;const i=this.player.elements.buttons.fullscreen;h.element(i)&&(i.pressed=this.active);const s=this.target===this.player.media?this.target:this.player.elements.container;E.call(this.player,s,this.active?"enterfullscreen":"exitfullscreen",!0)}),_(this,"toggleFallback",(i=!1)=>{if(i?this.scrollPosition={x:window.scrollX||0,y:window.scrollY||0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=i?"hidden":"",W(this.target,this.player.config.classNames.fullscreen.fallback,i),re.isIos){let s=document.head.querySelector('meta[name="viewport"]');const r="viewport-fit=cover";s||(s=document.createElement("meta"),s.setAttribute("name","viewport"));const a=h.string(s.content)&&s.content.includes(r);i?(this.cleanupViewport=!a,a||(s.content+=`,${r}`)):this.cleanupViewport&&(s.content=s.content.split(",").filter(n=>n.trim()!==r).join(","))}this.onChange()}),_(this,"trapFocus",i=>{if(re.isIos||!this.active||i.key!=="Tab")return;const s=document.activeElement,r=xt.call(this.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),[a]=r,n=r[r.length-1];s!==n||i.shiftKey?s===a&&i.shiftKey&&(n.focus(),i.preventDefault()):(a.focus(),i.preventDefault())}),_(this,"update",()=>{if(this.enabled){let i;i=this.forceFallback?"Fallback (forced)":Ve.native?"Native":"Fallback",this.player.debug.log(`${i} fullscreen enabled`)}else this.player.debug.log("Fullscreen not supported and fallback disabled");W(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.enabled)}),_(this,"enter",()=>{this.enabled&&(re.isIos&&this.player.config.fullscreen.iosNative?this.player.isVimeo?this.player.embed.requestFullscreen():this.target.webkitEnterFullscreen():!Ve.native||this.forceFallback?this.toggleFallback(!0):this.prefix?h.empty(this.prefix)||this.target[`${this.prefix}Request${this.property}`]():this.target.requestFullscreen({navigationUI:"hide"}))}),_(this,"exit",()=>{if(this.enabled)if(re.isIos&&this.player.config.fullscreen.iosNative)this.target.webkitExitFullscreen(),Be(this.player.play());else if(!Ve.native||this.forceFallback)this.toggleFallback(!1);else if(this.prefix){if(!h.empty(this.prefix)){const i=this.prefix==="moz"?"Cancel":"Exit";document[`${this.prefix}${i}${this.property}`]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)}),_(this,"toggle",()=>{this.active?this.exit():this.enter()}),this.player=e,this.prefix=Ve.prefix,this.property=Ve.property,this.scrollPosition={x:0,y:0},this.forceFallback=e.config.fullscreen.fallback==="force",this.player.elements.fullscreen=e.config.fullscreen.container&&Fu(this.player.elements.container,e.config.fullscreen.container),H.call(this.player,document,this.prefix==="ms"?"MSFullscreenChange":`${this.prefix}fullscreenchange`,()=>{this.onChange()}),H.call(this.player,this.player.elements.container,"dblclick",i=>{h.element(this.player.elements.controls)&&this.player.elements.controls.contains(i.target)||this.player.listeners.proxy(i,this.toggle,"fullscreen")}),H.call(this,this.player.elements.container,"keydown",i=>this.trapFocus(i)),this.update()}static get native(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}get usingNative(){return Ve.native&&!this.forceFallback}static get prefix(){if(h.function(document.exitFullscreen))return"";let e="";return["webkit","moz","ms"].some(i=>!(!h.function(document[`${i}ExitFullscreen`])&&!h.function(document[`${i}CancelFullScreen`]))&&(e=i,!0)),e}static get property(){return this.prefix==="moz"?"FullScreen":"Fullscreen"}get enabled(){return(Ve.native||this.player.config.fullscreen.fallback)&&this.player.config.fullscreen.enabled&&this.player.supported.ui&&this.player.isVideo}get active(){if(!this.enabled)return!1;if(!Ve.native||this.forceFallback)return ki(this.target,this.player.config.classNames.fullscreen.fallback);const e=this.prefix?this.target.getRootNode()[`${this.prefix}${this.property}Element`]:this.target.getRootNode().fullscreenElement;return e&&e.shadowRoot?e===this.target.getRootNode().host:e===this.target}get target(){return re.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.fullscreen||this.player.elements.container}}function vi(t,e=1){return new Promise((i,s)=>{const r=new Image,a=()=>{delete r.onload,delete r.onerror,(r.naturalWidth>=e?i:s)(r)};Object.assign(r,{onload:a,onerror:a,src:t})})}const Z={addStyleHook(){W(this.elements.container,this.config.selectors.container.replace(".",""),!0),W(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls(t=!1){t&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build(){if(this.listeners.media(),!this.supported.ui)return this.debug.warn(`Basic support only for ${this.provider} ${this.type}`),void Z.toggleNativeControls.call(this,!0);h.element(this.elements.controls)||(S.inject.call(this),this.listeners.controls()),Z.toggleNativeControls.call(this),this.isHTML5&&F.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,S.updateVolume.call(this),S.timeUpdate.call(this),S.durationUpdate.call(this),Z.checkPlaying.call(this),W(this.elements.container,this.config.classNames.pip.supported,G.pip&&this.isHTML5&&this.isVideo),W(this.elements.container,this.config.classNames.airplay.supported,G.airplay&&this.isHTML5),W(this.elements.container,this.config.classNames.isIos,re.isIos),W(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout(()=>{E.call(this,this.media,"ready")},0),Z.setTitle.call(this),this.poster&&Z.setPoster.call(this,this.poster,!1).catch(()=>{}),this.config.duration&&S.durationUpdate.call(this),this.config.mediaMetadata&&S.setMediaMetadata.call(this)},setTitle(){let t=K.get("play",this.config);if(h.string(this.config.title)&&!h.empty(this.config.title)&&(t+=`, ${this.config.title}`),Array.from(this.elements.buttons.play||[]).forEach(e=>{e.setAttribute("aria-label",t)}),this.isEmbed){const e=X.call(this,"iframe");if(!h.element(e))return;const i=h.empty(this.config.title)?"video":this.config.title,s=K.get("frameTitle",this.config);e.setAttribute("title",s.replace("{title}",i))}},togglePoster(t){W(this.elements.container,this.config.classNames.posterEnabled,t)},setPoster(t,e=!0){return e&&this.poster?Promise.reject(new Error("Poster already set")):(this.media.setAttribute("data-poster",t),this.elements.poster.removeAttribute("hidden"),Qu.call(this).then(()=>vi(t)).catch(i=>{throw t===this.poster&&Z.togglePoster.call(this,!1),i}).then(()=>{if(t!==this.poster)throw new Error("setPoster cancelled by later call to setPoster")}).then(()=>(Object.assign(this.elements.poster.style,{backgroundImage:`url('${t}')`,backgroundSize:""}),Z.togglePoster.call(this,!0),t)))},checkPlaying(t){W(this.elements.container,this.config.classNames.playing,this.playing),W(this.elements.container,this.config.classNames.paused,this.paused),W(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach(e=>{Object.assign(e,{pressed:this.playing}),e.setAttribute("aria-label",K.get(this.playing?"pause":"play",this.config))}),h.event(t)&&t.type==="timeupdate"||Z.toggleControls.call(this)},checkLoading(t){this.loading=["stalled","waiting"].includes(t.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout(()=>{W(this.elements.container,this.config.classNames.loading,this.loading),Z.toggleControls.call(this)},this.loading?250:0)},toggleControls(t){const{controls:e}=this.elements;if(e&&this.config.hideControls){const i=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(Boolean(t||this.loading||this.paused||e.pressed||e.hover||i))}},migrateStyles(){Object.values(O({},this.media.style)).filter(t=>!h.empty(t)&&h.string(t)&&t.startsWith("--plyr")).forEach(t=>{this.elements.container.style.setProperty(t,this.media.style.getPropertyValue(t)),this.media.style.removeProperty(t)}),h.empty(this.media.style)&&this.media.removeAttribute("style")}};class ap{constructor(e){_(this,"firstTouch",()=>{const{player:i}=this,{elements:s}=i;i.touch=!0,W(s.container,i.config.classNames.isTouch,!0)}),_(this,"setTabFocus",i=>{const{player:s}=this,{elements:r}=s,{key:a,type:n,timeStamp:o}=i;if(clearTimeout(this.focusTimer),n==="keydown"&&a!=="Tab")return;n==="keydown"&&(this.lastKeyDown=o);const c=o-this.lastKeyDown<=20;(n!=="focus"||c)&&((()=>{const l=s.config.classNames.tabFocus;W(xt.call(s,`.${l}`),l,!1)})(),n!=="focusout"&&(this.focusTimer=setTimeout(()=>{const l=document.activeElement;r.container.contains(l)&&W(document.activeElement,s.config.classNames.tabFocus,!0)},10)))}),_(this,"global",(i=!0)=>{const{player:s}=this;s.config.keyboard.global&&Mt.call(s,window,"keydown keyup",this.handleKey,i,!1),Mt.call(s,document.body,"click",this.toggleMenu,i),lr.call(s,document.body,"touchstart",this.firstTouch),Mt.call(s,document.body,"keydown focus blur focusout",this.setTabFocus,i,!1,!0)}),_(this,"container",()=>{const{player:i}=this,{config:s,elements:r,timers:a}=i;!s.keyboard.global&&s.keyboard.focused&&H.call(i,r.container,"keydown keyup",this.handleKey,!1),H.call(i,r.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",c=>{const{controls:l}=r;l&&c.type==="enterfullscreen"&&(l.pressed=!1,l.hover=!1);let d=0;["touchstart","touchmove","mousemove"].includes(c.type)&&(Z.toggleControls.call(i,!0),d=i.touch?3e3:2e3),clearTimeout(a.controls),a.controls=setTimeout(()=>Z.toggleControls.call(i,!1),d)});const n=()=>{if(!i.isVimeo||i.config.vimeo.premium)return;const c=r.wrapper,{active:l}=i.fullscreen,[d,u]=cr.call(i),p=eo(`aspect-ratio: ${d} / ${u}`);if(!l)return void(p?(c.style.width=null,c.style.height=null):(c.style.maxWidth=null,c.style.margin=null));const[m,g]=Gu(),f=m/g>d/u;p?(c.style.width=f?"auto":"100%",c.style.height=f?"100%":"auto"):(c.style.maxWidth=f?g/u*d+"px":null,c.style.margin=f?"0 auto":null)},o=()=>{clearTimeout(a.resized),a.resized=setTimeout(n,50)};H.call(i,r.container,"enterfullscreen exitfullscreen",c=>{const{target:l}=i.fullscreen;l===r.container&&(!i.isEmbed&&h.empty(i.config.ratio)||(n(),(c.type==="enterfullscreen"?H:Oi).call(i,window,"resize",o)))})}),_(this,"media",()=>{const{player:i}=this,{elements:s}=i;if(H.call(i,i.media,"timeupdate seeking seeked",a=>S.timeUpdate.call(i,a)),H.call(i,i.media,"durationchange loadeddata loadedmetadata",a=>S.durationUpdate.call(i,a)),H.call(i,i.media,"ended",()=>{i.isHTML5&&i.isVideo&&i.config.resetOnEnd&&(i.restart(),i.pause())}),H.call(i,i.media,"progress playing seeking seeked",a=>S.updateProgress.call(i,a)),H.call(i,i.media,"volumechange",a=>S.updateVolume.call(i,a)),H.call(i,i.media,"playing play pause ended emptied timeupdate",a=>Z.checkPlaying.call(i,a)),H.call(i,i.media,"waiting canplay seeked playing",a=>Z.checkLoading.call(i,a)),i.supported.ui&&i.config.clickToPlay&&!i.isAudio){const a=X.call(i,`.${i.config.classNames.video}`);if(!h.element(a))return;H.call(i,s.container,"click",n=>{([s.container,a].includes(n.target)||a.contains(n.target))&&(i.touch&&i.config.hideControls||(i.ended?(this.proxy(n,i.restart,"restart"),this.proxy(n,()=>{Be(i.play())},"play")):this.proxy(n,()=>{Be(i.togglePlay())},"play")))})}i.supported.ui&&i.config.disableContextMenu&&H.call(i,s.wrapper,"contextmenu",a=>{a.preventDefault()},!1),H.call(i,i.media,"volumechange",()=>{i.storage.set({volume:i.volume,muted:i.muted})}),H.call(i,i.media,"ratechange",()=>{S.updateSetting.call(i,"speed"),i.storage.set({speed:i.speed})}),H.call(i,i.media,"qualitychange",a=>{S.updateSetting.call(i,"quality",null,a.detail.quality)}),H.call(i,i.media,"ready qualitychange",()=>{S.setDownloadUrl.call(i)});const r=i.config.events.concat(["keyup","keydown"]).join(" ");H.call(i,i.media,r,a=>{let{detail:n={}}=a;a.type==="error"&&(n=i.media.error),E.call(i,s.container,a.type,!0,n)})}),_(this,"proxy",(i,s,r)=>{const{player:a}=this,n=a.config.listeners[r];let o=!0;h.function(n)&&(o=n.call(a,i)),o!==!1&&h.function(s)&&s.call(a,i)}),_(this,"bind",(i,s,r,a,n=!0)=>{const{player:o}=this,c=o.config.listeners[a],l=h.function(c);H.call(o,i,s,d=>this.proxy(d,r,a),n&&!l)}),_(this,"controls",()=>{const{player:i}=this,{elements:s}=i,r=re.isIE?"change":"input";if(s.buttons.play&&Array.from(s.buttons.play).forEach(a=>{this.bind(a,"click",()=>{Be(i.togglePlay())},"play")}),this.bind(s.buttons.restart,"click",i.restart,"restart"),this.bind(s.buttons.rewind,"click",()=>{i.lastSeekTime=Date.now(),i.rewind()},"rewind"),this.bind(s.buttons.fastForward,"click",()=>{i.lastSeekTime=Date.now(),i.forward()},"fastForward"),this.bind(s.buttons.mute,"click",()=>{i.muted=!i.muted},"mute"),this.bind(s.buttons.captions,"click",()=>i.toggleCaptions()),this.bind(s.buttons.download,"click",()=>{E.call(i,i.media,"download")},"download"),this.bind(s.buttons.fullscreen,"click",()=>{i.fullscreen.toggle()},"fullscreen"),this.bind(s.buttons.pip,"click",()=>{i.pip="toggle"},"pip"),this.bind(s.buttons.airplay,"click",i.airplay,"airplay"),this.bind(s.buttons.settings,"click",a=>{a.stopPropagation(),a.preventDefault(),S.toggleMenu.call(i,a)},null,!1),this.bind(s.buttons.settings,"keyup",a=>{["Space","Enter"].includes(a.key)&&(a.key!=="Enter"?(a.preventDefault(),a.stopPropagation(),S.toggleMenu.call(i,a)):S.focusFirstMenuItem.call(i,null,!0))},null,!1),this.bind(s.settings.menu,"keydown",a=>{a.key==="Escape"&&S.toggleMenu.call(i,a)}),this.bind(s.inputs.seek,"mousedown mousemove",a=>{const n=s.progress.getBoundingClientRect(),o=100/n.width*(a.pageX-n.left);a.currentTarget.setAttribute("seek-value",o)}),this.bind(s.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",a=>{const n=a.currentTarget,o="play-on-seeked";if(h.keyboardEvent(a)&&!["ArrowLeft","ArrowRight"].includes(a.key))return;i.lastSeekTime=Date.now();const c=n.hasAttribute(o),l=["mouseup","touchend","keyup"].includes(a.type);c&&l?(n.removeAttribute(o),Be(i.play())):!l&&i.playing&&(n.setAttribute(o,""),i.pause())}),re.isIos){const a=xt.call(i,'input[type="range"]');Array.from(a).forEach(n=>this.bind(n,r,o=>qn(o.target)))}this.bind(s.inputs.seek,r,a=>{const n=a.currentTarget;let o=n.getAttribute("seek-value");h.empty(o)&&(o=n.value),n.removeAttribute("seek-value"),i.currentTime=o/n.max*i.duration},"seek"),this.bind(s.progress,"mouseenter mouseleave mousemove",a=>S.updateSeekTooltip.call(i,a)),this.bind(s.progress,"mousemove touchmove",a=>{const{previewThumbnails:n}=i;n&&n.loaded&&n.startMove(a)}),this.bind(s.progress,"mouseleave touchend click",()=>{const{previewThumbnails:a}=i;a&&a.loaded&&a.endMove(!1,!0)}),this.bind(s.progress,"mousedown touchstart",a=>{const{previewThumbnails:n}=i;n&&n.loaded&&n.startScrubbing(a)}),this.bind(s.progress,"mouseup touchend",a=>{const{previewThumbnails:n}=i;n&&n.loaded&&n.endScrubbing(a)}),re.isWebkit&&Array.from(xt.call(i,'input[type="range"]')).forEach(a=>{this.bind(a,"input",n=>S.updateRangeFill.call(i,n.target))}),i.config.toggleInvert&&!h.element(s.display.duration)&&this.bind(s.display.currentTime,"click",()=>{i.currentTime!==0&&(i.config.invertTime=!i.config.invertTime,S.timeUpdate.call(i))}),this.bind(s.inputs.volume,r,a=>{i.volume=a.target.value},"volume"),this.bind(s.controls,"mouseenter mouseleave",a=>{s.controls.hover=!i.touch&&a.type==="mouseenter"}),s.fullscreen&&Array.from(s.fullscreen.children).filter(a=>!a.contains(s.container)).forEach(a=>{this.bind(a,"mouseenter mouseleave",n=>{s.controls&&(s.controls.hover=!i.touch&&n.type==="mouseenter")})}),this.bind(s.controls,"mousedown mouseup touchstart touchend touchcancel",a=>{s.controls.pressed=["mousedown","touchstart"].includes(a.type)}),this.bind(s.controls,"focusin",()=>{const{config:a,timers:n}=i;W(s.controls,a.classNames.noTransition,!0),Z.toggleControls.call(i,!0),setTimeout(()=>{W(s.controls,a.classNames.noTransition,!1)},0);const o=this.touch?3e3:4e3;clearTimeout(n.controls),n.controls=setTimeout(()=>Z.toggleControls.call(i,!1),o)}),this.bind(s.inputs.volume,"wheel",a=>{const n=a.webkitDirectionInvertedFromDevice,[o,c]=[a.deltaX,-a.deltaY].map(u=>n?-u:u),l=Math.sign(Math.abs(o)>Math.abs(c)?o:c);i.increaseVolume(l/50);const{volume:d}=i.media;(l===1&&d<1||l===-1&&d>0)&&a.preventDefault()},"volume",!1)}),this.player=e,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.setTabFocus=this.setTabFocus.bind(this),this.firstTouch=this.firstTouch.bind(this)}handleKey(e){const{player:i}=this,{elements:s}=i,{key:r,type:a,altKey:n,ctrlKey:o,metaKey:c,shiftKey:l}=e,d=a==="keydown",u=d&&r===this.lastKey;if(!(n||o||c||l)&&!!r){if(d){const m=document.activeElement;if(h.element(m)){const{editable:g}=i.config.selectors,{seek:f}=s.inputs;if(m!==f&&ht(m,g)||e.key==="Space"&&ht(m,'button, [role^="menuitem"]'))return}switch(["Space","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","0","1","2","3","4","5","6","7","8","9","c","f","k","l","m"].includes(r)&&(e.preventDefault(),e.stopPropagation()),r){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":u||(p=parseInt(r,10),i.currentTime=i.duration/10*p);break;case"Space":case"k":u||Be(i.togglePlay());break;case"ArrowUp":i.increaseVolume(.1);break;case"ArrowDown":i.decreaseVolume(.1);break;case"m":u||(i.muted=!i.muted);break;case"ArrowRight":i.forward();break;case"ArrowLeft":i.rewind();break;case"f":i.fullscreen.toggle();break;case"c":u||i.toggleCaptions();break;case"l":i.loop=!i.loop}r==="Escape"&&!i.fullscreen.usingNative&&i.fullscreen.active&&i.fullscreen.toggle(),this.lastKey=r}else this.lastKey=null;var p}}toggleMenu(e){S.toggleMenu.call(this.player,e)}}function np(t,e){return t(e={exports:{}},e.exports),e.exports}var op=np(function(t,e){t.exports=function(){var i=function(){},s={},r={},a={};function n(p,m){p=p.push?p:[p];var g,f,b,v=[],x=p.length,y=x;for(g=function(k,z){z.length&&v.push(k),--y||m(v)};x--;)f=p[x],(b=r[f])?g(f,b):(a[f]=a[f]||[]).push(g)}function o(p,m){if(p){var g=a[p];if(r[p]=m,g)for(;g.length;)g[0](p,m),g.splice(0,1)}}function c(p,m){p.call&&(p={success:p}),m.length?(p.error||i)(m):(p.success||i)(p)}function l(p,m,g,f){var b,v,x=document,y=g.async,k=(g.numRetries||0)+1,z=g.before||i,T=p.replace(/[\?|#].*$/,""),R=p.replace(/^(css|img)!/,"");f=f||0,/(^css!|\.css$)/.test(T)?((v=x.createElement("link")).rel="stylesheet",v.href=R,(b="hideFocus"in v)&&v.relList&&(b=0,v.rel="preload",v.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(T)?(v=x.createElement("img")).src=R:((v=x.createElement("script")).src=p,v.async=y===void 0||y),v.onload=v.onerror=v.onbeforeload=function(te){var Q=te.type[0];if(b)try{v.sheet.cssText.length||(Q="e")}catch(xe){xe.code!=18&&(Q="e")}if(Q=="e"){if((f+=1)<k)return l(p,m,g,f)}else if(v.rel=="preload"&&v.as=="style")return v.rel="stylesheet";m(p,Q,te.defaultPrevented)},z(p,v)!==!1&&x.head.appendChild(v)}function d(p,m,g){var f,b,v=(p=p.push?p:[p]).length,x=v,y=[];for(f=function(k,z,T){if(z=="e"&&y.push(k),z=="b"){if(!T)return;y.push(k)}--v||m(y)},b=0;b<x;b++)l(p[b],f,g)}function u(p,m,g){var f,b;if(m&&m.trim&&(f=m),b=(f?g:m)||{},f){if(f in s)throw"LoadJS";s[f]=!0}function v(x,y){d(p,function(k){c(b,k),x&&c({success:x,error:y},k),o(f,k)},b)}if(b.returnPromise)return new Promise(v);v()}return u.ready=function(p,m){return n(p,function(g){c(m,g)}),u},u.done=function(p){o(p,[])},u.reset=function(){s={},r={},a={}},u.isDefined=function(p){return p in s},u}()});function hr(t){return new Promise((e,i)=>{op(t,{success:e,error:i})})}function lp(t){return h.empty(t)?null:h.number(Number(t))?t:t.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:t}function cp(t){const e=t.match(/^.*(vimeo.com\/|video\/)(\d+)(\?.*&*h=|\/)+([\d,a-f]+)/);return e&&e.length===5?e[4]:null}function Et(t){t&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===t&&(this.media.paused=!t,E.call(this,this.media,t?"play":"pause"))}const Es={setup(){const t=this;W(t.elements.wrapper,t.config.classNames.embed,!0),t.options.speed=t.config.speed.options,It.call(t),h.object(window.Vimeo)?Es.ready.call(t):hr(t.config.urls.vimeo.sdk).then(()=>{Es.ready.call(t)}).catch(e=>{t.debug.warn("Vimeo SDK (player.js) failed to load",e)})},ready(){const t=this,e=t.config.vimeo,x=e,{premium:i,referrerPolicy:s}=x,r=yr(x,["premium","referrerPolicy"]);let a=t.media.getAttribute("src"),n="";h.empty(a)?(a=t.media.getAttribute(t.config.attributes.embed.id),n=t.media.getAttribute(t.config.attributes.embed.hash)):n=cp(a);const o=n?{h:n}:{};i&&Object.assign(r,{controls:!1,sidedock:!1});const c=oo(O(O({loop:t.config.loop.active,autoplay:t.autoplay,muted:t.muted,gesture:"media",playsinline:!this.config.fullscreen.iosNative},o),r)),l=lp(a),d=N("iframe"),u=Ns(t.config.urls.vimeo.iframe,l,c);if(d.setAttribute("src",u),d.setAttribute("allowfullscreen",""),d.setAttribute("allow",["autoplay","fullscreen","picture-in-picture","encrypted-media","accelerometer","gyroscope"].join("; ")),h.empty(s)||d.setAttribute("referrerPolicy",s),i||!e.customControls)d.setAttribute("data-poster",t.poster),t.media=Ai(d,t.media);else{const y=N("div",{class:t.config.classNames.embedContainer,"data-poster":t.poster});y.appendChild(d),t.media=Ai(y,t.media)}e.customControls||ri(Ns(t.config.urls.vimeo.api,u)).then(y=>{!h.empty(y)&&y.thumbnail_url&&Z.setPoster.call(t,y.thumbnail_url).catch(()=>{})}),t.embed=new window.Vimeo.Player(d,{autopause:t.config.autopause,muted:t.muted}),t.media.paused=!0,t.media.currentTime=0,t.supported.ui&&t.embed.disableTextTrack(),t.media.play=()=>(Et.call(t,!0),t.embed.play()),t.media.pause=()=>(Et.call(t,!1),t.embed.pause()),t.media.stop=()=>{t.pause(),t.currentTime=0};let{currentTime:p}=t.media;Object.defineProperty(t.media,"currentTime",{get:()=>p,set(y){const{embed:k,media:z,paused:T,volume:R}=t,te=T&&!k.hasPlayed;z.seeking=!0,E.call(t,z,"seeking"),Promise.resolve(te&&k.setVolume(0)).then(()=>k.setCurrentTime(y)).then(()=>te&&k.pause()).then(()=>te&&k.setVolume(R)).catch(()=>{})}});let m=t.config.speed.selected;Object.defineProperty(t.media,"playbackRate",{get:()=>m,set(y){t.embed.setPlaybackRate(y).then(()=>{m=y,E.call(t,t.media,"ratechange")}).catch(()=>{t.options.speed=[1]})}});let{volume:g}=t.config;Object.defineProperty(t.media,"volume",{get:()=>g,set(y){t.embed.setVolume(y).then(()=>{g=y,E.call(t,t.media,"volumechange")})}});let{muted:f}=t.config;Object.defineProperty(t.media,"muted",{get:()=>f,set(y){const k=!!h.boolean(y)&&y;t.embed.setVolume(k?0:t.config.volume).then(()=>{f=k,E.call(t,t.media,"volumechange")})}});let b,{loop:v}=t.config;Object.defineProperty(t.media,"loop",{get:()=>v,set(y){const k=h.boolean(y)?y:t.config.loop.active;t.embed.setLoop(k).then(()=>{v=k})}}),t.embed.getVideoUrl().then(y=>{b=y,S.setDownloadUrl.call(t)}).catch(y=>{this.debug.warn(y)}),Object.defineProperty(t.media,"currentSrc",{get:()=>b}),Object.defineProperty(t.media,"ended",{get:()=>t.currentTime===t.duration}),Promise.all([t.embed.getVideoWidth(),t.embed.getVideoHeight()]).then(y=>{const[k,z]=y;t.embed.ratio=io(k,z),It.call(this)}),t.embed.setAutopause(t.config.autopause).then(y=>{t.config.autopause=y}),t.embed.getVideoTitle().then(y=>{t.config.title=y,Z.setTitle.call(this)}),t.embed.getCurrentTime().then(y=>{p=y,E.call(t,t.media,"timeupdate")}),t.embed.getDuration().then(y=>{t.media.duration=y,E.call(t,t.media,"durationchange")}),t.embed.getTextTracks().then(y=>{t.media.textTracks=y,F.setup.call(t)}),t.embed.on("cuechange",({cues:y=[]})=>{const k=y.map(z=>ep(z.text));F.updateCues.call(t,k)}),t.embed.on("loaded",()=>{t.embed.getPaused().then(y=>{Et.call(t,!y),y||E.call(t,t.media,"playing")}),h.element(t.embed.element)&&t.supported.ui&&t.embed.element.setAttribute("tabindex",-1)}),t.embed.on("bufferstart",()=>{E.call(t,t.media,"waiting")}),t.embed.on("bufferend",()=>{E.call(t,t.media,"playing")}),t.embed.on("play",()=>{Et.call(t,!0),E.call(t,t.media,"playing")}),t.embed.on("pause",()=>{Et.call(t,!1)}),t.embed.on("timeupdate",y=>{t.media.seeking=!1,p=y.seconds,E.call(t,t.media,"timeupdate")}),t.embed.on("progress",y=>{t.media.buffered=y.percent,E.call(t,t.media,"progress"),parseInt(y.percent,10)===1&&E.call(t,t.media,"canplaythrough"),t.embed.getDuration().then(k=>{k!==t.media.duration&&(t.media.duration=k,E.call(t,t.media,"durationchange"))})}),t.embed.on("seeked",()=>{t.media.seeking=!1,E.call(t,t.media,"seeked")}),t.embed.on("ended",()=>{t.media.paused=!0,E.call(t,t.media,"ended")}),t.embed.on("error",y=>{t.media.error=y,E.call(t,t.media,"error")}),e.customControls&&setTimeout(()=>Z.build.call(t),0)}};function hp(t){return h.empty(t)?null:t.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:t}function Pt(t){t&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===t&&(this.media.paused=!t,E.call(this,this.media,t?"play":"pause"))}function dp(t){return t.noCookie?"https://www.youtube-nocookie.com":window.location.protocol==="http:"?"http://www.youtube.com":void 0}const xi={setup(){if(W(this.elements.wrapper,this.config.classNames.embed,!0),h.object(window.YT)&&h.function(window.YT.Player))xi.ready.call(this);else{const t=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{h.function(t)&&t(),xi.ready.call(this)},hr(this.config.urls.youtube.sdk).catch(e=>{this.debug.warn("YouTube API failed to load",e)})}},getTitle(t){ri(Ns(this.config.urls.youtube.api,t)).then(e=>{if(h.object(e)){const{title:i,height:s,width:r}=e;this.config.title=i,Z.setTitle.call(this),this.embed.ratio=io(r,s)}It.call(this)}).catch(()=>{It.call(this)})},ready(){const t=this,e=t.config.youtube,i=t.media&&t.media.getAttribute("id");if(!h.empty(i)&&i.startsWith("youtube-"))return;let s=t.media.getAttribute("src");h.empty(s)&&(s=t.media.getAttribute(this.config.attributes.embed.id));const r=hp(s),a=N("div",{id:qu(t.provider),"data-poster":e.customControls?t.poster:void 0});if(t.media=Ai(a,t.media),e.customControls){const n=o=>`https://i.ytimg.com/vi/${r}/${o}default.jpg`;vi(n("maxres"),121).catch(()=>vi(n("sd"),121)).catch(()=>vi(n("hq"))).then(o=>Z.setPoster.call(t,o.src)).then(o=>{o.includes("maxres")||(t.elements.poster.style.backgroundSize="cover")}).catch(()=>{})}t.embed=new window.YT.Player(t.media,{videoId:r,host:dp(e),playerVars:q({},{autoplay:t.config.autoplay?1:0,hl:t.config.hl,controls:t.supported.ui&&e.customControls?0:1,disablekb:1,playsinline:t.config.fullscreen.iosNative?0:1,cc_load_policy:t.captions.active?1:0,cc_lang_pref:t.config.captions.language,widget_referrer:window?window.location.href:null},e),events:{onError(n){if(!t.media.error){const o=n.data,c={2:"The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[o]||"An unknown error occured";t.media.error={code:o,message:c},E.call(t,t.media,"error")}},onPlaybackRateChange(n){const o=n.target;t.media.playbackRate=o.getPlaybackRate(),E.call(t,t.media,"ratechange")},onReady(n){if(h.function(t.media.play))return;const o=n.target;xi.getTitle.call(t,r),t.media.play=()=>{Pt.call(t,!0),o.playVideo()},t.media.pause=()=>{Pt.call(t,!1),o.pauseVideo()},t.media.stop=()=>{o.stopVideo()},t.media.duration=o.getDuration(),t.media.paused=!0,t.media.currentTime=0,Object.defineProperty(t.media,"currentTime",{get:()=>Number(o.getCurrentTime()),set(u){t.paused&&!t.embed.hasPlayed&&t.embed.mute(),t.media.seeking=!0,E.call(t,t.media,"seeking"),o.seekTo(u)}}),Object.defineProperty(t.media,"playbackRate",{get:()=>o.getPlaybackRate(),set(u){o.setPlaybackRate(u)}});let{volume:c}=t.config;Object.defineProperty(t.media,"volume",{get:()=>c,set(u){c=u,o.setVolume(100*c),E.call(t,t.media,"volumechange")}});let{muted:l}=t.config;Object.defineProperty(t.media,"muted",{get:()=>l,set(u){const p=h.boolean(u)?u:l;l=p,o[p?"mute":"unMute"](),o.setVolume(100*c),E.call(t,t.media,"volumechange")}}),Object.defineProperty(t.media,"currentSrc",{get:()=>o.getVideoUrl()}),Object.defineProperty(t.media,"ended",{get:()=>t.currentTime===t.duration});const d=o.getAvailablePlaybackRates();t.options.speed=d.filter(u=>t.config.speed.options.includes(u)),t.supported.ui&&e.customControls&&t.media.setAttribute("tabindex",-1),E.call(t,t.media,"timeupdate"),E.call(t,t.media,"durationchange"),clearInterval(t.timers.buffering),t.timers.buffering=setInterval(()=>{t.media.buffered=o.getVideoLoadedFraction(),(t.media.lastBuffered===null||t.media.lastBuffered<t.media.buffered)&&E.call(t,t.media,"progress"),t.media.lastBuffered=t.media.buffered,t.media.buffered===1&&(clearInterval(t.timers.buffering),E.call(t,t.media,"canplaythrough"))},200),e.customControls&&setTimeout(()=>Z.build.call(t),50)},onStateChange(n){const o=n.target;switch(clearInterval(t.timers.playing),t.media.seeking&&[1,2].includes(n.data)&&(t.media.seeking=!1,E.call(t,t.media,"seeked")),n.data){case-1:E.call(t,t.media,"timeupdate"),t.media.buffered=o.getVideoLoadedFraction(),E.call(t,t.media,"progress");break;case 0:Pt.call(t,!1),t.media.loop?(o.stopVideo(),o.playVideo()):E.call(t,t.media,"ended");break;case 1:e.customControls&&!t.config.autoplay&&t.media.paused&&!t.embed.hasPlayed?t.media.pause():(Pt.call(t,!0),E.call(t,t.media,"playing"),t.timers.playing=setInterval(()=>{E.call(t,t.media,"timeupdate")},50),t.media.duration!==o.getDuration()&&(t.media.duration=o.getDuration(),E.call(t,t.media,"durationchange")));break;case 2:t.muted||t.embed.unMute(),Pt.call(t,!1);break;case 3:E.call(t,t.media,"waiting")}E.call(t,t.elements.container,"statechange",!1,{code:n.data})}}})}},co={setup(){this.media?(W(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),W(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&W(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=N("div",{class:this.config.classNames.video}),Xn(this.media,this.elements.wrapper),this.elements.poster=N("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?Ke.setup.call(this):this.isYouTube?xi.setup.call(this):this.isVimeo&&Es.setup.call(this)):this.debug.warn("No media element found!")}};class up{constructor(e){_(this,"load",()=>{this.enabled&&(h.object(window.google)&&h.object(window.google.ima)?this.ready():hr(this.player.config.urls.googleIMA.sdk).then(()=>{this.ready()}).catch(()=>{this.trigger("error",new Error("Google IMA SDK failed to load"))}))}),_(this,"ready",()=>{var i;this.enabled||((i=this).manager&&i.manager.destroy(),i.elements.displayContainer&&i.elements.displayContainer.destroy(),i.elements.container.remove()),this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then(()=>{this.clearSafetyTimer("onAdsManagerLoaded()")}),this.listeners(),this.setupIMA()}),_(this,"setupIMA",()=>{this.elements.container=N("div",{class:this.player.config.classNames.ads}),this.player.elements.container.appendChild(this.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(this.player.config.ads.language),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.player.config.playsinline),this.elements.displayContainer=new google.ima.AdDisplayContainer(this.elements.container,this.player.media),this.loader=new google.ima.AdsLoader(this.elements.displayContainer),this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,i=>this.onAdsManagerLoaded(i),!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,i=>this.onAdError(i),!1),this.requestAds()}),_(this,"requestAds",()=>{const{container:i}=this.player.elements;try{const s=new google.ima.AdsRequest;s.adTagUrl=this.tagUrl,s.linearAdSlotWidth=i.offsetWidth,s.linearAdSlotHeight=i.offsetHeight,s.nonLinearAdSlotWidth=i.offsetWidth,s.nonLinearAdSlotHeight=i.offsetHeight,s.forceNonLinearFullSlot=!1,s.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(s)}catch(s){this.onAdError(s)}}),_(this,"pollCountdown",(i=!1)=>{if(!i)return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");this.countdownTimer=setInterval(()=>{const s=Ui(Math.max(this.manager.getRemainingTime(),0)),r=`${K.get("advertisement",this.player.config)} - ${s}`;this.elements.container.setAttribute("data-badge-text",r)},100)}),_(this,"onAdsManagerLoaded",i=>{if(!this.enabled)return;const s=new google.ima.AdsRenderingSettings;s.restoreCustomPlaybackStateOnAdBreakComplete=!0,s.enablePreloading=!0,this.manager=i.getAdsManager(this.player,s),this.cuePoints=this.manager.getCuePoints(),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,r=>this.onAdError(r)),Object.keys(google.ima.AdEvent.Type).forEach(r=>{this.manager.addEventListener(google.ima.AdEvent.Type[r],a=>this.onAdEvent(a))}),this.trigger("loaded")}),_(this,"addCuePoints",()=>{h.empty(this.cuePoints)||this.cuePoints.forEach(i=>{if(i!==0&&i!==-1&&i<this.player.duration){const s=this.player.elements.progress;if(h.element(s)){const r=100/this.player.duration*i,a=N("span",{class:this.player.config.classNames.cues});a.style.left=`${r.toString()}%`,s.appendChild(a)}}})}),_(this,"onAdEvent",i=>{const{container:s}=this.player.elements,r=i.getAd(),a=i.getAdData();switch((n=>{E.call(this.player,this.player.media,`ads${n.replace(/_/g,"").toLowerCase()}`)})(i.type),i.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),this.pollCountdown(!0),r.isLinear()||(r.width=s.offsetWidth,r.height=s.offsetHeight);break;case google.ima.AdEvent.Type.STARTED:this.manager.setVolume(this.player.volume);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:this.player.ended?this.loadAds():this.loader.contentComplete();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:this.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:this.pollCountdown(),this.resumeContent();break;case google.ima.AdEvent.Type.LOG:a.adError&&this.player.debug.warn(`Non-fatal ad error: ${a.adError.getMessage()}`)}}),_(this,"onAdError",i=>{this.cancel(),this.player.debug.warn("Ads error",i)}),_(this,"listeners",()=>{const{container:i}=this.player.elements;let s;this.player.on("canplay",()=>{this.addCuePoints()}),this.player.on("ended",()=>{this.loader.contentComplete()}),this.player.on("timeupdate",()=>{s=this.player.currentTime}),this.player.on("seeked",()=>{const r=this.player.currentTime;h.empty(this.cuePoints)||this.cuePoints.forEach((a,n)=>{s<a&&a<r&&(this.manager.discardAdBreak(),this.cuePoints.splice(n,1))})}),window.addEventListener("resize",()=>{this.manager&&this.manager.resize(i.offsetWidth,i.offsetHeight,google.ima.ViewMode.NORMAL)})}),_(this,"play",()=>{const{container:i}=this.player.elements;this.managerPromise||this.resumeContent(),this.managerPromise.then(()=>{this.manager.setVolume(this.player.volume),this.elements.displayContainer.initialize();try{this.initialized||(this.manager.init(i.offsetWidth,i.offsetHeight,google.ima.ViewMode.NORMAL),this.manager.start()),this.initialized=!0}catch(s){this.onAdError(s)}}).catch(()=>{})}),_(this,"resumeContent",()=>{this.elements.container.style.zIndex="",this.playing=!1,Be(this.player.media.play())}),_(this,"pauseContent",()=>{this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()}),_(this,"cancel",()=>{this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()}),_(this,"loadAds",()=>{this.managerPromise.then(()=>{this.manager&&this.manager.destroy(),this.managerPromise=new Promise(i=>{this.on("loaded",i),this.player.debug.log(this.manager)}),this.initialized=!1,this.requestAds()}).catch(()=>{})}),_(this,"trigger",(i,...s)=>{const r=this.events[i];h.array(r)&&r.forEach(a=>{h.function(a)&&a.apply(this,s)})}),_(this,"on",(i,s)=>(h.array(this.events[i])||(this.events[i]=[]),this.events[i].push(s),this)),_(this,"startSafetyTimer",(i,s)=>{this.player.debug.log(`Safety timer invoked from: ${s}`),this.safetyTimer=setTimeout(()=>{this.cancel(),this.clearSafetyTimer("startSafetyTimer()")},i)}),_(this,"clearSafetyTimer",i=>{h.nullOrUndefined(this.safetyTimer)||(this.player.debug.log(`Safety timer cleared from: ${i}`),clearTimeout(this.safetyTimer),this.safetyTimer=null)}),this.player=e,this.config=e.config.ads,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise((i,s)=>{this.on("loaded",i),this.on("error",s)}),this.load()}get enabled(){const{config:e}=this;return this.player.isHTML5&&this.player.isVideo&&e.enabled&&(!h.empty(e.publisherId)||h.url(e.tagUrl))}get tagUrl(){const{config:e}=this;return h.url(e.tagUrl)?e.tagUrl:`https://go.aniview.com/api/adserver6/vast/?${oo({AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:e.publisherId})}`}}function ho(t=0,e=0,i=255){return Math.min(Math.max(t,e),i)}const pp=t=>{const e=[];return t.split(/\r\n\r\n|\n\n|\r\r/).forEach(i=>{const s={};i.split(/\r\n|\n|\r/).forEach(r=>{if(h.number(s.startTime)){if(!h.empty(r.trim())&&h.empty(s.text)){const a=r.trim().split("#xywh=");[s.text]=a,a[1]&&([s.x,s.y,s.w,s.h]=a[1].split(","))}}else{const a=r.match(/([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})( ?--> ?)([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})/);a&&(s.startTime=60*Number(a[1]||0)*60+60*Number(a[2])+Number(a[3])+Number(`0.${a[4]}`),s.endTime=60*Number(a[6]||0)*60+60*Number(a[7])+Number(a[8])+Number(`0.${a[9]}`))}}),s.text&&e.push(s)}),e},oa=(t,e)=>{const i={};return t>e.width/e.height?(i.width=e.width,i.height=1/t*e.width):(i.height=e.height,i.width=t*e.height),i};class Ps{constructor(e){_(this,"load",()=>{this.player.elements.display.seekTooltip&&(this.player.elements.display.seekTooltip.hidden=this.enabled),this.enabled&&this.getThumbnails().then(()=>{this.enabled&&(this.render(),this.determineContainerAutoSizing(),this.loaded=!0)})}),_(this,"getThumbnails",()=>new Promise(i=>{const{src:s}=this.player.config.previewThumbnails;if(h.empty(s))throw new Error("Missing previewThumbnails.src config attribute");const r=()=>{this.thumbnails.sort((a,n)=>a.height-n.height),this.player.debug.log("Preview thumbnails",this.thumbnails),i()};if(h.function(s))s(a=>{this.thumbnails=a,r()});else{const a=(h.string(s)?[s]:s).map(n=>this.getThumbnail(n));Promise.all(a).then(r)}})),_(this,"getThumbnail",i=>new Promise(s=>{ri(i).then(r=>{const a={frames:pp(r),height:null,urlPrefix:""};a.frames[0].text.startsWith("/")||a.frames[0].text.startsWith("http://")||a.frames[0].text.startsWith("https://")||(a.urlPrefix=i.substring(0,i.lastIndexOf("/")+1));const n=new Image;n.onload=()=>{a.height=n.naturalHeight,a.width=n.naturalWidth,this.thumbnails.push(a),s()},n.src=a.urlPrefix+a.frames[0].text})})),_(this,"startMove",i=>{if(this.loaded&&h.event(i)&&["touchmove","mousemove"].includes(i.type)&&this.player.media.duration){if(i.type==="touchmove")this.seekTime=this.player.media.duration*(this.player.elements.inputs.seek.value/100);else{var s,r;const a=this.player.elements.progress.getBoundingClientRect(),n=100/a.width*(i.pageX-a.left);this.seekTime=this.player.media.duration*(n/100),this.seekTime<0&&(this.seekTime=0),this.seekTime>this.player.media.duration-1&&(this.seekTime=this.player.media.duration-1),this.mousePosX=i.pageX,this.elements.thumb.time.innerText=Ui(this.seekTime);const o=(s=this.player.config.markers)===null||s===void 0||(r=s.points)===null||r===void 0?void 0:r.find(({time:c})=>c===Math.round(this.seekTime));o&&this.elements.thumb.time.insertAdjacentHTML("afterbegin",`${o.label}<br>`)}this.showImageAtCurrentTime()}}),_(this,"endMove",()=>{this.toggleThumbContainer(!1,!0)}),_(this,"startScrubbing",i=>{(h.nullOrUndefined(i.button)||i.button===!1||i.button===0)&&(this.mouseDown=!0,this.player.media.duration&&(this.toggleScrubbingContainer(!0),this.toggleThumbContainer(!1,!0),this.showImageAtCurrentTime()))}),_(this,"endScrubbing",()=>{this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):lr.call(this.player,this.player.media,"timeupdate",()=>{this.mouseDown||this.toggleScrubbingContainer(!1)})}),_(this,"listeners",()=>{this.player.on("play",()=>{this.toggleThumbContainer(!1,!0)}),this.player.on("seeked",()=>{this.toggleThumbContainer(!1)}),this.player.on("timeupdate",()=>{this.lastTime=this.player.media.currentTime})}),_(this,"render",()=>{this.elements.thumb.container=N("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=N("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);const i=N("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=N("span",{},"00:00"),i.appendChild(this.elements.thumb.time),this.elements.thumb.imageContainer.appendChild(i),h.element(this.player.elements.progress)&&this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=N("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)}),_(this,"destroy",()=>{this.elements.thumb.container&&this.elements.thumb.container.remove(),this.elements.scrubbing.container&&this.elements.scrubbing.container.remove()}),_(this,"showImageAtCurrentTime",()=>{this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();const i=this.thumbnails[0].frames.findIndex(a=>this.seekTime>=a.startTime&&this.seekTime<=a.endTime),s=i>=0;let r=0;this.mouseDown||this.toggleThumbContainer(s),s&&(this.thumbnails.forEach((a,n)=>{this.loadedImages.includes(a.frames[i].text)&&(r=n)}),i!==this.showingThumb&&(this.showingThumb=i,this.loadImage(r)))}),_(this,"loadImage",(i=0)=>{const s=this.showingThumb,r=this.thumbnails[i],{urlPrefix:a}=r,n=r.frames[s],o=r.frames[s].text,c=a+o;if(this.currentImageElement&&this.currentImageElement.dataset.filename===o)this.showImage(this.currentImageElement,n,i,s,o,!1),this.currentImageElement.dataset.index=s,this.removeOldImages(this.currentImageElement);else{this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);const l=new Image;l.src=c,l.dataset.index=s,l.dataset.filename=o,this.showingThumbFilename=o,this.player.debug.log(`Loading image: ${c}`),l.onload=()=>this.showImage(l,n,i,s,o,!0),this.loadingImage=l,this.removeOldImages(l)}}),_(this,"showImage",(i,s,r,a,n,o=!0)=>{this.player.debug.log(`Showing thumb: ${n}. num: ${a}. qual: ${r}. newimg: ${o}`),this.setImageSizeAndOffset(i,s),o&&(this.currentImageContainer.appendChild(i),this.currentImageElement=i,this.loadedImages.includes(n)||this.loadedImages.push(n)),this.preloadNearby(a,!0).then(this.preloadNearby(a,!1)).then(this.getHigherQuality(r,i,s,n))}),_(this,"removeOldImages",i=>{Array.from(this.currentImageContainer.children).forEach(s=>{if(s.tagName.toLowerCase()!=="img")return;const r=this.usingSprites?500:1e3;if(s.dataset.index!==i.dataset.index&&!s.dataset.deleting){s.dataset.deleting=!0;const{currentImageContainer:a}=this;setTimeout(()=>{a.removeChild(s),this.player.debug.log(`Removing thumb: ${s.dataset.filename}`)},r)}})}),_(this,"preloadNearby",(i,s=!0)=>new Promise(r=>{setTimeout(()=>{const a=this.thumbnails[0].frames[i].text;if(this.showingThumbFilename===a){let n;n=s?this.thumbnails[0].frames.slice(i):this.thumbnails[0].frames.slice(0,i).reverse();let o=!1;n.forEach(c=>{const l=c.text;if(l!==a&&!this.loadedImages.includes(l)){o=!0,this.player.debug.log(`Preloading thumb filename: ${l}`);const{urlPrefix:d}=this.thumbnails[0],u=d+l,p=new Image;p.src=u,p.onload=()=>{this.player.debug.log(`Preloaded thumb filename: ${l}`),this.loadedImages.includes(l)||this.loadedImages.push(l),r()}}}),o||r()}},300)})),_(this,"getHigherQuality",(i,s,r,a)=>{if(i<this.thumbnails.length-1){let n=s.naturalHeight;this.usingSprites&&(n=r.h),n<this.thumbContainerHeight&&setTimeout(()=>{this.showingThumbFilename===a&&(this.player.debug.log(`Showing higher quality thumb for: ${a}`),this.loadImage(i+1))},300)}}),_(this,"toggleThumbContainer",(i=!1,s=!1)=>{const r=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(r,i),!i&&s&&(this.showingThumb=null,this.showingThumbFilename=null)}),_(this,"toggleScrubbingContainer",(i=!1)=>{const s=this.player.config.classNames.previewThumbnails.scrubbingContainerShown;this.elements.scrubbing.container.classList.toggle(s,i),i||(this.showingThumb=null,this.showingThumbFilename=null)}),_(this,"determineContainerAutoSizing",()=>{(this.elements.thumb.imageContainer.clientHeight>20||this.elements.thumb.imageContainer.clientWidth>20)&&(this.sizeSpecifiedInCSS=!0)}),_(this,"setThumbContainerSizeAndPos",()=>{const{imageContainer:i}=this.elements.thumb;if(this.sizeSpecifiedInCSS){if(i.clientHeight>20&&i.clientWidth<20){const s=Math.floor(i.clientHeight*this.thumbAspectRatio);i.style.width=`${s}px`}else if(i.clientHeight<20&&i.clientWidth>20){const s=Math.floor(i.clientWidth/this.thumbAspectRatio);i.style.height=`${s}px`}}else{const s=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);i.style.height=`${this.thumbContainerHeight}px`,i.style.width=`${s}px`}this.setThumbContainerPos()}),_(this,"setThumbContainerPos",()=>{const i=this.player.elements.progress.getBoundingClientRect(),s=this.player.elements.container.getBoundingClientRect(),{container:r}=this.elements.thumb,a=s.left-i.left+10,n=s.right-i.left-r.clientWidth-10,o=this.mousePosX-i.left-r.clientWidth/2,c=ho(o,a,n);r.style.left=`${c}px`,r.style.setProperty("--preview-arrow-offset",o-c+"px")}),_(this,"setScrubbingContainerSize",()=>{const{width:i,height:s}=oa(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});this.elements.scrubbing.container.style.width=`${i}px`,this.elements.scrubbing.container.style.height=`${s}px`}),_(this,"setImageSizeAndOffset",(i,s)=>{if(!this.usingSprites)return;const r=this.thumbContainerHeight/s.h;i.style.height=i.naturalHeight*r+"px",i.style.width=i.naturalWidth*r+"px",i.style.left=`-${s.x*r}px`,i.style.top=`-${s.y*r}px`}),this.player=e,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}get enabled(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}get currentImageContainer(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}get usingSprites(){return Object.keys(this.thumbnails[0].frames[0]).includes("w")}get thumbAspectRatio(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}get thumbContainerHeight(){if(this.mouseDown){const{height:e}=oa(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});return e}return this.sizeSpecifiedInCSS?this.elements.thumb.imageContainer.clientHeight:Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}get currentImageElement(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement}set currentImageElement(e){this.mouseDown?this.currentScrubbingImageElement=e:this.currentThumbnailImageElement=e}}const zs={insertElements(t,e){h.string(e)?sa(t,this.media,{src:e}):h.array(e)&&e.forEach(i=>{sa(t,this.media,i)})},change(t){Jn(t,"sources.length")?(Ke.cancelRequests.call(this),this.destroy.call(this,()=>{this.options.quality=[],He(this.media),this.media=null,h.element(this.elements.container)&&this.elements.container.removeAttribute("class");const{sources:e,type:i}=t,[{provider:s=qe.html5,src:r}]=e,a=s==="html5"?i:"div",n=s==="html5"?{}:{src:r};Object.assign(this,{provider:s,type:i,supported:G.check(i,s,this.config.playsinline),media:N(a,n)}),this.elements.container.appendChild(this.media),h.boolean(t.autoplay)&&(this.config.autoplay=t.autoplay),this.isHTML5&&(this.config.crossorigin&&this.media.setAttribute("crossorigin",""),this.config.autoplay&&this.media.setAttribute("autoplay",""),h.empty(t.poster)||(this.poster=t.poster),this.config.loop.active&&this.media.setAttribute("loop",""),this.config.muted&&this.media.setAttribute("muted",""),this.config.playsinline&&this.media.setAttribute("playsinline","")),Z.addStyleHook.call(this),this.isHTML5&&zs.insertElements.call(this,"source",e),this.config.title=t.title,co.setup.call(this),this.isHTML5&&Object.keys(t).includes("tracks")&&zs.insertElements.call(this,"track",t.tracks),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Z.build.call(this),this.isHTML5&&this.media.load(),h.empty(t.previewThumbnails)||(Object.assign(this.config.previewThumbnails,t.previewThumbnails),this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Ps(this))),this.fullscreen.update()},!0)):this.debug.warn("Invalid source format")}};class Xt{constructor(e,i){if(_(this,"play",()=>h.function(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then(()=>this.ads.play()).catch(()=>Be(this.media.play())),this.media.play()):null),_(this,"pause",()=>this.playing&&h.function(this.media.pause)?this.media.pause():null),_(this,"togglePlay",o=>(h.boolean(o)?o:!this.playing)?this.play():this.pause()),_(this,"stop",()=>{this.isHTML5?(this.pause(),this.restart()):h.function(this.media.stop)&&this.media.stop()}),_(this,"restart",()=>{this.currentTime=0}),_(this,"rewind",o=>{this.currentTime-=h.number(o)?o:this.config.seekTime}),_(this,"forward",o=>{this.currentTime+=h.number(o)?o:this.config.seekTime}),_(this,"increaseVolume",o=>{const c=this.media.muted?0:this.volume;this.volume=c+(h.number(o)?o:0)}),_(this,"decreaseVolume",o=>{this.increaseVolume(-o)}),_(this,"airplay",()=>{G.airplay&&this.media.webkitShowPlaybackTargetPicker()}),_(this,"toggleControls",o=>{if(this.supported.ui&&!this.isAudio){const c=ki(this.elements.container,this.config.classNames.hideControls),l=o===void 0?void 0:!o,d=W(this.elements.container,this.config.classNames.hideControls,l);if(d&&h.array(this.config.controls)&&this.config.controls.includes("settings")&&!h.empty(this.config.settings)&&S.toggleMenu.call(this,!1),d!==c){const u=d?"controlshidden":"controlsshown";E.call(this,this.media,u)}return!d}return!1}),_(this,"on",(o,c)=>{H.call(this,this.elements.container,o,c)}),_(this,"once",(o,c)=>{lr.call(this,this.elements.container,o,c)}),_(this,"off",(o,c)=>{Oi(this.elements.container,o,c)}),_(this,"destroy",(o,c=!1)=>{if(!this.ready)return;const l=()=>{document.body.style.overflow="",this.embed=null,c?(Object.keys(this.elements).length&&(He(this.elements.buttons.play),He(this.elements.captions),He(this.elements.controls),He(this.elements.wrapper),this.elements.buttons.play=null,this.elements.captions=null,this.elements.controls=null,this.elements.wrapper=null),h.function(o)&&o()):(Yu.call(this),Ke.cancelRequests.call(this),Ai(this.elements.original,this.elements.container),E.call(this,this.elements.original,"destroyed",!0),h.function(o)&&o.call(this.elements.original),this.ready=!1,setTimeout(()=>{this.elements=null,this.media=null},200))};this.stop(),clearTimeout(this.timers.loading),clearTimeout(this.timers.controls),clearTimeout(this.timers.resized),this.isHTML5?(Z.toggleNativeControls.call(this,!0),l()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),this.embed!==null&&h.function(this.embed.destroy)&&this.embed.destroy(),l()):this.isVimeo&&(this.embed!==null&&this.embed.unload().then(l),setTimeout(l,200))}),_(this,"supports",o=>G.mime.call(this,o)),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=G.touch,this.media=e,h.string(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||h.nodeList(this.media)||h.array(this.media))&&(this.media=this.media[0]),this.config=q({},lo,Xt.defaults,i||{},(()=>{try{return JSON.parse(this.media.getAttribute("data-plyr-config"))}catch{return{}}})()),this.elements={container:null,fullscreen:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new rp(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",G),h.nullOrUndefined(this.media)||!h.element(this.media))return void this.debug.error("Setup failed: no suitable element passed");if(this.media.plyr)return void this.debug.warn("Target already setup");if(!this.config.enabled)return void this.debug.error("Setup failed: disabled by config");if(!G.check().api)return void this.debug.error("Setup failed: no support");const s=this.media.cloneNode(!0);s.autoplay=!1,this.elements.original=s;const r=this.media.tagName.toLowerCase();let a=null,n=null;switch(r){case"div":if(a=this.media.querySelector("iframe"),h.element(a)){if(n=no(a.getAttribute("src")),this.provider=sp(n.toString()),this.elements.container=this.media,this.media=a,this.elements.container.className="",n.search.length){const o=["1","true"];o.includes(n.searchParams.get("autoplay"))&&(this.config.autoplay=!0),o.includes(n.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=o.includes(n.searchParams.get("playsinline")),this.config.youtube.hl=n.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(h.empty(this.provider)||!Object.values(qe).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=cs.video;break;case"video":case"audio":this.type=r,this.provider=qe.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:return void this.debug.error("Setup failed: unsupported type")}this.supported=G.check(this.type,this.provider,this.config.playsinline),this.supported.api?(this.eventListeners=[],this.listeners=new ap(this),this.storage=new Jt(this),this.media.plyr=this,h.element(this.elements.container)||(this.elements.container=N("div",{tabindex:0}),Xn(this.media,this.elements.container)),Z.migrateStyles.call(this),Z.addStyleHook.call(this),co.setup.call(this),this.config.debug&&H.call(this,this.elements.container,this.config.events.join(" "),o=>{this.debug.log(`event: ${o.type}`)}),this.fullscreen=new Ve(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Z.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new up(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",()=>Be(this.play())),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Ps(this))):this.debug.error("Setup failed: no support")}get isHTML5(){return this.provider===qe.html5}get isEmbed(){return this.isYouTube||this.isVimeo}get isYouTube(){return this.provider===qe.youtube}get isVimeo(){return this.provider===qe.vimeo}get isVideo(){return this.type===cs.video}get isAudio(){return this.type===cs.audio}get playing(){return Boolean(this.ready&&!this.paused&&!this.ended)}get paused(){return Boolean(this.media.paused)}get stopped(){return Boolean(this.paused&&this.currentTime===0)}get ended(){return Boolean(this.media.ended)}set currentTime(e){if(!this.duration)return;const i=h.number(e)&&e>0;this.media.currentTime=i?Math.min(e,this.duration):0,this.debug.log(`Seeking to ${this.currentTime} seconds`)}get currentTime(){return Number(this.media.currentTime)}get buffered(){const{buffered:e}=this.media;return h.number(e)?e:e&&e.length&&this.duration>0?e.end(0)/this.duration:0}get seeking(){return Boolean(this.media.seeking)}get duration(){const e=parseFloat(this.config.duration),i=(this.media||{}).duration,s=h.number(i)&&i!==1/0?i:0;return e||s}set volume(e){let i=e;h.string(i)&&(i=Number(i)),h.number(i)||(i=this.storage.get("volume")),h.number(i)||({volume:i}=this.config),i>1&&(i=1),i<0&&(i=0),this.config.volume=i,this.media.volume=i,!h.empty(e)&&this.muted&&i>0&&(this.muted=!1)}get volume(){return Number(this.media.volume)}set muted(e){let i=e;h.boolean(i)||(i=this.storage.get("muted")),h.boolean(i)||(i=this.config.muted),this.config.muted=i,this.media.muted=i}get muted(){return Boolean(this.media.muted)}get hasAudio(){return!this.isHTML5||!!this.isAudio||Boolean(this.media.mozHasAudio)||Boolean(this.media.webkitAudioDecodedByteCount)||Boolean(this.media.audioTracks&&this.media.audioTracks.length)}set speed(e){let i=null;h.number(e)&&(i=e),h.number(i)||(i=this.storage.get("speed")),h.number(i)||(i=this.config.speed.selected);const{minimumSpeed:s,maximumSpeed:r}=this;i=ho(i,s,r),this.config.speed.selected=i,setTimeout(()=>{this.media&&(this.media.playbackRate=i)},0)}get speed(){return Number(this.media.playbackRate)}get minimumSpeed(){return this.isYouTube?Math.min(...this.options.speed):this.isVimeo?.5:.0625}get maximumSpeed(){return this.isYouTube?Math.max(...this.options.speed):this.isVimeo?2:16}set quality(e){const i=this.config.quality,s=this.options.quality;if(!s.length)return;let r=[!h.empty(e)&&Number(e),this.storage.get("quality"),i.selected,i.default].find(h.number),a=!0;if(!s.includes(r)){const n=Kn(s,r);this.debug.warn(`Unsupported quality option: ${r}, using ${n} instead`),r=n,a=!1}i.selected=r,this.media.quality=r,a&&this.storage.set({quality:r})}get quality(){return this.media.quality}set loop(e){const i=h.boolean(e)?e:this.config.loop.active;this.config.loop.active=i,this.media.loop=i}get loop(){return Boolean(this.media.loop)}set source(e){zs.change.call(this,e)}get source(){return this.media.currentSrc}get download(){const{download:e}=this.config.urls;return h.url(e)?e:this.source}set download(e){h.url(e)&&(this.config.urls.download=e,S.setDownloadUrl.call(this))}set poster(e){this.isVideo?Z.setPoster.call(this,e,!1).catch(()=>{}):this.debug.warn("Poster can only be set for video")}get poster(){return this.isVideo?this.media.getAttribute("poster")||this.media.getAttribute("data-poster"):null}get ratio(){if(!this.isVideo)return null;const e=Ti(cr.call(this));return h.array(e)?e.join(":"):e}set ratio(e){this.isVideo?h.string(e)&&to(e)?(this.config.ratio=Ti(e),It.call(this)):this.debug.error(`Invalid aspect ratio specified (${e})`):this.debug.warn("Aspect ratio can only be set for video")}set autoplay(e){this.config.autoplay=h.boolean(e)?e:this.config.autoplay}get autoplay(){return Boolean(this.config.autoplay)}toggleCaptions(e){F.toggle.call(this,e,!1)}set currentTrack(e){F.set.call(this,e,!1),F.setup.call(this)}get currentTrack(){const{toggled:e,currentTrack:i}=this.captions;return e?i:-1}set language(e){F.setLanguage.call(this,e,!1)}get language(){return(F.getCurrentTrack.call(this)||{}).language}set pip(e){if(!G.pip)return;const i=h.boolean(e)?e:!this.pip;h.function(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(i?ls.active:ls.inactive),h.function(this.media.requestPictureInPicture)&&(!this.pip&&i?this.media.requestPictureInPicture():this.pip&&!i&&document.exitPictureInPicture())}get pip(){return G.pip?h.empty(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===ls.active:null}setPreviewThumbnails(e){this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),Object.assign(this.config.previewThumbnails,e),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Ps(this))}static supported(e,i,s){return G.check(e,i,s)}static loadSprite(e,i){return ro(e,i)}static setup(e,i={}){let s=null;return h.string(e)?s=Array.from(document.querySelectorAll(e)):h.nodeList(e)?s=Array.from(e):h.array(e)&&(s=e.filter(h.element)),h.empty(s)?null:s.map(r=>new Xt(r,i))}}Xt.defaults=Wu(lo);function gp(t){let e,i,s;return{c(){e=Ct("video"),i=Ct("source"),Pn(i.src,s=t[3])||C(i,"src",s),C(i,"type",t[2]),C(e,"data-app-kind","Plyr"),C(e,"crossorigin","anonymous"),e.playsInline=!0,C(e,"data-poster",t[4])},m(r,a){At(r,e,a),V(e,i),t[8](e)},p:st,d(r){r&&ft(e),t[8](null)}}}function mp(t){let e,i,s;return{c(){e=Ct("audio"),i=Ct("source"),Pn(i.src,s=t[3])||C(i,"src",s),C(i,"type",t[2]),C(e,"data-app-kind","Plyr"),C(e,"crossorigin","anonymous"),C(e,"data-poster",t[4])},m(r,a){At(r,e,a),V(e,i),t[7](e)},p:st,d(r){r&&ft(e),t[7](null)}}}function fp(t){let e,i,s=JSON.stringify({src:t[3],type:t[0].state.type})+"",r;return{c(){e=Ct("div"),i=Cs(`Invalid "src" or "type".
|
126
|
+
`),r=Cs(s),C(e,"data-app-kind","Plyr"),C(e,"class","plyr--audio")},m(a,n){At(a,e,n),V(e,i),V(e,r)},p(a,n){n&1&&s!==(s=JSON.stringify({src:a[3],type:a[0].state.type})+"")&&Jd(r,s)},d(a){a&&ft(e)}}}function bp(t){let e;return{c(){e=Ct("div"),C(e,"data-app-kind","Plyr"),C(e,"class","plyr__video-embed"),C(e,"data-plyr-provider","youtube"),C(e,"data-plyr-embed-id",t[3]),C(e,"data-poster",t[4])},m(i,s){At(i,e,s),t[6](e)},p:st,d(i){i&&ft(e),t[6](null)}}}function yp(t){let e,i,s,r;function a(c,l){return c[0].state.provider==="youtube"?bp:c[2]?(e==null&&(e=!!c[2].startsWith("audio/")),e?mp:gp):fp}let n=a(t),o=n(t);return s=new bu({}),{c(){o.c(),i=Gd(),au(s.$$.fragment)},m(c,l){o.m(c,l),At(c,i,l),Vn(s,c,l),r=!0},p(c,[l]){n===(n=a(c))&&o?o.p(c,l):(o.d(1),o=n(c),o&&(o.c(),o.m(i.parentNode,i)))},i(c){r||(Ln(s.$$.fragment,c),r=!0)},o(c){ru(s.$$.fragment,c),r=!1},d(c){o.d(c),c&&ft(i),$n(s,c)}}}function wp(t,e,i){let{storage:s}=e,{sync:r}=e;const a=s.state.provider?void 0:s.state.type||cu(s.state.src),{src:n,poster:o}=s.state,c=lu.includes(String(a).toLowerCase());let l,d;Xd(async()=>{if(l){if(c&&pu(l)){const g=await uu();g.loadSource(n),g.attachMedia(l)}d=new Xt(l,{fullscreen:{enabled:!1},controls:["play","progress","current-time","mute","volume"],clickToPlay:!1,youtube:{autoplay:!0},loadSprite:!1}),i(5,r.player=d,r)}}),Kd(()=>{try{r.dispose(),d==null||d.destroy()}catch(g){console.warn("[Plyr] destroy plyr error",g)}});function u(g){Ht[g?"unshift":"push"](()=>{l=g,i(1,l)})}function p(g){Ht[g?"unshift":"push"](()=>{l=g,i(1,l)})}function m(g){Ht[g?"unshift":"push"](()=>{l=g,i(1,l)})}return t.$$set=g=>{"storage"in g&&i(0,s=g.storage),"sync"in g&&i(5,r=g.sync)},[s,l,a,n,o,r,u,p,m]}class vp extends Bn{constructor(e){super();jn(this,e,wp,yp,En,{storage:0,sync:5})}}class xp{constructor(e){this.context=e,this.behavior="owner",this._skip_next_play_pause=0,this._sync_timer=0,this._interval=1e3,this._blink=0,this._player=null,this._buffering=!1,this._throttle=0,this._dispatch_time_again=!1,this._buffering_timer=0,this._disposer=null;const i=e.room,s=e.displayer;this.uid=i?i.uid:"",this.getTimestamp=i?()=>i.calibrationTimestamp:()=>s.beginTimestamp+s.progressTime,this._disposer=this.context.storage.addStateChangedListener(this.syncAll.bind(this))}dispose(){this._disposer&&this._disposer(),this._disposer=null,clearInterval(this._sync_timer),clearTimeout(this._buffering_timer)}get player(){return this._player}set player(e){this._player=e,e&&e.once("ready",this.setupPlayer.bind(this,e))}setupPlayer(e){this.registerListeners(e),this.watchUserInputs(e),this._sync_timer=setInterval(this.syncAll.bind(this),this._interval)}syncAll(){const{behavior:e,player:i,context:s}=this;if(!i)return;const{storage:r}=s,{currentTime:a,hostTime:n,muted:o,paused:c,volume:l,owner:d}=r.state;e==="owner"&&d===this.uid||(c!==i.paused&&!this._skip_next_play_pause&&(console.log("< sync paused",c),c?i.pause():hu(i)),o!==i.muted&&(console.log("< sync muted",o),i.muted=o),l!==i.volume&&(console.log("< sync volume",l),i.volume=l),!this._buffering&&(c?Math.abs(i.currentTime-a)>.5&&(console.log("< sync current time (paused)",a),i.currentTime=a):this.syncCurrentTime(n,a,i)))}watchUserInputs(e){const i=e.elements.controls,s=mu(e.elements.buttons.play),r=i==null?void 0:i.querySelector('input[data-plyr="seek"]'),a=i==null?void 0:i.querySelector('button[data-plyr="mute"]'),n=i==null?void 0:i.querySelector('input[data-plyr="volume"]');this.fixSeekBarOnInit(r,e),s==null||s.addEventListener("click",()=>{this.behavior==="owner"&&this.dispatchOwner(),this.dispatchPlayPause(e)}),r==null||r.addEventListener("change",()=>{this.behavior==="owner"&&this.dispatchOwner(),this.dispatchSeek(e,r)}),a==null||a.addEventListener("click",()=>{this.behavior==="owner"&&this.dispatchOwner(),this.dispatchVolume(e)}),n==null||n.addEventListener("change",()=>{this.behavior==="owner"&&this.dispatchOwner(),this.dispatchVolume(e)})}fixSeekBarOnInit(e,i){const{currentTime:s}=this.context.storage.state;if(i.duration&&s&&e){const r=100*s/i.duration;e.value=r.toFixed(2)}}registerListeners(e){e.on("ended",()=>{e.stop(),this.context.storage.setState({paused:!0,currentTime:0})}),e.on("waiting",()=>{this._buffering=!0,this._buffering_timer=setTimeout(this.clearBuffering.bind(this),this._interval/2)}),e.on("playing",()=>{this._buffering=!1}),e.on("timeupdate",()=>{this.isOwner()&&this.dispatchCurrentTime(e)}),e.on("volumechange",()=>{this.isOwner()&&this.dispatchVolume(e)}),e.on("play",()=>{this.isOwner()&&this.dispatchPlayPause(e)}),e.on("pause",()=>{this.isOwner()&&this.dispatchPlayPause(e)})}clearBuffering(){this._buffering=!1,this._buffering_timer=0}dispatchOwner(){this.context.storage.state.owner!==this.uid&&(console.log("> set owner",this.uid),this.context.storage.setState({owner:this.uid}))}dispatchPlayPause(e){console.log("> set paused",e.paused),this.context.storage.setState({hostTime:this.getTimestamp(),currentTime:e.currentTime,paused:e.paused}),clearTimeout(this._skip_next_play_pause),this._skip_next_play_pause=setTimeout(this.skipNextPlayPause.bind(this),500)}skipNextPlayPause(){this._skip_next_play_pause=0}dispatchVolume(e){console.log("> set volume",e.volume),this.context.storage.setState({muted:e.muted,volume:e.volume})}dispatchSeek(e,i){const s=i.valueAsNumber*e.duration/100;console.log("> set current time (seek)",s),this.context.storage.setState({hostTime:this.getTimestamp(),currentTime:s})}dispatchCurrentTime(e){if(this._throttle){this._dispatch_time_again=!0;return}console.log("> set current time",e.currentTime),this.context.storage.setState({hostTime:this.getTimestamp(),currentTime:e.currentTime}),this._throttle=setTimeout(this.clearThrottle.bind(this,e),1e3)}clearThrottle(e){this._throttle=0,this._dispatch_time_again&&(this._dispatch_time_again=!1,this.dispatchCurrentTime(e))}isOwner(){return this.behavior==="owner"&&this.context.storage.state.owner===this.uid}syncCurrentTime(e,i,s){const r=this.getTimestamp();if(r&&e){const a=i+(r-e)/1e3;Math.abs(a-s.currentTime)>1?(console.log("< sync current time (playing)",a),s.currentTime=a,this._blink++,this._blink>3&&this.updateSyncInterval(!0)):this.updateSyncInterval(!1)}}updateSyncInterval(e){this._blink=0,this._interval=gu(this._interval+(e?2e3:-2e3),1e3,15e3),clearTimeout(this._sync_timer),this._sync_timer=setInterval(this.syncAll.bind(this),this._interval)}}var Mp=(()=>`@charset "UTF-8";@keyframes plyr-progress{to{background-position:25px 0;background-position:var(--plyr-progress-loading-size,25px) 0}}@keyframes plyr-popup{0%{opacity:.5;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@keyframes plyr-fade-in{0%{opacity:0}to{opacity:1}}.plyr{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;align-items:center;direction:ltr;display:flex;flex-direction:column;font-family:inherit;font-family:var(--plyr-font-family,inherit);font-variant-numeric:tabular-nums;font-weight:400;font-weight:var(--plyr-font-weight-regular,400);line-height:1.7;line-height:var(--plyr-line-height,1.7);max-width:100%;min-width:200px;position:relative;text-shadow:none;transition:box-shadow .3s ease;z-index:0}.plyr audio,.plyr iframe,.plyr video{display:block;height:100%;width:100%}.plyr button{font:inherit;line-height:inherit;width:auto}.plyr:focus{outline:0}.plyr--full-ui{box-sizing:border-box}.plyr--full-ui *,.plyr--full-ui :after,.plyr--full-ui :before{box-sizing:inherit}.plyr--full-ui a,.plyr--full-ui button,.plyr--full-ui input,.plyr--full-ui label{touch-action:manipulation}.plyr__badge{background:#4a5464;background:var(--plyr-badge-background,#4a5464);border-radius:2px;border-radius:var(--plyr-badge-border-radius,2px);color:#fff;color:var(--plyr-badge-text-color,#fff);font-size:9px;font-size:var(--plyr-font-size-badge,9px);line-height:1;padding:3px 4px}.plyr--full-ui ::-webkit-media-text-track-container{display:none}.plyr__captions{animation:plyr-fade-in .3s ease;bottom:0;display:none;font-size:13px;font-size:var(--plyr-font-size-small,13px);left:0;padding:10px;padding:var(--plyr-control-spacing,10px);position:absolute;text-align:center;transition:transform .4s ease-in-out;width:100%}.plyr__captions span:empty{display:none}@media (min-width:480px){.plyr__captions{font-size:15px;font-size:var(--plyr-font-size-base,15px);padding:20px;padding:calc(var(--plyr-control-spacing, 10px)*2)}}@media (min-width:768px){.plyr__captions{font-size:18px;font-size:var(--plyr-font-size-large,18px)}}.plyr--captions-active .plyr__captions{display:block}.plyr:not(.plyr--hide-controls) .plyr__controls:not(:empty)~.plyr__captions{transform:translateY(-40px);transform:translateY(calc(var(--plyr-control-spacing, 10px)*-4))}.plyr__caption{background:rgba(0,0,0,.8);background:var(--plyr-captions-background,rgba(0,0,0,.8));border-radius:2px;-webkit-box-decoration-break:clone;box-decoration-break:clone;color:#fff;color:var(--plyr-captions-text-color,#fff);line-height:185%;padding:.2em .5em;white-space:pre-wrap}.plyr__caption div{display:inline}.plyr__control{background:transparent;border:0;border-radius:3px;border-radius:var(--plyr-control-radius,3px);color:inherit;cursor:pointer;flex-shrink:0;overflow:visible;padding:7px;padding:calc(var(--plyr-control-spacing, 10px)*.7);position:relative;transition:all .3s ease}.plyr__control svg{fill:currentColor;display:block;height:18px;height:var(--plyr-control-icon-size,18px);pointer-events:none;width:18px;width:var(--plyr-control-icon-size,18px)}.plyr__control:focus{outline:0}.plyr__control.plyr__tab-focus{outline:3px dotted #00b2ff;outline:var(--plyr-tab-focus-color,var(--plyr-color-main,var(--plyr-color-main,#00b2ff))) dotted 3px;outline-offset:2px}a.plyr__control{text-decoration:none}.plyr__control.plyr__control--pressed .icon--not-pressed,.plyr__control.plyr__control--pressed .label--not-pressed,.plyr__control:not(.plyr__control--pressed) .icon--pressed,.plyr__control:not(.plyr__control--pressed) .label--pressed,a.plyr__control:after,a.plyr__control:before{display:none}.plyr--full-ui ::-webkit-media-controls{display:none}.plyr__controls{align-items:center;display:flex;justify-content:flex-end;text-align:center}.plyr__controls .plyr__progress__container{flex:1;min-width:0}.plyr__controls .plyr__controls__item{margin-left:2.5px;margin-left:calc(var(--plyr-control-spacing, 10px)/4)}.plyr__controls .plyr__controls__item:first-child{margin-left:0;margin-right:auto}.plyr__controls .plyr__controls__item.plyr__progress__container{padding-left:2.5px;padding-left:calc(var(--plyr-control-spacing, 10px)/4)}.plyr__controls .plyr__controls__item.plyr__time{padding:0 5px;padding:0 calc(var(--plyr-control-spacing, 10px)/2)}.plyr__controls .plyr__controls__item.plyr__progress__container:first-child,.plyr__controls .plyr__controls__item.plyr__time+.plyr__time,.plyr__controls .plyr__controls__item.plyr__time:first-child{padding-left:0}.plyr [data-plyr=airplay],.plyr [data-plyr=captions],.plyr [data-plyr=fullscreen],.plyr [data-plyr=pip],.plyr__controls:empty{display:none}.plyr--airplay-supported [data-plyr=airplay],.plyr--captions-enabled [data-plyr=captions],.plyr--fullscreen-enabled [data-plyr=fullscreen],.plyr--pip-supported [data-plyr=pip]{display:inline-block}.plyr__menu{display:flex;position:relative}.plyr__menu .plyr__control svg{transition:transform .3s ease}.plyr__menu .plyr__control[aria-expanded=true] svg{transform:rotate(90deg)}.plyr__menu .plyr__control[aria-expanded=true] .plyr__tooltip{display:none}.plyr__menu__container{animation:plyr-popup .2s ease;background:hsla(0,0%,100%,.9);background:var(--plyr-menu-background,hsla(0,0%,100%,.9));border-radius:4px;bottom:100%;box-shadow:0 1px 2px #00000026;box-shadow:var(--plyr-menu-shadow,0 1px 2px rgba(0,0,0,.15));color:#4a5464;color:var(--plyr-menu-color,#4a5464);font-size:15px;font-size:var(--plyr-font-size-base,15px);margin-bottom:10px;position:absolute;right:-3px;text-align:left;white-space:nowrap;z-index:3}.plyr__menu__container>div{overflow:hidden;transition:height .35s cubic-bezier(.4,0,.2,1),width .35s cubic-bezier(.4,0,.2,1)}.plyr__menu__container:after{border:4px solid transparent;border-top-color:#ffffffe6;border:var(--plyr-menu-arrow-size,4px) solid transparent;border-top-color:var(--plyr-menu-background,hsla(0,0%,100%,.9));content:"";height:0;position:absolute;right:14px;right:calc(var(--plyr-control-icon-size, 18px)/2 + var(--plyr-control-spacing, 10px)*.7 - var(--plyr-menu-arrow-size, 4px)/2);top:100%;width:0}.plyr__menu__container [role=menu]{padding:7px;padding:calc(var(--plyr-control-spacing, 10px)*.7)}.plyr__menu__container [role=menuitem],.plyr__menu__container [role=menuitemradio]{margin-top:2px}.plyr__menu__container [role=menuitem]:first-child,.plyr__menu__container [role=menuitemradio]:first-child{margin-top:0}.plyr__menu__container .plyr__control{align-items:center;color:#4a5464;color:var(--plyr-menu-color,#4a5464);display:flex;font-size:13px;font-size:var(--plyr-font-size-menu,var(--plyr-font-size-small,13px));padding:4.66667px 10.5px;padding:calc(var(--plyr-control-spacing, 10px)*.7/1.5) calc(var(--plyr-control-spacing, 10px)*.7*1.5);-webkit-user-select:none;user-select:none;width:100%}.plyr__menu__container .plyr__control>span{align-items:inherit;display:flex;width:100%}.plyr__menu__container .plyr__control:after{border:4px solid transparent;border:var(--plyr-menu-item-arrow-size,4px) solid transparent;content:"";position:absolute;top:50%;transform:translateY(-50%)}.plyr__menu__container .plyr__control--forward{padding-right:28px;padding-right:calc(var(--plyr-control-spacing, 10px)*.7*4)}.plyr__menu__container .plyr__control--forward:after{border-left-color:#728197;border-left-color:var(--plyr-menu-arrow-color,#728197);right:6.5px;right:calc(var(--plyr-control-spacing, 10px)*.7*1.5 - var(--plyr-menu-item-arrow-size, 4px))}.plyr__menu__container .plyr__control--forward.plyr__tab-focus:after,.plyr__menu__container .plyr__control--forward:hover:after{border-left-color:currentColor}.plyr__menu__container .plyr__control--back{font-weight:400;font-weight:var(--plyr-font-weight-regular,400);margin:7px;margin:calc(var(--plyr-control-spacing, 10px)*.7);margin-bottom:3.5px;margin-bottom:calc(var(--plyr-control-spacing, 10px)*.7/2);padding-left:28px;padding-left:calc(var(--plyr-control-spacing, 10px)*.7*4);position:relative;width:calc(100% - 14px);width:calc(100% - var(--plyr-control-spacing, 10px)*.7*2)}.plyr__menu__container .plyr__control--back:after{border-right-color:#728197;border-right-color:var(--plyr-menu-arrow-color,#728197);left:6.5px;left:calc(var(--plyr-control-spacing, 10px)*.7*1.5 - var(--plyr-menu-item-arrow-size, 4px))}.plyr__menu__container .plyr__control--back:before{background:#dcdfe5;background:var(--plyr-menu-back-border-color,#dcdfe5);box-shadow:0 1px #fff;box-shadow:0 1px 0 var(--plyr-menu-back-border-shadow-color,#fff);content:"";height:1px;left:0;margin-top:3.5px;margin-top:calc(var(--plyr-control-spacing, 10px)*.7/2);overflow:hidden;position:absolute;right:0;top:100%}.plyr__menu__container .plyr__control--back.plyr__tab-focus:after,.plyr__menu__container .plyr__control--back:hover:after{border-right-color:currentColor}.plyr__menu__container .plyr__control[role=menuitemradio]{padding-left:7px;padding-left:calc(var(--plyr-control-spacing, 10px)*.7)}.plyr__menu__container .plyr__control[role=menuitemradio]:after,.plyr__menu__container .plyr__control[role=menuitemradio]:before{border-radius:100%}.plyr__menu__container .plyr__control[role=menuitemradio]:before{background:rgba(0,0,0,.1);content:"";display:block;flex-shrink:0;height:16px;margin-right:10px;margin-right:var(--plyr-control-spacing,10px);transition:all .3s ease;width:16px}.plyr__menu__container .plyr__control[role=menuitemradio]:after{background:#fff;border:0;height:6px;left:12px;opacity:0;top:50%;transform:translateY(-50%) scale(0);transition:transform .3s ease,opacity .3s ease;width:6px}.plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]:before{background:#00b2ff;background:var(--plyr-control-toggle-checked-background,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)))}.plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]:after{opacity:1;transform:translateY(-50%) scale(1)}.plyr__menu__container .plyr__control[role=menuitemradio].plyr__tab-focus:before,.plyr__menu__container .plyr__control[role=menuitemradio]:hover:before{background:rgba(35,40,47,.1)}.plyr__menu__container .plyr__menu__value{align-items:center;display:flex;margin-left:auto;margin-right:calc(-7px + 2);margin-right:calc(var(--plyr-control-spacing, 10px)*.7*-1 - -2);overflow:hidden;padding-left:24.5px;padding-left:calc(var(--plyr-control-spacing, 10px)*.7*3.5);pointer-events:none}.plyr--full-ui input[type=range]{-webkit-appearance:none;appearance:none;background:transparent;border:0;border-radius:26px;border-radius:calc(var(--plyr-range-thumb-height, 13px)*2);color:#00b2ff;color:var(--plyr-range-fill-background,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)));display:block;height:19px;height:calc(var(--plyr-range-thumb-active-shadow-width, 3px)*2 + var(--plyr-range-thumb-height, 13px));margin:0;min-width:0;padding:0;transition:box-shadow .3s ease;width:100%}.plyr--full-ui input[type=range]::-webkit-slider-runnable-track{background:transparent;background-image:linear-gradient(90deg,currentColor 0,transparent 0);background-image:linear-gradient(to right,currentColor var(--value,0),transparent var(--value,0));border:0;border-radius:2.5px;border-radius:calc(var(--plyr-range-track-height, 5px)/2);height:5px;height:var(--plyr-range-track-height,5px);-webkit-transition:box-shadow .3s ease;transition:box-shadow .3s ease;-webkit-user-select:none;user-select:none}.plyr--full-ui input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background:#fff;background:var(--plyr-range-thumb-background,#fff);border:0;border-radius:100%;box-shadow:0 1px 1px #23282f26,0 0 0 1px #23282f33;box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2));height:13px;height:var(--plyr-range-thumb-height,13px);margin-top:-4px;margin-top:calc((var(--plyr-range-thumb-height, 13px) - var(--plyr-range-track-height, 5px))/2*-1);position:relative;-webkit-transition:all .2s ease;transition:all .2s ease;width:13px;width:var(--plyr-range-thumb-height,13px)}.plyr--full-ui input[type=range]::-moz-range-track{background:transparent;border:0;border-radius:2.5px;border-radius:calc(var(--plyr-range-track-height, 5px)/2);height:5px;height:var(--plyr-range-track-height,5px);-moz-transition:box-shadow .3s ease;transition:box-shadow .3s ease;user-select:none}.plyr--full-ui input[type=range]::-moz-range-thumb{background:#fff;background:var(--plyr-range-thumb-background,#fff);border:0;border-radius:100%;box-shadow:0 1px 1px #23282f26,0 0 0 1px #23282f33;box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2));height:13px;height:var(--plyr-range-thumb-height,13px);position:relative;-moz-transition:all .2s ease;transition:all .2s ease;width:13px;width:var(--plyr-range-thumb-height,13px)}.plyr--full-ui input[type=range]::-moz-range-progress{background:currentColor;border-radius:2.5px;border-radius:calc(var(--plyr-range-track-height, 5px)/2);height:5px;height:var(--plyr-range-track-height,5px)}.plyr--full-ui input[type=range]::-ms-track{color:transparent}.plyr--full-ui input[type=range]::-ms-fill-upper,.plyr--full-ui input[type=range]::-ms-track{background:transparent;border:0;border-radius:2.5px;border-radius:calc(var(--plyr-range-track-height, 5px)/2);height:5px;height:var(--plyr-range-track-height,5px);-ms-transition:box-shadow .3s ease;transition:box-shadow .3s ease;user-select:none}.plyr--full-ui input[type=range]::-ms-fill-lower{background:transparent;background:currentColor;border:0;border-radius:2.5px;border-radius:calc(var(--plyr-range-track-height, 5px)/2);height:5px;height:var(--plyr-range-track-height,5px);-ms-transition:box-shadow .3s ease;transition:box-shadow .3s ease;user-select:none}.plyr--full-ui input[type=range]::-ms-thumb{background:#fff;background:var(--plyr-range-thumb-background,#fff);border:0;border-radius:100%;box-shadow:0 1px 1px #23282f26,0 0 0 1px #23282f33;box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2));height:13px;height:var(--plyr-range-thumb-height,13px);margin-top:0;position:relative;-ms-transition:all .2s ease;transition:all .2s ease;width:13px;width:var(--plyr-range-thumb-height,13px)}.plyr--full-ui input[type=range]::-ms-tooltip{display:none}.plyr--full-ui input[type=range]::-moz-focus-outer{border:0}.plyr--full-ui input[type=range]:focus{outline:0}.plyr--full-ui input[type=range].plyr__tab-focus::-webkit-slider-runnable-track{outline:3px dotted #00b2ff;outline:var(--plyr-tab-focus-color,var(--plyr-color-main,var(--plyr-color-main,#00b2ff))) dotted 3px;outline-offset:2px}.plyr--full-ui input[type=range].plyr__tab-focus::-moz-range-track{outline:3px dotted #00b2ff;outline:var(--plyr-tab-focus-color,var(--plyr-color-main,var(--plyr-color-main,#00b2ff))) dotted 3px;outline-offset:2px}.plyr--full-ui input[type=range].plyr__tab-focus::-ms-track{outline:3px dotted #00b2ff;outline:var(--plyr-tab-focus-color,var(--plyr-color-main,var(--plyr-color-main,#00b2ff))) dotted 3px;outline-offset:2px}.plyr__poster{background-color:#000;background-color:var(--plyr-video-background,var(--plyr-video-background,#000));background-position:50% 50%;background-repeat:no-repeat;background-size:contain;height:100%;left:0;opacity:0;position:absolute;top:0;transition:opacity .2s ease;width:100%;z-index:1}.plyr--stopped.plyr__poster-enabled .plyr__poster{opacity:1}.plyr--youtube.plyr--paused.plyr__poster-enabled:not(.plyr--stopped) .plyr__poster{display:none}.plyr__time{font-size:13px;font-size:var(--plyr-font-size-time,var(--plyr-font-size-small,13px))}.plyr__time+.plyr__time:before{content:"\\2044";margin-right:10px;margin-right:var(--plyr-control-spacing,10px)}@media (max-width:767px){.plyr__time+.plyr__time{display:none}}.plyr__tooltip{background:hsla(0,0%,100%,.9);background:var(--plyr-tooltip-background,hsla(0,0%,100%,.9));border-radius:5px;border-radius:var(--plyr-tooltip-radius,5px);bottom:100%;box-shadow:0 1px 2px #00000026;box-shadow:var(--plyr-tooltip-shadow,0 1px 2px rgba(0,0,0,.15));color:#4a5464;color:var(--plyr-tooltip-color,#4a5464);font-size:13px;font-size:var(--plyr-font-size-small,13px);font-weight:400;font-weight:var(--plyr-font-weight-regular,400);left:50%;line-height:1.3;margin-bottom:10px;margin-bottom:calc(var(--plyr-control-spacing, 10px)/2*2);opacity:0;padding:5px 7.5px;padding:calc(var(--plyr-control-spacing, 10px)/2) calc(var(--plyr-control-spacing, 10px)/2*1.5);pointer-events:none;position:absolute;transform:translate(-50%,10px) scale(.8);transform-origin:50% 100%;transition:transform .2s ease .1s,opacity .2s ease .1s;white-space:nowrap;z-index:2}.plyr__tooltip:before{border-left:4px solid transparent;border-left:var(--plyr-tooltip-arrow-size,4px) solid transparent;border-right:4px solid transparent;border-right:var(--plyr-tooltip-arrow-size,4px) solid transparent;border-top:4px solid hsla(0,0%,100%,.9);border-top:var(--plyr-tooltip-arrow-size,4px) solid var(--plyr-tooltip-background,hsla(0,0%,100%,.9));bottom:-4px;bottom:calc(var(--plyr-tooltip-arrow-size, 4px)*-1);content:"";height:0;left:50%;position:absolute;transform:translate(-50%);width:0;z-index:2}.plyr .plyr__control.plyr__tab-focus .plyr__tooltip,.plyr .plyr__control:hover .plyr__tooltip,.plyr__tooltip--visible{opacity:1;transform:translate(-50%) scale(1)}.plyr .plyr__control:hover .plyr__tooltip{z-index:3}.plyr__controls>.plyr__control:first-child .plyr__tooltip,.plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip{left:0;transform:translateY(10px) scale(.8);transform-origin:0 100%}.plyr__controls>.plyr__control:first-child .plyr__tooltip:before,.plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip:before{left:16px;left:calc(var(--plyr-control-icon-size, 18px)/2 + var(--plyr-control-spacing, 10px)*.7)}.plyr__controls>.plyr__control:last-child .plyr__tooltip{left:auto;right:0;transform:translateY(10px) scale(.8);transform-origin:100% 100%}.plyr__controls>.plyr__control:last-child .plyr__tooltip:before{left:auto;right:16px;right:calc(var(--plyr-control-icon-size, 18px)/2 + var(--plyr-control-spacing, 10px)*.7);transform:translate(50%)}.plyr__controls>.plyr__control:first-child .plyr__tooltip--visible,.plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip--visible,.plyr__controls>.plyr__control:first-child+.plyr__control.plyr__tab-focus .plyr__tooltip,.plyr__controls>.plyr__control:first-child+.plyr__control:hover .plyr__tooltip,.plyr__controls>.plyr__control:first-child.plyr__tab-focus .plyr__tooltip,.plyr__controls>.plyr__control:first-child:hover .plyr__tooltip,.plyr__controls>.plyr__control:last-child .plyr__tooltip--visible,.plyr__controls>.plyr__control:last-child.plyr__tab-focus .plyr__tooltip,.plyr__controls>.plyr__control:last-child:hover .plyr__tooltip{transform:translate(0) scale(1)}.plyr__progress{left:6.5px;left:calc(var(--plyr-range-thumb-height, 13px)*.5);margin-right:13px;margin-right:var(--plyr-range-thumb-height,13px);position:relative}.plyr__progress input[type=range],.plyr__progress__buffer{margin-left:-6.5px;margin-left:calc(var(--plyr-range-thumb-height, 13px)*-.5);margin-right:-6.5px;margin-right:calc(var(--plyr-range-thumb-height, 13px)*-.5);width:calc(100% + 13px);width:calc(100% + var(--plyr-range-thumb-height, 13px))}.plyr__progress input[type=range]{position:relative;z-index:2}.plyr__progress .plyr__tooltip{left:0;max-width:120px;overflow-wrap:break-word;white-space:normal}.plyr__progress__buffer{-webkit-appearance:none;background:transparent;border:0;border-radius:100px;height:5px;height:var(--plyr-range-track-height,5px);left:0;margin-top:-2.5px;margin-top:calc((var(--plyr-range-track-height, 5px)/2)*-1);padding:0;position:absolute;top:50%}.plyr__progress__buffer::-webkit-progress-bar{background:transparent}.plyr__progress__buffer::-webkit-progress-value{background:currentColor;border-radius:100px;min-width:5px;min-width:var(--plyr-range-track-height,5px);-webkit-transition:width .2s ease;transition:width .2s ease}.plyr__progress__buffer::-moz-progress-bar{background:currentColor;border-radius:100px;min-width:5px;min-width:var(--plyr-range-track-height,5px);-moz-transition:width .2s ease;transition:width .2s ease}.plyr__progress__buffer::-ms-fill{border-radius:100px;-ms-transition:width .2s ease;transition:width .2s ease}.plyr--loading .plyr__progress__buffer{animation:plyr-progress 1s linear infinite;background-image:linear-gradient(-45deg,rgba(35,40,47,.6) 25%,transparent 0,transparent 50%,rgba(35,40,47,.6) 0,rgba(35,40,47,.6) 75%,transparent 0,transparent);background-image:linear-gradient(-45deg,var(--plyr-progress-loading-background,rgba(35,40,47,.6)) 25%,transparent 25%,transparent 50%,var(--plyr-progress-loading-background,rgba(35,40,47,.6)) 50%,var(--plyr-progress-loading-background,rgba(35,40,47,.6)) 75%,transparent 75%,transparent);background-repeat:repeat-x;background-size:25px 25px;background-size:var(--plyr-progress-loading-size,25px) var(--plyr-progress-loading-size,25px);color:transparent}.plyr--video.plyr--loading .plyr__progress__buffer{background-color:#ffffff40;background-color:var(--plyr-video-progress-buffered-background,hsla(0,0%,100%,.25))}.plyr--audio.plyr--loading .plyr__progress__buffer{background-color:#c1c8d199;background-color:var(--plyr-audio-progress-buffered-background,rgba(193,200,209,.6))}.plyr__progress__marker{background-color:#fff;background-color:var(--plyr-progress-marker-background,#fff);border-radius:1px;height:5px;height:var(--plyr-range-track-height,5px);position:absolute;top:50%;transform:translate(-50%,-50%);width:3px;width:var(--plyr-progress-marker-width,3px);z-index:3}.plyr__volume{align-items:center;display:flex;max-width:110px;min-width:80px;position:relative;width:20%}.plyr__volume input[type=range]{margin-left:5px;margin-left:calc(var(--plyr-control-spacing, 10px)/2);margin-right:5px;margin-right:calc(var(--plyr-control-spacing, 10px)/2);position:relative;z-index:2}.plyr--is-ios .plyr__volume{min-width:0;width:auto}.plyr--audio{display:block}.plyr--audio .plyr__controls{background:#fff;background:var(--plyr-audio-controls-background,#fff);border-radius:inherit;color:#4a5464;color:var(--plyr-audio-control-color,#4a5464);padding:10px;padding:var(--plyr-control-spacing,10px)}.plyr--audio .plyr__control.plyr__tab-focus,.plyr--audio .plyr__control:hover,.plyr--audio .plyr__control[aria-expanded=true]{background:#00b2ff;background:var(--plyr-audio-control-background-hover,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)));color:#fff;color:var(--plyr-audio-control-color-hover,#fff)}.plyr--full-ui.plyr--audio input[type=range]::-webkit-slider-runnable-track{background-color:#c1c8d199;background-color:var(--plyr-audio-range-track-background,var(--plyr-audio-progress-buffered-background,rgba(193,200,209,.6)))}.plyr--full-ui.plyr--audio input[type=range]::-moz-range-track{background-color:#c1c8d199;background-color:var(--plyr-audio-range-track-background,var(--plyr-audio-progress-buffered-background,rgba(193,200,209,.6)))}.plyr--full-ui.plyr--audio input[type=range]::-ms-track{background-color:#c1c8d199;background-color:var(--plyr-audio-range-track-background,var(--plyr-audio-progress-buffered-background,rgba(193,200,209,.6)))}.plyr--full-ui.plyr--audio input[type=range]:active::-webkit-slider-thumb{box-shadow:0 1px 1px #23282f26,0 0 0 1px #23282f33,0 0 0 3px #23282f1a;box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2)),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,rgba(35,40,47,.1))}.plyr--full-ui.plyr--audio input[type=range]:active::-moz-range-thumb{box-shadow:0 1px 1px #23282f26,0 0 0 1px #23282f33,0 0 0 3px #23282f1a;box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2)),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,rgba(35,40,47,.1))}.plyr--full-ui.plyr--audio input[type=range]:active::-ms-thumb{box-shadow:0 1px 1px #23282f26,0 0 0 1px #23282f33,0 0 0 3px #23282f1a;box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2)),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,rgba(35,40,47,.1))}.plyr--audio .plyr__progress__buffer{color:#c1c8d199;color:var(--plyr-audio-progress-buffered-background,rgba(193,200,209,.6))}.plyr--video{background:#000;background:var(--plyr-video-background,var(--plyr-video-background,#000));overflow:hidden}.plyr--video.plyr--menu-open{overflow:visible}.plyr__video-wrapper{background:#000;background:var(--plyr-video-background,var(--plyr-video-background,#000));height:100%;margin:auto;overflow:hidden;position:relative;width:100%}.plyr__video-embed,.plyr__video-wrapper--fixed-ratio{aspect-ratio:16/9}@supports not (aspect-ratio:16/9){.plyr__video-embed,.plyr__video-wrapper--fixed-ratio{height:0;padding-bottom:56.25%;position:relative}}.plyr__video-embed iframe,.plyr__video-wrapper--fixed-ratio video{border:0;height:100%;left:0;position:absolute;top:0;width:100%}.plyr--full-ui .plyr__video-embed>.plyr__video-embed__container{padding-bottom:240%;position:relative;transform:translateY(-38.28125%)}.plyr--video .plyr__controls{background:linear-gradient(transparent,rgba(0,0,0,.75));background:var(--plyr-video-controls-background,linear-gradient(transparent,rgba(0,0,0,.75)));border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;bottom:0;color:#fff;color:var(--plyr-video-control-color,#fff);left:0;padding:5px;padding:calc(var(--plyr-control-spacing, 10px)/2);padding-top:20px;padding-top:calc(var(--plyr-control-spacing, 10px)*2);position:absolute;right:0;transition:opacity .4s ease-in-out,transform .4s ease-in-out;z-index:3}@media (min-width:480px){.plyr--video .plyr__controls{padding:10px;padding:var(--plyr-control-spacing,10px);padding-top:35px;padding-top:calc(var(--plyr-control-spacing, 10px)*3.5)}}.plyr--video.plyr--hide-controls .plyr__controls{opacity:0;pointer-events:none;transform:translateY(100%)}.plyr--video .plyr__control.plyr__tab-focus,.plyr--video .plyr__control:hover,.plyr--video .plyr__control[aria-expanded=true]{background:#00b2ff;background:var(--plyr-video-control-background-hover,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)));color:#fff;color:var(--plyr-video-control-color-hover,#fff)}.plyr__control--overlaid{background:#00b2ff;background:var(--plyr-video-control-background-hover,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)));border:0;border-radius:100%;color:#fff;color:var(--plyr-video-control-color,#fff);display:none;left:50%;opacity:.9;padding:15px;padding:calc(var(--plyr-control-spacing, 10px)*1.5);position:absolute;top:50%;transform:translate(-50%,-50%);transition:.3s;z-index:2}.plyr__control--overlaid svg{left:2px;position:relative}.plyr__control--overlaid:focus,.plyr__control--overlaid:hover{opacity:1}.plyr--playing .plyr__control--overlaid{opacity:0;visibility:hidden}.plyr--full-ui.plyr--video .plyr__control--overlaid{display:block}.plyr--full-ui.plyr--video input[type=range]::-webkit-slider-runnable-track{background-color:#ffffff40;background-color:var(--plyr-video-range-track-background,var(--plyr-video-progress-buffered-background,hsla(0,0%,100%,.25)))}.plyr--full-ui.plyr--video input[type=range]::-moz-range-track{background-color:#ffffff40;background-color:var(--plyr-video-range-track-background,var(--plyr-video-progress-buffered-background,hsla(0,0%,100%,.25)))}.plyr--full-ui.plyr--video input[type=range]::-ms-track{background-color:#ffffff40;background-color:var(--plyr-video-range-track-background,var(--plyr-video-progress-buffered-background,hsla(0,0%,100%,.25)))}.plyr--full-ui.plyr--video input[type=range]:active::-webkit-slider-thumb{box-shadow:0 1px 1px #23282f26,0 0 0 1px #23282f33,0 0 0 3px #ffffff80;box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2)),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,hsla(0,0%,100%,.5))}.plyr--full-ui.plyr--video input[type=range]:active::-moz-range-thumb{box-shadow:0 1px 1px #23282f26,0 0 0 1px #23282f33,0 0 0 3px #ffffff80;box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2)),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,hsla(0,0%,100%,.5))}.plyr--full-ui.plyr--video input[type=range]:active::-ms-thumb{box-shadow:0 1px 1px #23282f26,0 0 0 1px #23282f33,0 0 0 3px #ffffff80;box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 1px rgba(35,40,47,.2)),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,hsla(0,0%,100%,.5))}.plyr--video .plyr__progress__buffer{color:#ffffff40;color:var(--plyr-video-progress-buffered-background,hsla(0,0%,100%,.25))}.plyr:fullscreen{background:#000;border-radius:0!important;height:100%;margin:0;width:100%}.plyr:fullscreen video{height:100%}.plyr:fullscreen .plyr__control .icon--exit-fullscreen{display:block}.plyr:fullscreen .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr:fullscreen.plyr--hide-controls{cursor:none}@media (min-width:1024px){.plyr:fullscreen .plyr__captions{font-size:21px;font-size:var(--plyr-font-size-xlarge,21px)}}.plyr--fullscreen-fallback{background:#000;border-radius:0!important;bottom:0;display:block;height:100%;left:0;margin:0;position:fixed;right:0;top:0;width:100%;z-index:10000000}.plyr--fullscreen-fallback video{height:100%}.plyr--fullscreen-fallback .plyr__control .icon--exit-fullscreen{display:block}.plyr--fullscreen-fallback .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr--fullscreen-fallback.plyr--hide-controls{cursor:none}@media (min-width:1024px){.plyr--fullscreen-fallback .plyr__captions{font-size:21px;font-size:var(--plyr-font-size-xlarge,21px)}}.plyr__ads{border-radius:inherit;bottom:0;cursor:pointer;left:0;overflow:hidden;position:absolute;right:0;top:0;z-index:-1}.plyr__ads>div,.plyr__ads>div iframe{height:100%;position:absolute;width:100%}.plyr__ads:after{background:#23282f;border-radius:2px;bottom:10px;bottom:var(--plyr-control-spacing,10px);color:#fff;content:attr(data-badge-text);font-size:11px;padding:2px 6px;pointer-events:none;position:absolute;right:10px;right:var(--plyr-control-spacing,10px);z-index:3}.plyr__ads:empty:after{display:none}.plyr__cues{background:currentColor;display:block;height:5px;height:var(--plyr-range-track-height,5px);left:0;opacity:.8;position:absolute;top:50%;transform:translateY(-50%);width:3px;z-index:3}.plyr__preview-thumb{background-color:#ffffffe6;background-color:var(--plyr-tooltip-background,hsla(0,0%,100%,.9));border-radius:5px;border-radius:var(--plyr-tooltip-radius,5px);bottom:100%;box-shadow:0 1px 2px #00000026;box-shadow:var(--plyr-tooltip-shadow,0 1px 2px rgba(0,0,0,.15));margin-bottom:10px;margin-bottom:calc(var(--plyr-control-spacing, 10px)/2*2);opacity:0;padding:3px;pointer-events:none;position:absolute;transform:translateY(10px) scale(.8);transform-origin:50% 100%;transition:transform .2s ease .1s,opacity .2s ease .1s;z-index:2}.plyr__preview-thumb--is-shown{opacity:1;transform:translate(0) scale(1)}.plyr__preview-thumb:before{border-left:4px solid transparent;border-left:var(--plyr-tooltip-arrow-size,4px) solid transparent;border-right:4px solid transparent;border-right:var(--plyr-tooltip-arrow-size,4px) solid transparent;border-top:4px solid hsla(0,0%,100%,.9);border-top:var(--plyr-tooltip-arrow-size,4px) solid var(--plyr-tooltip-background,hsla(0,0%,100%,.9));bottom:-4px;bottom:calc(var(--plyr-tooltip-arrow-size, 4px)*-1);content:"";height:0;left:calc(50% + var(--preview-arrow-offset));position:absolute;transform:translate(-50%);width:0;z-index:2}.plyr__preview-thumb__image-container{background:#c1c8d1;border-radius:4px;border-radius:calc(var(--plyr-tooltip-radius, 5px) - 1px);overflow:hidden;position:relative;z-index:0}.plyr__preview-thumb__image-container img,.plyr__preview-thumb__image-container:after{height:100%;left:0;position:absolute;top:0;width:100%}.plyr__preview-thumb__image-container:after{border-radius:inherit;box-shadow:inset 0 0 0 1px #00000026;content:"";pointer-events:none}.plyr__preview-thumb__image-container img{max-height:none;max-width:none}.plyr__preview-thumb__time-container{background:linear-gradient(transparent,rgba(0,0,0,.75));background:var(--plyr-video-controls-background,linear-gradient(transparent,rgba(0,0,0,.75)));border-bottom-left-radius:4px;border-bottom-left-radius:calc(var(--plyr-tooltip-radius, 5px) - 1px);border-bottom-right-radius:4px;border-bottom-right-radius:calc(var(--plyr-tooltip-radius, 5px) - 1px);bottom:0;left:0;line-height:1.1;padding:20px 6px 6px;position:absolute;right:0;z-index:3}.plyr__preview-thumb__time-container span{color:#fff;font-size:13px;font-size:var(--plyr-font-size-time,var(--plyr-font-size-small,13px))}.plyr__preview-scrubbing{bottom:0;filter:blur(1px);height:100%;left:0;margin:auto;opacity:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0;transition:opacity .3s ease;width:100%;z-index:1}.plyr__preview-scrubbing--is-shown{opacity:1}.plyr__preview-scrubbing img{height:100%;left:0;max-height:none;max-width:none;-o-object-fit:contain;object-fit:contain;position:absolute;top:0;width:100%}.plyr--no-transition{transition:none!important}.plyr__sr-only{clip:rect(1px,1px,1px,1px);border:0!important;height:1px!important;overflow:hidden;padding:0!important;position:absolute!important;width:1px!important}.plyr [hidden]{display:none!important}.plyr--video{width:100%;height:100%}.plyr--audio{width:100%;height:100%;display:flex;align-items:stretch;justify-content:center;background-color:#fff}.telebox-color-scheme-dark .plyr--audio{color-scheme:dark;background-color:#121212;--plyr-audio-controls-background: #121212;--plyr-audio-control-color: #eee}
|
127
|
+
`)();const Sp={volume:1,paused:!0,muted:!1,currentTime:0},Ni={kind:"Plyr",config:{minwidth:300,minheight:80},setup(t){const e=t.storage;if(e.ensureState(Sp),!e.state.src){t.emitter.emit("destroy",{error:new Error('[Plyr]: missing "src"')});return}!e.state.type&&!e.state.provider&&console.warn('[Plyr]: missing "type", will guess from file extension');const i=t.box;i.mountStyles(Mp);const s=new xp(t),r=new vp({target:i.$content,props:{storage:t.storage,sync:s}});t.emitter.on("destroy",()=>{try{s.dispose(),r.$destroy()}catch{}})}},Cp=()=>{le.register({kind:_i.kind,src:_i}),le.register({kind:Ni.kind,src:Ni})},Ds={DocsViewer:_i.kind,MediaPlayer:Ni.kind},Ip={[Ds.DocsViewer]:_i,[Ds.MediaPlayer]:Ni};const uo=new Jc({emitter:P}),$=class extends M.InvisiblePlugin{constructor(t){super(t);this.version="1.0.0-canary.35",this.dependencies={dependencies:{"@juggle/resize-observer":"^3.3.1","@netless/telebox-insider":"1.0.0-alpha.33",emittery:"^0.11.0",lodash:"^4.17.21","p-retry":"^4.6.2","side-effect-manager":"^1.1.1",uuid:"^7.0.3","value-enhancer":"^1.3.2"},peerDependencies:{"white-web-sdk":"^2.16.0"},devDependencies:{"@netless/app-docs-viewer":"^0.3.0","@netless/app-plyr":"0.2.0","@playwright/test":"^1.23.2","@rollup/plugin-commonjs":"^20.0.0","@rollup/plugin-node-resolve":"^13.0.4","@rollup/plugin-url":"^6.1.0","@sveltejs/vite-plugin-svelte":"^1.0.0-next.49","@tsconfig/svelte":"^2.0.1","@types/debug":"^4.1.7","@types/lodash":"^4.14.182","@types/lodash-es":"^4.17.6","@types/node":"^18.0.3","@types/uuid":"^8.3.4","@typescript-eslint/eslint-plugin":"^4.30.0","@typescript-eslint/parser":"^4.30.0","@vitest/ui":"^0.14.2",cypress:"^8.7.0",dotenv:"^10.0.0",eslint:"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-svelte3":"^3.2.0",jsdom:"^19.0.0",less:"^4.1.3",prettier:"^2.3.2","prettier-plugin-svelte":"^2.4.0","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-styles":"^3.14.1",svelte:"^3.42.4",typescript:"^4.5.5",vite:"^2.5.3","vite-plugin-dts":"^1.2.1",vitest:"^0.18.0","white-web-sdk":"2.16.26"}},this.emitter=J,this.viewMode=M.ViewMode.Broadcaster,this.viewMode$=new w.Val(M.ViewMode.Broadcaster),this.isReplay=M.isPlayer(this.displayer),this.containerSizeRatio=$.containerSizeRatio,$.displayer=t.displayer,window.NETLESS_DEPS={dependencies:{"@juggle/resize-observer":"^3.3.1","@netless/telebox-insider":"1.0.0-alpha.33",emittery:"^0.11.0",lodash:"^4.17.21","p-retry":"^4.6.2","side-effect-manager":"^1.1.1",uuid:"^7.0.3","value-enhancer":"^1.3.2"},peerDependencies:{"white-web-sdk":"^2.16.0"},devDependencies:{"@netless/app-docs-viewer":"^0.3.0","@netless/app-plyr":"0.2.0","@playwright/test":"^1.23.2","@rollup/plugin-commonjs":"^20.0.0","@rollup/plugin-node-resolve":"^13.0.4","@rollup/plugin-url":"^6.1.0","@sveltejs/vite-plugin-svelte":"^1.0.0-next.49","@tsconfig/svelte":"^2.0.1","@types/debug":"^4.1.7","@types/lodash":"^4.14.182","@types/lodash-es":"^4.17.6","@types/node":"^18.0.3","@types/uuid":"^8.3.4","@typescript-eslint/eslint-plugin":"^4.30.0","@typescript-eslint/parser":"^4.30.0","@vitest/ui":"^0.14.2",cypress:"^8.7.0",dotenv:"^10.0.0",eslint:"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-svelte3":"^3.2.0",jsdom:"^19.0.0",less:"^4.1.3",prettier:"^2.3.2","prettier-plugin-svelte":"^2.4.0","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-styles":"^3.14.1",svelte:"^3.42.4",typescript:"^4.5.5",vite:"^2.5.3","vite-plugin-dts":"^1.2.1",vitest:"^0.18.0","white-web-sdk":"2.16.26"}}}static async mount(t){var a;const e=t.room;$.container=t.container;const i=t.debug,s=t.cursor;$.params=t,$.displayer=t.room,ll();let r;if(M.isRoom(e)){if(e.phase!==M.RoomPhase.Connected)throw new Error("[WindowManager]: Room only Connected can be mount");e.phase===M.RoomPhase.Connected&&e.isWritable&&(e.disableSerialization=!1),r=await this.initManager(e)}if($.isCreated)throw new Error("[WindowManager]: Already created cannot be created again");if(this.debug=Boolean(i),Je("Already insert room",r),M.isRoom(this.displayer)){if(!r)throw new Error("[WindowManager]: init InvisiblePlugin failed")}else await No.default(async n=>{if(r=await e.getInvisiblePlugin($.kind),!r)throw Je(`manager is empty. retrying ${n}`),new Error},{retries:10});if(!r)throw new Error("[WindowManager]: create manager failed");t.containerSizeRatio&&($.containerSizeRatio=t.containerSizeRatio),r.containerSizeRatio=$.containerSizeRatio,await r.ensureAttributes(),r.appManager=new yl(r),r._pageState=new qc(r.appManager),r.cursorManager=new Gc(r.appManager,Boolean(s),t.applianceIcons),r.boxManager=Sc(r,J,P,Ue,{collectorContainer:t.collectorContainer,collectorStyles:t.collectorStyles,prefersColorScheme:t.prefersColorScheme,stageRatio:$.containerSizeRatio,containerStyle:t.containerStyle,stageStyle:t.stageStyle,fullscreen:t.fullscreen}),(a=r.appManager)==null||a.setBoxManager(r.boxManager),t.container&&r.bindContainer(t.container),Xc(e,r),P.emit("onCreated"),$.isCreated=!0;try{await Vo()}catch(n){console.warn("[WindowManager]: indexedDB open failed"),console.log(n)}return r}static async initManager(t){let e=t.getInvisiblePlugin($.kind);if(!e&&M.isRoom(t))if(t.isWritable===!1){try{await t.setWritable(!0)}catch{throw new Error("[WindowManger]: room must be switched to be writable")}e=await kr(t),e==null||e.ensureAttributes(),await Mi(500),await t.setWritable(!1)}else e=await kr(t);return e}static initContainer(t,e,i){$.container||($.container=t);const{playground:s,mainViewElement:r}=ol(t,e);if($.playground=s,i){const a=document.createElement("style");a.textContent=i,s.appendChild(a)}return r}static get registered(){return ue.registered}bindContainer(t){var e,i,s,r,a,n;if(M.isRoom(this.displayer)&&this.room.phase!==M.RoomPhase.Connected)throw new va;if($.isCreated&&$.container)$.container.firstChild&&t.appendChild($.container.firstChild);else{const o=(e=this.boxManager)==null?void 0:e.teleBoxManager.$stage;if($.params&&o){const c=$.params,l=$.initContainer(t,o,c.overwriteStyles);this.boxManager&&$.playground&&this.boxManager.setRoot($.playground),this.bindMainView(l,c.disableCameraTransform),$.playground&&((i=this.cursorManager)==null||i.setupWrapper($.playground))}}P.emit("updateManagerRect"),(s=this.appManager)==null||s.refresh(),(r=this.appManager)==null||r.resetMaximized(),(a=this.appManager)==null||a.resetMinimized(),(n=this.appManager)==null||n.displayerWritableListener(!this.room.isWritable),$.container=t}bindCollectorContainer(t){$.isCreated&&this.boxManager?this.boxManager.setCollector(t):$.params&&($.params.collectorContainer=t)}static register(t){return ue.register(t)}static unregister(t){return ue.unregister(t)}async addApp(t){if(this.appManager)return this.appManager.rootDirRemoving?new Promise((e,i)=>{P.once("rootDirRemoved").then(async()=>{try{const s=await this._addApp(t);e(s)}catch(s){i(s.message)}})}):this._addApp(t);throw new he}async _addApp(t){var e,i,s;if(this.appManager){if(!t.kind||typeof t.kind!="string")throw new fa;const r=await((e=ue.appClasses.get(t.kind))==null?void 0:e());if(r&&((i=r.config)==null?void 0:i.singleton)&&this.appManager.appProxies.has(t.kind))throw new ga;const a=this.setupScenePath(t,this.appManager);return a===void 0?void 0:((s=t==null?void 0:t.options)!=null&&s.scenePath&&(t.options.scenePath=Ko(t.options.scenePath)),await this.appManager.addApp(t,Boolean(a)))}else throw new he}setupScenePath(t,e){let i=!1;if(t.options){const{scenePath:s,scenes:r}=t.options;if(s){if(!Xo(s))throw new ya;const a=Object.keys(this.apps||{});for(const n of a){const o=e.store.getAppScenePath(n);if(o&&o===s){if(console.warn(`[WindowManager]: ScenePath ${s} Already opened`),this.boxManager){const c=this.boxManager.getTopBox();c&&this.boxManager.setZIndex(n,c.zIndex+1,!1)}return}}}s&&r&&r.length>0&&(this.isDynamicPPT(r)?(i=!0,ut(this.displayer)[s]||vt(this.room,s,r)):ut(this.displayer)[s]||vt(this.room,s,[{name:r[0].name}])),s&&r===void 0&&vt(this.room,s,[{}])}return i}async setMainViewScenePath(t){this.appManager&&await this.appManager.setMainViewScenePath(t)}async setMainViewSceneIndex(t){this.appManager&&await this.appManager.setMainViewSceneIndex(t)}async nextPage(){if(this.appManager){const t=this.mainViewSceneIndex+1;return t>=this.mainViewScenesLength?(console.warn("[WindowManager]: current page is the last page"),!1):(await this.appManager.setMainViewSceneIndex(t),!0)}else return!1}async prevPage(){if(this.appManager){const t=this.mainViewSceneIndex-1;return t<0?(console.warn("[WindowManager]: current page is the first page"),!1):(await this.appManager.setMainViewSceneIndex(t),!0)}else return!1}async jumpPage(t){return this.appManager?t<0||t>=this.pageState.length?(console.warn(`[WindowManager]: index ${t} out of range`),!1):(await this.appManager.setMainViewSceneIndex(t),!0):!1}async addPage(t){if(this.appManager){const e=t==null?void 0:t.after,i=t==null?void 0:t.scene;if(e){const s=this.mainViewSceneIndex+1;this.room.putScenes(we,[i||{}],s)}else this.room.putScenes(we,[i||{}])}}async removePage(t){if(this.appManager){const e=t===void 0?this.pageState.index:t;return this.pageState.length===1?(console.warn("[WindowManager]: can not remove the last page"),!1):e<0||e>=this.pageState.length?(console.warn(`[WindowManager]: index ${t} out of range`),!1):this.appManager.removeSceneByIndex(e)}else return!1}getMainViewScenePath(){var t;return(t=this.appManager)==null?void 0:t.store.getMainViewScenePath()}getMainViewSceneIndex(){var t;return(t=this.appManager)==null?void 0:t.store.getMainViewSceneIndex()}setReadonly(t){var e;this.readonly=t,(e=this.boxManager)==null||e.setReadonly(t),P.emit("setReadonly",t)}switchMainViewToWriter(){var t;return(t=this.appManager)==null?void 0:t.mainViewProxy.mainViewClickHandler()}onAppDestroy(t,e){qo(`destroy-${t}`,e)}setViewMode(t){var i;Je("setViewMode",t);const e=(i=this.appManager)==null?void 0:i.mainViewProxy;t===M.ViewMode.Broadcaster&&(this.canOperate&&(e==null||e.storeCurrentCamera()),e==null||e.start()),t===M.ViewMode.Freedom&&(e==null||e.stop()),this.viewMode=t,this.viewMode$.setValue(t)}setBoxState(t){if(!!this.canOperate)switch(t){case"normal":this.setMaximized(!1),this.setMinimized(!1);break;case"maximized":this.setMaximized(!0),this.setMinimized(!1);break;case"minimized":this.setMinimized(!0);break}}setMaximized(t){var e;!this.canOperate||(e=this.boxManager)==null||e.setMaximized(t,!1)}setMinimized(t){var e;!this.canOperate||(e=this.boxManager)==null||e.setMinimized(t,!1)}get mainView(){if(this.appManager)return this.appManager.mainViewProxy.view;throw new he}get camera(){if(this.appManager)return this.appManager.mainViewProxy.view.camera;throw new he}get baseCamera(){if(this.appManager)return this.appManager.mainViewProxy.camera$.value;throw new he}get baseSize(){if(this.appManager)return this.appManager.mainViewProxy.size$.value;throw new he}get cameraState(){if(this.appManager)return this.appManager.mainViewProxy.cameraState;throw new he}get apps(){var t;return(t=this.appManager)==null?void 0:t.store.apps()}get boxState(){var t;if(this.appManager)return(t=this.appManager.boxManager)==null?void 0:t.boxState;throw new he}get darkMode(){var t,e;return Boolean((e=(t=this.appManager)==null?void 0:t.boxManager)==null?void 0:e.darkMode)}get prefersColorScheme(){var t;if(this.appManager)return(t=this.appManager.boxManager)==null?void 0:t.prefersColorScheme;throw new he}get fullscreen(){var t;if(this.appManager)return(t=this.appManager.boxManager)==null?void 0:t.teleBoxManager.fullscreen;throw new he}get focused(){return this.attributes.focus}get focusedView(){var t,e;return((e=(t=this.appManager)==null?void 0:t.focusApp)==null?void 0:e.view)||this.mainView}get mainViewSceneIndex(){var t;return((t=this._pageState)==null?void 0:t.index)||0}get mainViewSceneDir(){var t;if(this.appManager)return(t=this.appManager)==null?void 0:t.getMainViewSceneDir();throw new he}get topApp(){var t,e;return(e=(t=this.boxManager)==null?void 0:t.getTopBox())==null?void 0:e.id}get mainViewScenesLength(){var t;return((t=this._pageState)==null?void 0:t.length)||0}get canRedoSteps(){var t;return((t=this.focusedView)==null?void 0:t.canRedoSteps)||0}get canUndoSteps(){var t;return((t=this.focusedView)==null?void 0:t.canUndoSteps)||0}get sceneState(){if(this.appManager)return this.appManager.sceneState;throw new he}get pageState(){if(this._pageState)return this._pageState.toObject();throw new he}queryAll(){var t;return Array.from(((t=this.appManager)==null?void 0:t.appProxies.values())||[])}queryOne(t){var e;return(e=this.appManager)==null?void 0:e.appProxies.get(t)}async closeApp(t){var e;return(e=this.appManager)==null?void 0:e.closeApp(t)}moveCamera(t){const e=O({},this.mainView.camera),i=O(O({},e),t);I.isEqual(i,e)||!this.appManager||this.appManager.mainViewProxy.storeCamera(O({id:this.appManager.uid},i))}moveCameraToContain(t){if(!this.appManager)return;const e=this.appManager.mainViewProxy.size$.value;if(e){const i=e.width/t.width,s=e.height/t.height,r=Math.min(i,s);this.appManager.mainViewProxy.storeCamera({id:this.appManager.uid,scale:r,centerX:t.originX,centerY:t.originY})}}convertToPointInWorld(t){return this.mainView.convertToPointInWorld(t)}setCameraBound(t){this.mainView.setCameraBound(t)}onDestroy(){this._destroy()}destroy(){this._destroy()}_destroy(){var t,e,i;(t=this.appManager)==null||t.destroy(),(e=this.cursorManager)==null||e.destroy(),$.container=void 0,$.isCreated=!1,$.playground&&((i=$.playground.parentNode)==null||i.removeChild($.playground)),$.params=void 0,Je("Destroyed")}bindMainView(t,e){var i;this.appManager&&(this.appManager.bindMainView(t,Boolean(e)),(i=this.cursorManager)==null||i.setMainViewDivElement(t))}get canOperate(){return M.isRoom(this.displayer)?this.displayer.isWritable&&this.displayer.phase===M.RoomPhase.Connected:!1}get room(){return this.displayer}safeSetAttributes(t){this.canOperate&&this.setAttributes(t)}safeUpdateAttributes(t,e){this.canOperate&&this.updateAttributes(t,e)}setPrefersColorScheme(t){var e,i;(i=(e=this.appManager)==null?void 0:e.boxManager)==null||i.setPrefersColorScheme(t)}setFullscreen(t){var e,i;(i=(e=this.appManager)==null?void 0:e.boxManager)==null||i.teleBoxManager.setFullscreen(t)}cleanCurrentScene(){var t;(t=this.focusedView)==null||t.cleanCurrentScene()}redo(){var t;return((t=this.focusedView)==null?void 0:t.redo())||0}undo(){var t;return((t=this.focusedView)==null?void 0:t.undo())||0}delete(){var t;(t=this.focusedView)==null||t.delete()}copy(){var t;(t=this.focusedView)==null||t.copy()}paste(){var t;(t=this.focusedView)==null||t.paste()}duplicate(){var t;(t=this.focusedView)==null||t.duplicate()}insertText(t,e,i){var s;return((s=this.focusedView)==null?void 0:s.insertText(t,e,i))||""}insertImage(t){var e;return(e=this.focusedView)==null?void 0:e.insertImage(t)}completeImageUpload(t,e){var i;return(i=this.focusedView)==null?void 0:i.completeImageUpload(t,e)}lockImage(t,e){var i;return(i=this.focusedView)==null?void 0:i.lockImage(t,e)}lockImages(t){var e;return(e=this.focusedView)==null?void 0:e.lockImages(t)}refresh(){var t;this._refresh(),(t=this.appManager)==null||t.dispatchInternalEvent(Y.Refresh)}_refresh(){var t,e;(t=this.appManager)==null||t.mainViewProxy.rebind(),$.container&&this.bindContainer($.container),(e=this.appManager)==null||e.refresher.refresh()}setContainerSizeRatio(t){if(!I.isNumber(t))throw new Error(`[WindowManager]: updateContainerSizeRatio error, ratio must be a number. but got ${t}`);$.containerSizeRatio=t,this.containerSizeRatio=t,P.emit("containerSizeRatioUpdate",t)}setContainerStyle(t){var e;(e=this.boxManager)==null||e.teleBoxManager.setContainerStyle(t)}setStageStyle(t){var e;(e=this.boxManager)==null||e.teleBoxManager.setStageStyle(t)}setBaseSize(t){var e;(e=this.appManager)==null||e.mainViewProxy.setMainViewSize(t)}createPPTHandler(){return{onPageJumpTo:(t,e)=>{var i,s,r,a;(a=(r=(s=(i=this.appManager)==null?void 0:i.focusApp)==null?void 0:s.appContext)==null?void 0:r.whiteBoardView)==null||a.jumpPage(e)},onPageToNext:()=>{var t,e,i,s;this.focused&&((s=(i=(e=(t=this.appManager)==null?void 0:t.focusApp)==null?void 0:e.appContext)==null?void 0:i.whiteBoardView)==null||s.nextPage())},onPageToPrev:()=>{var t,e,i,s;this.focused&&((s=(i=(e=(t=this.appManager)==null?void 0:t.focusApp)==null?void 0:e.appContext)==null?void 0:i.whiteBoardView)==null||s.prevPage())}}}isDynamicPPT(t){var i,s;const e=(s=(i=t[0])==null?void 0:i.ppt)==null?void 0:s.src;return e==null?void 0:e.startsWith("pptx://")}async ensureAttributes(){I.isNull(this.attributes)&&await Mi(50),I.isObject(this.attributes)&&(this.attributes[ee.Apps]||this.safeSetAttributes({[ee.Apps]:{}}),this.attributes[ee.Cursors]||this.safeSetAttributes({[ee.Cursors]:{}}),this.attributes._mainScenePath||this.safeSetAttributes({_mainScenePath:ua}),this.attributes._mainSceneIndex||this.safeSetAttributes({_mainSceneIndex:0}),this.attributes[ee.Registered]||this.safeSetAttributes({[ee.Registered]:{}}))}};let le=$;le.kind="WindowManager";le.debug=!1;le.containerSizeRatio=zo;le.isCreated=!1;Cp();exports.AppCreateError=ga;exports.AppManagerNotInitError=he;exports.AppNotRegisterError=il;exports.BindContainerRoomPhaseInvalidError=va;exports.BoxManagerNotFoundError=wa;exports.BoxNotCreatedError=ba;exports.BuiltinApps=Ds;exports.BuiltinAppsMap=Ip;exports.InvalidScenePath=ya;exports.ParamsInvalidError=fa;exports.WhiteWebSDKInvalidError=ma;exports.WindowManager=le;exports.calculateNextIndex=Ls;exports.reconnectRefresher=uo;
|