js-dos 8.1.8 → 8.1.10
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/js-dos.js +2 -2
- package/dist/js-dos.js.map +1 -1
- package/package.json +1 -1
- package/release.zip +0 -0
package/dist/js-dos.js
CHANGED
|
@@ -17,6 +17,6 @@ var Et=Pt;var Ot="function"==typeof Object.is?Object.is:function(e,t){return e==
|
|
|
17
17
|
*
|
|
18
18
|
* This source code is licensed under the MIT license found in the
|
|
19
19
|
* LICENSE file in the root directory of this source tree.
|
|
20
|
-
*/function Xn(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case Tn:switch(e=e.type){case zn:case In:case Un:case Fn:case qn:return e;default:switch(e=e&&e.$$typeof){case Dn:case Bn:case Hn:case $n:case Wn:case Ln:return e;default:return t}}case Nn:return t}}}Mn=Symbol.for("react.module.reference"),Rn.ContextConsumer=Bn,Rn.ContextProvider=Ln,Rn.Element=Tn,Rn.ForwardRef=Hn,Rn.Fragment=zn,Rn.Lazy=$n,Rn.Memo=Wn,Rn.Portal=Nn,Rn.Profiler=In,Rn.StrictMode=Un,Rn.Suspense=Fn,Rn.SuspenseList=qn,Rn.isAsyncMode=function(){return!1},Rn.isConcurrentMode=function(){return!1},Rn.isContextConsumer=function(e){return Xn(e)===Bn},Rn.isContextProvider=function(e){return Xn(e)===Ln},Rn.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Tn},Rn.isForwardRef=function(e){return Xn(e)===Hn},Rn.isFragment=function(e){return Xn(e)===zn},Rn.isLazy=function(e){return Xn(e)===$n},Rn.isMemo=function(e){return Xn(e)===Wn},Rn.isPortal=function(e){return Xn(e)===Nn},Rn.isProfiler=function(e){return Xn(e)===In},Rn.isStrictMode=function(e){return Xn(e)===Un},Rn.isSuspense=function(e){return Xn(e)===Fn},Rn.isSuspenseList=function(e){return Xn(e)===qn},Rn.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===zn||e===In||e===Un||e===Fn||e===qn||e===Vn||"object"==typeof e&&null!==e&&(e.$$typeof===$n||e.$$typeof===Wn||e.$$typeof===Ln||e.$$typeof===Bn||e.$$typeof===Hn||e.$$typeof===Mn||void 0!==e.getModuleId)},Rn.typeOf=Xn;const Kn={notify(){},get:()=>[]};function Qn(e,t){let n,r=Kn,o=0,i=!1;function s(){l.onStateChange&&l.onStateChange()}function a(){o++,n||(n=t?t.addNestedSub(s):e.subscribe(s),r=function(){const e=Kt();let t=null,n=null;return{clear(){t=null,n=null},notify(){e((()=>{let e=t;for(;e;)e.callback(),e=e.next}))},get(){let e=[],n=t;for(;n;)e.push(n),n=n.next;return e},subscribe(e){let r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())}function c(){o--,n&&0===o&&(n(),n=void 0,r.clear(),r=Kn)}const l={addNestedSub:function(e){a();const t=r.subscribe(e);let n=!1;return()=>{n||(n=!0,t(),c())}},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:s,isSubscribed:function(){return i},trySubscribe:function(){i||(i=!0,a())},tryUnsubscribe:function(){i&&(i=!1,c())},getListeners:()=>r};return l}const Gn=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement)?ce:ae;function Yn({store:e,context:t,children:n,serverState:r,stabilityCheck:o="once",noopCheck:i="once"}){const s=de((()=>{const t=Qn(e);return{store:e,subscription:t,getServerState:r?()=>r:void 0,stabilityCheck:o,noopCheck:i}}),[e,r,o,i]),a=de((()=>e.getState()),[e]);Gn((()=>{const{subscription:t}=s;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),a!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[s,a]);return m((t||Zt).Provider,{value:s},n)}function Zn(e=Zt){const t=e===Zt?en:Jt(e);return function(){const{store:e}=t();return e}}const Jn=Zn();function er(e=Zt){const t=e===Zt?Jn:Zn(e);return function(){return t().dispatch}}const tr=er();var nr;function rr(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function or(e){return!!e&&!!e[Wr]}function ir(e){var t;return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===$r}(e)||Array.isArray(e)||!!e[qr]||!!(null===(t=e.constructor)||void 0===t?void 0:t[qr])||dr(e)||fr(e))}function sr(e,t,n){void 0===n&&(n=!1),0===ar(e)?(n?Object.keys:Vr)(e).forEach((function(r){n&&"symbol"==typeof r||t(r,e[r],e)})):e.forEach((function(n,r){return t(r,n,e)}))}function ar(e){var t=e[Wr];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:dr(e)?2:fr(e)?3:0}function cr(e,t){return 2===ar(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function lr(e,t,n){var r=ar(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function ur(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function dr(e){return Br&&e instanceof Map}function fr(e){return Dr&&e instanceof Set}function hr(e){return e.o||e.t}function pr(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=Xr(e);delete t[Wr];for(var n=Vr(t),r=0;r<n.length;r++){var o=n[r],i=t[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function vr(e,t){return void 0===t&&(t=!1),br(e)||or(e)||!ir(e)||(ar(e)>1&&(e.set=e.add=e.clear=e.delete=mr),Object.freeze(e),t&&sr(e,(function(e,t){return vr(t,!0)}),!0)),e}function mr(){rr(2)}function br(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function _r(e){var t=Kr[e];return t||rr(18,e),t}function yr(){return Ir}function gr(e,t){t&&(_r("Patches"),e.u=[],e.s=[],e.v=t)}function wr(e){kr(e),e.p.forEach(Sr),e.p=null}function kr(e){e===Ir&&(Ir=e.l)}function xr(e){return Ir={p:[],l:Ir,h:e,m:!0,_:0}}function Sr(e){var t=e[Wr];0===t.i||1===t.i?t.j():t.g=!0}function Cr(e,t){t._=t.p.length;var n=t.p[0],r=void 0!==e&&e!==n;return t.h.O||_r("ES5").S(t,e,r),r?(n[Wr].P&&(wr(t),rr(4)),ir(e)&&(e=Pr(t,e),t.l||Or(t,e)),t.u&&_r("Patches").M(n[Wr].t,e,t.u,t.s)):e=Pr(t,n,[]),wr(t),t.u&&t.v(t.u,t.s),e!==Fr?e:void 0}function Pr(e,t,n){if(br(t))return t;var r=t[Wr];if(!r)return sr(t,(function(o,i){return Er(e,r,t,o,i,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return Or(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=4===r.i||5===r.i?r.o=pr(r.k):r.o,i=o,s=!1;3===r.i&&(i=new Set(o),o.clear(),s=!0),sr(i,(function(t,i){return Er(e,r,o,t,i,n,s)})),Or(e,o,!1),n&&e.u&&_r("Patches").N(r,n,e.u,e.s)}return r.o}function Er(e,t,n,r,o,i,s){if(or(o)){var a=Pr(e,o,i&&t&&3!==t.i&&!cr(t.R,r)?i.concat(r):void 0);if(lr(n,r,a),!or(a))return;e.m=!1}else s&&n.add(o);if(ir(o)&&!br(o)){if(!e.h.D&&e._<1)return;Pr(e,o),t&&t.A.l||Or(e,o)}}function Or(e,t,n){void 0===n&&(n=!1),!e.l&&e.h.D&&e.m&&vr(t,n)}function jr(e,t){var n=e[Wr];return(n?hr(n):e)[t]}function Ar(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function Mr(e){e.P||(e.P=!0,e.l&&Mr(e.l))}function Rr(e){e.o||(e.o=pr(e.t))}function Tr(e,t,n){var r=dr(t)?_r("MapSet").F(t,n):fr(t)?_r("MapSet").T(t,n):e.O?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:yr(),P:!1,I:!1,R:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=r,i=Qr;n&&(o=[r],i=Gr);var s=Proxy.revocable(o,i),a=s.revoke,c=s.proxy;return r.k=c,r.j=a,c}(t,n):_r("ES5").J(t,n);return(n?n.A:yr()).p.push(r),r}function Nr(e){return or(e)||rr(22,e),function e(t){if(!ir(t))return t;var n,r=t[Wr],o=ar(t);if(r){if(!r.P&&(r.i<4||!_r("ES5").K(r)))return r.t;r.I=!0,n=zr(t,o),r.I=!1}else n=zr(t,o);return sr(n,(function(t,o){r&&function(e,t){return 2===ar(e)?e.get(t):e[t]}(r.t,t)===o||lr(n,t,e(o))})),3===o?new Set(n):n}(e)}function zr(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return pr(e)}nr=Vt.useSyncExternalStoreWithSelector,tn=nr,Xt=pt;var Ur,Ir,Lr="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Br="undefined"!=typeof Map,Dr="undefined"!=typeof Set,Hr="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Fr=Lr?Symbol.for("immer-nothing"):((Ur={})["immer-nothing"]=!0,Ur),qr=Lr?Symbol.for("immer-draftable"):"__$immer_draftable",Wr=Lr?Symbol.for("immer-state"):"__$immer_state",$r=""+Object.prototype.constructor,Vr="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,Xr=Object.getOwnPropertyDescriptors||function(e){var t={};return Vr(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},Kr={},Qr={get:function(e,t){if(t===Wr)return e;var n,r,o,i=hr(e);if(!cr(i,t))return n=e,(o=Ar(i,t))?"value"in o?o.value:null===(r=o.get)||void 0===r?void 0:r.call(n.k):void 0;var s=i[t];return e.I||!ir(s)?s:s===jr(e.t,t)?(Rr(e),e.o[t]=Tr(e.A.h,s,e)):s},has:function(e,t){return t in hr(e)},ownKeys:function(e){return Reflect.ownKeys(hr(e))},set:function(e,t,n){var r=Ar(hr(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=jr(hr(e),t),i=null==o?void 0:o[Wr];if(i&&i.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(ur(n,o)&&(void 0!==n||cr(e.t,t)))return!0;Rr(e),Mr(e)}return e.o[t]===n&&(void 0!==n||t in e.o)||Number.isNaN(n)&&Number.isNaN(e.o[t])||(e.o[t]=n,e.R[t]=!0),!0},deleteProperty:function(e,t){return void 0!==jr(e.t,t)||t in e.t?(e.R[t]=!1,Rr(e),Mr(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=hr(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){rr(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){rr(12)}},Gr={};sr(Qr,(function(e,t){Gr[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Gr.deleteProperty=function(e,t){return Gr.set.call(this,e,t,void 0)},Gr.set=function(e,t,n){return Qr.set.call(this,e[0],t,n,e[0])};var Yr=function(){function e(e){var t=this;this.O=Hr,this.D=!0,this.produce=function(e,n,r){if("function"==typeof e&&"function"!=typeof n){var o=n;n=e;var i=t;return function(e){var t=this;void 0===e&&(e=o);for(var r=arguments.length,s=Array(r>1?r-1:0),a=1;a<r;a++)s[a-1]=arguments[a];return i.produce(e,(function(e){var r;return(r=n).call.apply(r,[t,e].concat(s))}))}}var s;if("function"!=typeof n&&rr(6),void 0!==r&&"function"!=typeof r&&rr(7),ir(e)){var a=xr(t),c=Tr(t,e,void 0),l=!0;try{s=n(c),l=!1}finally{l?wr(a):kr(a)}return"undefined"!=typeof Promise&&s instanceof Promise?s.then((function(e){return gr(a,r),Cr(e,a)}),(function(e){throw wr(a),e})):(gr(a,r),Cr(s,a))}if(!e||"object"!=typeof e){if(void 0===(s=n(e))&&(s=e),s===Fr&&(s=void 0),t.D&&vr(s,!0),r){var u=[],d=[];_r("Patches").M(e,s,u,d),r(u,d)}return s}rr(21,e)},this.produceWithPatches=function(e,n){if("function"==typeof e)return function(n){for(var r=arguments.length,o=Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return t.produceWithPatches(n,(function(t){return e.apply(void 0,[t].concat(o))}))};var r,o,i=t.produce(e,n,(function(e,t){r=e,o=t}));return"undefined"!=typeof Promise&&i instanceof Promise?i.then((function(e){return[e,r,o]})):[i,r,o]},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){ir(e)||rr(8),or(e)&&(e=Nr(e));var t=xr(this),n=Tr(this,e,void 0);return n[Wr].C=!0,kr(t),n},t.finishDraft=function(e,t){var n=(e&&e[Wr]).A;return gr(n,t),Cr(void 0,n)},t.setAutoFreeze=function(e){this.D=e},t.setUseProxies=function(e){e&&!Hr&&rr(20),this.O=e},t.applyPatches=function(e,t){var n;for(n=t.length-1;n>=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));var o=_r("Patches").$;return or(e)?o(e,t):this.produce(e,(function(e){return o(e,t)}))},e}(),Zr=new Yr,Jr=Zr.produce;function eo(e){return(eo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function to(e){var t=function(e,t){if("object"!==eo(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==eo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===eo(t)?t:String(t)}function no(e,t,n){return(t=to(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ro(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ro(Object(n),!0).forEach((function(t){no(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ro(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function io(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}Zr.produceWithPatches.bind(Zr),Zr.setAutoFreeze.bind(Zr),Zr.setUseProxies.bind(Zr),Zr.applyPatches.bind(Zr),Zr.createDraft.bind(Zr),Zr.finishDraft.bind(Zr);var so="function"==typeof Symbol&&Symbol.observable||"@@observable",ao=function(){return Math.random().toString(36).substring(7).split("").join(".")},co={INIT:"@@redux/INIT"+ao(),REPLACE:"@@redux/REPLACE"+ao(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+ao()}};function lo(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(io(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(io(1));return n(lo)(e,t)}if("function"!=typeof e)throw new Error(io(2));var o=e,i=t,s=[],a=s,c=!1;function l(){a===s&&(a=s.slice())}function u(){if(c)throw new Error(io(3));return i}function d(e){if("function"!=typeof e)throw new Error(io(4));if(c)throw new Error(io(5));var t=!0;return l(),a.push(e),function(){if(t){if(c)throw new Error(io(6));t=!1,l();var n=a.indexOf(e);a.splice(n,1),s=null}}}function f(e){if(!function(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e))throw new Error(io(7));if(void 0===e.type)throw new Error(io(8));if(c)throw new Error(io(9));try{c=!0,i=o(i,e)}finally{c=!1}for(var t=s=a,n=0;n<t.length;n++){(0,t[n])()}return e}return f({type:co.INIT}),(r={dispatch:f,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(io(10));o=e,f({type:co.REPLACE})}})[so]=function(){var e,t=d;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(io(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}})[so]=function(){return this},e},r}function uo(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];"function"==typeof e[o]&&(n[o]=e[o])}var i,s=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:co.INIT}))throw new Error(io(12));if(void 0===n(void 0,{type:co.PROBE_UNKNOWN_ACTION()}))throw new Error(io(13))}))}(n)}catch(a){i=a}return function(e,t){if(void 0===e&&(e={}),i)throw i;for(var r=!1,o={},a=0;a<s.length;a++){var c=s[a],l=n[c],u=e[c],d=l(u,t);if(void 0===d)throw t&&t.type,new Error(io(14));o[c]=d,r=r||d!==u}return(r=r||s.length!==Object.keys(e).length)?o:e}}function fo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}function ho(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),r=function(){throw new Error(io(15))},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},i=t.map((function(e){return e(o)}));return r=fo.apply(void 0,i)(n.dispatch),oo(oo({},n),{},{dispatch:r})}}}function po(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"==typeof o?o(n,r,e):t(o)}}}}var vo=po();vo.withExtraArgument=po;const mo=vo;var bo=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_o=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(a){i=[6,a],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},yo=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e},go=Object.defineProperty,wo=Object.defineProperties,ko=Object.getOwnPropertyDescriptors,xo=Object.getOwnPropertySymbols,So=Object.prototype.hasOwnProperty,Co=Object.prototype.propertyIsEnumerable,Po=function(e,t,n){return t in e?go(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Eo=function(e,t){for(var n in t||(t={}))So.call(t,n)&&Po(e,n,t[n]);if(xo)for(var r=0,o=xo(t);r<o.length;r++){n=o[r];Co.call(t,n)&&Po(e,n,t[n])}return e},Oo=function(e,t){return wo(e,ko(t))},jo="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?fo:fo.apply(null,arguments)};function Ao(e,t){function n(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];if(t){var o=t.apply(void 0,n);if(!o)throw new Error("prepareAction did not return an object");return Eo(Eo({type:e,payload:o.payload},"meta"in o&&{meta:o.meta}),"error"in o&&{error:o.error})}return{type:e,payload:n[0]}}return n.toString=function(){return""+e},n.type=e,n.match=function(t){return t.type===e},n}var Mo=function(e){function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.apply(this,n)||this;return Object.setPrototypeOf(o,t.prototype),o}return bo(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.prototype.concat.apply(this,t)},t.prototype.prepend=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,yo([void 0],e[0].concat(this)))):new(t.bind.apply(t,yo([void 0],e.concat(this))))},t}(Array),Ro=function(e){function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.apply(this,n)||this;return Object.setPrototypeOf(o,t.prototype),o}return bo(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.prototype.concat.apply(this,t)},t.prototype.prepend=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,yo([void 0],e[0].concat(this)))):new(t.bind.apply(t,yo([void 0],e.concat(this))))},t}(Array);function To(e){return ir(e)?Jr(e,(function(){})):e}function No(){return function(e){return function(e){void 0===e&&(e={});var t=e.thunk,n=void 0===t||t;e.immutableCheck,e.serializableCheck,e.actionCreatorCheck;var r=new Mo;n&&("boolean"==typeof n?r.push(mo):r.push(mo.withExtraArgument(n.extraArgument)));return r}(e)}}var zo=!0;function Uo(e){var t,n=No(),r=e||{},o=r.reducer,i=void 0===o?void 0:o,s=r.middleware,a=void 0===s?n():s,c=r.devTools,l=void 0===c||c,u=r.preloadedState,d=void 0===u?void 0:u,f=r.enhancers,h=void 0===f?void 0:f;if("function"==typeof i)t=i;else{if(!function(e){if("object"!=typeof e||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n}(i))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');t=uo(i)}var p=a;"function"==typeof p&&(p=p(n));var v=ho.apply(void 0,p),m=fo;l&&(m=jo(Eo({trace:!zo},"object"==typeof l&&l)));var b=new Ro(v),_=b;return Array.isArray(h)?_=yo([v],h):"function"==typeof h&&(_=h(b)),lo(t,d,m.apply(void 0,_))}function Io(e){var t,n={},r=[],o={addCase:function(e,t){var r="string"==typeof e?e:e.type;if(!r)throw new Error("`builder.addCase` cannot be called with an empty action type");if(r in n)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return n[r]=t,o},addMatcher:function(e,t){return r.push({matcher:e,reducer:t}),o},addDefaultCase:function(e){return t=e,o}};return e(o),[n,r,t]}function Lo(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");var n,r="function"==typeof e.initialState?e.initialState:To(e.initialState),o=e.reducers||{},i=Object.keys(o),s={},a={},c={};function l(){var t="function"==typeof e.extraReducers?Io(e.extraReducers):[e.extraReducers],n=t[0],o=void 0===n?{}:n,i=t[1],s=void 0===i?[]:i,c=t[2],l=void 0===c?void 0:c,u=Eo(Eo({},o),a);return function(e,t,n,r){void 0===n&&(n=[]);var o,i="function"==typeof t?Io(t):[t,n,r],s=i[0],a=i[1],c=i[2];if("function"==typeof e)o=function(){return To(e())};else{var l=To(e);o=function(){return l}}function u(e,t){void 0===e&&(e=o());var n=yo([s[t.type]],a.filter((function(e){return(0,e.matcher)(t)})).map((function(e){return e.reducer})));return 0===n.filter((function(e){return!!e})).length&&(n=[c]),n.reduce((function(e,n){if(n){var r;if(or(e))return void 0===(r=n(e,t))?e:r;if(ir(e))return Jr(e,(function(e){return n(e,t)}));if(void 0===(r=n(e,t))){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}return e}),e)}return u.getInitialState=o,u}(r,(function(e){for(var t in u)e.addCase(t,u[t]);for(var n=0,r=s;n<r.length;n++){var o=r[n];e.addMatcher(o.matcher,o.reducer)}l&&e.addDefaultCase(l)}))}return i.forEach((function(e){var n,r,i=o[e],l=t+"/"+e;"reducer"in i?(n=i.reducer,r=i.prepare):n=i,s[e]=n,a[l]=n,c[e]=r?Ao(l,r):Ao(l)})),{name:t,reducer:function(e,t){return n||(n=l()),n(e,t)},actions:c,caseReducers:s,getInitialState:function(){return n||(n=l()),n.getInitialState()}}}var Bo=["name","message","stack","code"],Do=function(){return function(e,t){this.payload=e,this.meta=t}}(),Ho=function(){return function(e,t){this.payload=e,this.meta=t}}(),Fo=function(e){if("object"==typeof e&&null!==e){for(var t={},n=0,r=Bo;n<r.length;n++){var o=r[n];"string"==typeof e[o]&&(t[o]=e[o])}return t}return{message:String(e)}};function qo(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}!function(){function e(e,t,n){var r=Ao(e+"/fulfilled",(function(e,t,n,r){return{payload:e,meta:Oo(Eo({},r||{}),{arg:n,requestId:t,requestStatus:"fulfilled"})}})),o=Ao(e+"/pending",(function(e,t,n){return{payload:void 0,meta:Oo(Eo({},n||{}),{arg:t,requestId:e,requestStatus:"pending"})}})),i=Ao(e+"/rejected",(function(e,t,r,o,i){return{payload:o,error:(n&&n.serializeError||Fo)(e||"Rejected"),meta:Oo(Eo({},i||{}),{arg:r,requestId:t,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===(null==e?void 0:e.name),condition:"ConditionError"===(null==e?void 0:e.name)})}})),s="undefined"!=typeof AbortController?AbortController:function(){function e(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return e.prototype.abort=function(){},e}();return Object.assign((function(e){return function(a,c,l){var u,d=(null==n?void 0:n.idGenerator)?n.idGenerator(e):function(e){void 0===e&&(e=21);for(var t="",n=e;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t}(),f=new s;function h(e){u=e,f.abort()}var p=function(){return s=this,p=null,v=function(){var s,p,v,m,b,_;return _o(this,(function(y){switch(y.label){case 0:return y.trys.push([0,4,,5]),m=null==(s=null==n?void 0:n.condition)?void 0:s.call(n,e,{getState:c,extra:l}),null===(g=m)||"object"!=typeof g||"function"!=typeof g.then?[3,2]:[4,m];case 1:m=y.sent(),y.label=2;case 2:if(!1===m||f.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return b=new Promise((function(e,t){return f.signal.addEventListener("abort",(function(){return t({name:"AbortError",message:u||"Aborted"})}))})),a(o(d,e,null==(p=null==n?void 0:n.getPendingMeta)?void 0:p.call(n,{requestId:d,arg:e},{getState:c,extra:l}))),[4,Promise.race([b,Promise.resolve(t(e,{dispatch:a,getState:c,extra:l,requestId:d,signal:f.signal,abort:h,rejectWithValue:function(e,t){return new Do(e,t)},fulfillWithValue:function(e,t){return new Ho(e,t)}})).then((function(t){if(t instanceof Do)throw t;return t instanceof Ho?r(t.payload,d,e,t.meta):r(t,d,e)}))])];case 3:return v=y.sent(),[3,5];case 4:return _=y.sent(),v=_ instanceof Do?i(null,d,e,_.payload,_.meta):i(_,d,e),[3,5];case 5:return n&&!n.dispatchConditionRejection&&i.match(v)&&v.meta.condition||a(v),[2,v]}var g}))},new Promise((function(e,t){var n=function(e){try{o(v.next(e))}catch(n){t(n)}},r=function(e){try{o(v.throw(e))}catch(n){t(n)}},o=function(t){return t.done?e(t.value):Promise.resolve(t.value).then(n,r)};o((v=v.apply(s,p)).next())}));var s,p,v}();return Object.assign(p,{abort:h,requestId:d,arg:e,unwrap:function(){return p.then(qo)}})}}),{pending:o,rejected:i,fulfilled:r,typePrefix:e})}e.withTypes=function(){return e}}();var Wo="listenerMiddleware";Ao(Wo+"/add"),Ao(Wo+"/removeAll"),Ao(Wo+"/remove"),"function"==typeof queueMicrotask&&queueMicrotask.bind("undefined"!=typeof window?window:"undefined"!=typeof global?global:globalThis),function(){function e(e,t){var n=s[e];return n?n.enumerable=t:s[e]=n={configurable:!0,enumerable:t,get:function(){var t=this[Wr];return Qr.get(t,e)},set:function(t){var n=this[Wr];Qr.set(n,e,t)}},n}function t(e){for(var t=e.length-1;t>=0;t--){var o=e[t][Wr];if(!o.P)switch(o.i){case 5:r(o)&&Mr(o);break;case 4:n(o)&&Mr(o)}}}function n(e){for(var t=e.t,n=e.k,r=Vr(n),o=r.length-1;o>=0;o--){var i=r[o];if(i!==Wr){var s=t[i];if(void 0===s&&!cr(t,i))return!0;var a=n[i],c=a&&a[Wr];if(c?c.t!==s:!ur(a,s))return!0}}var l=!!t[Wr];return r.length!==Vr(t).length+(l?0:1)}function r(e){var t=e.k;if(t.length!==e.t.length)return!0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);if(n&&!n.get)return!0;for(var r=0;r<t.length;r++)if(!t.hasOwnProperty(r))return!0;return!1}var o,i,s={};i={J:function(t,n){var r=Array.isArray(t),o=function(t,n){if(t){for(var r=Array(n.length),o=0;o<n.length;o++)Object.defineProperty(r,""+o,e(o,!0));return r}var i=Xr(n);delete i[Wr];for(var s=Vr(i),a=0;a<s.length;a++){var c=s[a];i[c]=e(c,t||!!i[c].enumerable)}return Object.create(Object.getPrototypeOf(n),i)}(r,t),i={i:r?5:4,A:n?n.A:yr(),P:!1,I:!1,R:{},l:n,t:t,k:o,o:null,g:!1,C:!1};return Object.defineProperty(o,Wr,{value:i,writable:!0}),o},S:function(e,n,o){o?or(n)&&n[Wr].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var n=t[Wr];if(n){var o=n.t,i=n.k,s=n.R,a=n.i;if(4===a)sr(i,(function(t){t!==Wr&&(void 0!==o[t]||cr(o,t)?s[t]||e(i[t]):(s[t]=!0,Mr(n)))})),sr(o,(function(e){void 0!==i[e]||cr(i,e)||(s[e]=!1,Mr(n))}));else if(5===a){if(r(n)&&(Mr(n),s.length=!0),i.length<o.length)for(var c=i.length;c<o.length;c++)s[c]=!1;else for(var l=o.length;l<i.length;l++)s[l]=!0;for(var u=Math.min(i.length,o.length),d=0;d<u;d++)i.hasOwnProperty(d)||(s[d]=!0),void 0===s[d]&&e(i[d])}}}}(e.p[0]),t(e.p))},K:function(e){return 4===e.i?n(e):r(e)}},Kr[o="ES5"]||(Kr[o]=i)}();class $o{constructor(){t(this,"length",0),t(this,"storage",{})}setItem(e,t){this.storage[e]=t,this.length=Object.keys(this.storage).length}getItem(e){const t=this.storage[e];return void 0===t?null:t}removeItem(e){delete this.storage[e],this.length=Object.keys(this.storage).length}key(e){const t=Object.keys(this.storage);return void 0===t[e]?null:t[e]}clear(){this.length=0,this.storage={}}}const Vo=new class{constructor(e,n){t(this,"backend"),t(this,"length"),t(this,"prefix"),this.prefix=n;try{this.backend=e||localStorage,this.testBackend()}catch(r){this.backend=new $o}this.length=this.backend.length,"function"==typeof this.backend.sync&&(this.sync=e=>{this.backend.sync(e)})}testBackend(){const e=this.prefix+".test.record";this.backend.setItem(e,"123");const t=this.backend.getItem(e);this.backend.removeItem(e);if(!("123"===t&&null===this.backend.getItem(e)))throw new Error("Storage backend is not working properly")}setLocalStoragePrefix(e){this.prefix=e}clear(){if(!this.backend.length)return;const e=[];for(let t=0;t<this.backend.length;++t){const n=this.backend.key(t);n&&n.startsWith(this.prefix)&&e.push(n)}for(const t of e)this.backend.removeItem(t);this.length=this.backend.length}key(e){return this.backend.key(e)}setItem(e,t){if(!t||void 0===t.length||0===t.length)return void this.writeStringToKey(e,"");let n=0;for(;n<t.length;){let r=t.substr(n,1024);n+=r.length,n<t.length&&(r+="@"),this.writeStringToKey(e,r),e+="."}}getItem(e){let t=this.readStringFromKey(e);if(null===t)return null;if(0===t.length)return t;for(;"@"===t[t.length-1];){t=t.substr(0,t.length-1),e+=".";const n=this.readStringFromKey(e);t+=null===n?"":n}return t}removeItem(e){this.backend.removeItem(this.prefix+e),this.length=this.backend.length}writeStringToKey(e,t){this.backend.setItem(this.prefix+e,t),this.length=this.backend.length}readStringFromKey(e){return this.backend.getItem(this.prefix+e)}}(void 0,"jsdos.8."),Xo=["light","dark","cupcake","bumblebee","emerald","corporate","synthwave","retro","cyberpunk","valentine","halloween","garden","forest","aqua","lofi","pastel","fantasy","wireframe","black","luxury","dracula","cmyk","autumn","business","acid","lemonade","night","coffee","winter"],Ko=Lo({name:"js-dos v8s",initialState:{modal:"none",frame:"none",frameXs:!1,window:"none",theme:Vo.getItem("theme")??"dark",editor:!1,wideScreen:!0,fullScreen:!1,toast:null,toastIntent:"none",toastTimeoutId:0,background:null,readOnlyWarning:!1,updateWsWarning:!1,cloudSaves:!0},reducers:{theme:(e,t)=>{Vo.setItem("theme",t.payload),e.theme=t.payload},modalLogin:e=>{e.modal="login"},modalNone:e=>{e.modal="none"},frameNone:e=>{e.frame="none",e.frameXs=!1},frameAccount:e=>{!function(e,t){e.frame===t?e.frame="none":e.frame=t}(e,"account"),e.frameXs=!1},frameSettings:e=>{e.frame="settings",e.frameXs=!1},frameNetwork:e=>{e.frame="network",e.frameXs=!1},frameStats:e=>{e.frame="stats",e.frameXs=!1},frameConf:e=>{e.frame="editor-conf",e.frameXs=!1},frameFs:e=>{e.frame="editor-fs",e.frameXs=!1},frameFatDrives:e=>{e.frame="fat-drives",e.frameXs=!1},frameQuickSave:e=>{e.frame="quick-save",e.frameXs=!0},frameImageRendering:e=>{e.frame="image-rendering",e.frameXs=!1},windowSelect:e=>{e.window="select"},background:(e,t)=>{e.background=t.payload},setEditor:(e,t)=>{e.editor=t.payload},setWideScreen:(e,t)=>{e.wideScreen=t.payload},setFullScreen:(e,t)=>{e.fullScreen=t.payload},showToast:(e,t)=>{0!==e.toastTimeoutId&&clearInterval(e.toastTimeoutId),e.toast=t.payload.message,e.toastIntent=t.payload.intent??"none","panic"!==t.payload.intent&&(e.toastTimeoutId=setTimeout((()=>{t.asyncStore((e=>e.dispatch(Ko.actions.hideToast())))}),t.payload.long?5e3:1500))},hideToast:e=>{e.toast=null,e.toastTimeoutId=0},readOnlyWarning:(e,t)=>{e.readOnlyWarning=t.payload},updateWsWarning:(e,t)=>{e.updateWsWarning=t.payload},cloudSaves:(e,t)=>{e.cloudSaves=t.payload}},extraReducers:e=>{e.addCase(Ao("dos/bndLoad"),((e,t)=>{e.window="loading"})).addCase(Ao("editor/extract"),((e,t)=>{e.window="loading"})).addCase(Ao("editor/ready"),((e,t)=>{e.window="prerun"})).addCase(Ao("dos/bndReady"),((e,t)=>{e.window="prerun"})).addCase(Ao("dos/bndPlay"),((e,t)=>{e.window="run",e.frame="none"})).addMatcher((e=>e.type.startsWith("dos/")&&e.type.endsWith("Error")),((e,t)=>{e.window="error"}))}});function Qo(e,t){t(null===e?Ko.actions.modalLogin():Ko.actions.frameAccount())}var Go=0;function Yo(e,t,n,o,i,s){var a,c,l={};for(c in t)"ref"==c?a=t[c]:l[c]=t[c];var u={type:e,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Go,__i:-1,__u:0,__source:i,__self:s};if("function"==typeof e&&(a=e.defaultProps))for(c in a)void 0===l[c]&&(l[c]=a[c]);return r.vnode&&r.vnode(u),u}function Zo(e){return Yo("div",{class:"text-gray-400 hover:text-gray-600 btn "+e.class,onClick:e.onClose,children:Yo("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-full h-full",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2",children:Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})})})}const Jo="https://v8.js-dos.com/auth/",ei="doszone-uploads",ti="https://storage.yandexcloud.net",ni="dzapi",ri="https://d5dn8hh4ivlobv6682ep.apigw.yandexcloud.net/presign-put",oi="https://subscriptions.xsolla.com/api/user/v1/projects/184012/subscriptions",ii="sumOxNVr",si="https://br.cdn.dos.zone",ai={en:"https://v8.js-dos.com/cancel-your-subscription/",ru:"https://v8.js-dos.com/ru/cancel-your-subscription/"},ci=2;class li{constructor(){t(this,"owner","")}close(){}put(e,t){return Promise.resolve()}get(e,t){return void 0!==t?Promise.resolve(t):Promise.reject(new Error("Cache is not supported on this host"))}del(e){return Promise.resolve()}keys(){return Promise.resolve([])}forEach(e){return Promise.resolve()}}class ui{constructor(e,n,r){if(t(this,"owner"),t(this,"storeName","files"),t(this,"indexedDB"),t(this,"db",null),this.owner=e,this.indexedDB="undefined"==typeof window?void 0:window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,this.indexedDB)try{const t=this.indexedDB.open("js-dos-cache ("+e+")",1);t.onerror=e=>{var n;r("Can't open cache database: "+(null==(n=t.error)?void 0:n.message))},t.onsuccess=e=>{this.db=t.result,n(this)},t.onupgradeneeded=e=>{try{this.db=t.result,this.db.onerror=e=>{r("Can't upgrade cache database")};this.db.createObjectStore(this.storeName).createIndex("key","",{unique:!0,multiEntry:!1})}catch(n){r("Can't upgrade cache database")}}}catch(o){r("Can't open cache database: "+o.message)}else r("Indexed db is not supported on this host")}close(){null!==this.db&&(this.db.close(),this.db=null)}put(e,t){return new Promise(((n,r)=>{if(null===this.db)return void n();const o=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).put(t.buffer,e);o.onerror=()=>r,o.onsuccess=()=>n()}))}del(e){return new Promise(((t,n)=>{if(null===this.db)return void t();const r=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).delete(e);r.onerror=()=>n,r.onsuccess=()=>t()}))}get(e,t){return new Promise(((n,r)=>{function o(e){void 0===t?r(new Error(e)):n(t)}if(null===this.db)return void o("db is not initalized");const i=this.db.transaction(this.storeName,"readonly").objectStore(this.storeName).get(e);i.onerror=()=>r(new Error("Can't read value for key '"+e+"'")),i.onsuccess=()=>{i.result?n(new Uint8Array(i.result)):o("Result is empty for key '"+e+"', result: "+i.result)}}))}keys(){return new Promise(((e,t)=>{if(null===this.db)return void e([]);const n=this.db.transaction(this.storeName,"readonly").objectStore(this.storeName).index("key").getAllKeys();n.onerror=()=>t,n.onsuccess=t=>{const n=t.target.result;e(n)}}))}forEach(e){return new Promise(((t,n)=>{if(null===this.db)return void t();const r=this.db.transaction(this.storeName,"readonly").objectStore(this.storeName).openCursor();r.onerror=()=>n,r.onsuccess=n=>{const r=n.target.result;r?(e(r.key.toString(),new Uint8Array(r.value)),r.continue()):t()}}))}}function di(e){return new Promise((t=>{new ui(e,t,(e=>{console.error("Can't open IndexedDB cache",e),t(new li)}))}))}const fi="qwertyuiopasdfghjklzxcvbnm1234567890",hi=["dosbox","dosboxX"],pi=["webgl","canvas"],vi=["AsIs","1/1","5/4","4/3","16/10","16/9","Fit"],mi=65535,bi=["pixelated","smooth"],_i=Lo({name:"dos",initialState:{step:"emu-init",emuVersion:"-",error:null,bundle:null,config:{},worker:"false"!==Vo.getItem("worker"),backend:Vo.getItem("backend")??"dosbox",backendLocked:!1,backendHardware:"false"!==Vo.getItem("backendHardware"),renderBackend:Vo.getItem("renderBackend")??"webgl",renderAspect:Vo.getItem("renderAspect")??"AsIs",volume:Number.parseFloat(Vo.getItem("volume")??"1.0"),mouseSensitivity:Number.parseFloat(Vo.getItem("mouse_sensitivity")??"1.0"),mouseCapture:!1,paused:!1,stats:{cyclesPerMs:0,nonSkippableSleepPreSec:0,sleepPerSec:0,sleepTimePerSec:0,framePerSec:0,soundPerSec:0,msgSentPerSec:0,msgRecvPerSec:0,netRecv:0,netSent:0,driveSent:0,driveRecv:0,driveRecvTime:0,driveCacheHit:0,driveCacheMiss:0,driveCacheUsed:0},network:{server:Vo.getItem("net.server")??"netherlands",room:wi()+wi()+wi(),ipx:"disconnected"},ci:!1,ciStartedAt:0,imageRendering:Vo.getItem("imageRendering")??"pixelated",sockdriveWrite:!0},reducers:{emuReady:(e,t)=>{e.step="emu-ready",e.emuVersion=t.payload},emuError:(e,t)=>{e.step="emu-error",e.error=t.payload??"Unexpeceted error"},bndLoad:(e,t)=>{e.step="bnd-load",e.bundle=t.payload},bndError:(e,t)=>{e.step="bnd-error",e.error=t.payload??"Unexpeceted error"},bndConfig:e=>{e.step="bnd-config"},bndReady:(e,t)=>{e.step="bnd-ready",e.config=t.payload},bndPlay:(e,t)=>{e.step="bnd-play",t.asyncStore((e=>{Li(Ui(e),"bnd-play")}))},dosWorker:(e,t)=>{e.worker=t.payload,Vo.setItem("worker",e.worker?"true":"false")},dosBackend:(e,t)=>{e.backend=t.payload},dosBackendLocked:(e,t)=>{e.backendLocked=t.payload},dosBackendHardware:(e,t)=>{e.backendHardware=t.payload,Vo.setItem("backendHardware",e.backendHardware?"true":"false")},renderBackend:(e,t)=>{e.renderBackend=t.payload,Vo.setItem("renderBackend",e.renderBackend)},renderAspect:(e,t)=>{e.renderAspect=t.payload,Vo.setItem("renderAspect",e.renderAspect)},imageRendering:(e,t)=>{e.imageRendering=t.payload,Vo.setItem("imageRendering",e.imageRendering)},volume:(e,t)=>{e.volume=t.payload,Vo.setItem("volume",e.volume+"")},mouseSensitivity:(e,t)=>{e.mouseSensitivity=t.payload,Vo.setItem("mouse_sensitivity",e.mouseSensitivity+"")},mouseCapture:(e,t)=>{e.mouseCapture=t.payload},paused:(e,t)=>{e.paused=t.payload},stats:(e,t)=>{e.stats=t.payload},ci:(e,t)=>{e.ci=t.payload,t.payload&&(e.ciStartedAt=Date.now())},connectIpx:(e,t)=>{if("connected"===e.network.ipx)throw new Error("Already connected");if(!e.ci)throw new Error("DOS is not started");const{room:n,address:r}=t.payload;e.network.ipx="connecting",t.asyncStore((e=>{const t=Ui(e);if(!t.ci)throw new Error("DOS is not started");const o=r.endsWith("/")?r.substring(0,r.length-1):r;t.ci.networkConnect(0,o+":1900/ipx/"+n.replaceAll("@","_")).then((()=>{e.dispatch(_i.actions.statusIpx("connected"))})).catch((t=>{e.dispatch(_i.actions.statusIpx("error")),console.error(t)}))}))},statusIpx:(e,t)=>{e.network.ipx=t.payload},disconnectIpx:(e,t)=>{e.network.ipx="disconnected",t.asyncStore((e=>{var t;null==(t=Ui(e).ci)||t.networkDisconnect(0)}))},setRoom:(e,t)=>{e.network.room=t.payload},setServer:(e,t)=>{e.network.server=t.payload,Vo.setItem("net.server",t.payload)},setSockdriveWrite:(e,t)=>{e.sockdriveWrite=t.payload}}});let yi=!1;function gi(e,t){e.dispatch((async e=>{try{yi||(await function(e){if(null!==document.querySelector("#emulators.js"))return Promise.resolve();return new Promise(((t,n)=>{const r=document.createElement("script");r.async=!0,r.type="text/javascript",r.src=e+"emulators.js",r.onload=()=>{emulators.pathPrefix=e,t()},r.onerror=e=>{n(new Error("Unable to add emulators.js. Probably you should set the 'pathPrefix' option to point to the js-dos folder."))},document.head.appendChild(r)}))}(t),yi=!0),e(_i.actions.emuReady(emulators.version))}catch(n){console.error("Unable to init emulators.js",n),e(_i.actions.emuError(n.message))}}))}function wi(){return fi[Math.round(Math.random()*(fi.length-1))]}const ki={ru:{enter_name_of_drive:"Введите название диска",ws_outdated:"Необходимо обновить DOS Браузер",update:"Обновить",preloading_sockdrive:"Загрузка FAT",filter:"Фильтр",add:"Добавить",logout:"Выйти",please_login:"Войдите в аккаунт",features:"Функции",premium:"Премиум",buy:"Купить",experimental_features:"Доступ к экспериентальным функциям",cloud_saves:"Облачные сохранения",writeable_fat32:"FAT32 диски",net_no_limits:"Выбор сервера для стевой игры",unlock_options:"Доступ ко всем настройкам",error:"Упс... Что-то пошло не так...",consult_logs:"Проверьте логи браузера",bundle_loading:"Загрузка бандла",bundle_config:"Чтение конфигурации",try_free:"дней бесплатно",upload_file:"Выбирите архив jsdos/zip что бы начать...",emulation_backend:"Эмуляция",render_backend:"Рендер",render_aspect:"Соотношение сторон",worker:"Фоновый поток",mouse_sensitivity:"Чувст. мыши",mouse_lock:"Захват мыши",volume:"Громкость",pause:"Пауза",dosboxconf_template:"dosbox.conf шаблон:",preview:"Превью",continue:"Продолжить",skip:"Пропустить",loading:"Загрузка",extract_loading:"Распаковка архива",extract_long_time:"Может занять длительное время, пожалуйста ждите...",theme:"Тема",create_empty:"Создать пустой бандл",uploading_file:"Загрузка файла",fs_restart:"Вы хотите пересобрать бандл используя эту FS?",please_wait:"Пожалуйста подождите",making_bundle:"Создаем бандл",size:"Размер",room:"Команта",server:"Сервер",load_by_url:"Загрузить по ссылке",enter_url:"Введите ссылку",load:"Загрузить",stored:"Сохраненные",delete:"Удалить",editor:"Редактор",download:"Скачать",changes:"Сохранения",account_not_ready:"Пропустить загрузку сохранений",loading_saves:"Загрузка сохранений",success:"Успешно",unable_to_save:"Ошибка записи",not_premium:"Подключить премиум",copy_net_link:"Отправьте ссылку на подключение",copied:"Скопировано",image_rendering:"Обработка изображения",read_only_access:"Диск FAT32 открыт только для чтения",fix:"Исправить",close:"Закрыть",cancle:"Отказаться",manage:"Управлять",unable_to_cancle_subscription:"Не удалось отменить подписку",subscription_cancelled:"Подписка отменена",hardware:"Аппаратное ускорение",net_drives:"Сетевые диски",fat_write:"FAT запись"},en:{enter_name_of_drive:"Enter name of drive",ws_outdated:"Must update DOS Browser App",update:"Update",preloading_sockdrive:"Preloading FAT",filter:"Filter",add:"Add",logout:"Logout",please_login:"Please login",features:"Features",premium:"Premium",buy:"Buy",experimental_features:"Access to all experimental features",cloud_saves:"Cloud saves",writeable_fat32:"Writable FAT32",net_no_limits:"Change the network region",unlock_options:"Unlock all configuration options",error:"Oops... Something went wrong...",consult_logs:"Please check browser logs",bundle_loading:"Bundle loading",bundle_config:"Reading config",try_free:"days for free",upload_file:"Select jsdos/zip file to start...",emulation_backend:"Emulation",render_backend:"Render",render_aspect:"Aspect",worker:"Worker thread",mouse_sensitivity:"Mouse sens...",mouse_lock:"Capture mouse",volume:"Volume",pause:"Pause",dosboxconf_template:"dosbox.conf template:",preview:"Preview",continue:"Continue",skip:"Skip",loading:"Loading",extract_loading:"Unpacking archive",extract_long_time:"Can take long time, please be patient...",theme:"Theme",create_empty:"Create empty bundle",uploading_file:"Uploading file",fs_restart:"Do you want to rebuild the bundle using this fs?",please_wait:"Please wait",making_bundle:"Creating bundle",size:"Size",room:"Room",server:"Server",load_by_url:"Load by url",enter_url:"Enter url",load:"Load",stored:"Stored",delete:"Delete",editor:"Editor",download:"Download",changes:"Saves",account_not_ready:"Skip loading saves",loading_saves:"Loading saves",success:"Success",unable_to_save:"Unable to save",not_premium:"Subscribe to premium",copy_net_link:"Share this link to connect",copied:"Copied",image_rendering:"Image rendering",read_only_access:"The FAT32 drive is open in read-only mode",fix:"Fix",close:"Close",cancle:"Cancle",manage:"Manage",unable_to_cancle_subscription:"Unable to cancle subscription",subscription_cancelled:"Subscription cancelled",hardware:"Hardware acceleration",net_drives:"Net drives",fat_write:"Writeable FAT"}},xi=navigator.language.startsWith("ru")?"ru":"en",Si=Lo({name:"i18n",initialState:{lang:xi,keys:ki[xi]},reducers:{setLang:(e,t)=>{e.lang=t.payload,e.keys=ki[t.payload]}}});function Ci(){const e=on((e=>e.i18n.keys));return t=>e[t]??t}const Pi=Lo({name:"storage",initialState:{recived:0,total:0,ready:!1},reducers:{reset:e=>{e.recived=-1,e.total=0,e.ready=!1},progress:(e,t)=>{e.recived=t.payload[0],e.total=t.payload[1]},ready:e=>{e.ready=!0}}}),Ei=[{name:"7.xx",backend:"dosbox",contents:"[sdl]\nautolock=false\n\nfullscreen=false\nfulldouble=false\nfullresolution=original\nwindowresolution=original\noutput=surface\nsensitivity=100\nwaitonerror=true\npriority=higher,normal\nmapperfile=mapper-jsdos.map\nusescancodes=true\nvsync=false\n[dosbox]\nmachine=svga_s3\n\nlanguage=\ncaptures=capture\nmemsize=16\n[cpu]\ncore=auto\ncputype=auto\ncycles=auto\n\ncycleup=10\ncycledown=20\n[mixer]\nnosound=false\nrate=44100\n\nblocksize=1024\nprebuffer=20\n\n[render]\n# frameskip: How many frames DOSBox skips before drawing one.\n# aspect: Do aspect correction, if your output method doesn't support scaling this can slow things down!.\n# scaler: Scaler used to enlarge/enhance low resolution modes.\n# If 'forced' is appended, then the scaler will be used even if the result might not be desired.\n# Possible values: none, normal2x, normal3x, advmame2x, advmame3x, advinterp2x, advinterp3x, hq2x, hq3x, 2xsai, super2xsai, supereagle, tv2x, tv3x, rgb2x, rgb3x, scan2x, scan3x.\n\nframeskip=0\naspect=false\nscaler=none\n\n[midi]\n# mpu401: Type of MPU-401 to emulate.\n# Possible values: intelligent, uart, none.\n# mididevice: Device that will receive the MIDI data from MPU-401.\n# Possible values: default, win32, alsa, oss, coreaudio, coremidi, none.\n# midiconfig: Special configuration options for the device driver. This is usually the id of the device you want to use.\n# See the README/Manual for more details.\n\nmpu401=intelligent\nmididevice=default\nmidiconfig=\n\n[sblaster]\n# sbtype: Type of Soundblaster to emulate. gb is Gameblaster.\n# Possible values: sb1, sb2, sbpro1, sbpro2, sb16, gb, none.\n# sbbase: The IO address of the soundblaster.\n# Possible values: 220, 240, 260, 280, 2a0, 2c0, 2e0, 300.\n# irq: The IRQ number of the soundblaster.\n# Possible values: 7, 5, 3, 9, 10, 11, 12.\n# dma: The DMA number of the soundblaster.\n# Possible values: 1, 5, 0, 3, 6, 7.\n# hdma: The High DMA number of the soundblaster.\n# Possible values: 1, 5, 0, 3, 6, 7.\n# sbmixer: Allow the soundblaster mixer to modify the DOSBox mixer.\n# oplmode: Type of OPL emulation. On 'auto' the mode is determined by sblaster type. All OPL modes are Adlib-compatible, except for 'cms'.\n# Possible values: auto, cms, opl2, dualopl2, opl3, none.\n# oplemu: Provider for the OPL emulation. compat might provide better quality (see oplrate as well).\n# Possible values: default, compat, fast.\n# oplrate: Sample rate of OPL music emulation. Use 49716 for highest quality (set the mixer rate accordingly).\n# Possible values: 44100, 49716, 48000, 32000, 22050, 16000, 11025, 8000.\n\nsbtype=sb16\nsbbase=220\nirq=7\ndma=1\nhdma=5\nsbmixer=true\noplmode=auto\noplemu=default\noplrate=44100\n\n[gus]\n# gus: Enable the Gravis Ultrasound emulation.\n# gusrate: Sample rate of Ultrasound emulation.\n# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716.\n# gusbase: The IO base address of the Gravis Ultrasound.\n# Possible values: 240, 220, 260, 280, 2a0, 2c0, 2e0, 300.\n# gusirq: The IRQ number of the Gravis Ultrasound.\n# Possible values: 5, 3, 7, 9, 10, 11, 12.\n# gusdma: The DMA channel of the Gravis Ultrasound.\n# Possible values: 3, 0, 1, 5, 6, 7.\n# ultradir: Path to Ultrasound directory. In this directory\n# there should be a MIDI directory that contains\n# the patch files for GUS playback. Patch sets used\n# with Timidity should work fine.\n\ngus=false\ngusrate=44100\ngusbase=240\ngusirq=5\ngusdma=3\nultradir=C:\\ULTRASND\n\n[speaker]\n# pcspeaker: Enable PC-Speaker emulation.\n# pcrate: Sample rate of the PC-Speaker sound generation.\n# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716.\n# tandy: Enable Tandy Sound System emulation. For 'auto', emulation is present only if machine is set to 'tandy'.\n# Possible values: auto, on, off.\n# tandyrate: Sample rate of the Tandy 3-Voice generation.\n# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716.\n# disney: Enable Disney Sound Source emulation. (Covox Voice Master and Speech Thing compatible).\n\npcspeaker=true\npcrate=44100\ntandy=auto\ntandyrate=44100\ndisney=true\n\n[joystick]\n# joysticktype: Type of joystick to emulate: auto (default), none,\n# 2axis (supports two joysticks),\n# 4axis (supports one joystick, first joystick used),\n# 4axis_2 (supports one joystick, second joystick used),\n# fcs (Thrustmaster), ch (CH Flightstick).\n# none disables joystick emulation.\n# auto chooses emulation depending on real joystick(s).\n# (Remember to reset dosbox's mapperfile if you saved it earlier)\n# Possible values: auto, 2axis, 4axis, 4axis_2, fcs, ch, none.\n# timed: enable timed intervals for axis. Experiment with this option, if your joystick drifts (away).\n# autofire: continuously fires as long as you keep the button pressed.\n# swap34: swap the 3rd and the 4th axis. can be useful for certain joysticks.\n# buttonwrap: enable button wrapping at the number of emulated buttons.\n\njoysticktype=auto\ntimed=true\nautofire=false\nswap34=false\nbuttonwrap=false\n\n[serial]\n# serial1: set type of device connected to com port.\n# Can be disabled, dummy, modem, nullmodem, directserial.\n# Additional parameters must be in the same line in the form of\n# parameter:value. Parameter for all types is irq (optional).\n# for directserial: realport (required), rxdelay (optional).\n# (realport:COM1 realport:ttyS0).\n# for modem: listenport (optional).\n# for nullmodem: server, rxdelay, txdelay, telnet, usedtr,\n# transparent, port, inhsocket (all optional).\n# Example: serial1=modem listenport:5000\n# Possible values: dummy, disabled, modem, nullmodem, directserial.\n# serial2: see serial1\n# Possible values: dummy, disabled, modem, nullmodem, directserial.\n# serial3: see serial1\n# Possible values: dummy, disabled, modem, nullmodem, directserial.\n# serial4: see serial1\n# Possible values: dummy, disabled, modem, nullmodem, directserial.\n\nserial1=dummy\nserial2=dummy\nserial3=disabled\nserial4=disabled\n\n[dos]\n# xms: Enable XMS support.\n# ems: Enable EMS support.\n# umb: Enable UMB support.\n# keyboardlayout: Language code of the keyboard layout (or none).\n\nxms=true\nems=true\numb=true\nkeyboardlayout=auto\n\n[ipx]\n# ipx: Enable ipx over UDP/IP emulation.\n\nipx=true\n[autoexec]\necho off\nmount c .\nc:\n\ntype jsdos~1/readme.txt\necho on\n\n# Generated using https://js-dos.com\n# █▀▀▀▀▀█ █ ▄▄▄▀▀█ █▀▀▀▀▀█\n# █ ███ █ ██▄ █ ▀ ▄ █ ███ █\n# █ ▀▀▀ █ ▄██ ▀ ▀▀█ █ ▀▀▀ █\n# ▀▀▀▀▀▀▀ ▀ █▄▀▄▀ █ ▀▀▀▀▀▀▀\n# █▀▄▄█▀▀▄▄ ▀ ▀█▄▄▄▄ ▀▄█▀█▀\n# █▀ ▀ ▀▀▄ █▀ ▄ ▄▀▀▀▄ █▀█▄\n# ▄ ▄▄ █▀▀▄ ▄▀▄▀▀█ ▀▀▄▀▀█▀\n# ▄▀▀█▀▀ █▀█▀█▀▀▄ ▀██▀█▄\n# ▀▀▀ ▀ ▀ █▄█ ▀█▄▄█▀▀▀█▀▀\n# █▀▀▀▀▀█ ▄▄▄ ▄ ▄ █ ▀ █▄▄▄▄\n# █ ███ █ ▀█▀▀▄▀▀▄████▀▀█▄█\n# █ ▀▀▀ █ ▄▀▀█▀█▀▄ ▀▀▄▄█▄█\n# ▀▀▀▀▀▀▀ ▀ ▀▀ ▀ ▀ ▀▀▀\n".replace(/\n/g,"\r\n")},{name:"DOS 7.1",backend:"dosboxX",contents:"\n[sdl]\nautolock=false\n\n[dosbox]\ntitle=DOS 7.1\nmemsize=64\n\n[dos]\nver=7.1\nhard drive data rate limit=0\nfloppy drive data rate limit=0\n\n[cpu]\ncputype=pentium_mmx\ncore=auto\n\n[sblaster]\nsbtype=sb16vibra\n\n[render]\nscaler=none\n\n[autoexec]\necho off\nimgmount 2 sockdrive {wss-makevm} system dos7.1-v1\necho Please visit our website:\necho \necho _ __\necho (_)____ ____/ /___ _____ _________ ____ ___\necho / / ___/_____/ __ / __ \\/ ___// ___/ __ \\/ __ `__ \\\necho / (__ )_____/ /_/ / /_/ (__ )/ /__/ /_/ / / / / / /\necho __/ /____/ \\__,_/\\____/____(_)___/\\____/_/ /_/ /_/\necho /___/\necho\necho type 'boot c:' to load DOS 7.1\necho on\n# \n# █▀▀▀▀▀█ █ ▄▄▄▀▀█ █▀▀▀▀▀█\n# █ ███ █ ██▄ █ ▀ ▄ █ ███ █\n# █ ▀▀▀ █ ▄██ ▀ ▀▀█ █ ▀▀▀ █\n# ▀▀▀▀▀▀▀ ▀ █▄▀▄▀ █ ▀▀▀▀▀▀▀\n# █▀▄▄█▀▀▄▄ ▀ ▀█▄▄▄▄ ▀▄█▀█▀\n# █▀ ▀ ▀▀▄ █▀ ▄ ▄▀▀▀▄ █▀█▄\n# ▄ ▄▄ █▀▀▄ ▄▀▄▀▀█ ▀▀▄▀▀█▀\n# ▄▀▀█▀▀ █▀█▀█▀▀▄ ▀██▀█▄\n# ▀▀▀ ▀ ▀ █▄█ ▀█▄▄█▀▀▀█▀▀\n# █▀▀▀▀▀█ ▄▄▄ ▄ ▄ █ ▀ █▄▄▄▄\n# █ ███ █ ▀█▀▀▄▀▀▄████▀▀█▄█\n# █ ▀▀▀ █ ▄▀▀█▀█▀▄ ▀▀▄▄█▄█\n# ▀▀▀▀▀▀▀ ▀ ▀▀ ▀ ▀ ▀▀▀\n#\n".replace(/\n/g,"\r\n")},{name:"Win 95",backend:"dosboxX",contents:"\n[sdl]\nautolock=false\nmouse_emulation=integration\n\n[dosbox]\ntitle=Windows 95\nmemsize=128\n\n[video]\nvmemsize=8\nvesa modelist width limit=0\nvesa modelist height limit=0\n\n[dos]\nver=7.1\nhard drive data rate limit=0\nfloppy drive data rate limit=0\n\n[cpu]\ncputype=pentium_mmx\ncore=auto\nintegration device=true\n\n[sblaster]\nsbtype=sb16vibra\n\n[fdc, primary]\nint13fakev86io=true\n\n[ide, primary]\nint13fakeio=true\nint13fakev86io=true\n\n[ide, secondary]\nint13fakeio=true\nint13fakev86io=true\ncd-rom insertion delay=4000\n\n[render]\nscaler=none\n\n[autoexec]\necho off\nimgmount 2 sockdrive {wss-makevm} system win95-v1\necho Please visit our website:\necho \necho _ __\necho (_)____ ____/ /___ _____ _________ ____ ___\necho / / ___/_____/ __ / __ \\/ ___// ___/ __ \\/ __ `__ \\\necho / (__ )_____/ /_/ / /_/ (__ )/ /__/ /_/ / / / / / /\necho __/ /____/ \\__,_/\\____/____(_)___/\\____/_/ /_/ /_/\necho /___/\necho\necho type 'boot c:' to load windows 95\necho on\n# \n# █▀▀▀▀▀█ █ ▄▄▄▀▀█ █▀▀▀▀▀█\n# █ ███ █ ██▄ █ ▀ ▄ █ ███ █\n# █ ▀▀▀ █ ▄██ ▀ ▀▀█ █ ▀▀▀ █\n# ▀▀▀▀▀▀▀ ▀ █▄▀▄▀ █ ▀▀▀▀▀▀▀\n# █▀▄▄█▀▀▄▄ ▀ ▀█▄▄▄▄ ▀▄█▀█▀\n# █▀ ▀ ▀▀▄ █▀ ▄ ▄▀▀▀▄ █▀█▄\n# ▄ ▄▄ █▀▀▄ ▄▀▄▀▀█ ▀▀▄▀▀█▀\n# ▄▀▀█▀▀ █▀█▀█▀▀▄ ▀██▀█▄\n# ▀▀▀ ▀ ▀ █▄█ ▀█▄▄█▀▀▀█▀▀\n# █▀▀▀▀▀█ ▄▄▄ ▄ ▄ █ ▀ █▄▄▄▄\n# █ ███ █ ▀█▀▀▄▀▀▄████▀▀█▄█\n# █ ▀▀▀ █ ▄▀▀█▀█▀▄ ▀▀▄▄█▄█\n# ▀▀▀▀▀▀▀ ▀ ▀▀ ▀ ▀ ▀▀▀\n#\n".replace(/\n/g,"\r\n")},{name:"Win 98",backend:"dosboxX",contents:"\n[sdl]\nautolock=false\nmouse_emulation=integration\n\n[dosbox]\ntitle=Windows 98\nmemsize=128\n\n[video]\nvmemsize=8\nvesa modelist width limit=0\nvesa modelist height limit=0\n\n[dos]\nver=7.1\nhard drive data rate limit=0\nfloppy drive data rate limit=0\n\n[cpu]\ncputype=pentium_mmx\ncore=auto\nintegration device=true\n\n[sblaster]\nsbtype=sb16vibra\n\n[fdc, primary]\nint13fakev86io=true\n\n[ide, primary]\nint13fakeio=true\nint13fakev86io=true\n\n[ide, secondary]\nint13fakeio=true\nint13fakev86io=true\ncd-rom insertion delay=4000\n\n[render]\nscaler=none\n\n[autoexec]\necho off\nimgmount 2 sockdrive {wss-makevm} system win98-v1\necho Please visit our website:\necho \necho _ __\necho (_)____ ____/ /___ _____ _________ ____ ___\necho / / ___/_____/ __ / __ \\/ ___// ___/ __ \\/ __ `__ \\\necho / (__ )_____/ /_/ / /_/ (__ )/ /__/ /_/ / / / / / /\necho __/ /____/ \\__,_/\\____/____(_)___/\\____/_/ /_/ /_/\necho /___/\necho\necho type 'boot c:' to load windows 98\necho on\n# \n# █▀▀▀▀▀█ █ ▄▄▄▀▀█ █▀▀▀▀▀█\n# █ ███ █ ██▄ █ ▀ ▄ █ ███ █\n# █ ▀▀▀ █ ▄██ ▀ ▀▀█ █ ▀▀▀ █\n# ▀▀▀▀▀▀▀ ▀ █▄▀▄▀ █ ▀▀▀▀▀▀▀\n# █▀▄▄█▀▀▄▄ ▀ ▀█▄▄▄▄ ▀▄█▀█▀\n# █▀ ▀ ▀▀▄ █▀ ▄ ▄▀▀▀▄ █▀█▄\n# ▄ ▄▄ █▀▀▄ ▄▀▄▀▀█ ▀▀▄▀▀█▀\n# ▄▀▀█▀▀ █▀█▀█▀▀▄ ▀██▀█▄\n# ▀▀▀ ▀ ▀ █▄█ ▀█▄▄█▀▀▀█▀▀\n# █▀▀▀▀▀█ ▄▄▄ ▄ ▄ █ ▀ █▄▄▄▄\n# █ ███ █ ▀█▀▀▄▀▀▄████▀▀█▄█\n# █ ▀▀▀ █ ▄▀▀█▀█▀▄ ▀▀▄▄█▄█\n# ▀▀▀▀▀▀▀ ▀ ▀▀ ▀ ▀ ▀▀▀\n#\n".replace(/\n/g,"\r\n")}],Oi=Lo({name:"editor",initialState:{configChanged:!1,bundleConfig:null,errorMessage:null,fs:[]},reducers:{init:(e,t)=>{null===t.payload?(e.configChanged=!0,e.bundleConfig={dosboxConf:Ei[0].contents,jsdosConf:{version:"js-dos-v8"}}):(e.configChanged=!1,e.bundleConfig=t.payload)},dosboxConf:(e,t)=>{e.configChanged=!0,e.bundleConfig.dosboxConf=t.payload}}}),ji=["localhost","js-dos"],Ai={"js-dos":{sockdriveEndpoint:"https://sockdrive.js-dos.com:8001",sockdriveWssEndpoint:"wss://sockdrive.js-dos.com:8001"},localhost:{sockdriveEndpoint:"http://localhost:8001",sockdriveWssEndpoint:"ws://localhost:8001"}};let Mi=-1;function Ri(){return Mi+=1,{storeUid:Mi,slice:Lo({name:"init",initialState:{uid:Mi,sockdriveBackendName:Vo.getItem("sockdrive.backend.name")??"js-dos"},reducers:{setSockdriveBackendName:(e,t)=>{e.sockdriveBackendName=t.payload,Vo.setItem("sockdrive.backend.name",t.payload)}}})}}const Ti=Ri().slice,Ni=e=>t=>n=>{const r=Object.assign({},n,{asyncStore:function(t){setTimeout((()=>t(e)),4)}});t(r)},zi={};function Ui(e){return"function"==typeof e.getState?zi[e.getState().init.uid]:zi[e.init.uid]}function Ii(){return Ui(Jn())}function Li(e,t,n){e.options.onEvent&&setTimeout((()=>{var r,o;null==(o=(r=e.options).onEvent)||o.call(r,t,n)}),4)}const Bi="cached.account",Di=(()=>{const e=new URLSearchParams(location.search).get("jsdos_token");if(null!==e)return Fi(e),history.replaceState(null,"",location.href.substring(0,location.href.indexOf("?"))),null;{const e=Vo.getItem(Bi),t=null!==e?JSON.parse(e):null;return null!==t&&t.token.validUntilMs-Date.now()>36e5?t:null}})(),Hi=Lo({name:"auth",initialState:{loginUrl:location.href,account:Di,ready:null!==Di},reducers:{login:(e,t)=>{Fi(t.payload.token.refresh_token),e.account=t.payload,e.account.premium=e.account.premium||"dz.caiiiycuk@gmail.com"===e.account.email||"caiiiycuk@gmail.com"===e.account.email,Vo.setItem(Bi,JSON.stringify(t.payload)),t.asyncStore((e=>{"dz.caiiiycuk@gmail.com"!==t.payload.email&&"caiiiycuk@gmail.com"!==t.payload.email||e.dispatch(_i.actions.setSockdriveWrite(!1)),di(t.payload.email).then((t=>Ui(e).cache=t)).catch(console.error).finally((()=>{e.dispatch(Hi.actions.ready())}))}))},logout:(e,t)=>{qi(),Vo.removeItem(Bi),t.asyncStore((e=>{di("guest").then((t=>Ui(e).cache=t)).catch(console.error)})),e.account=null},ready:e=>{e.ready=!0},setLoginUrl:(e,t)=>{e.loginUrl=t.payload}}});function Fi(e){if(null!==e)return Vo.setItem("cached.rt",e);qi()}function qi(){Vo.removeItem("cached.rt")}function Wi(){const e=le(null),t=on((e=>e.auth.account)),n="login"===on((e=>e.ui.modal)),r=on((e=>e.auth.loginUrl)),o=tr();return ae((()=>{if(null!=t)return;const n=e.current;if(null===n)return o(Hi.actions.logout({})),o(Hi.actions.ready()),void console.error("Unable to inialize authentificator!");async function r(e){if("auth/ready"===e.data.action)$i("auth/authenicate",n,o);else if("auth/authenicate"===e.data.action){const n=e.data.account;if(null!==n){try{n.premium=await async function(e){const t=await fetch(oi,{method:"GET",cache:"no-cache",headers:{Authorization:"Bearer "+e}}),n=await t.json();return void 0===n.items?(console.error("Unexpected subscriptions response:",n),!1):n.items.length>0&&n.items[0].plan_external_id===ii}(n.token.access_token)}catch(t){console.error(t),n.premium=!1}o(Hi.actions.login(e.data.account))}else o(Hi.actions.logout({})),o(Hi.actions.ready())}}return window.addEventListener("message",r),n.src=Jo,()=>{window.removeEventListener("message",r)}}),[]),ae((()=>{if(n){const t=e.current;if(null===t)return;$i("auth/login",t,o,r)}}),[n,r]),Yo("div",{id:"login",class:"login-widget "+(n?"block":"hidden"),children:[Yo("iframe",{id:"authentificator",ref:e}),Yo(Zo,{class:"absolute z-40 right-24 top-10",onClose:()=>o(Ko.actions.modalNone())})]})}function $i(e,t,n,r){const o={action:e,refresh_token:"auth/authenicate"===e?Vo.getItem("cached.rt"):void 0,url:"auth/login"===e?r:void 0};t&&t.contentWindow?t.contentWindow.postMessage(o,"*"):(console.error("Can't find authentificator iframe"),n(Hi.actions.logout({})),n(Hi.actions.ready()))}function Vi(e){const t=Ci(),n=on((e=>e.auth.account)),r=tr();if(null===n)return null;return Yo("div",{class:"account-frame frame-root items-center",children:[null!==n.picture&&Yo("img",{class:"account-img",src:n.picture}),Yo("div",{children:n.name??n.email}),null!==n.name&&Yo("div",{class:"account-email",children:n.email}),Yo("button",{class:"btn mt-8",onClick:function(){r(Hi.actions.logout({})),r(Ko.actions.frameNone())},children:t("logout")}),Yo("div",{class:"mt-8 mb-4 text-2xl",children:t("features")}),Yo(Xi,{})]})}function Xi(e){const t=Ci(),n=on((e=>e.i18n.lang)),r=on((e=>e.auth.account)),[o,i]=ie(!1),s=tr();if(null===r)return null;const a=r.token.access_token;return Yo("div",{class:"premium-plan-root "+(r.premium?"have-premium":""),children:[Yo("div",{class:"premium-plan-head flex",children:[Yo(Ki,{}),t("premium"),Yo("div",{class:"flex-grow"}),r.premium&&Yo("button",{onClick:async function(){const e=()=>{s(Ko.actions.showToast({message:t("unable_to_cancle_subscription"),intent:"error"})),window.open(ai[n]??ai.en,"_blank")};if(r)try{await async function(e){const t=await fetch(oi+"/"+ii+"/cancel",{method:"PUT",cache:"no-cache",headers:{Authorization:"Bearer "+e}}),n=await t.json();return!n.error||(console.error("Unexpected subscriptions response:",n),!1)}(r.token.access_token)?s(Ko.actions.showToast({message:t("subscription_cancelled"),intent:"success"})):e()}catch(o){e()}else e()},class:"ml-2 btn btn-ghost btn-xs text-success-content",children:t("cancle")})]}),!r.premium&&Yo(y,{children:[Yo("div",{class:"flex flex-row my-6 items-top",children:[Yo("div",{class:"premium-plan-cost",children:"$3"}),Yo("div",{class:"premium-plan-cost-expl",children:[Yo("div",{children:"USD / mo"}),Yo("div",{children:[Yo("span",{class:"text-blue-600",children:"5"})," ",t("try_free")]})]})]}),Yo("button",{class:"btn btn-primary w-full "+(o?"hidden":""),onClick:function(){o||("js-dos.com"===location.host?(i(!0),async function(e){const t=await fetch(oi+"/buy",{method:"POST",cache:"no-cache",headers:{Authorization:"Bearer "+e,"Content-Type":"application/json"},body:JSON.stringify({plan_external_id:ii})}),n=await t.json();return void 0===n.link_to_ps?(console.error("Unexpected subscriptions response:",n),null):n.link_to_ps}(a).then((e=>{null!==e&&window.open(e,"_blank")})).catch(console.error).finally((()=>i(!1)))):window.open("https://js-dos.com/subscription.html","_blank"))},children:t("buy")})]}),Yo("div",{class:"flex flex-col mt-4",children:[Yo("div",{class:"premium-plan-highlight",children:[Yo(Ki,{}),Yo("div",{children:t("cloud_saves")})]}),Yo("div",{class:"premium-plan-highlight",children:[Yo(Ki,{}),Yo("div",{children:t("experimental_features")})]}),Yo("div",{class:"premium-plan-highlight",children:[Yo(Ki,{}),Yo("div",{children:t("writeable_fat32")}),Yo("div",{class:"flex-grow"}),Yo("button",{onClick:()=>s(Ko.actions.frameFatDrives()),target:"_blank",class:"ml-2 btn btn-xs text-success-content",children:t("manage")})]}),Yo("div",{class:"premium-plan-highlight",children:[Yo(Ki,{}),Yo("div",{children:t("net_no_limits")})]}),Yo("div",{class:"premium-plan-highlight",style:"border-bottom: 0px",children:[Yo(Ki,{}),Yo("div",{children:t("unlock_options")})]})]})]})}function Ki(e){return Yo("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"mr-4 w-6 h-6 text-blue-500 flex-shrink-0",children:Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"})})}const Qi="imgmount\\s+(\\d+)\\s+sockdrive\\s+([^\\s]+)\\s+([^\\s]+)\\s+([^\\s]+)\\s*$",Gi="imgmount\\s+(\\d+)\\s+sockdrive\\s+.*$";function Yi(){const e=Ci(),t=on((e=>e.editor.bundleConfig)),n=on((e=>e.auth.account)),r=on((e=>e.dos.backend)),{sockdriveEndpoint:o,sockdriveWssEndpoint:i}=on((e=>Ai[e.init.sockdriveBackendName]??Ai["js-dos"])),s=tr(),[a,c]=ie([]);function l(e){const t={},n=new RegExp(Qi,"gm");let r;for(;r=n.exec(e);){const[e,n,o,i,s]=r;t[n]={num:n,backend:o,owner:i,drive:s}}return t}ae((()=>{n&&n.token?fetch(o+"/list/drives/"+n.token.access_token).then((e=>e.json())).then(c).catch(console.error):c([])}),[null==n?void 0:n.token,o]);const[u,d]=ie(l((null==t?void 0:t.dosboxConf)??""));function f(e){if(d(e),t){const n=[];for(const t of Object.values(e))t.owner.length>0&&t.drive.length>0&&n.push(`imgmount ${t.num} sockdrive ${t.backend} ${t.owner} ${t.drive}`);let r=t.dosboxConf;if(r=r.replaceAll(new RegExp(Gi,"gm"),""),n.length>0){let e=r.indexOf("[autoexec]");-1===e?e=r.length:e+=10;const t=r.substring(e);r=r.substring(0,e),r+="\n"+n.join("\n")+"\n"+t.trim()}p(r)}}function h(e){d(l(e)),p(e)}function p(e){s(_i.actions.mouseCapture(e.indexOf("autolock=true")>0)),s(Oi.actions.dosboxConf(e)),s(_i.actions.dosBackendLocked(e.indexOf("sockdrive")>=0))}return null===t?null:Yo("div",{class:"editor-conf-frame flex flex-col flex-grow w-full gap-2",children:[Yo("div",{class:"",children:e("dosboxconf_template")}),Yo("div",{class:"flex flex-row flex-wrap items-center gap-2",children:Ei.map((({name:e,backend:t,contents:n})=>Yo("button",{class:"btn btn-sm",onClick:()=>{s(_i.actions.dosBackend("dosboxX"===t?"dosboxX":"dosbox")),h(n.replaceAll("{wss-makevm}",i))},children:e})))}),"dosboxX"===r&&Yo(y,{children:[Yo("button",{class:"btn btn-ghost btn-xs self-start",target:"_blank",onClick:()=>s(Ko.actions.frameFatDrives()),children:[e("net_drives"),":",Yo("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-4 h-4",children:Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m12.75 15 3-3m0 0-3-3m3 3h-7.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})})]}),["2","3"].map((e=>{var t,n;return Yo("div",{class:"flex flex-row justify-start items-center gap-3 w-full",children:[Yo("p",{children:"2"===e?"C:":"D:"}),Yo("div",{class:"flex flex-col gap-2",children:[Yo("div",{class:"flex flex-row gap-1 items-center",children:[Yo("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-4 h-4",children:Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})}),Yo("input",{class:"input input-xs",type:"text",value:(null==(t=u[e])?void 0:t.owner)??"",onChange:t=>{var n,r;const o={...u};o[e]={num:e,backend:(null==(n=u[e])?void 0:n.backend)??i,owner:t.currentTarget.value,drive:(null==(r=u[e])?void 0:r.drive)??""},f(o)}})]}),Yo("div",{class:"flex flex-row gap-1 items-center",children:[Yo("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-4 h-4",children:Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"})}),Yo("input",{class:"input input-xs",type:"text",value:(null==(n=u[e])?void 0:n.drive)??"",onChange:t=>{var n,r;const o={...u};o[e]={num:e,backend:(null==(n=u[e])?void 0:n.backend)??i,owner:(null==(r=u[e])?void 0:r.owner)??"",drive:t.currentTarget.value},f(o)}})]})]}),Yo("div",{class:"dropdown dropdown-bottom dropdown-end",children:[Yo("button",{tabIndex:0,role:"button",class:"btn btn-sm",children:Yo("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-4 h-4",children:Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 9.776c.112-.017.227-.026.344-.026h15.812c.117 0 .232.009.344.026m-16.5 0a2.25 2.25 0 0 0-1.883 2.542l.857 6a2.25 2.25 0 0 0 2.227 1.932H19.05a2.25 2.25 0 0 0 2.227-1.932l.857-6a2.25 2.25 0 0 0-1.883-2.542m-16.5 0V6A2.25 2.25 0 0 1 6 3.75h3.879a1.5 1.5 0 0 1 1.06.44l2.122 2.12a1.5 1.5 0 0 0 1.06.44H18A2.25 2.25 0 0 1 20.25 9v.776"})})}),Yo("ul",{tabIndex:0,class:"dropdown-content z-[1] menu p-2 shadow bg-base-100 rounded-box w-52 max-h-80 overflow-auto",children:a.map((({name:t,owner:n})=>Yo("li",{onClick:r=>{const o={...u};o[e]={num:e,owner:n,backend:i,drive:t},f(o),r.currentTarget.parentElement.blur()},children:Yo("a",{children:t})})))})]}),Yo("button",{class:"btn btn-sm",onClick:()=>{const t={...u};delete t[e],f(t)},children:Yo("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-4 h-4",children:Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9.75 14.25 12m0 0 2.25 2.25M14.25 12l2.25-2.25M14.25 12 12 14.25m-2.58 4.92-6.374-6.375a1.125 1.125 0 0 1 0-1.59L9.42 4.83c.21-.211.497-.33.795-.33H19.5a2.25 2.25 0 0 1 2.25 2.25v10.5a2.25 2.25 0 0 1-2.25 2.25h-9.284c-.298 0-.585-.119-.795-.33Z"})})})]})}))]}),Yo("textarea",{class:"flex-grow",value:t.dosboxConf,onChange:e=>{var t;return h((null==(t=e.currentTarget)?void 0:t.value)??"")}})]})}var Zi={exports:{}};
|
|
21
|
-
/*! react-checkbox-tree - v1.8.0 | 2022 */self;const Ji=F(Zi.exports=(e=>(()=>{var t={4184:(e,t)=>{var n;!function(){var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var s=o.apply(null,n);s&&e.push(s)}}else if("object"===i)if(n.toString===Object.prototype.toString)for(var a in n)r.call(n,a)&&n[a]&&e.push(a);else e.push(n.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},8552:(e,t,n)=>{var r=n(852)(n(5639),"DataView");e.exports=r},1989:(e,t,n)=>{var r=n(1789),o=n(401),i=n(7667),s=n(1327),a=n(1866);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=s,c.prototype.set=a,e.exports=c},8407:(e,t,n)=>{var r=n(7040),o=n(4125),i=n(2117),s=n(7518),a=n(4705);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=s,c.prototype.set=a,e.exports=c},7071:(e,t,n)=>{var r=n(852)(n(5639),"Map");e.exports=r},3369:(e,t,n)=>{var r=n(4785),o=n(1285),i=n(6e3),s=n(9916),a=n(5265);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=s,c.prototype.set=a,e.exports=c},3818:(e,t,n)=>{var r=n(852)(n(5639),"Promise");e.exports=r},8525:(e,t,n)=>{var r=n(852)(n(5639),"Set");e.exports=r},8668:(e,t,n)=>{var r=n(3369),o=n(619),i=n(2385);function s(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}s.prototype.add=s.prototype.push=o,s.prototype.has=i,e.exports=s},6384:(e,t,n)=>{var r=n(8407),o=n(7465),i=n(3779),s=n(7599),a=n(4758),c=n(4309);function l(e){var t=this.__data__=new r(e);this.size=t.size}l.prototype.clear=o,l.prototype.delete=i,l.prototype.get=s,l.prototype.has=a,l.prototype.set=c,e.exports=l},2705:(e,t,n)=>{var r=n(5639).Symbol;e.exports=r},1149:(e,t,n)=>{var r=n(5639).Uint8Array;e.exports=r},577:(e,t,n)=>{var r=n(852)(n(5639),"WeakMap");e.exports=r},4963:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var s=e[n];t(s,n,e)&&(i[o++]=s)}return i}},4636:(e,t,n)=>{var r=n(2545),o=n(5694),i=n(1469),s=n(4144),a=n(5776),c=n(6719),l=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=i(e),u=!n&&o(e),d=!n&&!u&&s(e),f=!n&&!u&&!d&&c(e),h=n||u||d||f,p=h?r(e.length,String):[],v=p.length;for(var m in e)!t&&!l.call(e,m)||h&&("length"==m||d&&("offset"==m||"parent"==m)||f&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||a(m,v))||p.push(m);return p}},2488:e=>{e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},2908:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},8470:(e,t,n)=>{var r=n(7813);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},8866:(e,t,n)=>{var r=n(2488),o=n(1469);e.exports=function(e,t,n){var i=t(e);return o(e)?i:r(i,n(e))}},4239:(e,t,n)=>{var r=n(2705),o=n(9607),i=n(2333),s=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?o(e):i(e)}},9454:(e,t,n)=>{var r=n(4239),o=n(7005);e.exports=function(e){return o(e)&&"[object Arguments]"==r(e)}},939:(e,t,n)=>{var r=n(2492),o=n(7005);e.exports=function e(t,n,i,s,a){return t===n||(null==t||null==n||!o(t)&&!o(n)?t!=t&&n!=n:r(t,n,i,s,e,a))}},2492:(e,t,n)=>{var r=n(6384),o=n(7114),i=n(8351),s=n(6096),a=n(4160),c=n(1469),l=n(4144),u=n(6719),d="[object Arguments]",f="[object Array]",h="[object Object]",p=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,v,m,b){var _=c(e),y=c(t),g=_?f:a(e),w=y?f:a(t),k=(g=g==d?h:g)==h,x=(w=w==d?h:w)==h,S=g==w;if(S&&l(e)){if(!l(t))return!1;_=!0,k=!1}if(S&&!k)return b||(b=new r),_||u(e)?o(e,t,n,v,m,b):i(e,t,g,n,v,m,b);if(!(1&n)){var C=k&&p.call(e,"__wrapped__"),P=x&&p.call(t,"__wrapped__");if(C||P){var E=C?e.value():e,O=P?t.value():t;return b||(b=new r),m(E,O,n,v,b)}}return!!S&&(b||(b=new r),s(e,t,n,v,m,b))}},8458:(e,t,n)=>{var r=n(3560),o=n(5346),i=n(3218),s=n(346),a=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp("^"+u.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(r(e)?f:a).test(s(e))}},8749:(e,t,n)=>{var r=n(4239),o=n(1780),i=n(7005),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!s[r(e)]}},280:(e,t,n)=>{var r=n(5726),o=n(6916),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))i.call(e,n)&&"constructor"!=n&&t.push(n);return t}},2545:e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},1717:e=>{e.exports=function(e){return function(t){return e(t)}}},4757:e=>{e.exports=function(e,t){return e.has(t)}},4429:(e,t,n)=>{var r=n(5639)["__core-js_shared__"];e.exports=r},7114:(e,t,n)=>{var r=n(8668),o=n(2908),i=n(4757);e.exports=function(e,t,n,s,a,c){var l=1&n,u=e.length,d=t.length;if(u!=d&&!(l&&d>u))return!1;var f=c.get(e),h=c.get(t);if(f&&h)return f==t&&h==e;var p=-1,v=!0,m=2&n?new r:void 0;for(c.set(e,t),c.set(t,e);++p<u;){var b=e[p],_=t[p];if(s)var y=l?s(_,b,p,t,e,c):s(b,_,p,e,t,c);if(void 0!==y){if(y)continue;v=!1;break}if(m){if(!o(t,(function(e,t){if(!i(m,t)&&(b===e||a(b,e,n,s,c)))return m.push(t)}))){v=!1;break}}else if(b!==_&&!a(b,_,n,s,c)){v=!1;break}}return c.delete(e),c.delete(t),v}},8351:(e,t,n)=>{var r=n(2705),o=n(1149),i=n(7813),s=n(7114),a=n(8776),c=n(1814),l=r?r.prototype:void 0,u=l?l.valueOf:void 0;e.exports=function(e,t,n,r,l,d,f){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new o(e),new o(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return i(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var h=a;case"[object Set]":var p=1&r;if(h||(h=c),e.size!=t.size&&!p)return!1;var v=f.get(e);if(v)return v==t;r|=2,f.set(e,t);var m=s(h(e),h(t),r,l,d,f);return f.delete(e),m;case"[object Symbol]":if(u)return u.call(e)==u.call(t)}return!1}},6096:(e,t,n)=>{var r=n(8234),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,i,s,a){var c=1&n,l=r(e),u=l.length;if(u!=r(t).length&&!c)return!1;for(var d=u;d--;){var f=l[d];if(!(c?f in t:o.call(t,f)))return!1}var h=a.get(e),p=a.get(t);if(h&&p)return h==t&&p==e;var v=!0;a.set(e,t),a.set(t,e);for(var m=c;++d<u;){var b=e[f=l[d]],_=t[f];if(i)var y=c?i(_,b,f,t,e,a):i(b,_,f,e,t,a);if(!(void 0===y?b===_||s(b,_,n,i,a):y)){v=!1;break}m||(m="constructor"==f)}if(v&&!m){var g=e.constructor,w=t.constructor;g==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof w&&w instanceof w||(v=!1)}return a.delete(e),a.delete(t),v}},1957:(e,t,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},8234:(e,t,n)=>{var r=n(8866),o=n(9551),i=n(3674);e.exports=function(e){return r(e,i,o)}},5050:(e,t,n)=>{var r=n(7019);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},852:(e,t,n)=>{var r=n(8458),o=n(7801);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},9607:(e,t,n)=>{var r=n(2705),o=Object.prototype,i=o.hasOwnProperty,s=o.toString,a=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch(c){}var o=s.call(e);return r&&(t?e[a]=n:delete e[a]),o}},9551:(e,t,n)=>{var r=n(4963),o=n(479),i=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols,a=s?function(e){return null==e?[]:(e=Object(e),r(s(e),(function(t){return i.call(e,t)})))}:o;e.exports=a},4160:(e,t,n)=>{var r=n(8552),o=n(7071),i=n(3818),s=n(8525),a=n(577),c=n(4239),l=n(346),u="[object Map]",d="[object Promise]",f="[object Set]",h="[object WeakMap]",p="[object DataView]",v=l(r),m=l(o),b=l(i),_=l(s),y=l(a),g=c;(r&&g(new r(new ArrayBuffer(1)))!=p||o&&g(new o)!=u||i&&g(i.resolve())!=d||s&&g(new s)!=f||a&&g(new a)!=h)&&(g=function(e){var t=c(e),n="[object Object]"==t?e.constructor:void 0,r=n?l(n):"";if(r)switch(r){case v:return p;case m:return u;case b:return d;case _:return f;case y:return h}return t}),e.exports=g},7801:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},1789:(e,t,n)=>{var r=n(4536);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},401:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},7667:(e,t,n)=>{var r=n(4536),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(t,e)?t[e]:void 0}},1327:(e,t,n)=>{var r=n(4536),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},1866:(e,t,n)=>{var r=n(4536);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},5776:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},7019:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},5346:(e,t,n)=>{var r,o=n(4429),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!i&&i in e}},5726:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},7040:e=>{e.exports=function(){this.__data__=[],this.size=0}},4125:(e,t,n)=>{var r=n(8470),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():o.call(t,n,1),--this.size,0))}},2117:(e,t,n)=>{var r=n(8470);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},7518:(e,t,n)=>{var r=n(8470);e.exports=function(e){return r(this.__data__,e)>-1}},4705:(e,t,n)=>{var r=n(8470);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},4785:(e,t,n)=>{var r=n(1989),o=n(8407),i=n(7071);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},1285:(e,t,n)=>{var r=n(5050);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},6e3:(e,t,n)=>{var r=n(5050);e.exports=function(e){return r(this,e).get(e)}},9916:(e,t,n)=>{var r=n(5050);e.exports=function(e){return r(this,e).has(e)}},5265:(e,t,n)=>{var r=n(5050);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},8776:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},4536:(e,t,n)=>{var r=n(852)(Object,"create");e.exports=r},6916:(e,t,n)=>{var r=n(5569)(Object.keys,Object);e.exports=r},1167:(e,t,n)=>{e=n.nmd(e);var r=n(1957),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,s=i&&i.exports===o&&r.process,a=function(){try{return i&&i.require&&i.require("util").types||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=a},2333:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},5639:(e,t,n)=>{var r=n(1957),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},619:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},2385:e=>{e.exports=function(e){return this.__data__.has(e)}},1814:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},7465:(e,t,n)=>{var r=n(8407);e.exports=function(){this.__data__=new r,this.size=0}},3779:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},7599:e=>{e.exports=function(e){return this.__data__.get(e)}},4758:e=>{e.exports=function(e){return this.__data__.has(e)}},4309:(e,t,n)=>{var r=n(8407),o=n(7071),i=n(3369);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!o||s.length<199)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(s)}return n.set(e,t),this.size=n.size,this}},346:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(n){}try{return e+""}catch(n){}}return""}},7813:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},5694:(e,t,n)=>{var r=n(9454),o=n(7005),i=Object.prototype,s=i.hasOwnProperty,a=i.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(e){return o(e)&&s.call(e,"callee")&&!a.call(e,"callee")};e.exports=c},1469:e=>{var t=Array.isArray;e.exports=t},8612:(e,t,n)=>{var r=n(3560),o=n(1780);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},4144:(e,t,n)=>{e=n.nmd(e);var r=n(5639),o=n(5062),i=t&&!t.nodeType&&t,s=i&&e&&!e.nodeType&&e,a=s&&s.exports===i?r.Buffer:void 0,c=(a?a.isBuffer:void 0)||o;e.exports=c},8446:(e,t,n)=>{var r=n(939);e.exports=function(e,t){return r(e,t)}},3560:(e,t,n)=>{var r=n(4239),o=n(3218);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1780:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},3218:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},6719:(e,t,n)=>{var r=n(8749),o=n(1717),i=n(1167),s=i&&i.isTypedArray,a=s?o(s):r;e.exports=a},3674:(e,t,n)=>{var r=n(4636),o=n(280),i=n(8612);e.exports=function(e){return i(e)?r(e):o(e)}},8306:(e,t,n)=>{var r=n(3369);function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=e.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(o.Cache||r),n}o.Cache=r,e.exports=o},479:e=>{e.exports=function(){return[]}},5062:e=>{e.exports=function(){return!1}},2703:(e,t,n)=>{var r=n(414);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,s){if(s!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},5697:(e,t,n)=>{e.exports=n(2703)()},414:e=>{e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},9787:t=>{t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={id:e,loaded:!1,exports:{}};return t[e](i,i.exports,r),i.loaded=!0,i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var o={};return(()=>{r.r(o),r.d(o,{default:()=>le,expandNodesToLevel:()=>ce});var e=r(4184),t=r.n(e),n=r(8446),i=r.n(n),s=r(8306),a=r.n(s);let c=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce(((e,t)=>e+((t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_")),"");var l=r(5697),u=r.n(l),d=r(9787),f=r.n(d);function h(e){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var p=["children","title"];function v(){return v=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},v.apply(this,arguments)}function m(e,t){return(m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}(s,e);var t,n,r,o,i=(r=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=b(r);if(o){var n=b(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===h(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function s(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),i.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this.props,t=e.children,n=e.title,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,p);return f().createElement("button",v({"aria-label":n,title:n,type:"button"},r),t)}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(f().PureComponent);_(y,"propTypes",{children:u().node.isRequired,title:u().string}),_(y,"defaultProps",{title:null});const g=y,w={ALL:"all",PARENT:"parent",LEAF:"leaf"};function k(e){this.message=e,this.stack=Error().stack}k.prototype=Object.create(Error.prototype),k.prototype.name="CheckboxTreeError";const x=k;function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function C(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var P=w;const E=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.props=t,this.flatNodes=n}var t,n;return t=e,n=[{key:"setProps",value:function(e){this.props=e}},{key:"clone",value:function(){var t=this,n={};return Object.keys(this.flatNodes).forEach((function(e){var r=t.flatNodes[e];n[e]=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach((function(t){C(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},r)})),new e(this.props,n)}},{key:"getNode",value:function(e){return this.flatNodes[e]}},{key:"reset",value:function(){this.flatNodes={}}},{key:"flattenNodes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(Array.isArray(e)&&0!==e.length){var o=this.props,i=o.disabled,s=o.noCascade;e.forEach((function(e,o){var a=t.nodeHasChildren(e);if(void 0!==t.flatNodes[e.value])throw new x("Duplicate value '".concat(e.value,"' detected. All node values must be unique."));t.flatNodes[e.value]={label:e.label,value:e.value,children:e.children,parent:n,isChild:void 0!==n.value,isParent:a,isLeaf:!a,showCheckbox:void 0===e.showCheckbox||e.showCheckbox,disabled:t.getDisabledState(e,n,i,s),treeDepth:r,index:o},t.flattenNodes(e.children,e,r+1)}))}}},{key:"nodeHasChildren",value:function(e){return Array.isArray(e.children)}},{key:"getDisabledState",value:function(e,t,n,r){return!!n||!(r||!t.disabled)||Boolean(e.disabled)}},{key:"deserializeLists",value:function(e){var t=this,n=["checked","expanded"];Object.keys(this.flatNodes).forEach((function(e){n.forEach((function(n){t.flatNodes[e][n]=!1}))})),n.forEach((function(n){e[n].forEach((function(e){void 0!==t.flatNodes[e]&&(t.flatNodes[e][n]=!0)}))}))}},{key:"serializeList",value:function(e){var t=this,n=[];return Object.keys(this.flatNodes).forEach((function(r){t.flatNodes[r][e]&&n.push(r)})),n}},{key:"expandAllNodes",value:function(e){var t=this;return Object.keys(this.flatNodes).forEach((function(n){t.flatNodes[n].isParent&&(t.flatNodes[n].expanded=e)})),this}},{key:"toggleChecked",value:function(e,t,n,r){var o=this,i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=this.flatNodes[e.value],a=[P.PARENT,P.ALL].indexOf(n)>-1,c=[P.LEAF,P.ALL].indexOf(n)>-1;if(s.isLeaf||r){if(e.disabled)return this;this.toggleNode(e.value,"checked",t)}else(a||0===s.children.length)&&this.toggleNode(e.value,"checked",t),c&&s.children.forEach((function(e){o.toggleChecked(e,t,n,r,!1)}));return i&&!r&&s.isChild&&a&&this.toggleParentStatus(s.parent,n),this}},{key:"toggleParentStatus",value:function(e,t){var n=this.flatNodes[e.value];n.isChild?(t===P.ALL&&this.toggleNode(e.value,"checked",this.isEveryChildChecked(n)),this.toggleParentStatus(n.parent,t)):this.toggleNode(e.value,"checked",this.isEveryChildChecked(n))}},{key:"isEveryChildChecked",value:function(e){var t=this;return e.children.every((function(e){return t.getNode(e.value).checked}))}},{key:"toggleNode",value:function(e,t,n){return this.flatNodes[e][t]=n,this}}],n&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function O(e){return(O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function j(){return j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},j.apply(this,arguments)}function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function M(e,t){return(M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function R(e){return(R=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function T(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var N=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&M(e,t)}(s,e);var t,n,r,o,i=(r=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=R(r);if(o){var n=R(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===O(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function s(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),i.apply(this,arguments)}return t=s,n=[{key:"componentDidMount",value:function(){this.updateDeterminateProperty()}},{key:"componentDidUpdate",value:function(){this.updateDeterminateProperty()}},{key:"updateDeterminateProperty",value:function(){var e=this.props.indeterminate;this.checkbox.indeterminate=e}},{key:"render",value:function(){var e=this,t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(Object(n),!0).forEach((function(t){T(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},this.props);return delete t.indeterminate,f().createElement("input",j({},t,{ref:function(t){e.checkbox=t},type:"checkbox"}))}}],n&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(f().PureComponent);T(N,"propTypes",{indeterminate:u().bool}),T(N,"defaultProps",{indeterminate:!1});const z=N,U=u().shape({check:u().node,uncheck:u().node,halfCheck:u().node,expandClose:u().node,expandOpen:u().node,expandAll:u().node,collapseAll:u().node,parentClose:u().node,parentOpen:u().node,leaf:u().node}),I=u().shape({collapseAll:u().string.isRequired,expandAll:u().string.isRequired,toggle:u().string.isRequired});function L(e){return(L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function B(e,t){return(B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function D(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function H(e){return(H=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function F(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var q=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&B(e,t)}(a,e);var n,r,o,i,s=(o=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=H(o);if(i){var n=H(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===L(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return D(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=s.call(this,e)).onCheck=t.onCheck.bind(D(t)),t.onCheckboxKeyPress=t.onCheckboxKeyPress.bind(D(t)),t.onCheckboxKeyUp=t.onCheckboxKeyUp.bind(D(t)),t.onClick=t.onClick.bind(D(t)),t.onExpand=t.onExpand.bind(D(t)),t}return n=a,(r=[{key:"onCheck",value:function(){var e=this.props,t=e.value;(0,e.onCheck)({value:t,checked:this.getCheckState({toggle:!0})})}},{key:"onCheckboxKeyPress",value:function(e){32===e.which&&e.preventDefault()}},{key:"onCheckboxKeyUp",value:function(e){var t=e.keyCode;[13,32].includes(t)&&this.onCheck()}},{key:"onClick",value:function(){var e=this.props,t=e.expandOnClick,n=e.isParent,r=e.value,o=e.onClick;n&&t&&this.onExpand(),o({value:r,checked:this.getCheckState({toggle:!1})})}},{key:"onExpand",value:function(){var e=this.props,t=e.expanded,n=e.value;(0,e.onExpand)({value:n,expanded:!t})}},{key:"getCheckState",value:function(e){var t=e.toggle,n=this.props,r=n.checked,o=n.optimisticToggle;return!(0!==r||!t)||1===r&&!t||2===r&&o}},{key:"renderCollapseButton",value:function(){var e=this.props,t=e.expandDisabled,n=e.isLeaf,r=e.lang;return n?f().createElement("span",{className:"rct-collapse"},f().createElement("span",{className:"rct-icon"})):f().createElement(g,{className:"rct-collapse rct-collapse-btn",disabled:t,title:r.toggle,onClick:this.onExpand},this.renderCollapseIcon())}},{key:"renderCollapseIcon",value:function(){var e=this.props,t=e.expanded,n=e.icons,r=n.expandClose,o=n.expandOpen;return t?o:r}},{key:"renderCheckboxIcon",value:function(){var e=this.props,t=e.checked,n=e.icons,r=n.uncheck,o=n.check,i=n.halfCheck;return 0===t?r:1===t?o:i}},{key:"renderNodeIcon",value:function(){var e=this.props,t=e.expanded,n=e.icon,r=e.icons,o=r.leaf,i=r.parentClose,s=r.parentOpen,a=e.isLeaf;return null!==n?n:a?o:t?s:i}},{key:"renderBareLabel",value:function(e){var t=this.props,n=t.onClick,r=t.title,o=null!==n;return f().createElement("span",{className:"rct-bare-label",title:r},o?f().createElement("span",{className:"rct-node-clickable",onClick:this.onClick,onKeyPress:this.onClick,role:"button",tabIndex:0},e):e)}},{key:"renderCheckboxLabel",value:function(e){var t=this.props,n=t.checked,r=t.disabled,o=t.title,i=t.treeId,s=t.value,a=null!==t.onClick,c="".concat(i,"-").concat(String(s).split(" ").join("_")),l=[f().createElement("label",{key:0,htmlFor:c,title:o},f().createElement(z,{checked:1===n,disabled:r,id:c,indeterminate:2===n,onClick:this.onCheck,onChange:function(){}}),f().createElement("span",{"aria-checked":1===n,"aria-disabled":r,className:"rct-checkbox",role:"checkbox",tabIndex:0,onKeyPress:this.onCheckboxKeyPress,onKeyUp:this.onCheckboxKeyUp},this.renderCheckboxIcon()),a?null:e)];return a&&l.push(f().createElement("span",{key:1,className:"rct-node-clickable",onClick:this.onClick,onKeyPress:this.onClick,role:"link",tabIndex:0},e)),l}},{key:"renderLabel",value:function(){var e=this.props,t=e.label,n=e.showCheckbox,r=[e.showNodeIcon?f().createElement("span",{key:0,className:"rct-node-icon"},this.renderNodeIcon()):null,f().createElement("span",{key:1,className:"rct-title"},t)];return n?this.renderCheckboxLabel(r):this.renderBareLabel(r)}},{key:"renderChildren",value:function(){return this.props.expanded?this.props.children:null}},{key:"render",value:function(){var e=this.props,n=e.className,r=e.disabled,o=e.expanded,i=e.isLeaf,s=t()({"rct-node":!0,"rct-node-leaf":i,"rct-node-parent":!i,"rct-node-expanded":!i&&o,"rct-node-collapsed":!i&&!o,"rct-disabled":r},n);return f().createElement("li",{className:s},f().createElement("span",{className:"rct-text"},this.renderCollapseButton(),this.renderLabel()),this.renderChildren())}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),a}(f().PureComponent);F(q,"propTypes",{checked:u().number.isRequired,disabled:u().bool.isRequired,expandDisabled:u().bool.isRequired,expanded:u().bool.isRequired,icons:U.isRequired,isLeaf:u().bool.isRequired,isParent:u().bool.isRequired,label:u().node.isRequired,lang:I.isRequired,optimisticToggle:u().bool.isRequired,showNodeIcon:u().bool.isRequired,treeId:u().string.isRequired,value:u().oneOfType([u().string,u().number]).isRequired,onCheck:u().func.isRequired,onExpand:u().func.isRequired,children:u().node,className:u().string,expandOnClick:u().bool,icon:u().node,showCheckbox:u().bool,title:u().string,onClick:u().func}),F(q,"defaultProps",{children:null,className:null,expandOnClick:!1,icon:null,showCheckbox:!0,title:null,onClick:function(){}});const W=q,$=u().oneOfType([u().arrayOf(u().string),u().arrayOf(u().number)]);function V(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function X(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?V(Object(n),!0).forEach((function(t){K(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function K(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Q={label:u().node.isRequired,value:u().oneOfType([u().string,u().number]).isRequired,disabled:u().bool,icon:u().node,showCheckbox:u().bool,title:u().string};const G=u().oneOfType([u().shape(Q),u().shape(X(X({},Q),{},{children:u().arrayOf(Q).isRequired}))]);function Y(e){return(Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function J(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(n),!0).forEach((function(t){oe(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Z(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ee(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function te(e,t){return(te=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function ne(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function re(e){return(re=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function oe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ie=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&te(e,t)}(d,e);var n,r,o,s,l,u=(s=d,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=re(s);if(l){var n=re(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Y(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ne(e)}(this,e)});function d(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d),t=u.call(this,e);var n=new E(e);return n.flattenNodes(e.nodes),n.deserializeLists({checked:e.checked,expanded:e.expanded}),t.state={id:e.id||"rct-".concat(c()),model:n,prevProps:e},t.onCheck=t.onCheck.bind(ne(t)),t.onExpand=t.onExpand.bind(ne(t)),t.onNodeClick=t.onNodeClick.bind(ne(t)),t.onExpandAll=t.onExpandAll.bind(ne(t)),t.onCollapseAll=t.onCollapseAll.bind(ne(t)),t.combineMemorized=a()((function(e,t){return J(J({},e),t)})).bind(ne(t)),t}return n=d,r=[{key:"onCheck",value:function(e){var t=this.props,n=t.checkModel,r=t.noCascade,o=t.onCheck,i=this.state.model.clone(),s=i.getNode(e.value);i.toggleChecked(e,e.checked,n,r),o(i.serializeList("checked"),J(J({},s),e))}},{key:"onExpand",value:function(e){var t=this.props.onExpand,n=this.state.model.clone(),r=n.getNode(e.value);n.toggleNode(e.value,"expanded",e.expanded),t(n.serializeList("expanded"),J(J({},r),e))}},{key:"onNodeClick",value:function(e){(0,this.props.onClick)(J(J({},this.state.model.getNode(e.value)),e))}},{key:"onExpandAll",value:function(){this.expandAllNodes()}},{key:"onCollapseAll",value:function(){this.expandAllNodes(!1)}},{key:"expandAllNodes",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];(0,this.props.onExpand)(this.state.model.clone().expandAllNodes(e).serializeList("expanded"))}},{key:"determineShallowCheckState",value:function(e,t){var n=this.state.model.getNode(e.value);return n.isLeaf||t||0===e.children.length?n.checked?1:0:this.isEveryChildChecked(e)?1:this.isSomeChildChecked(e)?2:0}},{key:"isEveryChildChecked",value:function(e){var t=this;return e.children.every((function(e){return 1===t.state.model.getNode(e.value).checkState}))}},{key:"isSomeChildChecked",value:function(e){var t=this;return e.children.some((function(e){return t.state.model.getNode(e.value).checkState>0}))}},{key:"renderTreeNodes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.props,o=r.expandDisabled,i=r.expandOnClick,s=r.icons,a=r.lang,c=r.noCascade,l=r.onClick,u=r.onlyLeafCheckboxes,h=r.optimisticToggle,p=r.showNodeTitle,v=r.showNodeIcon,m=this.state,b=m.id,_=m.model,y=d.defaultProps.icons,g=e.map((function(e){var r=e.value,d=_.getNode(e.value),m=d.isParent?t.renderTreeNodes(e.children,e):null;d.checkState=t.determineShallowCheckState(e,c);var g=u?d.isLeaf:d.showCheckbox;return!n.value||_.getNode(n.value).expanded?f().createElement(W,{key:r,checked:d.checkState,className:e.className,disabled:d.disabled,expandDisabled:o,expandOnClick:i,expanded:d.expanded,icon:e.icon,icons:t.combineMemorized(y,s),label:e.label,lang:a,optimisticToggle:h,isLeaf:d.isLeaf,isParent:d.isParent,showCheckbox:g,showNodeIcon:v,title:p?e.title||e.label:e.title,treeId:b,value:e.value,onCheck:t.onCheck,onClick:l&&t.onNodeClick,onExpand:t.onExpand},m):null}));return f().createElement("ol",null,g)}},{key:"renderExpandAll",value:function(){var e=this.props,t=e.icons,n=t.expandAll,r=t.collapseAll,o=e.lang;return e.showExpandAll?f().createElement("div",{className:"rct-options"},f().createElement(g,{className:"rct-option rct-option-expand-all",title:o.expandAll,onClick:this.onExpandAll},n),f().createElement(g,{className:"rct-option rct-option-collapse-all",title:o.collapseAll,onClick:this.onCollapseAll},r)):null}},{key:"renderHiddenInput",value:function(){var e=this.props,t=e.name,n=e.nameAsArray;return void 0===t?null:n?this.renderArrayHiddenInput():this.renderJoinedHiddenInput()}},{key:"renderArrayHiddenInput",value:function(){var e=this.props,t=e.checked,n=e.name;return t.map((function(e){var t="".concat(n,"[]");return f().createElement("input",{key:e,name:t,type:"hidden",value:e})}))}},{key:"renderJoinedHiddenInput",value:function(){var e=this.props,t=e.checked,n=e.name,r=t.join(",");return f().createElement("input",{name:n,type:"hidden",value:r})}},{key:"render",value:function(){var e,n=this.props,r=n.direction,o=n.disabled,i=n.iconsClass,s=n.nodes,a=n.nativeCheckboxes,c=this.state.id,l=this.renderTreeNodes(s),u=t()((oe(e={"react-checkbox-tree":!0,"rct-disabled":o},"rct-icons-".concat(i),!0),oe(e,"rct-native-display",a),oe(e,"rct-direction-rtl","rtl"===r),e));return f().createElement("div",{className:u,id:c},this.renderExpandAll(),this.renderHiddenInput(),l)}}],o=[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.model,r=t.prevProps,o=e.disabled,s=e.id,a=e.nodes,c=J(J({},t),{},{prevProps:e});return n.setProps(e),i()(r.nodes,a)&&r.disabled===o||(n.reset(),n.flattenNodes(a)),null!==s&&(c=J(J({},c),{},{id:s})),n.deserializeLists({checked:e.checked,expanded:e.expanded}),c}}],r&&ee(n.prototype,r),o&&ee(n,o),Object.defineProperty(n,"prototype",{writable:!1}),d}(f().Component);function se(e){return function(e){if(Array.isArray(e))return ae(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return ae(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ae(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ae(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ce(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(n>t)return[];var r=[];return e.forEach((function(e){e.children&&(r=[].concat(se(r),[e.value],se(ce(e.children,t,n+1))))})),r}oe(ie,"propTypes",{nodes:u().arrayOf(G).isRequired,checkModel:u().oneOf([w.LEAF,w.ALL]),checked:$,direction:u().string,disabled:u().bool,expandDisabled:u().bool,expandOnClick:u().bool,expanded:$,icons:U,iconsClass:u().string,id:u().string,lang:I,name:u().string,nameAsArray:u().bool,nativeCheckboxes:u().bool,noCascade:u().bool,onlyLeafCheckboxes:u().bool,optimisticToggle:u().bool,showExpandAll:u().bool,showNodeIcon:u().bool,showNodeTitle:u().bool,onCheck:u().func,onClick:u().func,onExpand:u().func}),oe(ie,"defaultProps",{checkModel:w.LEAF,checked:[],direction:"ltr",disabled:!1,expandDisabled:!1,expandOnClick:!1,expanded:[],icons:{check:f().createElement("span",{className:"rct-icon rct-icon-check"}),uncheck:f().createElement("span",{className:"rct-icon rct-icon-uncheck"}),halfCheck:f().createElement("span",{className:"rct-icon rct-icon-half-check"}),expandClose:f().createElement("span",{className:"rct-icon rct-icon-expand-close"}),expandOpen:f().createElement("span",{className:"rct-icon rct-icon-expand-open"}),expandAll:f().createElement("span",{className:"rct-icon rct-icon-expand-all"}),collapseAll:f().createElement("span",{className:"rct-icon rct-icon-collapse-all"}),parentClose:f().createElement("span",{className:"rct-icon rct-icon-parent-close"}),parentOpen:f().createElement("span",{className:"rct-icon rct-icon-parent-open"}),leaf:f().createElement("span",{className:"rct-icon rct-icon-leaf"})},iconsClass:"fa4",id:null,lang:{collapseAll:"Collapse all",expandAll:"Expand all",toggle:"Toggle"},name:void 0,nameAsArray:!1,nativeCheckboxes:!1,noCascade:!1,onlyLeafCheckboxes:!1,optimisticToggle:!0,showExpandAll:!1,showNodeIcon:!0,showNodeTitle:!1,onCheck:function(){},onClick:null,onExpand:function(){}});const le=ie})(),o})())(Pt));function es(e,t){const n=function(e,t){const n=t.lastIndexOf("/"),r=t.substring(n+1);return"personal-v2/"+ni+"/"+e+"/"+r}(e,t);return ti+"/"+ei+"/"+n}async function ts(e,t){let n=await fetch(ri+"?bundleUrl="+encodeURIComponent(e));const r=await n.json();if(!r.success)throw new Error("Unable to put personal bundle");const o=r.post,i=new FormData;if(Object.entries(o.fields).forEach((([e,t])=>{i.append(e,t)})),i.append("acl","public-read"),i.append("file",new Blob([t])),n=await fetch(o.url,{method:"post",body:i}),200!==n.status&&204!==n.status)throw new Error("Unable to put changes: "+n.statusText)}function ns(e,t){return os(e.name,function(e,t){return new Promise((n=>{t.dispatch(Pi.actions.reset());const r=new FileReader;r.addEventListener("load",(async e=>{n(new Uint8Array(r.result))})),r.addEventListener("progress",(e=>{t.dispatch(Pi.actions.progress([e.loaded,e.total]))})),r.readAsArrayBuffer(e)}))}(e,t),null,null,t)}async function rs(e,t){var n;const r=(null==(n=t.getState().auth.account)?void 0:n.email)??"guest",o=await es(r,e);return os(e,async function(e,t){try{return await Ui(t).cache.get(e)}catch(u){}t.dispatch(Pi.actions.reset());const n=await fetch(e,{cache:"no-store"});if(200!==n.status)throw new Error("Resource not avalible ("+n.status+"): "+n.statusText);const r=n.headers.get("Content-Length"),o=null===r?0:Number.parseInt(r),i=n.body.getReader();let s=0;const a=[];for(;;){const{done:n,value:r}=await i.read();if(n)break;a.push(r),s+=r.length;const c=Math.min(e.startsWith(si)?s/2:s,o);t.dispatch(Pi.actions.progress([c,o]))}let c=0;const l=new Uint8Array(s);for(const d of a)l.set(d,c),c+=d.length;return Ui(t).cache.put(e,l).catch(console.error),l}(e,t),async function(e,t){t.getState().auth.ready||await new Promise((e=>{let n=null;const r=()=>{t.getState().auth.ready&&(n(),e())};n=t.subscribe(r)}));const n=t.getState().auth.account,r=(null==n?void 0:n.email)??"guest",o=es(r,e),i=await async function(e,t,n){if(null===t||!t.premium)return await Ui(n).cache.get(e).catch((()=>null));try{const t=await fetch(e,{cache:"no-cache"});if(200!==t.status)throw new Error("Resource not avalible ("+t.status+"): "+t.statusText);return t.arrayBuffer().then((e=>new Uint8Array(e)))}catch(r){return await Ui(n).cache.get(e).catch((()=>null))}}(o,n,t);return{url:o,bundle:i}}(o,t),e,t)}async function os(e,t,n,r,o){const i=Ui(o),s=o.dispatch;i.loadedBundle=null,s(_i.actions.bndLoad(e));const a=await t;s(Pi.actions.ready());const c=await n;s(_i.actions.bndConfig());const l=await emulators.bundleConfig(a);s(Oi.actions.init(l)),null===l?s(Ko.actions.frameConf()):is(l,s),i.loadedBundle={bundleUrl:r,bundleChangesUrl:(null==c?void 0:c.url)??null,bundle:a,bundleChanges:(null==c?void 0:c.bundle)??null},s(_i.actions.bndReady({}))}function is(e,t){e.dosboxConf.indexOf("sockdrive")>=0&&(t(_i.actions.dosBackendLocked(!0)),t(_i.actions.dosBackend("dosboxX"))),t(_i.actions.mouseCapture(e.dosboxConf.indexOf("autolock=true")>=0))}function ss(e,t){const n=new Blob([t],{type:"application/zip"});!function(e,t,n=!0){const r=document.createElement("a");r.href=t,r.target=n?"_blank":"_self",r.download=e,r.style.display="none",document.body.appendChild(r),r.click(),r.remove()}(e,URL.createObjectURL(n))}function as(){const e=Ci(),t=on((e=>e.dos.ci)),n=Ii(),[r,o]=ie(0),[i,s]=ie(null),[a,c]=ie([]),[l,u]=ie([]),[d,f]=ie(null),[h,p]=ie(!1);function v(e){s(e),o(Math.round(ps(e)/1024/1024*100)/100)}return ae((()=>{if(null===n.ci||!t)return;let e=!1;return n.ci.fsTree().then((t=>{e||v(cs(t))})).catch((t=>{console.error(t),e||v(null)})),()=>{e=!0}}),[t]),Yo("div",{class:"editor-fs-frame frame-root items-start px-4",children:[(h||null!==d)&&Yo("div",{class:"card card-bordered bg-base-100 shadow-xl w-full",children:Yo("div",{class:"card-body",children:[Yo("div",{class:"card-title",children:e(h?"please_wait":"uploading_file")}),Yo("span",{class:"break-words",children:h?e("making_bundle"):d})]})}),!h&&null===d&&i&&Yo("div",{className:"fs-tree-view",children:[Yo(us,{onRefresh:async function(){if(v(null),null===n.ci||!t)return;v(cs(await n.ci.fsTree()))},onUploadingFile:f,onMakingBundle:p}),Yo("div",{class:"bg-base-200 px-2 py-1 text-right",children:[e("size"),": ",r," Mb"]}),Yo("div",{class:"fs-tree",children:Yo(Ji,{icons:{expandOpen:Yo(fs,{}),expandClose:Yo(hs,{})},iconsClass:"icon",nativeCheckboxes:!1,onlyLeafCheckboxes:!0,nodes:i,checked:l,onCheck:function(e,t){u(e)},expanded:a,onExpand:function(e,t){c(e)}})})]})]})}function cs(e){var t;const n=[];for(const r of(null==(t=e.nodes)?void 0:t.sort(ds))||[])n.push(ls(r,"."));return n}function ls(e,t){const n=t+"/"+e.name,r={label:e.name,value:n,fsNode:e};if(null!==e.nodes){const t=e.nodes.sort(ds).map((e=>ls(e,n)));r.children=t}return r}function us(e){const t=Ci(),n=le(null),r=le(null),o=Jn(),i=Ii(),{onRefresh:s,onUploadingFile:a,onMakingBundle:c}=e;function l(e){const t=(e?r:n).current;null!==t&&t.click()}async function u(e){const t=i.ci,n=e.target.files;if(null!==t&&null!==n){try{for(const e of n){a(e.name);const n=(e.webkitRelativePath??"").split("/");n.shift();const r=n.join("/");await t.fsWriteFile(0==r.length?e.name:r,e.stream())}}finally{a(null)}await s()}}return ae((()=>{null!==n.current&&(n.current.setAttribute("directory",""),n.current.setAttribute("webkitdirectory",""))}),[n]),Yo("div",{class:"h-6 flex flex-row",children:[Yo("input",{class:"hidden",type:"file",multiple:!0,ref:n,onChange:u}),Yo("input",{class:"hidden",type:"file",multiple:!0,ref:r,onChange:u}),Yo("button",{class:"refresh btn-xs rounded-none",onClick:s,children:Yo("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-4 h-4",children:Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99"})})}),Yo("button",{class:"add-file btn-xs rounded-none",onClick:()=>l(!0),children:Yo("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-4 h-4",children:Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m3.75 9v6m3-3H9m1.5-12H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})})}),Yo("button",{class:"add-dir btn-xs rounded-none",onClick:()=>l(!1),children:Yo("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-4 h-4",children:Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 10.5v6m3-3H9m4.06-7.19l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})})}),Yo("div",{class:"flex-grow"}),Yo("button",{class:"download btn-xs rounded-none",onClick:async function(){const e=i.ci;if(null!==e){c(!0);try{const t=await e.persist(!1);t&&ss("bundle.jsdos",t)}finally{c(!1)}}},children:Yo("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-4 h-4",children:Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 13.5l3 3m0 0l3-3m-3 3v-6m1.06-4.19l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})})}),Yo("button",{class:"restart btn-xs rounded-none",onClick:async function(){const e=i.ci;if(null!==e&&window.confirm(t("fs_restart"))){c(!0);try{const t=await e.persist(!1);t&&async function(e,t,n){await os("bundle.jsdos",Promise.resolve(e),null,null,n),t&&n.dispatch(Ko.actions.frameConf())}(t,!0,o)}finally{c(!1)}}},children:Yo("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-4 h-4",children:Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21 7.5V18M15 7.5V18M3 16.811V8.69c0-.864.933-1.406 1.683-.977l7.108 4.061a1.125 1.125 0 010 1.954l-7.108 4.061A1.125 1.125 0 013 16.811z"})})})]})}function ds(e,t){return null!==e.nodes&&null!==t.nodes?t.name.localeCompare(e.name):null===e.nodes?1:-1}function fs(){return Yo("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-4 h-4 mr-2",children:Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"})})}function hs(){return Yo("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-4 h-4 mr-2",children:Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})})}function ps(e){if(!e)return 0;let t=0;for(const n of e)null!==n.fsNode.size?t+=n.fsNode.size:t+=ps(n.children);return t}function vs(e){const t=Ci(),n=!0===e.multiline;return Yo("div",{class:e.class+" option flex "+(n?"flex-col":"flex-row items-center"),children:[Yo("div",{class:n?"mb-2":"mr-4",children:e.label}),Yo("div",{class:"flex-grow",children:Yo("select",{class:e.selectClass?e.selectClass:n?"w-full":"w-28",onChange:function(t){void 0!==e.onSelect&&e.onSelect(t.currentTarget.value)},disabled:!0===e.disabled,children:e.values.map((n=>Yo("option",{selected:n===e.selected,value:n,children:t(n)})))})})]})}function ms(){const e=on((e=>e.dos.backendLocked));return Yo(ks,{label:"emulation_backend",values:[...hi],disabled:e,selector:e=>e.dos.backend,dispatch:e=>(Vo.setItem("backend",e),_i.actions.dosBackend(e))})}function bs(){const e="run"===on((e=>e.ui.window));return Yo(ks,{label:"render_backend",values:[...pi],disabled:e,selector:e=>e.dos.renderBackend,dispatch:e=>_i.actions.renderBackend(e)})}function _s(e){return Yo(ks,{label:"render_aspect",multiline:e.multiline,values:[...vi],selector:e=>e.dos.renderAspect,dispatch:e=>_i.actions.renderAspect(e)})}function ys(e){return Yo(ks,{label:"image_rendering",multiline:e.multiline,values:[...bi],selector:e=>e.dos.imageRendering,dispatch:e=>_i.actions.imageRendering(e)})}function gs(e){return Yo(ks,{class:e.class,label:"theme",values:[...Xo],selector:e=>e.ui.theme,dispatch:e=>Ko.actions.theme(e),multiline:e.multiline})}function ws(e){return Yo(ks,{class:e.class,label:"FAT16/32 Backend",values:ji,selector:e=>e.init.sockdriveBackendName,dispatch:e=>Ti.actions.setSockdriveBackendName(e),multiline:e.multiline})}function ks(e){const t=Ci(),n=on(e.selector),r=tr();return Yo(vs,{class:"mt-4 "+e.class,selectClass:e.selectClass,disabled:e.disabled,multiline:e.multiline,label:t(e.label),selected:n,values:e.values,onSelect:function(t){r(e.dispatch(t))}})}function xs(e){return Yo("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",class:e.class??"absolute left-0 top-0 -ml-1 -mt-1 text-error w-4 h-4",children:Yo("path",{"fill-rule":"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z","clip-rule":"evenodd"})})}function Ss(){const e=Ci(),t=on((e=>e.auth.account)),{sockdriveEndpoint:n}=on((e=>Ai[e.init.sockdriveBackendName]??Ai["js-dos"])),[r,o]=ie([]),i=tr(),s=(null==t?void 0:t.premium)??!1,a=(null==t?void 0:t.email)??"",[c,l]=ie(""),[u,d]=ie(!0),f=le(null),h=le(null),[p,v]=ie(""),[m,b]=ie(""),[_,g]=ie(null),[w,k]=ie(-1);function x(){t&&t.token?(d(!0),fetch(n+"/list/drives/"+t.token.access_token).then((e=>e.json())).then((e=>{o(e.sort(((e,t)=>e.name.localeCompare(t.name))))})).catch(console.error).finally((()=>d(!1)))):o([])}return ae((()=>{x()}),[null==t?void 0:t.token,n]),Yo("div",{class:"frame-root items-start gap-3 px-4",children:[Yo(ws,{multiline:!0,class:"w-full "}),Yo("input",{class:"input input-bordered input-sm w-full",placeholder:e("filter"),value:c,onChange:e=>l(e.currentTarget.value??"")}),Yo("div",{class:"w-full",children:[!u&&Yo("table",{class:"table w-full",children:[Yo("thead",{children:Yo("tr",{children:[Yo("th",{children:e("net_drives")}),Yo("th",{})]})}),Yo("tbody",{children:r.map((({name:n,owner:r,fork_of:o},l)=>c.length>0&&-1===r.indexOf(c)&&-1===n.indexOf(c)?null:Yo(y,{children:Yo("tr",{children:[Yo("td",{onClick:()=>{},children:[Yo("p",{class:"font-bold",children:n}),o.map((e=>Yo("p",{class:"text-xs",children:[" ",e]}))),r!==(null==t?void 0:t.email)&&Yo("p",{class:"text-xs",children:r})]}),s&&Yo("td",{children:[(null==t?void 0:t.token)&&Yo("div",{class:"btn btn-ghost btn-xs",onClick:()=>{var e;k(l),null==(e=f.current)||e.showModal()},children:"Fork"}),(null==t?void 0:t.token)&&r===a&&Yo("div",{class:"btn btn-xs btn-ghost",onClick:()=>{var e;k(l),null==(e=h.current)||e.showModal()},children:e("delete")})]}),!s&&Yo("td",{children:Yo("div",{class:"cursor-pointer",onClick:()=>Qo(t,i),children:Yo(xs,{class:"text-error"})})})]})})))})]}),u&&Yo("span",{class:"loading loading-spinner loading-lg"})]}),Yo("dialog",{ref:f,class:"modal",children:!u&&w>=0&&null!==t&&Yo("div",{class:"modal-box",children:[Yo("h3",{class:"font-bold text-lg",children:[e("enter_name_of_drive"),":"]}),Yo("p",{class:"text-xs text-neutral-content mt-2",children:["fork of: ",r[w].owner,"/",r[w].name]}),Yo("input",{type:"text",placeholder:"name",value:p,class:"mt-6 input input-bordered input-primary w-full",onChange:e=>v(e.currentTarget.value)}),null!==_&&Yo("p",{class:"mt-2 text-error",children:[e("error"),": ",_]}),Yo("div",{class:"modal-action",children:[p.length>0&&Yo("button",{class:"btn mr-2 btn-primary",onClick:()=>{k(-1),d(!0),fetch(`${n}/fork/drive/${r[w].owner}/${r[w].name}/${p}/${t.token.access_token}`,{method:"POST"}).then((e=>e.json())).then((e=>{var t;if(e.error)throw new Error(e.error);o([]),x(),null==(t=f.current)||t.close()})).catch((e=>{console.error(e.message),i(Ko.actions.showToast({message:e.message,intent:"error"}))})).finally((()=>{d(!1)}))},children:e("fork")}),Yo("button",{class:"btn",onClick:()=>{var e;return null==(e=f.current)?void 0:e.close()},children:e("close")})]})]})}),Yo("dialog",{ref:h,class:"modal",children:!u&&w>=0&&null!==t&&Yo("div",{class:"modal-box",children:[Yo("h3",{class:"font-bold text-lg",children:[e("enter_name_of_drive"),":"]}),Yo("p",{class:"text-xs text-neutral mt-2",children:[r[w].owner,"/",r[w].name]}),Yo("input",{type:"text",placeholder:"name",value:m,class:"mt-6 input input-bordered input-primary w-full",onChange:e=>b(e.currentTarget.value)}),null!==_&&Yo("p",{class:"mt-2 text-error",children:[e("error"),": ",g]}),Yo("div",{class:"modal-action",children:[m===r[w].owner+"/"+r[w].name&&Yo("button",{class:"btn mr-2 btn-primary",onClick:()=>{k(-1),d(!0),fetch(`${n}/fork/delete/${r[w].owner}/${r[w].name}/${t.token.access_token}`,{method:"POST"}).then((e=>e.json())).then((e=>{var t;if(e.error)throw new Error(e.error);{const e=[...r];e.splice(w,1),o(e)}null==(t=h.current)||t.close()})).catch((e=>{console.error(e.message),g(e.message),i(Ko.actions.showToast({message:e.message,intent:"error"}))})).finally((()=>{d(!1)}))},children:e("delete")}),Yo("button",{class:"btn",onClick:()=>{var e;return null==(e=h.current)?void 0:e.close()},children:e("close")})]})]})})]})}function Cs(e){const t=le(null);return ae((()=>{null!==t&&null!==t.current&&(t.current.indeterminate=e.intermediate)}),[t,e.intermediate]),Yo("div",{className:e.class+" form-control option",onClick:function(){e.onChange&&e.onChange(!(!0===e.checked))},children:Yo("label",{className:"label cursor-pointer",children:[Yo("span",{className:"label-text mr-6",children:e.label}),Yo("input",{ref:t,checked:!0===e.checked,type:"checkbox",className:"toggle "+(e.checked?" toggle-primary ":"")+e.toggleClass,disabled:!0===e.disabled})]})})}function Ps(){const e=on((e=>e.auth.account)),t=on((e=>e.dos.network)),n=t.room,r=t.server,o="disconnected"!==t.ipx,i=Ci(),s=tr(),a=!0===(null==e?void 0:e.premium),c="connected"===t.ipx?location.href+function(){if(location.href.endsWith("?")||location.href.endsWith("&"))return"";return location.href.indexOf("?")>0?"&":"?"}()+"ipx=1&server="+t.server+"&room="+n:null;return ae((()=>{"netherlands"!==r&&!0!==(null==e?void 0:e.premium)&&s(_i.actions.setServer("netherlands"))}),[r,e]),Yo("div",{class:"network-frame frame-root items-start px-4 relative",children:[Yo("div",{class:"ml-1 mb-4 w-full flex flex-row items-center",children:[Yo(vs,{class:"text-sm",selectClass:"w-full",label:i("server")+":",selected:r,values:["netherlands","newyork","singapore"],disabled:o,onSelect:function(t){var n;n=t,s(_i.actions.setServer(n)),a||Qo(e,s)}}),Yo("div",{onClick:function(){Qo(e,s)},children:Yo(xs,{class:"cursor-pointer ml-2 w-4 h-4 text-error"})})]}),Yo("div",{class:"form-control w-full",children:[Yo("label",{class:"label",children:Yo("span",{class:"label-text",children:[i("room"),":"]})}),Yo("input",{type:"text",class:"input w-full input-sm input-bordered",disabled:o,onChange:e=>{return t=e.currentTarget.value,void s(_i.actions.setRoom(t));var t},value:n})]}),Yo(Cs,{class:"mt-4 "+("error"===t.ipx?"error":""),onChange:function(){"connected"===t.ipx?s(_i.actions.disconnectIpx({})):s(_i.actions.connectIpx({room:n,address:"wss://"+(a?r:"netherlands")+".dos.zone"}))},label:"IPX",checked:"connected"===t.ipx,disabled:"connecting"===t.ipx,intermediate:"connecting"===t.ipx}),null!==c&&Yo("div",{class:"mt-4 text-sm alert alert-success shadow-lg flex flex-col",children:[Yo("div",{children:[i("copy_net_link"),":"]}),Yo("div",{class:"flex flex-row",children:[Yo("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-6 h-6 mx-1 cursor-pointer hover:text-accent-focus flex-shrink-0",fill:"none",onClick:function(){c&&(!async function(e,t,n){if(!navigator.clipboard)return;try{await navigator.clipboard.writeText(e),n(Ko.actions.showToast({message:t("copied"),intent:"success"}))}catch(r){n(Ko.actions.showToast({message:t("error"),intent:"error"}))}}(c,i,s),s(Ko.actions.frameNone()))},viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",children:Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 01-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 011.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 00-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 01-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 00-3.375-3.375h-1.5a1.125 1.125 0 01-1.125-1.125v-1.5a3.375 3.375 0 00-3.375-3.375H9.75"})}),Yo("div",{class:"contextmenu underline break-all",target:"_blank",children:c})]})]})]})}function Es(e){return Yo("svg",{xmlns:"http://www.w3.org/2000/svg",style:"padding: 2px",viewBox:"0 0 16 16","enable-background":"new 0 0 16 16",fill:"currentColor",class:"w-full h-full rounded-lg "+e.class,children:Yo("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.71,2.29l-2-2C13.53,0.11,13.28,0,13,0h-1v6H4V0H1C0.45,0,0,0.45,0,1v14 c0,0.55,0.45,1,1,1h14c0.55,0,1-0.45,1-1V3C16,2.72,15.89,2.47,15.71,2.29z M14,15H2V9c0-0.55,0.45-1,1-1h10c0.55,0,1,0.45,1,1V15 z M11,1H9v4h2V1z"})})}function Os(e){const[t,n]=ie(!1),r=on((e=>e.auth.account)),o=null===r&&!1,i=tr(),s=Ci(),a=on((e=>e.ui.cloudSaves)),c=Ii();if(!a||null===c.loadedBundle||null===c.loadedBundle.bundleChangesUrl)return null;return Yo("div",{class:"save-button sidebar-button overflow-hidden "+(t?" sidebar-highlight ":"")+e.class+(o?" opacity-50":""),onClick:async function(){var e;if(o)return void i(Ko.actions.modalLogin());if(t)return;const a=c.ci,l=null==(e=c.loadedBundle)?void 0:e.bundleChangesUrl;if(null!==a&&l){n(!0);try{const e=await a.persist(!0);null!==e&&(null!==r&&r.premium?await Promise.all([ts(l,e),c.cache.put(l,e)]):await c.cache.put(l,e)),i(Ko.actions.showToast({message:s("success"),intent:"success"}))}catch(u){i(Ko.actions.showToast({message:s("unable_to_save"),intent:"error"})),console.error(u)}finally{n(!1)}}},children:Yo("div",{class:"w-full h-full flex justify-center",children:[Yo(Es,{}),t&&Yo("div",{class:"sidebar-badge"}),o&&Yo(xs,{}),Yo("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"absolute bottom-1 w-3 h-3 text-primary-content",children:Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 16.5V9.75m0 0l3 3m-3-3l-3 3M6.75 19.5a4.5 4.5 0 01-1.41-8.775 5.25 5.25 0 0110.233-2.33 3 3 0 013.758 3.848A3.752 3.752 0 0118 19.5H6.75z"})})]})})}function js(){var e;const t=(null==(e=on((e=>e.auth.account)))?void 0:e.premium)&&!1;return Yo("div",{class:"quick-save-frame flex flex-col justify-center items-center -my-2",children:[Yo(Os,{}),Yo(As,{label:"quick",bgcolor:"bg-primary",textcolor:"text-primary-content"}),Yo(Ms,{label:"quick",bgcolor:"bg-primary"}),t&&Yo(y,{children:[Yo(As,{disabled:!t,label:2,bgcolor:"bg-secondary",textcolor:"text-secondary-content"}),Yo(Ms,{disabled:!t,label:2,bgcolor:"bg-secondary"}),Yo(As,{disabled:!t,label:3,bgcolor:"bg-accent",textcolor:"text-accent-content"}),Yo(Ms,{disabled:!t,label:3,bgcolor:"bg-accent"})]})]})}function As(e){const t=on((e=>e.auth.account)),n=tr(),r=Ii();return Yo("div",{class:"sidebar-button flex justify-center "+(e.disabled?"opacity-50":""),onClick:function(){!0===e.disabled&&Qo(t,n);const o=r.ci;null!==o&&o.sendBackendEvent({type:"wc-trigger-event",event:"hand_savestate"})},children:[Yo(Es,{}),!0!==e.disabled&&Yo("div",{class:"text-badge "+e.textcolor+" "+e.bgcolor,children:e.label}),!0===e.disabled&&Yo(xs,{}),Yo("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"absolute bottom-1 w-3 h-3",children:Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"})})]})}function Ms(e){const t=on((e=>e.auth.account)),n=tr(),r=Ii();return Yo("div",{class:"sidebar-button flex justify-center "+(e.disabled?" opacity-50":""),onClick:function(){!0===e.disabled&&Qo(t,n);const o=r.ci;null!==o&&o.sendBackendEvent({type:"wc-trigger-event",event:"hand_loadstate"})},children:[Yo(Es,{class:"opacity-10"}),!0===e.disabled&&Yo(xs,{}),Yo("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"absolute bottom-1 w-6 h-6 -scale-y-100",children:Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m15 15 6-6m0 0-6-6m6 6H9a6 6 0 0 0 0 12h3"})})]})}function Rs(){const e=Ci(),t=tr(),n=on((e=>e.ui.editor));return Yo(Cs,{class:"mt-4",label:e("editor"),checked:n,onChange:e=>t(Ko.actions.setEditor(e))})}function Ts(){const e=Ci(),t=tr(),n=on((e=>e.dos.mouseCapture));return Yo(Cs,{class:"mt-4",label:e("mouse_lock"),checked:n,onChange:e=>t(_i.actions.mouseCapture(e))})}function Ns(){const e=Ci(),t=tr(),n=on((e=>e.dos.paused)),r="run"!==on((e=>e.ui.window));return Yo(Cs,{class:"mt-4",label:e("pause"),checked:n,disabled:r,onChange:e=>t(_i.actions.paused(e))})}function zs(){const e=Ci(),t=tr(),n=on((e=>e.dos.worker)),r=on((e=>e.dos.backendHardware)),o="run"===on((e=>e.ui.window)),i=Ii();return r&&i.options.backendHardware?null:Yo(Cs,{class:"mt-4",label:e("worker"),checked:n,disabled:o,onChange:e=>t(_i.actions.dosWorker(e))})}function Us(){const e=Ci(),t=tr(),n=on((e=>e.dos.backendHardware));return Ii().options.backendHardware?Yo(Cs,{class:"mt-4",label:e("hardware"),checked:n,onChange:e=>t(_i.actions.dosBackendHardware(e))}):null}function Is(){const e=Ci(),t=tr(),n=on((e=>e.auth.account)),r=!0===(null==n?void 0:n.premium),o=on((e=>"dosboxX"===e.dos.backend)),i=on((e=>e.dos.sockdriveWrite))&&r;return o?Yo(Cs,{class:"mt-4",label:e("fat_write"),checked:i,onChange:e=>{r?t(_i.actions.setSockdriveWrite(e)):Qo(n,t)}}):null}function Ls(e){const t=le(null),n=le(null);ae((()=>{if(null===(null==t?void 0:t.current))return;const n=t.current;let r=!1;function o(t){const r=n.getBoundingClientRect(),o=Math.min(1,Math.max(0,(t.clientX-r.left)/r.width));e.onChange(o)}function i(e){r=!0,o(e)}function s(e){r&&o(e)}function a(e){r=!1}return n.addEventListener("pointerdown",i),n.addEventListener("pointermove",s),n.addEventListener("pointerup",a),n.addEventListener("pointercancel",a),n.addEventListener("pointerleave",a),()=>{n.removeEventListener("pointerdown",i),n.removeEventListener("pointermove",s),n.removeEventListener("pointerup",a),n.removeEventListener("pointercancel",a),n.removeEventListener("pointerleave",a)}}),[t]);const r=Math.min(Math.max(0,100*e.value),100);return Yo("div",{class:e.class+" slider option",children:[Yo("div",{class:"label",children:e.label}),Yo("div",{class:"touch",ref:t,children:[Yo("div",{class:"bg"}),Yo("div",{class:"point",ref:n,style:{left:"calc("+r+"% - 12px)"}})]})]})}function Bs(e){const t=Ci(),n=on((e=>e.dos.mouseSensitivity)),r=tr();return Yo(Ls,{class:"mt-4 "+e.class,label:t("mouse_sensitivity"),value:n,onChange:e=>r(_i.actions.mouseSensitivity(e))})}function Ds(e){const t=Ci(),n=on((e=>e.dos.volume)),r=tr();return Yo(Ls,{class:e.class,label:t("volume"),value:n,onChange:e=>r(_i.actions.volume(e))})}function Hs(e){return Yo("div",{class:"settings-frame frame-root items-start pl-4",children:[Yo(Ns,{}),Yo(Ts,{}),Yo(Bs,{}),Yo(Ds,{}),Yo(Rs,{}),Yo(gs,{multiline:!0})]})}function Fs(){const e=on((e=>e.dos.ciStartedAt)),t=on((e=>e.dos.stats)),n=Math.round(on((e=>e.dos.stats.cyclesPerMs))/1e3),r=Math.round(t.driveRecv/1024/1024*100)/100,o=t.driveRecvTime/1e3>1?Math.round(r/t.driveRecvTime*1e3*100)/100:0;return Yo("div",{class:"stats-frame frame-root items-start px-4",children:Yo("div",{class:"w-full overflow-x-auto",children:Yo("table",{class:"table table-compact w-full",children:[Yo("thead",{children:Yo("tr",{children:[Yo("th",{children:"Metric"}),Yo("th",{children:"Value"})]})}),Yo("tbody",{children:[Yo("tr",{children:[Yo("td",{children:"Uptime"}),Yo("td",{children:[Math.round((Date.now()-e)/100)/10," s"]})]}),Yo("tr",{children:[Yo("td",{children:"Cycles/ms"}),n<=0&&Yo("td",{children:"~ K"}),n>0&&n<=1e3&&Yo("td",{children:[n," K"]}),n>1e3&&Yo("td",{children:[Math.round(n/1e3)," KK"]})]}),Yo("tr",{children:[Yo("td",{children:"NonSkipSleep COUNT/s"}),Yo("td",{children:t.nonSkippableSleepPreSec})]}),Yo("tr",{children:[Yo("td",{children:"Sleep COUNT/s"}),Yo("td",{children:t.sleepPerSec})]}),Yo("tr",{children:[Yo("td",{children:"Sleep TIME/s"}),Yo("td",{children:t.sleepTimePerSec})]}),Yo("tr",{children:[Yo("td",{children:"Msg FRAME/s"}),Yo("td",{children:t.framePerSec})]}),Yo("tr",{children:[Yo("td",{children:"Msg SOUND/s"}),Yo("td",{children:t.soundPerSec})]}),Yo("tr",{children:[Yo("td",{children:"Msg SENT/s"}),Yo("td",{children:t.msgSentPerSec})]}),Yo("tr",{children:[Yo("td",{children:"Msg RECV/s"}),Yo("td",{children:t.msgRecvPerSec})]}),Yo("tr",{children:[Yo("td",{children:"Net SENT/s"}),Yo("td",{children:[Math.round(t.netSent/1024*100)/100,"Kb"]})]}),Yo("tr",{children:[Yo("td",{children:"Net RECV/s"}),Yo("td",{children:[Math.round(t.netRecv/1024*100)/100,"Kb"]})]}),Yo("tr",{children:[Yo("td",{children:"HDD RECV/s"}),Yo("td",{children:[r,"Mb (~",o,"Mb/s)"]})]}),Yo("tr",{children:[Yo("td",{children:"HDD SENT/s"}),Yo("td",{children:[Math.round(t.driveSent/1024/1024*100)/100,"Mb"]})]}),Yo("tr",{children:[Yo("td",{children:"HDD Cache"}),Yo("td",{children:[Math.round(t.driveCacheUsed/1024/1024*100)/100,"Mb"]})]}),Yo("tr",{children:[Yo("td",{children:"HDD Cache Hit/Miss"}),Yo("td",{children:[t.driveCacheHit," / ",t.driveCacheMiss]})]})]})]})})})}function qs(e){return Yo("div",{class:"image-rendering-frame frame-root items-start pl-4",children:[Yo(_s,{multiline:!0}),Yo(ys,{multiline:!0})]})}function Ws(e){const t=on((e=>e.ui.frame)),n=on((e=>e.ui.frameXs)),r=on((e=>e.ui.wideScreen));return"none"===t?null:Yo("div",{class:"frame "+(n?" frame-xs ":"")+(n||r?"":" frame-md"),children:["account"===t&&Yo(Vi,{}),"settings"===t&&Yo(Hs,{}),"editor-conf"===t&&Yo(Yi,{}),"editor-fs"===t&&Yo(as,{}),"network"===t&&Yo(Ps,{}),"stats"===t&&Yo(Fs,{}),"fat-drives"===t&&Yo(Ss,{}),"quick-save"===t&&Yo(js,{}),"image-rendering"===t&&Yo(qs,{})]})}function $s(e){const t=on((e=>e.auth.account)),n=null!==t,r="account"===on((e=>e.ui.frame)),o=tr();return Yo("div",{class:"sidebar-button "+(r?"sidebar-highlight ":"")+("dz.caiiiycuk@gmail.com"===(null==t?void 0:t.email)?"bg-accent ":"")+e.class,onClick:function(){Qo(t,o)},children:[Yo("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-full h-full",children:Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.982 18.725A7.488 7.488 0 0012 15.75a7.488 7.488 0 00-5.982 2.975m11.963 0a9 9 0 10-11.963 0m11.963 0A8.966 8.966 0 0112 21a8.966 8.966 0 01-5.982-2.275M15 9.75a3 3 0 11-6 0 3 3 0 016 0z"})}),!1===n&&Yo("div",{class:"sidebar-badge"})]})}function Vs(e,t){const n=Ui(t).root;e?n.requestFullscreen?n.requestFullscreen():n.webkitRequestFullscreen?n.webkitRequestFullscreen():n.mozRequestFullScreen?n.mozRequestFullScreen():n.msRequestFullscreen?n.msRequestFullscreen():n.webkitEnterFullscreen?n.webkitEnterFullscreen():n.classList.add("jsdos-fullscreen-workaround"):n.classList.contains("jsdos-fullscreen-workaround")?n.classList.remove("jsdos-fullscreen-workaround"):document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen(),t.dispatch(Ko.actions.setFullScreen(e))}function Xs(e){const t=on((e=>e.ui.fullScreen)),n=Jn();return Yo("div",{class:"fullscreen-button sidebar-button "+e.class,onClick:function(){Vs(!t,n)},children:Yo("div",{class:"w-full h-full scale-75 hover:scale-90",children:[!t&&Yo("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 16 16",fill:"currentColor",stroke:"none","enable-background":"new 0 0 16 16",children:Yo("g",{children:Yo("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.99,8.99c-0.28,0-0.53,0.11-0.71,0.29l-3.29,3.29v-1.59c0-0.55-0.45-1-1-1 s-1,0.45-1,1v4c0,0.55,0.45,1,1,1h4c0.55,0,1-0.45,1-1s-0.45-1-1-1H3.41L6.7,10.7c0.18-0.18,0.29-0.43,0.29-0.71 C6.99,9.44,6.54,8.99,5.99,8.99z M14.99-0.01h-4c-0.55,0-1,0.45-1,1s0.45,1,1,1h1.59L9.28,5.29C9.1,5.47,8.99,5.72,8.99,5.99 c0,0.55,0.45,1,1,1c0.28,0,0.53-0.11,0.71-0.29l3.29-3.29v1.59c0,0.55,0.45,1,1,1s1-0.45,1-1v-4C15.99,0.44,15.54-0.01,14.99-0.01 z"})})}),t&&Yo("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 16 16",fill:"currentColor",stroke:"none","enable-background":"new 0 0 16 16",children:Yo("g",{children:Yo("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.99,0.99c0-0.55-0.45-1-1-1c-0.28,0-0.53,0.11-0.71,0.29l-3.29,3.29V1.99 c0-0.55-0.45-1-1-1s-1,0.45-1,1v4c0,0.55,0.45,1,1,1h4c0.55,0,1-0.45,1-1s-0.45-1-1-1h-1.59L15.7,1.7 C15.88,1.52,15.99,1.27,15.99,0.99z M5.99,8.99h-4c-0.55,0-1,0.45-1,1s0.45,1,1,1h1.59l-3.29,3.29c-0.18,0.18-0.29,0.43-0.29,0.71 c0,0.55,0.45,1,1,1c0.28,0,0.53-0.11,0.71-0.29l3.29-3.29v1.59c0,0.55,0.45,1,1,1s1-0.45,1-1v-4C6.99,9.44,6.54,8.99,5.99,8.99z"})})})]})})}function Ks(e){const t="network"===on((e=>e.ui.frame)),n=on((e=>"connected"!==e.dos.network.ipx)),r=tr();return Yo("div",{class:"network-button sidebar-button "+(t?" sidebar-highlight ":"")+(n?" inactive ":"")+e.class,onClick:function(){r(t?Ko.actions.frameNone():Ko.actions.frameNetwork())},children:Yo("div",{class:"w-full h-full",children:[Yo("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-full h-full",children:Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.288 15.038a5.25 5.25 0 017.424 0M5.106 11.856c3.807-3.808 9.98-3.808 13.788 0M1.924 8.674c5.565-5.565 14.587-5.565 20.152 0M12.53 18.22l-.53.53-.53-.53a.75.75 0 011.06 0z"})}),n&&Yo("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-full text-error h-full absolute top-0 left-0",children:Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 4L18 18"})})]})})}function Qs(e){return Yo(ra,{class:e.class,frame:"image-rendering",action:Ko.actions.frameImageRendering(),children:Yo("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-full h-full",children:Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 001.5-1.5V6a1.5 1.5 0 00-1.5-1.5H3.75A1.5 1.5 0 002.25 6v12a1.5 1.5 0 001.5 1.5zm10.5-11.25h.008v.008h-.008V8.25zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z"})})})}function Gs(e){const t=null===on((e=>e.auth.account))&&!1,n=t?Ko.actions.modalLogin():Ko.actions.frameQuickSave();return Yo(ra,{class:e.class+(t?" opacity-50":""),frame:"quick-save",action:n,children:[Yo(Es,{}),t&&Yo(xs,{})]})}function Ys(e){return Yo(ra,{class:e.class,frame:"fat-drives",action:Ko.actions.frameFatDrives(),children:Yo("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-full h-full",children:Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5.25 14.25h13.5m-13.5 0a3 3 0 01-3-3m3 3a3 3 0 100 6h13.5a3 3 0 100-6m-16.5-3a3 3 0 013-3h13.5a3 3 0 013 3m-19.5 0a4.5 4.5 0 01.9-2.7L5.737 5.1a3.375 3.375 0 012.7-1.35h7.126c1.062 0 2.062.5 2.7 1.35l2.587 3.45a4.5 4.5 0 01.9 2.7m0 0a3 3 0 01-3 3m0 3h.008v.008h-.008v-.008zm0-6h.008v.008h-.008v-.008zm-3 6h.008v.008h-.008v-.008zm0-6h.008v.008h-.008v-.008z"})})})}function Zs(e){return Yo(ra,{class:e.class,frame:"editor-conf",action:Ko.actions.frameConf(),children:Yo("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-full h-full",children:Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})})})}function Js(e){return Yo(ra,{class:e.class,frame:"editor-fs",action:Ko.actions.frameFs(),children:Yo("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-full h-full",children:Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21.75 17.25v-.228a4.5 4.5 0 00-.12-1.03l-2.268-9.64a3.375 3.375 0 00-3.285-2.602H7.923a3.375 3.375 0 00-3.285 2.602l-2.268 9.64a4.5 4.5 0 00-.12 1.03v.228m19.5 0a3 3 0 01-3 3H5.25a3 3 0 01-3-3m19.5 0a3 3 0 00-3-3H5.25a3 3 0 00-3 3m16.5 0h.008v.008h-.008v-.008zm-3 0h.008v.008h-.008v-.008z"})})})}function ea(){const e=Math.round(on((e=>e.dos.stats.cyclesPerMs))/1e3);return Yo(ra,{class:"cycles",frame:"stats",action:Ko.actions.frameStats(),children:[e<=0&&Yo(y,{children:[Yo("span",{children:"~"}),Yo("sup",{children:"KC"})]}),e>0&&e<=1e3&&Yo(y,{children:[Yo("span",{children:e}),Yo("sup",{children:"KC"})]}),e>0&&e>1e3&&Yo(y,{children:[Yo("span",{children:Math.round(e/1e3)}),Yo("sup",{children:[Yo("strong",{children:"K"}),"KC"]})]})]})}function ta(e){const t=Jn(),n=le(null),[r]=ie({recv:0,enabled:!1,delayLedTo:0});ae((()=>{if(n.current){const e=n.current;e.classList.add("bg-base-300");const o=setInterval((()=>{if(r.delayLedTo<=Date.now()){const n=t.getState().dos.stats.driveRecv,o=r.recv!==n;o!==r.enabled&&(e.classList.remove("bg-base-300","bg-green-300","animate-led"),o?e.classList.add("bg-green-300","animate-led"):e.classList.add("bg-base-300"),r.enabled=o),r.delayLedTo=o?Date.now()+300+1500*Math.random():0,r.recv=n}}),150);return()=>{e.classList.remove("bg-base-300","bg-green-300","animate-led"),clearInterval(o)}}}),[n,r]);const[o,i]=ie(!1),[s,a]=ie({recv:0,timeoutId:null}),c=on((e=>e.dos.stats.driveRecv));if(s.recv!==c){o||i(!0),s.timeoutId&&clearTimeout(s.timeoutId);const e=setTimeout((()=>{i(!1),a({recv:c,timeoutId:null})}),1e3);a({recv:c,timeoutId:e})}return Yo("div",{ref:n,class:"self-end mr-2 -mt-3 w-2 h-1"})}function na(e){return Yo(ra,{class:e.class,action:Ko.actions.frameSettings(),frame:"settings",children:Yo("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-full h-full",children:[Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z"}),Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})})}function ra(e){const t=on((e=>e.ui.frame))===e.frame,n=tr();return Yo("div",{class:"sidebar-button "+(t?"sidebar-highlight ":"")+e.class,onClick:function(){n(t?Ko.actions.frameNone():e.action)},children:e.children})}function oa(e){const t=on((e=>e.ui.window)),n=on((e=>e.ui.editor)),r=on((e=>e.dos.backend));return Yo("div",{class:"sidebar",children:["run"===t&&"dosbox"===r&&Yo(Os,{}),"run"===t&&"dosboxX"===r&&Yo(Gs,{}),"run"===t&&Yo(Qs,{}),"run"===t&&Yo(Ks,{}),n&&"prerun"===t&&Yo(Zs,{}),n&&"prerun"===t&&"dosboxX"===r&&Yo(Ys,{}),n&&"run"===t&&Yo(Js,{}),Yo("div",{class:"contentbar"}),"run"===t&&Yo(Xs,{}),"run"===t&&Yo(ea,{}),"run"===t&&Yo(ta,{}),("prerun"===t||"run"===t)&&Yo(na,{}),"run"!==t&&Yo($s,{})]})}const ia=48,sa={8:259,9:258,13:257,16:340,17:341,18:342,19:284,27:256,32:32,33:266,34:267,35:269,36:268,37:263,38:265,39:262,40:264,45:260,46:261,48:ia,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,59:59,64:61,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,93:93,96:320,97:321,98:322,99:323,100:324,101:325,102:326,103:327,104:328,105:329,111:331,112:290,113:291,114:292,115:293,116:294,117:295,118:296,119:297,120:298,121:299,122:300,123:301,144:282,145:281,173:45,186:59,187:61,188:44,189:45,190:46,191:47,219:91,220:92,221:93};for(const cc of Object.keys(sa));function aa(e){return sa[e]||0}function ca(e,t,n,r){const o=e.parentElement.getBoundingClientRect(),i=o.width,s=o.height;if(0===n)return;const a=r===mi?i/s:r??t/n;let c=i,l=i/a;l>s&&(l=s,c=s*a),e.style.position="relative",e.style.top=(s-l)/2+"px",e.style.left=(i-c)/2+"px",e.style.width=c+"px",e.style.height=l+"px"}const la="\nattribute vec4 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nvarying highp vec2 vTextureCoord;\n\nvoid main(void) {\n gl_Position = aVertexPosition;\n vTextureCoord = aTextureCoord;\n}\n",ua="\nvarying highp vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\n\nvoid main(void) {\n highp vec4 color = texture2D(uSampler, vTextureCoord);\n gl_FragColor = vec4(color.r, color.g, color.b, 1.0);\n}\n";function da(e,t,n){const r=e.getContext("webgl");if(null===r)throw new Error("Unable to create webgl context on given canvas");const o=function(e,t,n){const r=fa(e,e.VERTEX_SHADER,t),o=fa(e,e.FRAGMENT_SHADER,n),i=e.createProgram();if(e.attachShader(i,r),e.attachShader(i,o),e.linkProgram(i),!e.getProgramParameter(i,e.LINK_STATUS))throw new Error("Unable to initialize the shader program: "+e.getProgramInfoLog(i));return i}(r,la,ua),i=r.getAttribLocation(o,"aVertexPosition"),s=r.getAttribLocation(o,"aTextureCoord"),a=r.getUniformLocation(o,"uSampler");!function(e,t,n){const r=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,r);const o=[-1,-1,0,1,-1,0,1,1,0,-1,-1,0,1,1,0,-1,1,0];e.bufferData(e.ARRAY_BUFFER,new Float32Array(o),e.STATIC_DRAW),e.vertexAttribPointer(t,3,e.FLOAT,!1,0,0),e.enableVertexAttribArray(t);const i=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,i);const s=[0,1,1,1,1,0,0,1,1,0,0,0];e.bufferData(e.ARRAY_BUFFER,new Float32Array(s),e.STATIC_DRAW),e.vertexAttribPointer(n,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(n)}(r,i,s);const c=r.createTexture();r.bindTexture(r.TEXTURE_2D,c),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR);const l=new Uint8Array([0,0,0]);r.texImage2D(r.TEXTURE_2D,0,r.RGB,1,1,0,r.RGB,r.UNSIGNED_BYTE,l),r.useProgram(o),r.activeTexture(r.TEXTURE0),r.uniform1i(a,0);let u=0,d=0,f=null,h=null,p=0;const v=()=>{null!==h&&(r.texImage2D(r.TEXTURE_2D,0,p,u,d,0,p,r.UNSIGNED_BYTE,h),h=null),r.drawArrays(r.TRIANGLES,0,6),f=null},m=()=>{ca(e,u,d,n)},b=(t,n)=>{u=t,d=n,e.width=u,e.height=d,h=null,r.viewport(0,0,u,d),m()};t.events().onFrameSize(b),t.events().onFrame(((e,t)=>{h=null!=e?e:t,p=null!=e?r.RGB:r.RGBA,null===f&&(f=requestAnimationFrame(v))})),b(t.width(),t.height());const _=new ResizeObserver(m);return _.observe(e.parentElement),window.addEventListener("resize",m),()=>{t.events().onFrameSize((()=>{})),t.events().onFrame((()=>{})),_.disconnect(),window.removeEventListener("resize",m)}}function fa(e,t,n){const r=e.createShader(t);if(e.shaderSource(r,n),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS)){const t=e.getShaderInfoLog(r);throw e.deleteShader(r),new Error("An error occurred compiling the shaders: "+t)}return r}function ha(e,t,n){const r=e.getContext("2d");if(null===r)throw new Error("Unable to create 2d context on given canvas");let o=0,i=0;const s=()=>{ca(e,o,i,n)};let a=new Uint8ClampedArray(0);const c=(t,n)=>{o=t,i=n,e.width=o,e.height=i,a=new Uint8ClampedArray(t*n*4),s()};t.events().onFrameSize(c),t.events().onFrame(((e,t)=>{if(null===e&&null===t)return;const n=null!==e?e:t;let s=0,c=0;for(;c<a.length;)a[c++]=n[s++],a[c++]=n[s++],a[c++]=n[s++],a[c++]=255,n.length===a.length&&s++;r.putImageData(new ImageData(a,o,i),0,0)})),c(t.width(),t.height());const l=new ResizeObserver(s);return l.observe(e.parentElement),window.addEventListener("resize",s),()=>{t.events().onFrameSize((()=>{})),t.events().onFrame((()=>{})),l.disconnect(),window.removeEventListener("resize",s)}}class pa{constructor(){t(this,"samplesQueue",[])}push(e){this.samplesQueue.push(e)}length(){let e=0;for(const t of this.samplesQueue)e+=t.length;return e}writeTo(e,t){let n=0;for(;this.samplesQueue.length>0;){const r=this.samplesQueue[0],o=Math.min(t-n,r.length);if(o===r.length?(e.set(r,n),this.samplesQueue.shift()):(e.set(r.slice(0,o),n),this.samplesQueue[0]=r.slice(o)),n+=o,n===t)break}n<t&&e.fill(0,n)}}function va(e,t){if(e.type.match(/^touch/)){const n=e,r=t.getBoundingClientRect();return{x:n.targetTouches[0].clientX-r.x,y:n.targetTouches[0].clientY-r.y,mX:0,mY:0}}if(e.type.match(/^pointer/)){const t=e;return{x:t.offsetX,y:t.offsetY,mX:t.movementX,mY:t.movementY}}{const t=e;return{x:t.offsetX,y:t.offsetY,mX:t.movementX,mY:t.movementY,button:0===t.button?0:1}}}const ma=function(){const e=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),t=e&&!!("ontouchstart"in window),n=e&&!!window.PointerEvent,r=e&&!!window.MSPointerEvent;let o=!e;const i=[],s=[],a=[],c=[],l=[];return n?(i.push("pointerdown"),a.push("pointerup","pointercancel"),s.push("pointermove"),l.push("touchstart","touchmove","touchend")):r?(i.push("MSPointerDown"),s.push("MSPointerMove"),a.push("MSPointerUp")):t?(o=!1,i.push("touchstart","mousedown"),s.push("touchmove"),a.push("touchend","touchcancel","mouseup")):(i.push("mousedown"),s.push("mousemove"),a.push("mouseup"),c.push("mouseleave")),{mobile:e,canLock:o,starters:i,changers:s,enders:a,prevents:l,leavers:c}}();function ba(e,t,n,r,o,i){let s=0;const a=r=>{if(r.target!==e)return;const o=va(r,e);s=void 0===o.button?t:o.button,n(o.x,o.y,s),r.stopPropagation()},c=t=>{if(t.target!==e)return;const n=va(t,e);r(n.x,n.y,n.mX,n.mY),t.stopPropagation()},l=t=>{const n=va(t,e);o(n.x,n.y,s),t.stopPropagation()},u=t=>{if(t.target!==e)return;const n=va(t,e);i(n.x,n.y),t.stopPropagation()},d=e=>{e.stopPropagation()},f={capture:!1};for(const h of ma.starters)e.addEventListener(h,a,f);for(const h of ma.changers)e.addEventListener(h,c,f);for(const h of ma.enders)e.addEventListener(h,l,f);for(const h of ma.prevents)e.addEventListener(h,d,f);for(const h of ma.leavers)e.addEventListener(h,u,f);return()=>{for(const t of ma.starters)e.removeEventListener(t,a,f);for(const t of ma.changers)e.removeEventListener(t,c,f);for(const t of ma.enders)e.removeEventListener(t,l,f);for(const t of ma.prevents)e.removeEventListener(t,d,f);for(const t of ma.leavers)e.removeEventListener(t,u,f)}}const _a=.01;function ya(e,t,n){const r=(e,r)=>function(e,t,n,r){const{width:o,height:i}=n.getBoundingClientRect(),s=r.width(),a=r.height(),c=s/a;let l=o,u=o/c;u>i&&(u=i,l=i*c);const d=(i-u)/2,f=(o-l)/2;let h=Math.max(0,Math.min(1,(e-f)/l)),p=Math.max(0,Math.min(1,(t-d)/u));h<=_a&&(h=0);h>=1-_a&&(h=1);p<=_a&&(p=0);p>=1-_a&&(p=1);return{x:h,y:p}}(e,r,t,n);return document.pointerLockElement===t&&document.exitPointerLock(),ba(t,e,(function(e,t,o){const i=r(e,t);n.sendMouseMotion(i.x,i.y),n.sendMouseButton(o,!0)}),(function(e,t,o,i){const s=r(e,t);n.sendMouseMotion(s.x,s.y)}),(function(e,t,o){const i=r(e,t);n.sendMouseMotion(i.x,i.y),n.sendMouseButton(o,!1)}),(function(e,t){const o=r(e,t);n.sendMouseMotion(o.x,o.y)}))}const ga=500,wa=50;function ka(e,t,n,r,o){return e&&!ma.canLock?function(e,t,n,r){let o=-1,i=0,s=0,a=0;return ba(n,t,((e,t)=>{o=Date.now(),i=0,s=e,a=t}),(function(t,n,o,c){void 0===o&&(o=t-s),void 0===c&&(c=n-a),s=t,a=n,0===o&&0===c||(i+=Math.abs(o)+Math.abs(c),r.sendMouseRelativeMotion(o*e*2,c*e*2))}),((e,n)=>{if(Date.now()-o<ga&&i<wa){const e=t??0;r.sendMouseButton(e,!0),setTimeout((()=>r.sendMouseButton(e,!1)),60)}}),(()=>{}))}(t,n,r,o):e?function(e,t,n,r){function o(){return document.pointerLockElement!==n}return ba(n,t,(function(e,t,i){o()?(n.requestPointerLock||n.mozRequestPointerLock||n.webkitRequestPointerLock).call(n):r.sendMouseButton(i,!0)}),(function(t,n,i,s){o()||0===i&&0===s||r.sendMouseRelativeMotion(i*e,s*e)}),(function(e,t,n){o()||r.sendMouseButton(n,!1)}),(function(e,t){}))}(t,n,r,o):ya(n,r,o)}function xa(e,t){!function(e){const t=tr(),n=Ci();ae((()=>{let r=0;const o={};e.events().onMessage(((e,...i)=>{var s,a,c,l,u;if("error"===e&&(null==(s=i[0])?void 0:s.startsWith("[panic]")))t(Ko.actions.showToast({message:i[0],intent:"panic"}));else if("log"===e&&-1!==(null==(a=i[0])?void 0:a.indexOf("sockdrive:"))){const e=i[0].substring(i[0].indexOf(" ")+1,i[0].indexOf(","));if(t(Ko.actions.cloudSaves(!1)),-1!==(null==(c=i[0])?void 0:c.indexOf("write="))&&console.log("drive",e,"config:",i[0]),-1!==(null==(l=i[0])?void 0:l.indexOf("write=false"))&&t(Ko.actions.readOnlyWarning(!0)),-1!==(null==(u=i[0])?void 0:u.indexOf("preload="))){const s=Number.parseInt(i[0].substring(i[0].indexOf("preload=")+8));void 0===o[e]?(o[e]=s,r+=s):o[e]=s;let a=r;for(const e of Object.values(o))a-=e;t(Ko.actions.showToast({message:n("preloading_sockdrive")+" "+Math.round(a/1024/1024*100)/100+"/"+Math.round(r/1024/1024*100)/100+"Mb",long:!0}))}}}))}),[e,t])}(t),function(e){const t=on((e=>e.dos.imageRendering));ae((()=>{e.style.imageRendering="smooth"===t?"auto":t}),[e,t])}(e),function(e){const t=tr();ae((()=>{let n=0,r=0,o=0,i=ia,s=0,a=0,c=0,l=0,u=Date.now();const d=setInterval((()=>{e.asyncifyStats().then((e=>{const d=Date.now()-u,f=d/1e3;if(f>0){const h={cyclesPerMs:Math.round((e.cycles-n)/d),nonSkippableSleepPreSec:Math.round((e.nonSkippableSleepCount-r)/f),sleepPerSec:Math.round((e.sleepCount-o)/f),sleepTimePerSec:Math.round((e.sleepTime-i)/f),framePerSec:Math.round((e.messageFrame-s)/f),soundPerSec:Math.round((e.messageSound-a)/f),msgSentPerSec:Math.round((e.messageSent-c)/f),msgRecvPerSec:Math.round((e.messageReceived-l)/f),netSent:e.netSent,netRecv:e.netRecv,driveSent:e.driveSent,driveRecv:e.driveRecv,driveRecvTime:e.driveRecvTime,driveCacheHit:e.driveCacheHit,driveCacheMiss:e.driveCacheMiss,driveCacheUsed:e.driveCacheUsed};t(_i.actions.stats(h)),n=e.cycles,r=e.nonSkippableSleepCount,o=e.sleepCount,i=e.sleepTime,s=e.messageFrame,a=e.messageSound,c=e.messageSent,l=e.messageReceived,u=Date.now()}}))}),3e3);return()=>{clearInterval(d)}}),[t,e])}(t),function(e){const t=on((e=>e.dos.paused));ae((()=>{t?e.pause():e.resume()}),[t,e])}(t),function(e){ae((()=>function(e,t){function n(e){if("text"===e.target.type)return;const n=aa(e.keyCode);t.sendKeyEvent(n,!0),e.stopPropagation(),e.preventDefault()}function r(e){if("text"===e.target.type)return;const n=aa(e.keyCode);t.sendKeyEvent(n,!1),e.stopPropagation(),e.preventDefault()}return e.addEventListener("keydown",n),e.addEventListener("keyup",r),()=>{e.removeEventListener("keydown",n),e.removeEventListener("keyup",r)}}(window,e)),[e])}(t),function(e,t){const n=on((e=>e.dos.mouseCapture)),r=on((e=>e.dos.mouseSensitivity));ae((()=>ka(n,.1+3*r,0,e,t)),[e,t,n,r])}(e,t),function(e,t){const n=on((e=>e.dos.renderBackend)),r=on((e=>e.dos.renderAspect));let o;switch(r){case"1/1":o=1;break;case"5/4":o=5/4;break;case"4/3":o=4/3;break;case"16/10":o=1.6;break;case"16/9":o=16/9;break;case"Fit":o=mi}ae((()=>{let r=()=>{};if("canvas"===n)r=ha(e,t,o);else try{r=da(e,t,o)}catch(i){console.error("Unalbe to start webgl render",i),r=ha(e,t,o)}return r}),[e,t,n,o])}(e,t),function(e){const t=Jn();ae((()=>{const n=function(e,t){const n=e.soundFrequency();if(0===n)return console.warn("Can't create audio node with sampleRate === 0, ingnoring"),()=>{};let r=null;if("undefined"!=typeof AudioContext?r=new AudioContext({sampleRate:n,latencyHint:"interactive"}):void 0!==window.webkitAudioContext&&(r=new window.webkitAudioContext({sampleRate:n,latencyHint:"interactive"})),null==r)return()=>{};const o=new pa;e.events().onSoundPush((e=>{o.length()<6144&&o.push(e)}));const i=r.createScriptProcessor(2048,0,1);let s=!1;i.onaudioprocess=e=>{const t=e.outputBuffer.length,n=e.outputBuffer.numberOfChannels,r=o.length();if(s||(s=r>=2048),s)for(let i=0;i<n;i++){const n=e.outputBuffer.getChannelData(i);o.writeTo(n,t)}};const a=r.createGain();let c;a.connect(r.destination),i.connect(a),a.gain.value=1,t&&(c=t((e=>{a.gain.value=e})));const l=()=>{null!==r&&"suspended"===r.state&&r.resume()};return document.addEventListener("pointerdown",l,{once:!0}),document.addEventListener("keydown",l,{once:!0}),()=>{e.events().onSoundPush((()=>{})),null!==r&&(i.disconnect(),a.disconnect(),r.close().catch(console.error),r=null),void 0!==c&&c(),document.removeEventListener("pointerdown",l),document.removeEventListener("keydown",l)}}(e,(e=>{let n=1;const r=()=>{const r=t.getState().dos.volume;Math.abs(n-r)>=.05&&(e(r),n=r)};return t.subscribe(r)}));return n}),[e])}(t)}const Sa="/b4b5275904d86a4ab8a20917b2b7e34f0df47bf7.jsdos";function Ca(e){const t=e.ci,n=on((e=>e.dos.backend)),r=on((e=>e.dos.worker)),[o,i]=ie({runs:0,time:0,vax:0,pc:null}),[s,a]=ie({sleepPerSec:0,cyclesPerMs:0});return ae((()=>{const e=[];t.events().onStdout((t=>{for(const n of e)n(t)}));const n=t.events().onStdout;t.events().onStdout=t=>{e.push(t)};let r=Date.now(),o=0,s=0;return t.events().onStdout((e=>{if(!e.startsWith("dhry2:"))return;t.asyncifyStats().then((e=>{const t=Date.now()-r;a({sleepPerSec:Math.round(1e3*(e.sleepCount-o)/t),cyclesPerMs:Math.round((e.cycles-s)/t)}),r=Date.now(),o=e.sleepCount,s=e.cycles}));const[n,c,l,u]=e.split(" "),d=Number.parseInt(c),f=Number.parseFloat(l),h=Number.parseFloat(u);i(f>=5e3?{runs:d,time:Math.round(10*f)/10,vax:Math.round(100*h)/100,pc:Pa(h)}:{runs:d,time:Math.round(10*f)/10,vax:Math.round(100*h)/100,pc:null})})),()=>{t.events().onStdout=n}}),[t]),Yo("div",{class:"dhry2-window",children:[Yo("div",{class:"title",children:"Dhrystone 2 Benchmark"}),Yo("div",{class:"backend",children:["Backend: ",n+"-"+(r?"worker":"direct")]}),Yo("div",{class:"results",children:[Yo("div",{children:"VAX:"}),Yo("div",{children:o.vax}),Yo("div",{children:"Cycles p/ms:"}),Yo("div",{children:s.cyclesPerMs}),Yo("div",{children:"Sleep p/sec:"}),Yo("div",{children:s.sleepPerSec}),Yo("div",{children:"Runs:"}),Yo("div",{children:o.runs}),Yo("div",{children:"Time:"}),Yo("div",{children:[o.time," ",Yo("span",{children:"ms"})]}),null!==o.pc&&Yo("div",{children:"PC:"}),null!==o.pc&&Yo("div",{children:o.pc??"..."})]})]})}function Pa(e){let t=0;for(;2*t+1<Ea.length&&!(Ea[2*t+1]>=e);)t++;return t=Math.min(Ea.length/2-1,t),(Ea[2*t]+"").trim()}const Ea=["AMD 80386 40MHz",13.7,"IBM 486D2 50MHz",22.4,"80486 DX2 66MHz",35.3,"IBM 486BL 100MHz",40.9,"AMD 5X86 133MHz",84.5,"Pentium 75MHz",87.1,"Cyrix P150 120MHz",160,"Pentium 100MHz",122,"Cyrix PP166 133MHz",180,"IBM 6x86 150MHz",188,"Pentium 133MHz",181,"Pentium 166MHz",189,"Cyrix PR233 188MHz",232,"Pentium 200MHz",269,"Pentium MMX 200MHz",276,"AMD K6 200MHz",289,"Pentium Pro 200MHz",312,"Celeron A 300MHz",484,"Pentium II 300MHz",477,"AMD K62 500MHz",606,"AMD K63 450MHz",645,"Pentium II 450MHz",713,"Celeron A 450MHz",720,"Pentium III 450MHz",722,"Pentium III 600MHz",959,"Athlon 600MHz",942,"Duron 600MHz",999,"Pentium III 1000MHz",1595,"PIII Tualatin 1200MHz",1907,"Pentium 4 1700MHz",1843,"Athlon Tbird 1000MHz",1659,"Duron 1000MHz",1674,"Celeron M 1295MHz",2273,"Atom 1600MHz",1828,"Pentium 4 1900MHz",2003,"Atom 1666MHz",1948,"P4 Xeon 2200MHz",2265,"Atom Z8300 1840MHz",2686,"Athlon 4 1600MHz",2830,"Pentium M 1862MHz",3933,"Ath4 Barton 1800MHz",3172,"Pentium 4E 3000MHz",3553,"Athlon XP 2080MHz",3700,"Turion 64 M 1900MHz",3742,"Pentium 4 3066MHz",4012,"Opteron 1991MHz",3985,"Core 2 Duo M 1830MHz",4952,"Athlon XP 2338MHz",4160,"Athlon 64 2150MHz",4288,"Pentium 4 3678MHz",4227,"Athlon 64 2211MHz",4462,"Celeron C2 M 2000MHz",5275,"Core 2 Duo 1 CP 2400MHz",6446,"Core i5 2467M 2300MHz",4752,"Phenom II 1 CP 3000MHz",7615,"Core i7 930 3066MHz",8684,"Core i7 860 3460MHz",9978,"Core i7 3930K 3800MHz",11197,"Core i7 4820K 3900MHz",11867,"Core i7 4820K 3900MHz",11978,"Core i7 3930K",13877],Oa=Symbol("newer"),ja=Symbol("older");class Aa{constructor(e,t){"number"!=typeof e&&(t=e,e=0),this.size=0,this.limit=e,this.oldest=this.newest=void 0,this._keymap=new Map,t&&(this.assign(t),e<1&&(this.limit=this.size))}_markEntryAsUsed(e){e!==this.newest&&(e[Oa]&&(e===this.oldest&&(this.oldest=e[Oa]),e[Oa][ja]=e[ja]),e[ja]&&(e[ja][Oa]=e[Oa]),e[Oa]=void 0,e[ja]=this.newest,this.newest&&(this.newest[Oa]=e),this.newest=e)}assign(e){let t,n=this.limit||Number.MAX_VALUE;this._keymap.clear();const r=e[Symbol.iterator]();for(let o=r.next();!o.done;o=r.next()){const e=new Ma(o.value[0],o.value[1]);if(this._keymap.set(e.key,e),t?(t[Oa]=e,e[ja]=t):this.oldest=e,t=e,0==n--)throw new Error("overflow")}this.newest=t,this.size=this._keymap.size}get(e){const t=this._keymap.get(e);if(t)return this._markEntryAsUsed(t),t.value}set(e,t){let n=this._keymap.get(e);return n?(n.value=t,this._markEntryAsUsed(n),this):(this._keymap.set(e,n=new Ma(e,t)),this.newest?(this.newest[Oa]=n,n[ja]=this.newest):this.oldest=n,this.newest=n,++this.size,this.size>this.limit&&this.shift(),this)}shift(){const e=this.oldest;if(e)return this.oldest[Oa]?(this.oldest=this.oldest[Oa],this.oldest[ja]=void 0):(this.oldest=void 0,this.newest=void 0),e[Oa]=e[ja]=void 0,this._keymap.delete(e.key),--this.size,[e.key,e.value]}}function Ma(e,t){this.key=e,this.value=t,this[Oa]=void 0,this[ja]=void 0}class Ra{constructor(e,t,n){this.aheadRange=t,this.sectorSize=e,this.lru=new Aa(Math.floor(n/(t*e)))}read(e,t){const n=this.getOrigin(e),r=this.lru.get(n);if(r){if(t)return r;{const t=e-n;return r.slice(t*this.sectorSize,(t+1)*this.sectorSize)}}return null}write(e,t){const n=this.getOrigin(e),r=this.lru.get(n);return r&&r.set(t,(e-n)*this.sectorSize),void 0!==r}create(e,t){this.lru.set(e,t.slice(0))}getOrigin(e){return e-e%this.aheadRange}memUsed(){return this.lru.size*this.aheadRange*this.sectorSize}}const Ta=67108864;class Na{constructor(e,t,n,r,o,i,s=!0,a=!1){this.socket=Promise.resolve(null),this.aheadRange=0,this.aheadSize=0,this.maxRead=0,this.readBuffer=new Uint8Array(0),this.readAheadBuffer=new Uint8Array(0),this.readAheadPos=0,this.readAheadCompressed=0,this.readStartedAt=0,this.decodeBuffer=new Uint8Array(0),this.cache=null,this.cleanup=()=>{},this.openFn=(e,t,n,r,o)=>{},this.preloadProgressFn=e=>{},this.errorFn=e=>{},this.preloadQueue=[],this.readOnly=!1,this.sectorSize=512,this.module=i,this.endpoint=e,this.owner=t,this.drive=n,this.token=r,this.request=null,this.pendingRequest=null,this.writeBuffer=new Uint8Array(5+this.sectorSize),this.stats=o,this.retries=3,this.preloadSectors=s,this.originReadMode=a,this.reconnect()}onError(e){this.errorFn=e}onOpen(e){this.openFn=e}onPreloadProgress(e){this.preloadProgressFn=e}reconnect(){this.socket=new Promise(((e,t)=>{const n=new WebSocket(this.endpoint);n.binaryType="arraybuffer";const r=this.onMessage.bind(this),o=()=>{const o=i=>{if(n.removeEventListener("message",o),i.data.startsWith("write")||i.data.startsWith("read")){const[o,s,a]=i.data.split(","),c=Number.parseInt(s);this.aheadRange=c,this.aheadSize=c*this.sectorSize,this.maxRead=Math.floor(1048576/this.aheadSize);const l=this.aheadSize*this.maxRead;this.readBuffer=new Uint8Array(5+4*this.maxRead),this.readAheadBuffer=new Uint8Array(l),this.decodeBuffer=new Uint8Array(l),this.cache=new Ra(this.sectorSize,c,Ta);let u=0,d=0,f=new Uint8Array(0);const h=i=>{let s=new Uint8Array(i.data);if(0===u&&(u=s[0]+(s[1]<<8)+(s[2]<<16)+(s[3]<<24),f=new Uint8Array(u-4),s=s.slice(4)),d<u&&(f.set(s,d),d+=s.length),d>f.length){const e=new Error("Preload buffer is bigger then expected");this.errorFn(e),t(e)}else if(d==f.length){if(this.preloadQueue=[],this.preloadSectors)for(let e=0;e<f.length;e+=4)this.preloadQueue.push(f[e]+(f[e+1]<<8)+(f[e+2]<<16)+(f[e+3]<<24));n.removeEventListener("message",h),n.addEventListener("message",r),this.readOnly="write"!==o,this.openFn(!0,!this.readOnly,1024*(Number.parseInt(a)??2097152),this.preloadQueue,c),e(n),this.preloadQueue.length>0&&(this.preloadQueue.length*this.aheadSize>Ta&&(console.log("WARN! preloadQueue size is bigger then allowed",this.preloadQueue.length*this.aheadSize/1024/1024,">",64),this.preloadQueue=this.preloadQueue.slice(0,Math.floor(Ta/this.aheadSize))),this.request=this.makeReadRequest(this.preloadQueue.shift()),this.executeRequest(this.request))}};n.addEventListener("message",h)}else{const e=new Error(i.data??"Unable to establish connection");this.errorFn(e),t(e)}};n.addEventListener("message",o),n.send(this.owner+"&"+this.drive+"&"+this.token)},i=e=>{if(console.error("Network error",e,"will reconnect"),s(),n.close(),this.retries--,0===this.retries){const e=new Error("Network problem");this.errorFn(e),t(e)}else setTimeout(this.reconnect.bind(this),300)};n.addEventListener("error",i),n.addEventListener("open",o);const s=function(){n.removeEventListener("message",r),n.removeEventListener("open",o),n.removeEventListener("error",i)};this.cleanup=s})),null!==this.request&&this.executeRequest(this.request)}makeReadRequest(e,t=-1,n=(()=>{})){const r=[e];if(this.preloadQueue.length>0){for(this.preloadProgressFn(this.preloadQueue.length*this.aheadSize);this.preloadQueue.length>0&&r.length<this.maxRead;){const t=this.preloadQueue.shift();t!==e&&r.push(t)}for(let t=0;t<this.preloadQueue.length;++t)if(this.preloadQueue[t]==e){this.preloadQueue.splice(t,1);break}}return{type:1,sectors:r,buffer:t,resolve:n}}read(e,t,n){const r=this.cache.read(e,this.originReadMode);return null!==r?(this.stats.cacheHit++,this.module.HEAPU8.set(r,t),n?0:Promise.resolve(0)):n?255:new Promise((n=>{this.stats.cacheMiss++;const r=this.makeReadRequest(e,t,n);null!==this.request?null===this.pendingRequest?this.pendingRequest=r:(console.error("New read request while old one is still processed"),n(3)):(this.request=r,this.executeRequest(this.request))}))}write(e,t){const n={type:2,sectors:[e],buffer:this.module.HEAPU8.slice(t,t+this.sectorSize),resolve:()=>{}};return this.cache.write(e,n.buffer),this.executeRequest(n),0}async close(){const e=await this.socket;await new Promise((t=>{const n=setInterval((()=>{0===e.bufferedAmount&&(clearInterval(n),t())}),32)})),this.cleanup(),e.close()}executeRequest(e){this.socket.then((t=>{if(1===e.type){const{sectors:n}=e;this.readStartedAt=Date.now(),this.readAheadPos=0,this.readAheadCompressed=0,this.readBuffer[0]=1,this.readBuffer[1]=255&n.length,this.readBuffer[2]=n.length>>8&255,this.readBuffer[3]=n.length>>16&255,this.readBuffer[4]=n.length>>24&255;for(let t=0;t<n.length;++t){const r=this.cache.getOrigin(n[t]);if(t>0&&r!==n[t])return console.error("Assertion failed orign should equal to sector",r,n[t]),void e.resolve(5);this.readBuffer[5+4*t]=255&r,this.readBuffer[5+4*t+1]=r>>8&255,this.readBuffer[5+4*t+2]=r>>16&255,this.readBuffer[5+4*t+3]=r>>24&255}t.send(this.readBuffer.slice(0,4*n.length+5).buffer)}else if(this.readOnly)e.resolve(0);else{const{sectors:n,buffer:r,resolve:o}=e;this.stats.write+=this.sectorSize,this.writeBuffer[0]=2,this.writeBuffer[1]=255&n[0],this.writeBuffer[2]=n[0]>>8&255,this.writeBuffer[3]=n[0]>>16&255,this.writeBuffer[4]=n[0]>>24&255,this.writeBuffer.set(r,5),t.send(this.writeBuffer.buffer),o(0)}}))}onMessage(e){if(null===this.request)console.error("Received message without request"),this.reconnect();else if(2===this.request.type)console.error("Received read payload while write request"),this.reconnect();else if(e.data instanceof ArrayBuffer){let t=new Uint8Array(e.data);0===this.readAheadCompressed&&(this.readAheadCompressed=t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24),t=t.slice(4));const{sectors:n,buffer:r,resolve:o}=this.request,i=this.readAheadCompressed-this.readAheadPos;if(t.byteLength>i||i<0)console.error("wrong read payload length "+t.byteLength+" instead of "+i),o(3);else{this.readAheadBuffer.set(t,this.readAheadPos),this.readAheadPos+=t.byteLength;const e=this.aheadSize*n.length;if(this.readAheadPos==this.readAheadCompressed){let t=e;if(this.readAheadCompressed<e){const n=function(e,t,n,r){let o,i,s;for(n=n||0,r=r||e.length-n,o=n,i=r,s=0;o<i;){const n=e[o++];let r=n>>4;if(r>0){let n=r+240;for(;255===n;)n=e[o++],r+=n;const a=o+r;for(;o<a;)t[s++]=e[o++];if(o===i)return s}const a=e[o++]|e[o++]<<8;if(0===a)return s;if(a>s)return-(o-2);let c=15&n,l=c+240;for(;255===l;)l=e[o++],c+=l;let u=s-a;const d=s+c+4;for(;s<d;)t[s++]=t[u++]}return s}(this.readAheadBuffer,this.decodeBuffer,0,this.readAheadCompressed);n<0?t=n:this.readAheadBuffer.set(this.decodeBuffer.slice(0,e),0)}if(t!=e)console.error("wrong decode result "+t+" should be "+e),o(4);else{for(let e=0;e<n.length;++e){const t=e*this.aheadSize,o=n[e],i=this.cache.getOrigin(o);if(this.cache.create(i,this.readAheadBuffer.slice(t,t+this.aheadSize)),0==e&&r>=0){if(this.originReadMode&&o!==i)throw new Error("Sector must be one of origins in originReadMode");const e=(o-i)*this.sectorSize;this.module.HEAPU8.set(this.readAheadBuffer.slice(e,e+(this.originReadMode?this.aheadRange:1)*this.sectorSize),r)}}this.stats.cacheUsed=this.cache.memUsed(),this.stats.read+=this.readAheadCompressed,this.stats.readTotalTime+=Date.now()-this.readStartedAt,this.request=null,o(0),null!==this.pendingRequest?(this.request=this.pendingRequest,this.pendingRequest=null,this.executeRequest(this.request)):this.preloadQueue.length>0&&(this.request=this.makeReadRequest(this.preloadQueue.shift()),this.executeRequest(this.request))}}}}else console.error("Received non arraybuffer data"),this.reconnect()}}const za=new TextDecoder,Ua=new TextEncoder,Ia=2e8,La={};["wc-install","wc-run","wc-pack-fs-to-bundle","wc-add-key","wc-mouse-move","wc-mouse-button","wc-mouse-sync","wc-exit","wc-sync-sleep","wc-pause","wc-resume","wc-mute","wc-unmute","wc-connect","wc-disconnect","wc-backend-event","wc-asyncify-stats","wc-fs-tree","wc-fs-get-file","wc-send-data-chunk"].forEach(((e,t)=>La[e]=t));const Ba={};["ws-extract-progress","ws-ready","ws-server-ready","ws-frame-set-size","ws-update-lines","ws-log","ws-warn","ws-err","ws-stdout","ws-exit","ws-persist","ws-sound-init","ws-sound-push","ws-config","ws-sync-sleep","ws-connected","ws-disconnected","ws-asyncify-stats","ws-fs-tree","ws-send-data-chunk"].forEach(((e,t)=>Ba[t]=e));class Da{constructor(e,n){t(this,"socket"),t(this,"sessionId",Date.now()+""),t(this,"hardware"),t(this,"onInit",(()=>{})),t(this,"cycles",0),t(this,"sockdrive",function(e,t,n){let r=0;const o={},i={},s={},a={read:0,write:0,readTotalTime:0,cacheHit:0,cacheMiss:0,cacheUsed:0};return{stats:a,open:async(c,l,u,d)=>{const f=await fetch(c.replace("wss://","https://").replace("ws://","http://")+"/template/"+l+"/"+u),h=await f.json();if(h.error)throw new Error(h.error);r++,i[r]={name:h.name,size:h.size??0,heads:h.heads??1,cylinders:h.cylinders??520,sectors:h.sectors??63,sectorSize:h.sector_size??512};const p=i[r].sectorSize,v={HEAPU8:new Uint8Array(0)};return o[r]=new Na(c,l,u,d,a,v,!0,!0),new Promise(((i,a)=>{const c=l+"/"+u;o[r].onOpen(((t,n,o,a,l)=>{s[r]=new Uint8Array(p+p*l),v.HEAPU8=s[r],e(c,t,n,o,a),i({handle:r,aheadRange:l})})),o[r].onPreloadProgress((e=>{n(c,e)})),o[r].onError((e=>{t(e),a(e)}))}))},read:async(e,t)=>{if(o[e]){const n=i[r].sectorSize;let a=o[e].read(t,n,!0);return(a=255)&&(a=await o[e].read(t,n,!1)),{code:a,buffer:s[e].slice(n)}}return console.error("ERROR! sockdrive handle",e,"not found"),Promise.resolve({code:1})},write:(e,n,r)=>r.byteLength!=i[e].sectorSize?(t(new Error("sockdrive write buffer size "+r.byteLength+" != sector size "+i[e].sectorSize)),1):o[e]?(s[e].set(r,0),o[e].write(n,0)):(console.error("ERROR! sockdrive handle",e,"not found"),1),close:e=>{o[e]&&(o[e].close(),delete s[e],delete i[e],delete o[e])},template:e=>i[e]}}(this.onSockdriveOpen.bind(this),this.onSockdriveError.bind(this),this.onSockdrivePreloadProgress.bind(this))),t(this,"handler",(()=>{})),this.socket=e,this.socket.addEventListener("error",(e=>{this.handler("ws-err",{tag:"ws",message:e.message??"Unknown transport layer error"}),this.handler("ws-exit",{}),this.socket.close()})),this.socket.addEventListener("message",(async e=>{const t=e.data;this.onMessage(new Uint8Array(await t.arrayBuffer()))})),this.sendMessageToSocket("wc-install"),this.hardware=null,this.onInit=n}writeUint32(e,t,n){return e[n]=255&t,e[n+1]=(65280&t)>>8,e[n+2]=(16711680&t)>>16,e[n+3]=(4278190080&t)>>24,n+4}readUint32(e,t){return 255&e[t]|e[t+1]<<8&65280|e[t+2]<<16&16711680|e[t+3]<<24&4278190080}readUint64(e,t){return this.readUint32(e,t)+this.readUint32(e,t+4)*2**32}sendMessageToSocket(e,...t){let n=1;for(const i of t)n+=4+((null==i?void 0:i.length)??0);const r=new Uint8Array(n);r[0]="string"==typeof e?La[e]:e;let o=1;for(const i of t)this.writeUint32(r,(null==i?void 0:i.length)??0,o),o+=4,i&&(r.set(i,o),o+=i.length);this.socket.send(r)}readMessage(e){const t=[];let n=1;for(;n+4<=e.length;){const r=this.readUint32(e,n);if(n+=4,n+r>e.length)throw new Error("read_message out of bounds");t.push(e.slice(n,n+r)),n+=r}return{id:e[0],payload:t}}onMessage(e){var t;const{id:n,payload:r}=this.readMessage(e),o=Ba[n];switch(o){case"ws-ready":this.onInit(r&&r[0]&&r.length>0?r[0][0]:0),this.handler(o,{});break;case"ws-server-ready":case"ws-exit":"ws-server-ready"!==o&&this.handler(o,{});break;case"ws-stdout":case"ws-log":case"ws-warn":case"ws-err":this.handler(o,{tag:za.decode(r[0]),message:za.decode(r[1])});break;case"ws-send-data-chunk":{const e={type:za.decode(r[0]),name:za.decode(r[1]),data:r[2]};this.handler(o,{chunk:e})}break;case"ws-config":this.handler(o,{dosboxConf:r[0],jsdosConf:za.decode(r[1])});break;case"ws-sound-init":this.handler(o,{freq:this.readUint32(r[0],0)}),this.handler("ws-server-ready",{});break;case"ws-sound-push":this.handler(o,{samples:new Float32Array(r[0].buffer)});break;case"ws-frame-set-size":this.handler(o,{width:this.readUint32(r[0],0),height:this.readUint32(r[0],4)});break;case"ws-update-lines":if(r.length>0){const e=[];for(const t of r)e.push({start:this.readUint32(t,0),heapu8:t.slice(4)});this.handler(o,{lines:e})}break;case"ws-asyncify-stats":{this.cycles+=this.readUint32(r[0],0);const e={messageSent:this.readUint32(r[0],4),messageReceived:this.readUint32(r[0],8),messageFrame:this.readUint32(r[0],12),messageSound:this.readUint32(r[0],16),nonSkippableSleepCount:0,sleepCount:0,sleepTime:0,cycles:this.cycles,netSent:0,netRecv:0,driveSent:this.sockdrive.stats.write,driveRecv:this.sockdrive.stats.read,driveRecvTime:this.sockdrive.stats.readTotalTime,driveCacheHit:this.sockdrive.stats.cacheHit,driveCacheMiss:this.sockdrive.stats.cacheMiss,driveCacheUsed:this.sockdrive.stats.cacheUsed};this.handler(o,e)}break;case"ws-connected":this.handler(o,{networkType:r[0][0],address:za.decode(r[1])});break;case"ws-disconnected":this.handler(o,{networkType:r[0][0]});break;case"ws-fs-tree":{let e=function(e){var t;const n=e.split("/");let r=i;for(let o=1;o<n.length-1;++o){const i=n[o];if(r=null==(t=r.nodes)?void 0:t.find((e=>e.name==i)),!r)throw new Error("Unable to find node "+e+", subdir "+i)}return[r,n[n.length-1]]};const n=[];for(let t=0;t<r.length-1;++t)n.push({name:za.decode(r[t]),size:null});const o=r[r.length-1];for(let t=0;t<n.length;++t){const e=this.readUint32(o,4*t);n[t].size=e<0?null:e}const i={name:".",nodes:[],size:null};for(const{name:r,size:s}of n){const[n,o]=e(r);null==(t=n.nodes)||t.push({name:o,size:s,nodes:null===s?[]:null})}this.handler("ws-fs-tree",{fsTree:i})}break;case"ws-persist":this.handler("ws-persist",{bundle:r.length>0?r[0]:null});break;default:void 0===o?(async()=>{switch(n){case 100:{const e=za.decode(r[0]),t=za.decode(r[1]),n=za.decode(r[2]),o=za.decode(r[3]),{handle:i,aheadRange:s}=await this.sockdrive.open(e,t,n,o),a=this.sockdrive.template(i),c=new Uint8Array(28);let l=0;l=this.writeUint32(c,i,l),l=this.writeUint32(c,a.size,l),l=this.writeUint32(c,a.heads,l),l=this.writeUint32(c,a.cylinders,l),l=this.writeUint32(c,a.sectors,l),l=this.writeUint32(c,a.sectorSize,l),this.writeUint32(c,s,l),this.sendMessageToSocket(100,c)}break;case 101:{const e=this.readUint32(r[0],0),t=this.readUint32(r[0],4),n=await this.sockdrive.read(e,t),o=new Uint8Array(4);this.writeUint32(o,n.code,0),this.sendMessageToSocket(101,o,n.buffer??null)}break;case 102:{const e=this.readUint32(r[0],0),t=this.readUint32(r[0],4),n=this.sockdrive.write(e,t,r[1]),o=new Uint8Array(4);this.writeUint32(o,n,0)}break;case 103:this.sockdrive.close(this.readUint32(r[0],0));break;default:console.log("WARN! Unhandled server non standard message",n,r)}})().catch((e=>{this.handler("ws-err",{tag:"panic",message:"sockdrive error: "+(e.message??"???")})})):console.warn("WARN! Unhandled server message",o)}}async sendMessageToServer(e,t){if(void 0===t||(null==t?void 0:t.sessionId)!==this.sessionId)return;const n=La[e];switch(e){case"wc-run":{const e=t.token??"";this.sendMessageToSocket(n,Ua.encode(e))}break;case"wc-send-data-chunk":{const e=t.chunk;this.sendMessageToSocket(n,Ua.encode(e.type),Ua.encode(e.name),e.data?new Uint8Array(e.data):null)}break;case"wc-asyncify-stats":case"wc-fs-tree":this.sendMessageToSocket(n);break;case"wc-add-key":{const e=new Uint8Array(12);let r=0;r=this.writeUint32(e,t.key,r),r=this.writeUint32(e,t.pressed?1:0,r),this.writeUint32(e,t.timeMs,r),this.sendMessageToSocket(n,e)}break;case"wc-mouse-move":{const e=new Uint8Array(15);let r=0;r=this.writeUint32(e,Math.abs(t.x)*Ia,r),r=this.writeUint32(e,Math.abs(t.y)*Ia,r),r=this.writeUint32(e,t.timeMs,r),e[r]=t.relative?1:0,e[r+1]=t.x>=0?0:1,e[r+2]=t.y>=0?0:1,this.sendMessageToSocket(n,e)}break;case"wc-mouse-button":{const e=new Uint8Array(6);e[0]=t.button,e[1]=t.pressed?1:0,this.writeUint32(e,t.timeMs,2),this.sendMessageToSocket(n,e)}break;case"wc-mouse-sync":{const e=new Uint8Array(4);this.writeUint32(e,t.timeMs,0),this.sendMessageToSocket(n,e)}break;case"wc-connect":this.sendMessageToSocket(n,new Uint8Array([t.networkType]),Ua.encode(t.address));break;case"wc-pack-fs-to-bundle":this.sendMessageToSocket(n,new Uint8Array([t.onlyChanges?1:0]));break;default:console.log("Unhandled client message (wc):",e,n,t)}}initMessageHandler(e){this.handler=(t,n)=>{n.sessionId=this.sessionId,e(t,n)}}exit(){this.sendMessageToSocket("wc-exit")}onSockdriveOpen(e,t,n,r,o){this.handler("ws-log",{tag:"worker",message:"sockdrive: "+e+", read="+t+", write="+n+", imageSize="+Math.round(r/1024/1024)+"Mb, preloadQueue="+o.length})}onSockdriveError(e){this.handler("ws-err",{tag:"panic",message:e.message??"unable to open sockdrive"})}onSockdrivePreloadProgress(e,t){this.handler("ws-log",{tag:"worker",message:"sockdrive: "+e+", preload="+t})}}function Ha(e){const t=le(null),[n,r]=ie(null),o=on((e=>e.dos.sockdriveWrite)),i=on((e=>{var t;return null==(t=e.auth.account)?void 0:t.token.access_token})),s=o?i:void 0,a=on((e=>e.dos.worker)),c=on((e=>e.dos.backend)),l=on((e=>e.dos.backendHardware)),u=tr(),d=Ii();return ae((()=>{try{const e=null!==d.loadedBundle.bundleChanges?[d.loadedBundle.bundle,d.loadedBundle.bundleChanges]:d.loadedBundle.bundle;d.loadedBundle.bundle=null,d.loadedBundle.bundleChanges=null;const t=(async()=>{if(l&&d.options.backendHardware){const r=await d.options.backendHardware(c);if(null!==r)return emulators.backend(e,await(t=r,n=e=>{e<ci&&u(Ko.actions.updateWsWarning(!0)),console.log("wsServer:",e," expected:",ci)},new Promise((e=>{let r=!1;const o=setInterval((()=>{if(r)return;r=!0;const i=new WebSocket(t),s=()=>{clearInterval(o),console.log("Connected to",t),e(new Da(i,n))};i.addEventListener("error",(e=>{console.error("Can't conect to ",t,e),i.removeEventListener("open",s),i.close(),r=!1})),i.addEventListener("open",s)}),1e3)}))),{token:s})}var t,n;return emulators[c+(a?"Worker":"Direct")](e,{token:s})})();return t.then((e=>{r(e),u(_i.actions.ci(!0)),d.ci=e,Li(d,"ci-ready",e),window.ci=e})).catch((e=>u(_i.actions.emuError(e.message)))),()=>{t.then((e=>{u(_i.actions.ci(!1)),d.ci=null,e.exit()}))}}catch(e){u(_i.actions.emuError(e.message))}}),[a,c,s??null]),Yo("div",{class:"bg-black h-full flex-grow overflow-hidden relative",children:[Yo("canvas",{ref:t}),t.current&&n&&Yo(Fa,{canvas:t.current,ci:n})]})}function Fa(e){const{canvas:t,ci:n}=e,r=on((e=>e.dos.bundle));return xa(t,n),Yo(y,{children:(null==r?void 0:r.endsWith(Sa))&&Yo(Ca,{ci:n})})}function qa(e){const t=Ci(),n=e.error??"Unexpected error";return Yo("div",{class:"flex-grow flex flex-col items-center justify-center px-8 m-auto",children:[Yo("div",{class:"text-2xl text-center",children:t("error")}),Yo("div",{class:"text-red-400 mt-8 text-2xl text-center",children:['"',n,'"']}),Yo("div",{class:"mt-8 text-sm text-center",children:t("consult_logs")}),e.onSkip&&Yo("button",{class:"mt-8 btn-primary",onClick:e.onSkip,children:t("skip")})]})}function Wa(){return Yo(qa,{error:on((e=>e.dos.error))})}function $a(e){const{head:t,message:n}=e;return Yo("div",{class:"flex flex-col items-center justify-center frame-color px-8",children:[Yo("div",{class:"text-2xl text-center",children:t}),Yo("div",{class:"mt-2 text-center",children:n})]})}function Va(e){return e<1024?e+"b":(e/=1024)<1024?Math.round(e)+"kb":(e/=1024,Math.round(10*e)/10+"mb")}function Xa(){const e=Ci(),t=on((e=>e.dos.step)),n=on((e=>e.storage.recived)),r=on((e=>e.storage.total)),o=on((e=>e.storage.ready));let i=e("loading"),s="100%";switch(t){case"bnd-load":i=e("bundle_loading"),n>0&&(s=`${Va(n)} / ${Va(r)}`,r>0&&(s+=` (${Math.round(1e3*n/r)/10}%)`));break;case"bnd-config":i=e("bundle_config")}return Yo("div",{class:"flex flex-col w-full h-full items-center justify-center",children:[Yo($a,{head:i,message:s}),"bnd-load"===t&&o&&Yo(Ka,{})]})}function Ka(){const e=Ci(),t=tr();return Yo(y,{children:[Yo("div",{class:"mt-16 text-2xl",children:e("loading_saves")}),Yo("div",{onClick:function(){t(Hi.actions.ready())},class:"self-center cursor-pointer underline mt-4 text-lg animate-pulse",children:e("account_not_ready")})]})}function Qa(){const e=on((e=>e.auth.account)),t=on((e=>e.dos.emuVersion)),n=tr(),r=Ci();function o(){Qo(e,n)}return Yo("div",{class:"pre-run-window",children:[Yo(Ga,{class:"mb-8"}),null===e&&Yo("div",{class:"flex flex-row mb-4 -mt-4 items-center",children:[Yo("div",{class:"btn btn-accent",onClick:o,children:[Yo("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",class:"w-6 h-6",children:Yo("path",{"fill-rule":"evenodd",d:"M7.5 6a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM3.751 20.105a8.25 8.25 0 0 1 16.498 0 .75.75 0 0 1-.437.695A18.683 18.683 0 0 1 12 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 0 1-.437-.695Z","clip-rule":"evenodd"})}),r("please_login")]}),Yo("div",{class:"ml-2 cursor-pointer",onClick:function(){window.open("https://js-dos.com/cloud-overview.html","_blank")},children:Yo("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-6 h-6",children:Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"})})})]}),e&&Yo("div",{class:"flex flex-row mb-4 -mt-4 items-center",children:Yo("div",{class:"btn btn-ghost",onClick:o,children:[Yo("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",class:"w-6 h-6",children:Yo("path",{"fill-rule":"evenodd",d:"M7.5 6a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM3.751 20.105a8.25 8.25 0 0 1 16.498 0 .75.75 0 0 1-.437.695A18.683 18.683 0 0 1 12 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 0 1-.437-.695Z","clip-rule":"evenodd"})}),e.name??e.email]})}),Yo("div",{class:"flex flex-row flex-wrap justify-end",children:[Yo("div",{class:"flex flex-col items-end",children:[Yo(ms,{}),Yo(bs,{}),Yo(Is,{})]}),Yo("div",{class:"ml-10 flex flex-col items-end",children:[Yo(Us,{}),Yo(zs,{}),Yo(_s,{}),Yo(Ts,{})]})]}),Yo(Bs,{class:"mt-4 w-full max-w-sm"}),Yo(Ds,{class:"w-full max-w-sm"}),Yo("div",{class:"text-center mt-8",children:["jsdos/emu version: ",Yo("span",{class:"text-ellipsis overflow-hidden",children:["8.1.8","/",t]})]})]})}function Ga(e){const t=on((e=>e.editor.configChanged)),n=on((e=>e.editor.bundleConfig)),r=Ii(),o=tr();return Yo("div",{class:e.class+" cursor-pointer",onClick:async function(){var e;if(t){const t=n,s=null==(e=r.loadedBundle)?void 0:e.bundle;if(null===s||null===t||!ArrayBuffer.isView(s))throw new Error("Unexpected behaviour (internal state is broken), bundle is null");try{r.loadedBundle.bundle=await emulators.bundleUpdateConfig(s,t),o(_i.actions.bndPlay({}))}catch(i){o(_i.actions.bndError(i.message??"unexpected error"))}}else o(_i.actions.bndPlay({}))},children:Yo("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-48 h-48 play-button",children:[Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.91 11.672a.375.375 0 010 .656l-5.603 3.113a.375.375 0 01-.557-.328V8.887c0-.286.307-.466.557-.327l5.603 3.112z"})]})})}const Ya=document.createElement("input");function Za(){const e=Ci(),t=Jn(),[n,r]=ie(!1);if(n)return Yo("div",{class:"select-window overflow-hidden flex-grow flex flex-col items-center justify-center px-8 py-8",children:Yo(Ja,{})});return Yo("div",{class:"select-window overflow-hidden flex-grow flex flex-col items-center justify-center px-8",children:[Yo("div",{class:"mb-4 text-center underline cursor-pointer hover:text-accent",onClick:()=>r(!0),children:e("load_by_url")}),Yo(ec,{}),Yo("div",{class:"mt-4 text-center",children:e("upload_file")}),Yo("div",{class:"mt-4 text-center underline cursor-pointer hover:text-accent",onClick:async function(){try{await async function(e){await os("empty.jsdos",(async()=>(await emulators.bundle()).toUint8Array())(),null,null,e),e.dispatch(Ko.actions.frameConf()),e.dispatch(Ko.actions.setEditor(!0))}(t).catch(console.error)}catch(e){t.dispatch(_i.actions.bndError(e.message??"unexpected error"))}},children:e("create_empty")})]})}function Ja(){const e=Ci(),t=Jn(),n=tr(),[r,o]=ie(""),[i,s]=ie(null);return Yo(y,{children:[Yo("div",{class:"form-control w-3/4 mb-4",children:[Yo("label",{class:"label",children:Yo("span",{class:"label-text",children:[e("enter_url"),":"]})}),Yo("input",{type:"text",class:"input w-full input-sm input-bordered",onChange:e=>o(e.currentTarget.value??""),value:r})]}),Yo("div",{class:"mt-4 text-center underline cursor-pointer hover:text-accent",onClick:()=>async function(e){let r;n(Ko.actions.frameNone());try{r=new URL(e)}catch(o){return void s(o.message)}try{await rs(r.toString(),t)}catch(o){n(_i.actions.bndError(o.message??"unexpected error"))}}(r),children:e("load")}),null!==i&&Yo("div",{class:"mt-8 text-center text-error",children:i})]})}function ec(){const e=Jn();async function t(){if(Ya.removeEventListener("change",t),null===Ya.files||0===Ya.files.length)return;const n=Ya.files[0];try{await ns(n,e).catch((t=>e.dispatch(_i.actions.bndError(t.message))))}catch(r){e.dispatch(_i.actions.bndError(r.message??"unexpected error"))}}return Yo("div",{class:"cursor-pointer",onClick:function(){Ya.addEventListener("change",t),Ya.click()},children:Yo("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-48 h-48 play-button",children:Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 13.5l3 3m0 0l3-3m-3 3v-6m1.06-4.19l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})})})}function tc(e){const t="none"!==on((e=>e.ui.frame)),n=on((e=>e.ui.frameXs)),r=on((e=>e.ui.window)),o=on((e=>e.ui.background));let i=Yo(nc,{});switch(r){case"error":i=Yo(Wa,{});break;case"loading":i=Yo(Xa,{});break;case"prerun":i=Yo(Qa,{});break;case"run":i=Yo(Ha,{});break;case"select":i=Yo(Za,{})}return Yo("div",{class:"window absolute w-full h-full bg-base-100",children:[Yo("div",{class:"background-image",style:{backgroundImage:o?"url("+o+")":void 0}}),Yo("div",{class:"relative flex flex-row h-full w-full items-start justify-start overflow-auto",children:[Yo("div",{class:(t?n?"w-24":"w-96":"w-12")+" flex-shrink-0"}),i]})]})}function nc(){return Yo("div",{class:"w-full h-full flex justify-center items-center",children:Yo("div",{class:"radial-progress animate-spin",style:"--value:70;"})})}Ya.type="file";let rc=Ko.getInitialState().wideScreen;function oc(){const e=le(null),t=on((e=>e.ui.theme)),n=tr();return ae((()=>{if(null===e||null===e.current)return;const t=e.current;function r(){const e=t.getBoundingClientRect().width>640;e!==rc&&(rc=e,n(Ko.actions.setWideScreen(rc)))}const o=new ResizeObserver(r);return o.observe(t),window.addEventListener("resize",r),()=>{o.disconnect(),window.removeEventListener("resize",r)}}),[e,n]),Yo("div",{ref:e,class:"w-full h-full relative","data-theme":t,children:[Yo(tc,{}),Yo(Ws,{}),Yo(oa,{}),Yo(Wi,{}),Yo(ic,{}),Yo(sc,{}),Yo(ac,{})]})}function ic(){const e=on((e=>e.ui.toast)),t=on((e=>e.ui.toastIntent)),n=on((e=>e.ui.readOnlyWarning));return null===e?null:Yo("div",{class:"absolute right-10 "+(n?"bottom-32":"bottom-10"),children:Yo("div",{class:"alert alert-"+("panic"===t?"error":t),children:e})})}function sc(){const e=on((e=>e.ui.readOnlyWarning)),t=on((e=>e.auth.account)),n=Ci(),r=tr();if(!e)return null;return Yo("div",{class:"absolute right-10 bottom-10",children:Yo("div",{class:"alert",children:[Yo("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",class:"stroke-info shrink-0 w-6 h-6",children:Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),Yo("span",{children:n("read_only_access")}),Yo("div",{children:[Yo("button",{class:"btn btn-sm btn-primary mr-2",onClick:function(){r(Ko.actions.readOnlyWarning(!1)),Qo(t,r)},children:n("fix")}),Yo("button",{class:"btn btn-sm",onClick:function(){r(Ko.actions.readOnlyWarning(!1))},children:n("close")})]})]})})}function ac(){const e=on((e=>e.ui.updateWsWarning)),t=Ci(),n=tr();if(!e)return null;return Yo("div",{class:"absolute left-20 right-10 top-10 flex justify-center",children:Yo("div",{class:"alert w-auto",children:[Yo("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6 text-error",children:Yo("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})}),Yo("span",{children:t("ws_outdated")}),Yo("div",{children:[Yo("button",{class:"btn btn-sm btn-primary mr-2",onClick:function(){window.open("https://dos.zone/download/","_blank"),n(Ko.actions.updateWsWarning(!1))},children:t("update")}),Yo("button",{class:"btn btn-sm",onClick:function(){n(Ko.actions.updateWsWarning(!1))},children:t("close")})]})]})})}window.Dos=(e,t={})=>{var n,r;const o=function(e){return{root:null,loadedBundle:null,ci:null,cache:new li,options:e}}(t),i=function(e,t){const{storeUid:n,slice:r}=Ri(),o=Uo({reducer:{init:r.reducer,i18n:Si.reducer,auth:Hi.reducer,ui:Ko.reducer,dos:_i.reducer,storage:Pi.reducer,editor:Oi.reducer},middleware:e=>{const t=e();return t.push(Ni),t}});return zi[n]=e,t.sockdriveBackend&&-1===ji.indexOf(t.sockdriveBackend.name)&&(ji.push(t.sockdriveBackend.name),Ai[t.sockdriveBackend.name]={sockdriveEndpoint:"https://"+t.sockdriveBackend.host,sockdriveWssEndpoint:"wss://"+t.sockdriveBackend.host},o.dispatch(Ti.actions.setSockdriveBackendName(t.sockdriveBackend.name))),o}(o,t);"dz.caiiiycuk@gmail.com"!==(null==(n=i.getState().auth.account)?void 0:n.email)&&"caiiiycuk@gmail.com"!==(null==(r=i.getState().auth.account)?void 0:r.email)||i.dispatch(_i.actions.setSockdriveWrite(!1)),function(e,t,n){t.root=e,e.classList.add("jsdos-rso"),e.addEventListener("contextmenu",(e=>{var t;if(null===e.target||!(null==(t=e.target.classList)?void 0:t.contains("contextmenu")))return e.stopPropagation(),e.preventDefault(),!1})),document.addEventListener("fullscreenchange",(()=>{const t=document.fullscreenElement===e;n.dispatch(Ko.actions.setFullScreen(t))}))}(e,o,i);let s="none";function a(e){i.dispatch(Ko.actions.theme(e))}function c(e){i.dispatch(Si.actions.setLang(e))}function l(e){i.dispatch(_i.actions.dosBackend(e))}function u(e){i.dispatch(_i.actions.dosBackendLocked(e))}function d(e){i.dispatch(_i.actions.dosWorker(e))}function f(e){i.dispatch(_i.actions.mouseCapture(e))}function h(e){i.dispatch(_i.actions.setServer(e))}function p(e){i.dispatch(_i.actions.setRoom(e))}function v(e){i.dispatch(Ko.actions.background(e))}function m(e){Vs(e,i)}return i.subscribe((function(){(async()=>{var e;const t=i.getState(),n=t.dos.step;if(n!==s&&(s=n,"emu-ready"===t.dos.step)){const n=null==(e=t.auth.account)?void 0:e.email;if(o.cache=await di(n??"guest"),o.options.url)try{await rs(o.options.url,i)}catch(r){i.dispatch(_i.actions.bndError(r.message))}else o.options.dosboxConf?async function(e,t){const n=Ui(t),r=t.dispatch;n.loadedBundle=null,r(Oi.actions.init(e)),is(e,r),n.loadedBundle={bundleUrl:null,bundleChangesUrl:null,bundle:e,bundleChanges:null},r(_i.actions.bndReady({}))}({dosboxConf:o.options.dosboxConf,jsdosConf:{version:"8"}},i):i.dispatch(Ko.actions.windowSelect());Li(o,"emu-ready")}})().catch(console.error)})),gi(i,t.pathPrefix??"https://v8.js-dos.com/latest/emulators/"),t.theme&&a(t.theme),t.lang&&c(t.lang),t.backend&&l(t.backend),t.backendLocked&&u(t.backendLocked),void 0!==t.workerThread&&d(t.workerThread),void 0!==t.mouseCapture&&f(t.mouseCapture),t.server&&h(t.server),t.room&&p(t.room),t.background&&v(t.background),void 0!==t.fullScreen&&m(t.fullScreen),void 0!==t.loginUrl&&i.dispatch(Hi.actions.setLoginUrl(t.loginUrl)),L(Yo(Yn,{store:i,children:Yo(oc,{})}),e),{setTheme:a,setLang:c,setBackend:l,setBackendLocked:u,setWorkerThread:d,setMouseCapture:f,setServer:h,setRoom:p,setFrame:function(e){i.dispatch(Ko.actions.frameNetwork())},setBackground:v,setFullScreen:m}};
|
|
20
|
+
*/function Xn(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case Tn:switch(e=e.type){case zn:case In:case Un:case Fn:case qn:return e;default:switch(e=e&&e.$$typeof){case Dn:case Bn:case Hn:case $n:case Wn:case Ln:return e;default:return t}}case Nn:return t}}}Mn=Symbol.for("react.module.reference"),Rn.ContextConsumer=Bn,Rn.ContextProvider=Ln,Rn.Element=Tn,Rn.ForwardRef=Hn,Rn.Fragment=zn,Rn.Lazy=$n,Rn.Memo=Wn,Rn.Portal=Nn,Rn.Profiler=In,Rn.StrictMode=Un,Rn.Suspense=Fn,Rn.SuspenseList=qn,Rn.isAsyncMode=function(){return!1},Rn.isConcurrentMode=function(){return!1},Rn.isContextConsumer=function(e){return Xn(e)===Bn},Rn.isContextProvider=function(e){return Xn(e)===Ln},Rn.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Tn},Rn.isForwardRef=function(e){return Xn(e)===Hn},Rn.isFragment=function(e){return Xn(e)===zn},Rn.isLazy=function(e){return Xn(e)===$n},Rn.isMemo=function(e){return Xn(e)===Wn},Rn.isPortal=function(e){return Xn(e)===Nn},Rn.isProfiler=function(e){return Xn(e)===In},Rn.isStrictMode=function(e){return Xn(e)===Un},Rn.isSuspense=function(e){return Xn(e)===Fn},Rn.isSuspenseList=function(e){return Xn(e)===qn},Rn.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===zn||e===In||e===Un||e===Fn||e===qn||e===Vn||"object"==typeof e&&null!==e&&(e.$$typeof===$n||e.$$typeof===Wn||e.$$typeof===Ln||e.$$typeof===Bn||e.$$typeof===Hn||e.$$typeof===Mn||void 0!==e.getModuleId)},Rn.typeOf=Xn;const Kn={notify(){},get:()=>[]};function Qn(e,t){let n,r=Kn,o=0,i=!1;function s(){l.onStateChange&&l.onStateChange()}function a(){o++,n||(n=t?t.addNestedSub(s):e.subscribe(s),r=function(){const e=Kt();let t=null,n=null;return{clear(){t=null,n=null},notify(){e((()=>{let e=t;for(;e;)e.callback(),e=e.next}))},get(){let e=[],n=t;for(;n;)e.push(n),n=n.next;return e},subscribe(e){let r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())}function c(){o--,n&&0===o&&(n(),n=void 0,r.clear(),r=Kn)}const l={addNestedSub:function(e){a();const t=r.subscribe(e);let n=!1;return()=>{n||(n=!0,t(),c())}},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:s,isSubscribed:function(){return i},trySubscribe:function(){i||(i=!0,a())},tryUnsubscribe:function(){i&&(i=!1,c())},getListeners:()=>r};return l}const Gn=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement)?ce:ae;function Yn({store:e,context:t,children:n,serverState:r,stabilityCheck:o="once",noopCheck:i="once"}){const s=de((()=>{const t=Qn(e);return{store:e,subscription:t,getServerState:r?()=>r:void 0,stabilityCheck:o,noopCheck:i}}),[e,r,o,i]),a=de((()=>e.getState()),[e]);Gn((()=>{const{subscription:t}=s;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),a!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[s,a]);return m((t||Zt).Provider,{value:s},n)}function Zn(e=Zt){const t=e===Zt?en:Jt(e);return function(){const{store:e}=t();return e}}const Jn=Zn();function er(e=Zt){const t=e===Zt?Jn:Zn(e);return function(){return t().dispatch}}const tr=er();var nr;function rr(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function or(e){return!!e&&!!e[Wr]}function ir(e){var t;return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===$r}(e)||Array.isArray(e)||!!e[qr]||!!(null===(t=e.constructor)||void 0===t?void 0:t[qr])||dr(e)||fr(e))}function sr(e,t,n){void 0===n&&(n=!1),0===ar(e)?(n?Object.keys:Vr)(e).forEach((function(r){n&&"symbol"==typeof r||t(r,e[r],e)})):e.forEach((function(n,r){return t(r,n,e)}))}function ar(e){var t=e[Wr];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:dr(e)?2:fr(e)?3:0}function cr(e,t){return 2===ar(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function lr(e,t,n){var r=ar(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function ur(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function dr(e){return Br&&e instanceof Map}function fr(e){return Dr&&e instanceof Set}function hr(e){return e.o||e.t}function pr(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=Xr(e);delete t[Wr];for(var n=Vr(t),r=0;r<n.length;r++){var o=n[r],i=t[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function vr(e,t){return void 0===t&&(t=!1),br(e)||or(e)||!ir(e)||(ar(e)>1&&(e.set=e.add=e.clear=e.delete=mr),Object.freeze(e),t&&sr(e,(function(e,t){return vr(t,!0)}),!0)),e}function mr(){rr(2)}function br(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function _r(e){var t=Kr[e];return t||rr(18,e),t}function yr(){return Ir}function gr(e,t){t&&(_r("Patches"),e.u=[],e.s=[],e.v=t)}function wr(e){kr(e),e.p.forEach(Sr),e.p=null}function kr(e){e===Ir&&(Ir=e.l)}function xr(e){return Ir={p:[],l:Ir,h:e,m:!0,_:0}}function Sr(e){var t=e[Wr];0===t.i||1===t.i?t.j():t.g=!0}function Cr(e,t){t._=t.p.length;var n=t.p[0],r=void 0!==e&&e!==n;return t.h.O||_r("ES5").S(t,e,r),r?(n[Wr].P&&(wr(t),rr(4)),ir(e)&&(e=Pr(t,e),t.l||Or(t,e)),t.u&&_r("Patches").M(n[Wr].t,e,t.u,t.s)):e=Pr(t,n,[]),wr(t),t.u&&t.v(t.u,t.s),e!==Fr?e:void 0}function Pr(e,t,n){if(br(t))return t;var r=t[Wr];if(!r)return sr(t,(function(o,i){return Er(e,r,t,o,i,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return Or(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=4===r.i||5===r.i?r.o=pr(r.k):r.o,i=o,s=!1;3===r.i&&(i=new Set(o),o.clear(),s=!0),sr(i,(function(t,i){return Er(e,r,o,t,i,n,s)})),Or(e,o,!1),n&&e.u&&_r("Patches").N(r,n,e.u,e.s)}return r.o}function Er(e,t,n,r,o,i,s){if(or(o)){var a=Pr(e,o,i&&t&&3!==t.i&&!cr(t.R,r)?i.concat(r):void 0);if(lr(n,r,a),!or(a))return;e.m=!1}else s&&n.add(o);if(ir(o)&&!br(o)){if(!e.h.D&&e._<1)return;Pr(e,o),t&&t.A.l||Or(e,o)}}function Or(e,t,n){void 0===n&&(n=!1),!e.l&&e.h.D&&e.m&&vr(t,n)}function jr(e,t){var n=e[Wr];return(n?hr(n):e)[t]}function Ar(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function Mr(e){e.P||(e.P=!0,e.l&&Mr(e.l))}function Rr(e){e.o||(e.o=pr(e.t))}function Tr(e,t,n){var r=dr(t)?_r("MapSet").F(t,n):fr(t)?_r("MapSet").T(t,n):e.O?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:yr(),P:!1,I:!1,R:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=r,i=Qr;n&&(o=[r],i=Gr);var s=Proxy.revocable(o,i),a=s.revoke,c=s.proxy;return r.k=c,r.j=a,c}(t,n):_r("ES5").J(t,n);return(n?n.A:yr()).p.push(r),r}function Nr(e){return or(e)||rr(22,e),function e(t){if(!ir(t))return t;var n,r=t[Wr],o=ar(t);if(r){if(!r.P&&(r.i<4||!_r("ES5").K(r)))return r.t;r.I=!0,n=zr(t,o),r.I=!1}else n=zr(t,o);return sr(n,(function(t,o){r&&function(e,t){return 2===ar(e)?e.get(t):e[t]}(r.t,t)===o||lr(n,t,e(o))})),3===o?new Set(n):n}(e)}function zr(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return pr(e)}nr=Vt.useSyncExternalStoreWithSelector,tn=nr,Xt=pt;var Ur,Ir,Lr="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Br="undefined"!=typeof Map,Dr="undefined"!=typeof Set,Hr="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Fr=Lr?Symbol.for("immer-nothing"):((Ur={})["immer-nothing"]=!0,Ur),qr=Lr?Symbol.for("immer-draftable"):"__$immer_draftable",Wr=Lr?Symbol.for("immer-state"):"__$immer_state",$r=""+Object.prototype.constructor,Vr="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,Xr=Object.getOwnPropertyDescriptors||function(e){var t={};return Vr(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},Kr={},Qr={get:function(e,t){if(t===Wr)return e;var n,r,o,i=hr(e);if(!cr(i,t))return n=e,(o=Ar(i,t))?"value"in o?o.value:null===(r=o.get)||void 0===r?void 0:r.call(n.k):void 0;var s=i[t];return e.I||!ir(s)?s:s===jr(e.t,t)?(Rr(e),e.o[t]=Tr(e.A.h,s,e)):s},has:function(e,t){return t in hr(e)},ownKeys:function(e){return Reflect.ownKeys(hr(e))},set:function(e,t,n){var r=Ar(hr(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=jr(hr(e),t),i=null==o?void 0:o[Wr];if(i&&i.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(ur(n,o)&&(void 0!==n||cr(e.t,t)))return!0;Rr(e),Mr(e)}return e.o[t]===n&&(void 0!==n||t in e.o)||Number.isNaN(n)&&Number.isNaN(e.o[t])||(e.o[t]=n,e.R[t]=!0),!0},deleteProperty:function(e,t){return void 0!==jr(e.t,t)||t in e.t?(e.R[t]=!1,Rr(e),Mr(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=hr(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){rr(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){rr(12)}},Gr={};sr(Qr,(function(e,t){Gr[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Gr.deleteProperty=function(e,t){return Gr.set.call(this,e,t,void 0)},Gr.set=function(e,t,n){return Qr.set.call(this,e[0],t,n,e[0])};var Yr=function(){function e(e){var t=this;this.O=Hr,this.D=!0,this.produce=function(e,n,r){if("function"==typeof e&&"function"!=typeof n){var o=n;n=e;var i=t;return function(e){var t=this;void 0===e&&(e=o);for(var r=arguments.length,s=Array(r>1?r-1:0),a=1;a<r;a++)s[a-1]=arguments[a];return i.produce(e,(function(e){var r;return(r=n).call.apply(r,[t,e].concat(s))}))}}var s;if("function"!=typeof n&&rr(6),void 0!==r&&"function"!=typeof r&&rr(7),ir(e)){var a=xr(t),c=Tr(t,e,void 0),l=!0;try{s=n(c),l=!1}finally{l?wr(a):kr(a)}return"undefined"!=typeof Promise&&s instanceof Promise?s.then((function(e){return gr(a,r),Cr(e,a)}),(function(e){throw wr(a),e})):(gr(a,r),Cr(s,a))}if(!e||"object"!=typeof e){if(void 0===(s=n(e))&&(s=e),s===Fr&&(s=void 0),t.D&&vr(s,!0),r){var u=[],d=[];_r("Patches").M(e,s,u,d),r(u,d)}return s}rr(21,e)},this.produceWithPatches=function(e,n){if("function"==typeof e)return function(n){for(var r=arguments.length,o=Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return t.produceWithPatches(n,(function(t){return e.apply(void 0,[t].concat(o))}))};var r,o,i=t.produce(e,n,(function(e,t){r=e,o=t}));return"undefined"!=typeof Promise&&i instanceof Promise?i.then((function(e){return[e,r,o]})):[i,r,o]},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){ir(e)||rr(8),or(e)&&(e=Nr(e));var t=xr(this),n=Tr(this,e,void 0);return n[Wr].C=!0,kr(t),n},t.finishDraft=function(e,t){var n=(e&&e[Wr]).A;return gr(n,t),Cr(void 0,n)},t.setAutoFreeze=function(e){this.D=e},t.setUseProxies=function(e){e&&!Hr&&rr(20),this.O=e},t.applyPatches=function(e,t){var n;for(n=t.length-1;n>=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));var o=_r("Patches").$;return or(e)?o(e,t):this.produce(e,(function(e){return o(e,t)}))},e}(),Zr=new Yr,Jr=Zr.produce;function eo(e){return(eo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function to(e){var t=function(e,t){if("object"!==eo(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==eo(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===eo(t)?t:String(t)}function no(e,t,n){return(t=to(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ro(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function oo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ro(Object(n),!0).forEach((function(t){no(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ro(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function io(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}Zr.produceWithPatches.bind(Zr),Zr.setAutoFreeze.bind(Zr),Zr.setUseProxies.bind(Zr),Zr.applyPatches.bind(Zr),Zr.createDraft.bind(Zr),Zr.finishDraft.bind(Zr);var so="function"==typeof Symbol&&Symbol.observable||"@@observable",ao=function(){return Math.random().toString(36).substring(7).split("").join(".")},co={INIT:"@@redux/INIT"+ao(),REPLACE:"@@redux/REPLACE"+ao(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+ao()}};function lo(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(io(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(io(1));return n(lo)(e,t)}if("function"!=typeof e)throw new Error(io(2));var o=e,i=t,s=[],a=s,c=!1;function l(){a===s&&(a=s.slice())}function u(){if(c)throw new Error(io(3));return i}function d(e){if("function"!=typeof e)throw new Error(io(4));if(c)throw new Error(io(5));var t=!0;return l(),a.push(e),function(){if(t){if(c)throw new Error(io(6));t=!1,l();var n=a.indexOf(e);a.splice(n,1),s=null}}}function f(e){if(!function(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e))throw new Error(io(7));if(void 0===e.type)throw new Error(io(8));if(c)throw new Error(io(9));try{c=!0,i=o(i,e)}finally{c=!1}for(var t=s=a,n=0;n<t.length;n++){(0,t[n])()}return e}return f({type:co.INIT}),(r={dispatch:f,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(io(10));o=e,f({type:co.REPLACE})}})[so]=function(){var e,t=d;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(io(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}})[so]=function(){return this},e},r}function uo(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];"function"==typeof e[o]&&(n[o]=e[o])}var i,s=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:co.INIT}))throw new Error(io(12));if(void 0===n(void 0,{type:co.PROBE_UNKNOWN_ACTION()}))throw new Error(io(13))}))}(n)}catch(a){i=a}return function(e,t){if(void 0===e&&(e={}),i)throw i;for(var r=!1,o={},a=0;a<s.length;a++){var c=s[a],l=n[c],u=e[c],d=l(u,t);if(void 0===d)throw t&&t.type,new Error(io(14));o[c]=d,r=r||d!==u}return(r=r||s.length!==Object.keys(e).length)?o:e}}function fo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}function ho(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),r=function(){throw new Error(io(15))},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},i=t.map((function(e){return e(o)}));return r=fo.apply(void 0,i)(n.dispatch),oo(oo({},n),{},{dispatch:r})}}}function po(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"==typeof o?o(n,r,e):t(o)}}}}var vo=po();vo.withExtraArgument=po;const mo=vo;var bo=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_o=function(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(a){i=[6,a],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},yo=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e},go=Object.defineProperty,wo=Object.defineProperties,ko=Object.getOwnPropertyDescriptors,xo=Object.getOwnPropertySymbols,So=Object.prototype.hasOwnProperty,Co=Object.prototype.propertyIsEnumerable,Po=function(e,t,n){return t in e?go(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Eo=function(e,t){for(var n in t||(t={}))So.call(t,n)&&Po(e,n,t[n]);if(xo)for(var r=0,o=xo(t);r<o.length;r++){n=o[r];Co.call(t,n)&&Po(e,n,t[n])}return e},Oo=function(e,t){return wo(e,ko(t))},jo="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?fo:fo.apply(null,arguments)};function Ao(e,t){function n(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];if(t){var o=t.apply(void 0,n);if(!o)throw new Error("prepareAction did not return an object");return Eo(Eo({type:e,payload:o.payload},"meta"in o&&{meta:o.meta}),"error"in o&&{error:o.error})}return{type:e,payload:n[0]}}return n.toString=function(){return""+e},n.type=e,n.match=function(t){return t.type===e},n}var Mo=function(e){function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.apply(this,n)||this;return Object.setPrototypeOf(o,t.prototype),o}return bo(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.prototype.concat.apply(this,t)},t.prototype.prepend=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,yo([void 0],e[0].concat(this)))):new(t.bind.apply(t,yo([void 0],e.concat(this))))},t}(Array),Ro=function(e){function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.apply(this,n)||this;return Object.setPrototypeOf(o,t.prototype),o}return bo(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.prototype.concat.apply(this,t)},t.prototype.prepend=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,yo([void 0],e[0].concat(this)))):new(t.bind.apply(t,yo([void 0],e.concat(this))))},t}(Array);function To(e){return ir(e)?Jr(e,(function(){})):e}function No(){return function(e){return function(e){void 0===e&&(e={});var t=e.thunk,n=void 0===t||t;e.immutableCheck,e.serializableCheck,e.actionCreatorCheck;var r=new Mo;n&&("boolean"==typeof n?r.push(mo):r.push(mo.withExtraArgument(n.extraArgument)));return r}(e)}}var zo=!0;function Uo(e){var t,n=No(),r=e||{},o=r.reducer,i=void 0===o?void 0:o,s=r.middleware,a=void 0===s?n():s,c=r.devTools,l=void 0===c||c,u=r.preloadedState,d=void 0===u?void 0:u,f=r.enhancers,h=void 0===f?void 0:f;if("function"==typeof i)t=i;else{if(!function(e){if("object"!=typeof e||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n}(i))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');t=uo(i)}var p=a;"function"==typeof p&&(p=p(n));var v=ho.apply(void 0,p),m=fo;l&&(m=jo(Eo({trace:!zo},"object"==typeof l&&l)));var b=new Ro(v),_=b;return Array.isArray(h)?_=yo([v],h):"function"==typeof h&&(_=h(b)),lo(t,d,m.apply(void 0,_))}function Io(e){var t,n={},r=[],o={addCase:function(e,t){var r="string"==typeof e?e:e.type;if(!r)throw new Error("`builder.addCase` cannot be called with an empty action type");if(r in n)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return n[r]=t,o},addMatcher:function(e,t){return r.push({matcher:e,reducer:t}),o},addDefaultCase:function(e){return t=e,o}};return e(o),[n,r,t]}function Lo(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");var n,r="function"==typeof e.initialState?e.initialState:To(e.initialState),o=e.reducers||{},i=Object.keys(o),s={},a={},c={};function l(){var t="function"==typeof e.extraReducers?Io(e.extraReducers):[e.extraReducers],n=t[0],o=void 0===n?{}:n,i=t[1],s=void 0===i?[]:i,c=t[2],l=void 0===c?void 0:c,u=Eo(Eo({},o),a);return function(e,t,n,r){void 0===n&&(n=[]);var o,i="function"==typeof t?Io(t):[t,n,r],s=i[0],a=i[1],c=i[2];if("function"==typeof e)o=function(){return To(e())};else{var l=To(e);o=function(){return l}}function u(e,t){void 0===e&&(e=o());var n=yo([s[t.type]],a.filter((function(e){return(0,e.matcher)(t)})).map((function(e){return e.reducer})));return 0===n.filter((function(e){return!!e})).length&&(n=[c]),n.reduce((function(e,n){if(n){var r;if(or(e))return void 0===(r=n(e,t))?e:r;if(ir(e))return Jr(e,(function(e){return n(e,t)}));if(void 0===(r=n(e,t))){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}return e}),e)}return u.getInitialState=o,u}(r,(function(e){for(var t in u)e.addCase(t,u[t]);for(var n=0,r=s;n<r.length;n++){var o=r[n];e.addMatcher(o.matcher,o.reducer)}l&&e.addDefaultCase(l)}))}return i.forEach((function(e){var n,r,i=o[e],l=t+"/"+e;"reducer"in i?(n=i.reducer,r=i.prepare):n=i,s[e]=n,a[l]=n,c[e]=r?Ao(l,r):Ao(l)})),{name:t,reducer:function(e,t){return n||(n=l()),n(e,t)},actions:c,caseReducers:s,getInitialState:function(){return n||(n=l()),n.getInitialState()}}}var Bo=["name","message","stack","code"],Do=function(){return function(e,t){this.payload=e,this.meta=t}}(),Ho=function(){return function(e,t){this.payload=e,this.meta=t}}(),Fo=function(e){if("object"==typeof e&&null!==e){for(var t={},n=0,r=Bo;n<r.length;n++){var o=r[n];"string"==typeof e[o]&&(t[o]=e[o])}return t}return{message:String(e)}};function qo(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}!function(){function e(e,t,n){var r=Ao(e+"/fulfilled",(function(e,t,n,r){return{payload:e,meta:Oo(Eo({},r||{}),{arg:n,requestId:t,requestStatus:"fulfilled"})}})),o=Ao(e+"/pending",(function(e,t,n){return{payload:void 0,meta:Oo(Eo({},n||{}),{arg:t,requestId:e,requestStatus:"pending"})}})),i=Ao(e+"/rejected",(function(e,t,r,o,i){return{payload:o,error:(n&&n.serializeError||Fo)(e||"Rejected"),meta:Oo(Eo({},i||{}),{arg:r,requestId:t,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===(null==e?void 0:e.name),condition:"ConditionError"===(null==e?void 0:e.name)})}})),s="undefined"!=typeof AbortController?AbortController:function(){function e(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return e.prototype.abort=function(){},e}();return Object.assign((function(e){return function(a,c,l){var u,d=(null==n?void 0:n.idGenerator)?n.idGenerator(e):function(e){void 0===e&&(e=21);for(var t="",n=e;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t}(),f=new s;function h(e){u=e,f.abort()}var p=function(){return s=this,p=null,v=function(){var s,p,v,m,b,_;return _o(this,(function(y){switch(y.label){case 0:return y.trys.push([0,4,,5]),m=null==(s=null==n?void 0:n.condition)?void 0:s.call(n,e,{getState:c,extra:l}),null===(g=m)||"object"!=typeof g||"function"!=typeof g.then?[3,2]:[4,m];case 1:m=y.sent(),y.label=2;case 2:if(!1===m||f.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return b=new Promise((function(e,t){return f.signal.addEventListener("abort",(function(){return t({name:"AbortError",message:u||"Aborted"})}))})),a(o(d,e,null==(p=null==n?void 0:n.getPendingMeta)?void 0:p.call(n,{requestId:d,arg:e},{getState:c,extra:l}))),[4,Promise.race([b,Promise.resolve(t(e,{dispatch:a,getState:c,extra:l,requestId:d,signal:f.signal,abort:h,rejectWithValue:function(e,t){return new Do(e,t)},fulfillWithValue:function(e,t){return new Ho(e,t)}})).then((function(t){if(t instanceof Do)throw t;return t instanceof Ho?r(t.payload,d,e,t.meta):r(t,d,e)}))])];case 3:return v=y.sent(),[3,5];case 4:return _=y.sent(),v=_ instanceof Do?i(null,d,e,_.payload,_.meta):i(_,d,e),[3,5];case 5:return n&&!n.dispatchConditionRejection&&i.match(v)&&v.meta.condition||a(v),[2,v]}var g}))},new Promise((function(e,t){var n=function(e){try{o(v.next(e))}catch(n){t(n)}},r=function(e){try{o(v.throw(e))}catch(n){t(n)}},o=function(t){return t.done?e(t.value):Promise.resolve(t.value).then(n,r)};o((v=v.apply(s,p)).next())}));var s,p,v}();return Object.assign(p,{abort:h,requestId:d,arg:e,unwrap:function(){return p.then(qo)}})}}),{pending:o,rejected:i,fulfilled:r,typePrefix:e})}e.withTypes=function(){return e}}();var Wo="listenerMiddleware";Ao(Wo+"/add"),Ao(Wo+"/removeAll"),Ao(Wo+"/remove"),"function"==typeof queueMicrotask&&queueMicrotask.bind("undefined"!=typeof window?window:"undefined"!=typeof global?global:globalThis),function(){function e(e,t){var n=s[e];return n?n.enumerable=t:s[e]=n={configurable:!0,enumerable:t,get:function(){var t=this[Wr];return Qr.get(t,e)},set:function(t){var n=this[Wr];Qr.set(n,e,t)}},n}function t(e){for(var t=e.length-1;t>=0;t--){var o=e[t][Wr];if(!o.P)switch(o.i){case 5:r(o)&&Mr(o);break;case 4:n(o)&&Mr(o)}}}function n(e){for(var t=e.t,n=e.k,r=Vr(n),o=r.length-1;o>=0;o--){var i=r[o];if(i!==Wr){var s=t[i];if(void 0===s&&!cr(t,i))return!0;var a=n[i],c=a&&a[Wr];if(c?c.t!==s:!ur(a,s))return!0}}var l=!!t[Wr];return r.length!==Vr(t).length+(l?0:1)}function r(e){var t=e.k;if(t.length!==e.t.length)return!0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);if(n&&!n.get)return!0;for(var r=0;r<t.length;r++)if(!t.hasOwnProperty(r))return!0;return!1}var o,i,s={};i={J:function(t,n){var r=Array.isArray(t),o=function(t,n){if(t){for(var r=Array(n.length),o=0;o<n.length;o++)Object.defineProperty(r,""+o,e(o,!0));return r}var i=Xr(n);delete i[Wr];for(var s=Vr(i),a=0;a<s.length;a++){var c=s[a];i[c]=e(c,t||!!i[c].enumerable)}return Object.create(Object.getPrototypeOf(n),i)}(r,t),i={i:r?5:4,A:n?n.A:yr(),P:!1,I:!1,R:{},l:n,t:t,k:o,o:null,g:!1,C:!1};return Object.defineProperty(o,Wr,{value:i,writable:!0}),o},S:function(e,n,o){o?or(n)&&n[Wr].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var n=t[Wr];if(n){var o=n.t,i=n.k,s=n.R,a=n.i;if(4===a)sr(i,(function(t){t!==Wr&&(void 0!==o[t]||cr(o,t)?s[t]||e(i[t]):(s[t]=!0,Mr(n)))})),sr(o,(function(e){void 0!==i[e]||cr(i,e)||(s[e]=!1,Mr(n))}));else if(5===a){if(r(n)&&(Mr(n),s.length=!0),i.length<o.length)for(var c=i.length;c<o.length;c++)s[c]=!1;else for(var l=o.length;l<i.length;l++)s[l]=!0;for(var u=Math.min(i.length,o.length),d=0;d<u;d++)i.hasOwnProperty(d)||(s[d]=!0),void 0===s[d]&&e(i[d])}}}}(e.p[0]),t(e.p))},K:function(e){return 4===e.i?n(e):r(e)}},Kr[o="ES5"]||(Kr[o]=i)}();class $o{constructor(){t(this,"length",0),t(this,"storage",{})}setItem(e,t){this.storage[e]=t,this.length=Object.keys(this.storage).length}getItem(e){const t=this.storage[e];return void 0===t?null:t}removeItem(e){delete this.storage[e],this.length=Object.keys(this.storage).length}key(e){const t=Object.keys(this.storage);return void 0===t[e]?null:t[e]}clear(){this.length=0,this.storage={}}}const Vo=new class{constructor(e,n){t(this,"backend"),t(this,"length"),t(this,"prefix"),this.prefix=n;try{this.backend=e||localStorage,this.testBackend()}catch(r){this.backend=new $o}this.length=this.backend.length,"function"==typeof this.backend.sync&&(this.sync=e=>{this.backend.sync(e)})}testBackend(){const e=this.prefix+".test.record";this.backend.setItem(e,"123");const t=this.backend.getItem(e);this.backend.removeItem(e);if(!("123"===t&&null===this.backend.getItem(e)))throw new Error("Storage backend is not working properly")}setLocalStoragePrefix(e){this.prefix=e}clear(){if(!this.backend.length)return;const e=[];for(let t=0;t<this.backend.length;++t){const n=this.backend.key(t);n&&n.startsWith(this.prefix)&&e.push(n)}for(const t of e)this.backend.removeItem(t);this.length=this.backend.length}key(e){return this.backend.key(e)}setItem(e,t){if(!t||void 0===t.length||0===t.length)return void this.writeStringToKey(e,"");let n=0;for(;n<t.length;){let r=t.substr(n,1024);n+=r.length,n<t.length&&(r+="@"),this.writeStringToKey(e,r),e+="."}}getItem(e){let t=this.readStringFromKey(e);if(null===t)return null;if(0===t.length)return t;for(;"@"===t[t.length-1];){t=t.substr(0,t.length-1),e+=".";const n=this.readStringFromKey(e);t+=null===n?"":n}return t}removeItem(e){this.backend.removeItem(this.prefix+e),this.length=this.backend.length}writeStringToKey(e,t){this.backend.setItem(this.prefix+e,t),this.length=this.backend.length}readStringFromKey(e){return this.backend.getItem(this.prefix+e)}}(void 0,"jsdos.8.");class Xo{constructor(){t(this,"owner","")}close(){}put(e,t){return Promise.resolve()}get(e,t){return void 0!==t?Promise.resolve(t):Promise.reject(new Error("Cache is not supported on this host"))}del(e){return Promise.resolve()}keys(){return Promise.resolve([])}forEach(e){return Promise.resolve()}}class Ko{constructor(e,n,r){if(t(this,"owner"),t(this,"storeName","files"),t(this,"indexedDB"),t(this,"db",null),this.owner=e,this.indexedDB="undefined"==typeof window?void 0:window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,this.indexedDB)try{const t=this.indexedDB.open("js-dos-cache ("+e+")",1);t.onerror=e=>{var n;r("Can't open cache database: "+(null==(n=t.error)?void 0:n.message))},t.onsuccess=e=>{this.db=t.result,n(this)},t.onupgradeneeded=e=>{try{this.db=t.result,this.db.onerror=e=>{r("Can't upgrade cache database")};this.db.createObjectStore(this.storeName).createIndex("key","",{unique:!0,multiEntry:!1})}catch(n){r("Can't upgrade cache database")}}}catch(o){r("Can't open cache database: "+o.message)}else r("Indexed db is not supported on this host")}close(){null!==this.db&&(this.db.close(),this.db=null)}put(e,t){return new Promise(((n,r)=>{if(null===this.db)return void n();const o=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).put(t.buffer,e);o.onerror=()=>r,o.onsuccess=()=>n()}))}del(e){return new Promise(((t,n)=>{if(null===this.db)return void t();const r=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).delete(e);r.onerror=()=>n,r.onsuccess=()=>t()}))}get(e,t){return new Promise(((n,r)=>{function o(e){void 0===t?r(new Error(e)):n(t)}if(null===this.db)return void o("db is not initalized");const i=this.db.transaction(this.storeName,"readonly").objectStore(this.storeName).get(e);i.onerror=()=>r(new Error("Can't read value for key '"+e+"'")),i.onsuccess=()=>{i.result?n(new Uint8Array(i.result)):o("Result is empty for key '"+e+"', result: "+i.result)}}))}keys(){return new Promise(((e,t)=>{if(null===this.db)return void e([]);const n=this.db.transaction(this.storeName,"readonly").objectStore(this.storeName).index("key").getAllKeys();n.onerror=()=>t,n.onsuccess=t=>{const n=t.target.result;e(n)}}))}forEach(e){return new Promise(((t,n)=>{if(null===this.db)return void t();const r=this.db.transaction(this.storeName,"readonly").objectStore(this.storeName).openCursor();r.onerror=()=>n,r.onsuccess=n=>{const r=n.target.result;r?(e(r.key.toString(),new Uint8Array(r.value)),r.continue()):t()}}))}}function Qo(e){return new Promise((t=>{new Ko(e,t,(e=>{console.error("Can't open IndexedDB cache",e),t(new Xo)}))}))}const Go="cached.account",Yo=(()=>{const e=new URLSearchParams(location.search).get("jsdos_token");if(null!==e)return Jo(e),history.replaceState(null,"",location.href.substring(0,location.href.indexOf("?"))),null;{const e=Vo.getItem(Go),t=null!==e?JSON.parse(e):null;return null!==t&&t.token.validUntilMs-Date.now()>36e5?t:null}})(),Zo=Lo({name:"auth",initialState:{loginUrl:location.href,account:Yo,ready:null!==Yo},reducers:{login:(e,t)=>{Jo(t.payload.token.refresh_token),e.account=t.payload,e.account.premium=e.account.premium||"dz.caiiiycuk@gmail.com"===e.account.email||"caiiiycuk@gmail.com"===e.account.email,Vo.setItem(Go,JSON.stringify(t.payload)),t.asyncStore((e=>{"dz.caiiiycuk@gmail.com"!==t.payload.email&&"caiiiycuk@gmail.com"!==t.payload.email||e.dispatch(Si.actions.setSockdriveWrite(!1)),Qo(t.payload.email).then((t=>vi(e).cache=t)).catch(console.error).finally((()=>{e.dispatch(Zo.actions.ready())}))}))},logout:(e,t)=>{ei(),Vo.removeItem(Go),t.asyncStore((e=>{Qo("guest").then((t=>vi(e).cache=t)).catch(console.error)})),e.account=null},ready:e=>{e.ready=!0},setLoginUrl:(e,t)=>{e.loginUrl=t.payload}}});function Jo(e){if(null!==e)return Vo.setItem("cached.rt",e);ei()}function ei(){Vo.removeItem("cached.rt")}const ti={ru:{enter_name_of_drive:"Введите название диска",ws_outdated:"Необходимо обновить DOS Браузер",update:"Обновить",preloading_sockdrive:"Загрузка FAT",filter:"Фильтр",add:"Добавить",logout:"Выйти",please_login:"Войдите в аккаунт",features:"Функции",premium:"Премиум",buy:"Купить",experimental_features:"Доступ к экспериентальным функциям",cloud_saves:"Облачные сохранения",writeable_fat32:"FAT32 диски",net_no_limits:"Выбор сервера для стевой игры",unlock_options:"Доступ ко всем настройкам",error:"Упс... Что-то пошло не так...",consult_logs:"Проверьте логи браузера",bundle_loading:"Загрузка бандла",bundle_config:"Чтение конфигурации",try_free:"дней бесплатно",upload_file:"Выбирите архив jsdos/zip что бы начать...",emulation_backend:"Эмуляция",render_backend:"Рендер",render_aspect:"Соотношение сторон",worker:"Фоновый поток",mouse_sensitivity:"Чувст. мыши",mouse_lock:"Захват мыши",volume:"Громкость",pause:"Пауза",dosboxconf_template:"dosbox.conf шаблон:",preview:"Превью",continue:"Продолжить",skip:"Пропустить",loading:"Загрузка",extract_loading:"Распаковка архива",extract_long_time:"Может занять длительное время, пожалуйста ждите...",theme:"Тема",create_empty:"Создать пустой бандл",uploading_file:"Загрузка файла",fs_restart:"Вы хотите пересобрать бандл используя эту FS?",please_wait:"Пожалуйста подождите",making_bundle:"Создаем бандл",size:"Размер",room:"Команта",server:"Сервер",load_by_url:"Загрузить по ссылке",enter_url:"Введите ссылку",load:"Загрузить",stored:"Сохраненные",delete:"Удалить",editor:"Редактор",download:"Скачать",changes:"Сохранения",account_not_ready:"Пропустить загрузку сохранений",loading_saves:"Загрузка сохранений",success:"Успешно",unable_to_save:"Ошибка записи",not_premium:"Подключить премиум",copy_net_link:"Отправьте ссылку на подключение",copied:"Скопировано",image_rendering:"Обработка изображения",read_only_access:"Диск FAT32 открыт только для чтения",fix:"Исправить",close:"Закрыть",cancle:"Отказаться",manage:"Управлять",unable_to_cancle_subscription:"Не удалось отменить подписку",subscription_cancelled:"Подписка отменена",hardware:"Аппаратное ускорение",net_drives:"Сетевые диски",fat_write:"FAT запись"},en:{enter_name_of_drive:"Enter name of drive",ws_outdated:"Must update DOS Browser App",update:"Update",preloading_sockdrive:"Preloading FAT",filter:"Filter",add:"Add",logout:"Logout",please_login:"Please login",features:"Features",premium:"Premium",buy:"Buy",experimental_features:"Access to all experimental features",cloud_saves:"Cloud saves",writeable_fat32:"Writable FAT32",net_no_limits:"Change the network region",unlock_options:"Unlock all configuration options",error:"Oops... Something went wrong...",consult_logs:"Please check browser logs",bundle_loading:"Bundle loading",bundle_config:"Reading config",try_free:"days for free",upload_file:"Select jsdos/zip file to start...",emulation_backend:"Emulation",render_backend:"Render",render_aspect:"Aspect",worker:"Worker thread",mouse_sensitivity:"Mouse sens...",mouse_lock:"Capture mouse",volume:"Volume",pause:"Pause",dosboxconf_template:"dosbox.conf template:",preview:"Preview",continue:"Continue",skip:"Skip",loading:"Loading",extract_loading:"Unpacking archive",extract_long_time:"Can take long time, please be patient...",theme:"Theme",create_empty:"Create empty bundle",uploading_file:"Uploading file",fs_restart:"Do you want to rebuild the bundle using this fs?",please_wait:"Please wait",making_bundle:"Creating bundle",size:"Size",room:"Room",server:"Server",load_by_url:"Load by url",enter_url:"Enter url",load:"Load",stored:"Stored",delete:"Delete",editor:"Editor",download:"Download",changes:"Saves",account_not_ready:"Skip loading saves",loading_saves:"Loading saves",success:"Success",unable_to_save:"Unable to save",not_premium:"Subscribe to premium",copy_net_link:"Share this link to connect",copied:"Copied",image_rendering:"Image rendering",read_only_access:"The FAT32 drive is open in read-only mode",fix:"Fix",close:"Close",cancle:"Cancle",manage:"Manage",unable_to_cancle_subscription:"Unable to cancle subscription",subscription_cancelled:"Subscription cancelled",hardware:"Hardware acceleration",net_drives:"Net drives",fat_write:"Writeable FAT"}},ni=navigator.language.startsWith("ru")?"ru":"en",ri=Lo({name:"i18n",initialState:{lang:ni,keys:ti[ni]},reducers:{setLang:(e,t)=>{e.lang=t.payload,e.keys=ti[t.payload]}}});function oi(){const e=on((e=>e.i18n.keys));return t=>e[t]??t}const ii=Lo({name:"storage",initialState:{recived:0,total:0,ready:!1},reducers:{reset:e=>{e.recived=-1,e.total=0,e.ready=!1},progress:(e,t)=>{e.recived=t.payload[0],e.total=t.payload[1]},ready:e=>{e.ready=!0}}}),si=[{name:"7.xx",backend:"dosbox",contents:"[sdl]\nautolock=false\n\nfullscreen=false\nfulldouble=false\nfullresolution=original\nwindowresolution=original\noutput=surface\nsensitivity=100\nwaitonerror=true\npriority=higher,normal\nmapperfile=mapper-jsdos.map\nusescancodes=true\nvsync=false\n[dosbox]\nmachine=svga_s3\n\nlanguage=\ncaptures=capture\nmemsize=16\n[cpu]\ncore=auto\ncputype=auto\ncycles=auto\n\ncycleup=10\ncycledown=20\n[mixer]\nnosound=false\nrate=44100\n\nblocksize=1024\nprebuffer=20\n\n[render]\n# frameskip: How many frames DOSBox skips before drawing one.\n# aspect: Do aspect correction, if your output method doesn't support scaling this can slow things down!.\n# scaler: Scaler used to enlarge/enhance low resolution modes.\n# If 'forced' is appended, then the scaler will be used even if the result might not be desired.\n# Possible values: none, normal2x, normal3x, advmame2x, advmame3x, advinterp2x, advinterp3x, hq2x, hq3x, 2xsai, super2xsai, supereagle, tv2x, tv3x, rgb2x, rgb3x, scan2x, scan3x.\n\nframeskip=0\naspect=false\nscaler=none\n\n[midi]\n# mpu401: Type of MPU-401 to emulate.\n# Possible values: intelligent, uart, none.\n# mididevice: Device that will receive the MIDI data from MPU-401.\n# Possible values: default, win32, alsa, oss, coreaudio, coremidi, none.\n# midiconfig: Special configuration options for the device driver. This is usually the id of the device you want to use.\n# See the README/Manual for more details.\n\nmpu401=intelligent\nmididevice=default\nmidiconfig=\n\n[sblaster]\n# sbtype: Type of Soundblaster to emulate. gb is Gameblaster.\n# Possible values: sb1, sb2, sbpro1, sbpro2, sb16, gb, none.\n# sbbase: The IO address of the soundblaster.\n# Possible values: 220, 240, 260, 280, 2a0, 2c0, 2e0, 300.\n# irq: The IRQ number of the soundblaster.\n# Possible values: 7, 5, 3, 9, 10, 11, 12.\n# dma: The DMA number of the soundblaster.\n# Possible values: 1, 5, 0, 3, 6, 7.\n# hdma: The High DMA number of the soundblaster.\n# Possible values: 1, 5, 0, 3, 6, 7.\n# sbmixer: Allow the soundblaster mixer to modify the DOSBox mixer.\n# oplmode: Type of OPL emulation. On 'auto' the mode is determined by sblaster type. All OPL modes are Adlib-compatible, except for 'cms'.\n# Possible values: auto, cms, opl2, dualopl2, opl3, none.\n# oplemu: Provider for the OPL emulation. compat might provide better quality (see oplrate as well).\n# Possible values: default, compat, fast.\n# oplrate: Sample rate of OPL music emulation. Use 49716 for highest quality (set the mixer rate accordingly).\n# Possible values: 44100, 49716, 48000, 32000, 22050, 16000, 11025, 8000.\n\nsbtype=sb16\nsbbase=220\nirq=7\ndma=1\nhdma=5\nsbmixer=true\noplmode=auto\noplemu=default\noplrate=44100\n\n[gus]\n# gus: Enable the Gravis Ultrasound emulation.\n# gusrate: Sample rate of Ultrasound emulation.\n# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716.\n# gusbase: The IO base address of the Gravis Ultrasound.\n# Possible values: 240, 220, 260, 280, 2a0, 2c0, 2e0, 300.\n# gusirq: The IRQ number of the Gravis Ultrasound.\n# Possible values: 5, 3, 7, 9, 10, 11, 12.\n# gusdma: The DMA channel of the Gravis Ultrasound.\n# Possible values: 3, 0, 1, 5, 6, 7.\n# ultradir: Path to Ultrasound directory. In this directory\n# there should be a MIDI directory that contains\n# the patch files for GUS playback. Patch sets used\n# with Timidity should work fine.\n\ngus=false\ngusrate=44100\ngusbase=240\ngusirq=5\ngusdma=3\nultradir=C:\\ULTRASND\n\n[speaker]\n# pcspeaker: Enable PC-Speaker emulation.\n# pcrate: Sample rate of the PC-Speaker sound generation.\n# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716.\n# tandy: Enable Tandy Sound System emulation. For 'auto', emulation is present only if machine is set to 'tandy'.\n# Possible values: auto, on, off.\n# tandyrate: Sample rate of the Tandy 3-Voice generation.\n# Possible values: 44100, 48000, 32000, 22050, 16000, 11025, 8000, 49716.\n# disney: Enable Disney Sound Source emulation. (Covox Voice Master and Speech Thing compatible).\n\npcspeaker=true\npcrate=44100\ntandy=auto\ntandyrate=44100\ndisney=true\n\n[joystick]\n# joysticktype: Type of joystick to emulate: auto (default), none,\n# 2axis (supports two joysticks),\n# 4axis (supports one joystick, first joystick used),\n# 4axis_2 (supports one joystick, second joystick used),\n# fcs (Thrustmaster), ch (CH Flightstick).\n# none disables joystick emulation.\n# auto chooses emulation depending on real joystick(s).\n# (Remember to reset dosbox's mapperfile if you saved it earlier)\n# Possible values: auto, 2axis, 4axis, 4axis_2, fcs, ch, none.\n# timed: enable timed intervals for axis. Experiment with this option, if your joystick drifts (away).\n# autofire: continuously fires as long as you keep the button pressed.\n# swap34: swap the 3rd and the 4th axis. can be useful for certain joysticks.\n# buttonwrap: enable button wrapping at the number of emulated buttons.\n\njoysticktype=auto\ntimed=true\nautofire=false\nswap34=false\nbuttonwrap=false\n\n[serial]\n# serial1: set type of device connected to com port.\n# Can be disabled, dummy, modem, nullmodem, directserial.\n# Additional parameters must be in the same line in the form of\n# parameter:value. Parameter for all types is irq (optional).\n# for directserial: realport (required), rxdelay (optional).\n# (realport:COM1 realport:ttyS0).\n# for modem: listenport (optional).\n# for nullmodem: server, rxdelay, txdelay, telnet, usedtr,\n# transparent, port, inhsocket (all optional).\n# Example: serial1=modem listenport:5000\n# Possible values: dummy, disabled, modem, nullmodem, directserial.\n# serial2: see serial1\n# Possible values: dummy, disabled, modem, nullmodem, directserial.\n# serial3: see serial1\n# Possible values: dummy, disabled, modem, nullmodem, directserial.\n# serial4: see serial1\n# Possible values: dummy, disabled, modem, nullmodem, directserial.\n\nserial1=dummy\nserial2=dummy\nserial3=disabled\nserial4=disabled\n\n[dos]\n# xms: Enable XMS support.\n# ems: Enable EMS support.\n# umb: Enable UMB support.\n# keyboardlayout: Language code of the keyboard layout (or none).\n\nxms=true\nems=true\numb=true\nkeyboardlayout=auto\n\n[ipx]\n# ipx: Enable ipx over UDP/IP emulation.\n\nipx=true\n[autoexec]\necho off\nmount c .\nc:\n\ntype jsdos~1/readme.txt\necho on\n\n# Generated using https://js-dos.com\n# █▀▀▀▀▀█ █ ▄▄▄▀▀█ █▀▀▀▀▀█\n# █ ███ █ ██▄ █ ▀ ▄ █ ███ █\n# █ ▀▀▀ █ ▄██ ▀ ▀▀█ █ ▀▀▀ █\n# ▀▀▀▀▀▀▀ ▀ █▄▀▄▀ █ ▀▀▀▀▀▀▀\n# █▀▄▄█▀▀▄▄ ▀ ▀█▄▄▄▄ ▀▄█▀█▀\n# █▀ ▀ ▀▀▄ █▀ ▄ ▄▀▀▀▄ █▀█▄\n# ▄ ▄▄ █▀▀▄ ▄▀▄▀▀█ ▀▀▄▀▀█▀\n# ▄▀▀█▀▀ █▀█▀█▀▀▄ ▀██▀█▄\n# ▀▀▀ ▀ ▀ █▄█ ▀█▄▄█▀▀▀█▀▀\n# █▀▀▀▀▀█ ▄▄▄ ▄ ▄ █ ▀ █▄▄▄▄\n# █ ███ █ ▀█▀▀▄▀▀▄████▀▀█▄█\n# █ ▀▀▀ █ ▄▀▀█▀█▀▄ ▀▀▄▄█▄█\n# ▀▀▀▀▀▀▀ ▀ ▀▀ ▀ ▀ ▀▀▀\n".replace(/\n/g,"\r\n")},{name:"DOS 7.1",backend:"dosboxX",contents:"\n[sdl]\nautolock=false\n\n[dosbox]\ntitle=DOS 7.1\nmemsize=64\n\n[dos]\nver=7.1\nhard drive data rate limit=0\nfloppy drive data rate limit=0\n\n[cpu]\ncputype=pentium_mmx\ncore=auto\n\n[sblaster]\nsbtype=sb16vibra\n\n[render]\nscaler=none\n\n[autoexec]\necho off\nimgmount 2 sockdrive {wss-makevm} system dos7.1-v1\necho Please visit our website:\necho \necho _ __\necho (_)____ ____/ /___ _____ _________ ____ ___\necho / / ___/_____/ __ / __ \\/ ___// ___/ __ \\/ __ `__ \\\necho / (__ )_____/ /_/ / /_/ (__ )/ /__/ /_/ / / / / / /\necho __/ /____/ \\__,_/\\____/____(_)___/\\____/_/ /_/ /_/\necho /___/\necho\necho type 'boot c:' to load DOS 7.1\necho on\n# \n# █▀▀▀▀▀█ █ ▄▄▄▀▀█ █▀▀▀▀▀█\n# █ ███ █ ██▄ █ ▀ ▄ █ ███ █\n# █ ▀▀▀ █ ▄██ ▀ ▀▀█ █ ▀▀▀ █\n# ▀▀▀▀▀▀▀ ▀ █▄▀▄▀ █ ▀▀▀▀▀▀▀\n# █▀▄▄█▀▀▄▄ ▀ ▀█▄▄▄▄ ▀▄█▀█▀\n# █▀ ▀ ▀▀▄ █▀ ▄ ▄▀▀▀▄ █▀█▄\n# ▄ ▄▄ █▀▀▄ ▄▀▄▀▀█ ▀▀▄▀▀█▀\n# ▄▀▀█▀▀ █▀█▀█▀▀▄ ▀██▀█▄\n# ▀▀▀ ▀ ▀ █▄█ ▀█▄▄█▀▀▀█▀▀\n# █▀▀▀▀▀█ ▄▄▄ ▄ ▄ █ ▀ █▄▄▄▄\n# █ ███ █ ▀█▀▀▄▀▀▄████▀▀█▄█\n# █ ▀▀▀ █ ▄▀▀█▀█▀▄ ▀▀▄▄█▄█\n# ▀▀▀▀▀▀▀ ▀ ▀▀ ▀ ▀ ▀▀▀\n#\n".replace(/\n/g,"\r\n")},{name:"Win 95",backend:"dosboxX",contents:"\n[sdl]\nautolock=false\nmouse_emulation=integration\n\n[dosbox]\ntitle=Windows 95\nmemsize=128\n\n[video]\nvmemsize=8\nvesa modelist width limit=0\nvesa modelist height limit=0\n\n[dos]\nver=7.1\nhard drive data rate limit=0\nfloppy drive data rate limit=0\n\n[cpu]\ncputype=pentium_mmx\ncore=auto\nintegration device=true\n\n[sblaster]\nsbtype=sb16vibra\n\n[fdc, primary]\nint13fakev86io=true\n\n[ide, primary]\nint13fakeio=true\nint13fakev86io=true\n\n[ide, secondary]\nint13fakeio=true\nint13fakev86io=true\ncd-rom insertion delay=4000\n\n[render]\nscaler=none\n\n[autoexec]\necho off\nimgmount 2 sockdrive {wss-makevm} system win95-v1\necho Please visit our website:\necho \necho _ __\necho (_)____ ____/ /___ _____ _________ ____ ___\necho / / ___/_____/ __ / __ \\/ ___// ___/ __ \\/ __ `__ \\\necho / (__ )_____/ /_/ / /_/ (__ )/ /__/ /_/ / / / / / /\necho __/ /____/ \\__,_/\\____/____(_)___/\\____/_/ /_/ /_/\necho /___/\necho\necho type 'boot c:' to load windows 95\necho on\n# \n# █▀▀▀▀▀█ █ ▄▄▄▀▀█ █▀▀▀▀▀█\n# █ ███ █ ██▄ █ ▀ ▄ █ ███ █\n# █ ▀▀▀ █ ▄██ ▀ ▀▀█ █ ▀▀▀ █\n# ▀▀▀▀▀▀▀ ▀ █▄▀▄▀ █ ▀▀▀▀▀▀▀\n# █▀▄▄█▀▀▄▄ ▀ ▀█▄▄▄▄ ▀▄█▀█▀\n# █▀ ▀ ▀▀▄ █▀ ▄ ▄▀▀▀▄ █▀█▄\n# ▄ ▄▄ █▀▀▄ ▄▀▄▀▀█ ▀▀▄▀▀█▀\n# ▄▀▀█▀▀ █▀█▀█▀▀▄ ▀██▀█▄\n# ▀▀▀ ▀ ▀ █▄█ ▀█▄▄█▀▀▀█▀▀\n# █▀▀▀▀▀█ ▄▄▄ ▄ ▄ █ ▀ █▄▄▄▄\n# █ ███ █ ▀█▀▀▄▀▀▄████▀▀█▄█\n# █ ▀▀▀ █ ▄▀▀█▀█▀▄ ▀▀▄▄█▄█\n# ▀▀▀▀▀▀▀ ▀ ▀▀ ▀ ▀ ▀▀▀\n#\n".replace(/\n/g,"\r\n")},{name:"Win 98",backend:"dosboxX",contents:"\n[sdl]\nautolock=false\nmouse_emulation=integration\n\n[dosbox]\ntitle=Windows 98\nmemsize=128\n\n[video]\nvmemsize=8\nvesa modelist width limit=0\nvesa modelist height limit=0\n\n[dos]\nver=7.1\nhard drive data rate limit=0\nfloppy drive data rate limit=0\n\n[cpu]\ncputype=pentium_mmx\ncore=auto\nintegration device=true\n\n[sblaster]\nsbtype=sb16vibra\n\n[fdc, primary]\nint13fakev86io=true\n\n[ide, primary]\nint13fakeio=true\nint13fakev86io=true\n\n[ide, secondary]\nint13fakeio=true\nint13fakev86io=true\ncd-rom insertion delay=4000\n\n[render]\nscaler=none\n\n[autoexec]\necho off\nimgmount 2 sockdrive {wss-makevm} system win98-v1\necho Please visit our website:\necho \necho _ __\necho (_)____ ____/ /___ _____ _________ ____ ___\necho / / ___/_____/ __ / __ \\/ ___// ___/ __ \\/ __ `__ \\\necho / (__ )_____/ /_/ / /_/ (__ )/ /__/ /_/ / / / / / /\necho __/ /____/ \\__,_/\\____/____(_)___/\\____/_/ /_/ /_/\necho /___/\necho\necho type 'boot c:' to load windows 98\necho on\n# \n# █▀▀▀▀▀█ █ ▄▄▄▀▀█ █▀▀▀▀▀█\n# █ ███ █ ██▄ █ ▀ ▄ █ ███ █\n# █ ▀▀▀ █ ▄██ ▀ ▀▀█ █ ▀▀▀ █\n# ▀▀▀▀▀▀▀ ▀ █▄▀▄▀ █ ▀▀▀▀▀▀▀\n# █▀▄▄█▀▀▄▄ ▀ ▀█▄▄▄▄ ▀▄█▀█▀\n# █▀ ▀ ▀▀▄ █▀ ▄ ▄▀▀▀▄ █▀█▄\n# ▄ ▄▄ █▀▀▄ ▄▀▄▀▀█ ▀▀▄▀▀█▀\n# ▄▀▀█▀▀ █▀█▀█▀▀▄ ▀██▀█▄\n# ▀▀▀ ▀ ▀ █▄█ ▀█▄▄█▀▀▀█▀▀\n# █▀▀▀▀▀█ ▄▄▄ ▄ ▄ █ ▀ █▄▄▄▄\n# █ ███ █ ▀█▀▀▄▀▀▄████▀▀█▄█\n# █ ▀▀▀ █ ▄▀▀█▀█▀▄ ▀▀▄▄█▄█\n# ▀▀▀▀▀▀▀ ▀ ▀▀ ▀ ▀ ▀▀▀\n#\n".replace(/\n/g,"\r\n")}],ai=Lo({name:"editor",initialState:{configChanged:!1,bundleConfig:null,errorMessage:null,fs:[]},reducers:{init:(e,t)=>{null===t.payload?(e.configChanged=!0,e.bundleConfig={dosboxConf:si[0].contents,jsdosConf:{version:"js-dos-v8"}}):(e.configChanged=!1,e.bundleConfig=t.payload)},dosboxConf:(e,t)=>{e.configChanged=!0,e.bundleConfig.dosboxConf=t.payload}}}),ci=["localhost","js-dos"],li={"js-dos":{sockdriveEndpoint:"https://sockdrive.js-dos.com:8001",sockdriveWssEndpoint:"wss://sockdrive.js-dos.com:8001"},localhost:{sockdriveEndpoint:"http://localhost:8001",sockdriveWssEndpoint:"ws://localhost:8001"}};let ui=-1;function di(){return ui+=1,{storeUid:ui,slice:Lo({name:"init",initialState:{uid:ui,sockdriveBackendName:Vo.getItem("sockdrive.backend.name")??"js-dos"},reducers:{setSockdriveBackendName:(e,t)=>{e.sockdriveBackendName=t.payload,Vo.setItem("sockdrive.backend.name",t.payload)}}})}}const fi=di().slice,hi=e=>t=>n=>{const r=Object.assign({},n,{asyncStore:function(t){setTimeout((()=>t(e)),4)}});t(r)},pi={};function vi(e){return"function"==typeof e.getState?pi[e.getState().init.uid]:pi[e.init.uid]}function mi(){return vi(Jn())}function bi(e,t,n){e.options.onEvent&&setTimeout((()=>{var r,o;null==(o=(r=e.options).onEvent)||o.call(r,t,n)}),4)}const _i="qwertyuiopasdfghjklzxcvbnm1234567890",yi=["dosbox","dosboxX"],gi=["webgl","canvas"],wi=["AsIs","1/1","5/4","4/3","16/10","16/9","Fit"],ki=65535,xi=["pixelated","smooth"],Si=Lo({name:"dos",initialState:{step:"emu-init",emuVersion:"-",error:null,bundle:null,config:{},worker:"false"!==Vo.getItem("worker"),backend:Vo.getItem("backend")??"dosbox",backendLocked:!1,backendHardware:"false"!==Vo.getItem("backendHardware"),renderBackend:Vo.getItem("renderBackend")??"webgl",renderAspect:Vo.getItem("renderAspect")??"AsIs",volume:Number.parseFloat(Vo.getItem("volume")??"1.0"),mouseSensitivity:Number.parseFloat(Vo.getItem("mouse_sensitivity")??"1.0"),mouseCapture:!1,paused:!1,stats:{cyclesPerMs:0,nonSkippableSleepPreSec:0,sleepPerSec:0,sleepTimePerSec:0,framePerSec:0,soundPerSec:0,msgSentPerSec:0,msgRecvPerSec:0,netRecv:0,netSent:0,driveSent:0,driveRecv:0,driveRecvTime:0,driveCacheHit:0,driveCacheMiss:0,driveCacheUsed:0},network:{server:Vo.getItem("net.server")??"netherlands",room:Ei()+Ei()+Ei(),ipx:"disconnected"},ci:!1,ciStartedAt:0,imageRendering:Vo.getItem("imageRendering")??"pixelated",sockdriveWrite:!0},reducers:{emuReady:(e,t)=>{e.step="emu-ready",e.emuVersion=t.payload},emuError:(e,t)=>{e.step="emu-error",e.error=t.payload??"Unexpeceted error"},bndLoad:(e,t)=>{e.step="bnd-load",e.bundle=t.payload},bndError:(e,t)=>{e.step="bnd-error",e.error=t.payload??"Unexpeceted error"},bndConfig:e=>{e.step="bnd-config"},bndReady:(e,t)=>{e.step="bnd-ready",e.config=t.payload},bndPlay:(e,t)=>{e.step="bnd-play",t.asyncStore((e=>{bi(vi(e),"bnd-play")}))},dosWorker:(e,t)=>{e.worker=t.payload,Vo.setItem("worker",e.worker?"true":"false")},dosBackend:(e,t)=>{e.backend=t.payload},dosBackendLocked:(e,t)=>{e.backendLocked=t.payload},dosBackendHardware:(e,t)=>{e.backendHardware=t.payload,Vo.setItem("backendHardware",e.backendHardware?"true":"false")},renderBackend:(e,t)=>{e.renderBackend=t.payload,Vo.setItem("renderBackend",e.renderBackend)},renderAspect:(e,t)=>{e.renderAspect=t.payload,Vo.setItem("renderAspect",e.renderAspect)},imageRendering:(e,t)=>{e.imageRendering=t.payload,Vo.setItem("imageRendering",e.imageRendering)},volume:(e,t)=>{e.volume=t.payload,Vo.setItem("volume",e.volume+"")},mouseSensitivity:(e,t)=>{e.mouseSensitivity=t.payload,Vo.setItem("mouse_sensitivity",e.mouseSensitivity+"")},mouseCapture:(e,t)=>{e.mouseCapture=t.payload},paused:(e,t)=>{e.paused=t.payload},stats:(e,t)=>{e.stats=t.payload},ci:(e,t)=>{e.ci=t.payload,t.payload&&(e.ciStartedAt=Date.now())},connectIpx:(e,t)=>{if("connected"===e.network.ipx)throw new Error("Already connected");if(!e.ci)throw new Error("DOS is not started");const{room:n,address:r}=t.payload;e.network.ipx="connecting",t.asyncStore((e=>{const t=vi(e);if(!t.ci)throw new Error("DOS is not started");const o=r.endsWith("/")?r.substring(0,r.length-1):r;t.ci.networkConnect(0,o+":1900/ipx/"+n.replaceAll("@","_")).then((()=>{e.dispatch(Si.actions.statusIpx("connected"))})).catch((t=>{e.dispatch(Si.actions.statusIpx("error")),console.error(t)}))}))},statusIpx:(e,t)=>{e.network.ipx=t.payload},disconnectIpx:(e,t)=>{e.network.ipx="disconnected",t.asyncStore((e=>{var t;null==(t=vi(e).ci)||t.networkDisconnect(0)}))},setRoom:(e,t)=>{e.network.room=t.payload},setServer:(e,t)=>{e.network.server=t.payload,Vo.setItem("net.server",t.payload)},setSockdriveWrite:(e,t)=>{e.sockdriveWrite=t.payload}}});let Ci=!1;function Pi(e,t){e.dispatch((async e=>{try{Ci||(await function(e){if(null!==document.querySelector("#emulators.js"))return Promise.resolve();return new Promise(((t,n)=>{const r=document.createElement("script");r.async=!0,r.type="text/javascript",r.src=e+"emulators.js",r.onload=()=>{emulators.pathPrefix=e,t()},r.onerror=e=>{n(new Error("Unable to add emulators.js. Probably you should set the 'pathPrefix' option to point to the js-dos folder."))},document.head.appendChild(r)}))}(t),Ci=!0),e(Si.actions.emuReady(emulators.version))}catch(n){console.error("Unable to init emulators.js",n),e(Si.actions.emuError(n.message))}}))}function Ei(){return _i[Math.round(Math.random()*(_i.length-1))]}const Oi=["light","dark","cupcake","bumblebee","emerald","corporate","synthwave","retro","cyberpunk","valentine","halloween","garden","forest","aqua","lofi","pastel","fantasy","wireframe","black","luxury","dracula","cmyk","autumn","business","acid","lemonade","night","coffee","winter"],ji=Lo({name:"js-dos v8s",initialState:{modal:"none",frame:"none",frameXs:!1,window:"none",theme:Vo.getItem("theme")??"dark",editor:!1,wideScreen:!0,fullScreen:!1,toast:null,toastIntent:"none",toastTimeoutId:0,background:null,readOnlyWarning:!1,updateWsWarning:!1,cloudSaves:!0,autoStart:!1,kiosk:!1},reducers:{theme:(e,t)=>{Vo.setItem("theme",t.payload),e.theme=t.payload},modalLogin:e=>{e.modal="login"},modalNone:e=>{e.modal="none"},frameNone:e=>{e.frame="none",e.frameXs=!1},frameAccount:e=>{!function(e,t){e.frame===t?e.frame="none":e.frame=t}(e,"account"),e.frameXs=!1},frameSettings:e=>{e.frame="settings",e.frameXs=!1},frameNetwork:e=>{e.frame="network",e.frameXs=!1},frameStats:e=>{e.frame="stats",e.frameXs=!1},frameConf:e=>{e.frame="editor-conf",e.frameXs=!1},frameFs:e=>{e.frame="editor-fs",e.frameXs=!1},frameFatDrives:e=>{e.frame="fat-drives",e.frameXs=!1},frameQuickSave:e=>{e.frame="quick-save",e.frameXs=!0},frameImageRendering:e=>{e.frame="image-rendering",e.frameXs=!1},windowSelect:e=>{e.window="select"},background:(e,t)=>{e.background=t.payload},setEditor:(e,t)=>{e.editor=t.payload},setWideScreen:(e,t)=>{e.wideScreen=t.payload},setFullScreen:(e,t)=>{e.fullScreen=t.payload},showToast:(e,t)=>{0!==e.toastTimeoutId&&clearInterval(e.toastTimeoutId),e.toast=t.payload.message,e.toastIntent=t.payload.intent??"none","panic"!==t.payload.intent&&(e.toastTimeoutId=setTimeout((()=>{t.asyncStore((e=>e.dispatch(ji.actions.hideToast())))}),t.payload.long?5e3:1500))},hideToast:e=>{e.toast=null,e.toastTimeoutId=0},readOnlyWarning:(e,t)=>{e.readOnlyWarning=t.payload},updateWsWarning:(e,t)=>{e.updateWsWarning=t.payload},cloudSaves:(e,t)=>{e.cloudSaves=t.payload},autoStart:(e,t)=>{e.autoStart=t.payload},kiosk:(e,t)=>{e.kiosk=t.payload}},extraReducers:e=>{e.addCase(Ao("dos/bndLoad"),((e,t)=>{e.window="loading"})).addCase(Ao("editor/extract"),((e,t)=>{e.window="loading"})).addCase(Ao("editor/ready"),((e,t)=>{e.window="prerun"})).addCase(Ao("dos/bndReady"),((e,t)=>{e.autoStart?t.asyncStore((e=>{e.dispatch(Si.actions.bndPlay({}))})):e.window="prerun"})).addCase(Ao("dos/bndPlay"),((e,t)=>{e.window="run",e.frame="none"})).addMatcher((e=>e.type.startsWith("dos/")&&e.type.endsWith("Error")),((e,t)=>{e.window="error"}))}});function Ai(e,t){t(null===e?ji.actions.modalLogin():ji.actions.frameAccount())}var Mi=0;function Ri(e,t,n,o,i,s){var a,c,l={};for(c in t)"ref"==c?a=t[c]:l[c]=t[c];var u={type:e,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Mi,__i:-1,__u:0,__source:i,__self:s};if("function"==typeof e&&(a=e.defaultProps))for(c in a)void 0===l[c]&&(l[c]=a[c]);return r.vnode&&r.vnode(u),u}function Ti(e){return Ri("div",{class:"text-gray-400 hover:text-gray-600 btn "+e.class,onClick:e.onClose,children:Ri("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-full h-full",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2",children:Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})})})}const Ni="https://v8.js-dos.com/auth/",zi="doszone-uploads",Ui="https://storage.yandexcloud.net",Ii="dzapi",Li="https://d5dn8hh4ivlobv6682ep.apigw.yandexcloud.net/presign-put",Bi="https://subscriptions.xsolla.com/api/user/v1/projects/184012/subscriptions",Di="sumOxNVr",Hi="https://br.cdn.dos.zone",Fi={en:"https://v8.js-dos.com/cancel-your-subscription/",ru:"https://v8.js-dos.com/ru/cancel-your-subscription/"},qi=2;function Wi(){const e=le(null),t=on((e=>e.auth.account)),n="login"===on((e=>e.ui.modal)),r=on((e=>e.auth.loginUrl)),o=tr();return ae((()=>{if(null!=t)return;const n=e.current;if(null===n)return o(Zo.actions.logout({})),o(Zo.actions.ready()),void console.error("Unable to inialize authentificator!");async function r(e){if("auth/ready"===e.data.action)$i("auth/authenicate",n,o);else if("auth/authenicate"===e.data.action){const n=e.data.account;if(null!==n){try{n.premium=await async function(e){const t=await fetch(Bi,{method:"GET",cache:"no-cache",headers:{Authorization:"Bearer "+e}}),n=await t.json();return void 0===n.items?(console.error("Unexpected subscriptions response:",n),!1):n.items.length>0&&n.items[0].plan_external_id===Di}(n.token.access_token)}catch(t){console.error(t),n.premium=!1}o(Zo.actions.login(e.data.account))}else o(Zo.actions.logout({})),o(Zo.actions.ready())}}return window.addEventListener("message",r),n.src=Ni,()=>{window.removeEventListener("message",r)}}),[]),ae((()=>{if(n){const t=e.current;if(null===t)return;$i("auth/login",t,o,r)}}),[n,r]),Ri("div",{id:"login",class:"login-widget "+(n?"block":"hidden"),children:[Ri("iframe",{id:"authentificator",ref:e}),Ri(Ti,{class:"absolute z-40 right-24 top-10",onClose:()=>o(ji.actions.modalNone())})]})}function $i(e,t,n,r){const o={action:e,refresh_token:"auth/authenicate"===e?Vo.getItem("cached.rt"):void 0,url:"auth/login"===e?r:void 0};t&&t.contentWindow?t.contentWindow.postMessage(o,"*"):(console.error("Can't find authentificator iframe"),n(Zo.actions.logout({})),n(Zo.actions.ready()))}function Vi(e){const t=oi(),n=on((e=>e.auth.account)),r=tr();if(null===n)return null;return Ri("div",{class:"account-frame frame-root items-center",children:[null!==n.picture&&Ri("img",{class:"account-img",src:n.picture}),Ri("div",{children:n.name??n.email}),null!==n.name&&Ri("div",{class:"account-email",children:n.email}),Ri("button",{class:"btn mt-8",onClick:function(){r(Zo.actions.logout({})),r(ji.actions.frameNone())},children:t("logout")}),Ri("div",{class:"mt-8 mb-4 text-2xl",children:t("features")}),Ri(Xi,{})]})}function Xi(e){const t=oi(),n=on((e=>e.i18n.lang)),r=on((e=>e.auth.account)),[o,i]=ie(!1),s=tr();if(null===r)return null;const a=r.token.access_token;return Ri("div",{class:"premium-plan-root "+(r.premium?"have-premium":""),children:[Ri("div",{class:"premium-plan-head flex",children:[Ri(Ki,{}),t("premium"),Ri("div",{class:"flex-grow"}),r.premium&&Ri("button",{onClick:async function(){const e=()=>{s(ji.actions.showToast({message:t("unable_to_cancle_subscription"),intent:"error"})),window.open(Fi[n]??Fi.en,"_blank")};if(r)try{await async function(e){const t=await fetch(Bi+"/"+Di+"/cancel",{method:"PUT",cache:"no-cache",headers:{Authorization:"Bearer "+e}}),n=await t.json();return!n.error||(console.error("Unexpected subscriptions response:",n),!1)}(r.token.access_token)?s(ji.actions.showToast({message:t("subscription_cancelled"),intent:"success"})):e()}catch(o){e()}else e()},class:"ml-2 btn btn-ghost btn-xs text-success-content",children:t("cancle")})]}),!r.premium&&Ri(y,{children:[Ri("div",{class:"flex flex-row my-6 items-top",children:[Ri("div",{class:"premium-plan-cost",children:"$3"}),Ri("div",{class:"premium-plan-cost-expl",children:[Ri("div",{children:"USD / mo"}),Ri("div",{children:[Ri("span",{class:"text-blue-600",children:"5"})," ",t("try_free")]})]})]}),Ri("button",{class:"btn btn-primary w-full "+(o?"hidden":""),onClick:function(){o||("js-dos.com"===location.host?(i(!0),async function(e){const t=await fetch(Bi+"/buy",{method:"POST",cache:"no-cache",headers:{Authorization:"Bearer "+e,"Content-Type":"application/json"},body:JSON.stringify({plan_external_id:Di})}),n=await t.json();return void 0===n.link_to_ps?(console.error("Unexpected subscriptions response:",n),null):n.link_to_ps}(a).then((e=>{null!==e&&window.open(e,"_blank")})).catch(console.error).finally((()=>i(!1)))):window.open("https://js-dos.com/subscription.html","_blank"))},children:t("buy")})]}),Ri("div",{class:"flex flex-col mt-4",children:[Ri("div",{class:"premium-plan-highlight",children:[Ri(Ki,{}),Ri("div",{children:t("cloud_saves")})]}),Ri("div",{class:"premium-plan-highlight",children:[Ri(Ki,{}),Ri("div",{children:t("experimental_features")})]}),Ri("div",{class:"premium-plan-highlight",children:[Ri(Ki,{}),Ri("div",{children:t("writeable_fat32")}),Ri("div",{class:"flex-grow"}),Ri("button",{onClick:()=>s(ji.actions.frameFatDrives()),target:"_blank",class:"ml-2 btn btn-xs text-success-content",children:t("manage")})]}),Ri("div",{class:"premium-plan-highlight",children:[Ri(Ki,{}),Ri("div",{children:t("net_no_limits")})]}),Ri("div",{class:"premium-plan-highlight",style:"border-bottom: 0px",children:[Ri(Ki,{}),Ri("div",{children:t("unlock_options")})]})]})]})}function Ki(e){return Ri("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"mr-4 w-6 h-6 text-blue-500 flex-shrink-0",children:Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 12.75l6 6 9-13.5"})})}const Qi="imgmount\\s+(\\d+)\\s+sockdrive\\s+([^\\s]+)\\s+([^\\s]+)\\s+([^\\s]+)\\s*$",Gi="imgmount\\s+(\\d+)\\s+sockdrive\\s+.*$";function Yi(){const e=oi(),t=on((e=>e.editor.bundleConfig)),n=on((e=>e.auth.account)),r=on((e=>e.dos.backend)),{sockdriveEndpoint:o,sockdriveWssEndpoint:i}=on((e=>li[e.init.sockdriveBackendName]??li["js-dos"])),s=tr(),[a,c]=ie([]);function l(e){const t={},n=new RegExp(Qi,"gm");let r;for(;r=n.exec(e);){const[e,n,o,i,s]=r;t[n]={num:n,backend:o,owner:i,drive:s}}return t}ae((()=>{n&&n.token?fetch(o+"/list/drives/"+n.token.access_token).then((e=>e.json())).then(c).catch(console.error):c([])}),[null==n?void 0:n.token,o]);const[u,d]=ie(l((null==t?void 0:t.dosboxConf)??""));function f(e){if(d(e),t){const n=[];for(const t of Object.values(e))t.owner.length>0&&t.drive.length>0&&n.push(`imgmount ${t.num} sockdrive ${t.backend} ${t.owner} ${t.drive}`);let r=t.dosboxConf;if(r=r.replaceAll(new RegExp(Gi,"gm"),""),n.length>0){let e=r.indexOf("[autoexec]");-1===e?e=r.length:e+=10;const t=r.substring(e);r=r.substring(0,e),r+="\n"+n.join("\n")+"\n"+t.trim()}p(r)}}function h(e){d(l(e)),p(e)}function p(e){s(Si.actions.mouseCapture(e.indexOf("autolock=true")>0)),s(ai.actions.dosboxConf(e)),s(Si.actions.dosBackendLocked(e.indexOf("sockdrive")>=0))}return null===t?null:Ri("div",{class:"editor-conf-frame flex flex-col flex-grow w-full gap-2",children:[Ri("div",{class:"",children:e("dosboxconf_template")}),Ri("div",{class:"flex flex-row flex-wrap items-center gap-2",children:si.map((({name:e,backend:t,contents:n})=>Ri("button",{class:"btn btn-sm",onClick:()=>{s(Si.actions.dosBackend("dosboxX"===t?"dosboxX":"dosbox")),h(n.replaceAll("{wss-makevm}",i))},children:e})))}),"dosboxX"===r&&Ri(y,{children:[Ri("button",{class:"btn btn-ghost btn-xs self-start",target:"_blank",onClick:()=>s(ji.actions.frameFatDrives()),children:[e("net_drives"),":",Ri("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-4 h-4",children:Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m12.75 15 3-3m0 0-3-3m3 3h-7.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})})]}),["2","3"].map((e=>{var t,n;return Ri("div",{class:"flex flex-row justify-start items-center gap-3 w-full",children:[Ri("p",{children:"2"===e?"C:":"D:"}),Ri("div",{class:"flex flex-col gap-2",children:[Ri("div",{class:"flex flex-row gap-1 items-center",children:[Ri("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-4 h-4",children:Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})}),Ri("input",{class:"input input-xs",type:"text",value:(null==(t=u[e])?void 0:t.owner)??"",onChange:t=>{var n,r;const o={...u};o[e]={num:e,backend:(null==(n=u[e])?void 0:n.backend)??i,owner:t.currentTarget.value,drive:(null==(r=u[e])?void 0:r.drive)??""},f(o)}})]}),Ri("div",{class:"flex flex-row gap-1 items-center",children:[Ri("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-4 h-4",children:Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"})}),Ri("input",{class:"input input-xs",type:"text",value:(null==(n=u[e])?void 0:n.drive)??"",onChange:t=>{var n,r;const o={...u};o[e]={num:e,backend:(null==(n=u[e])?void 0:n.backend)??i,owner:(null==(r=u[e])?void 0:r.owner)??"",drive:t.currentTarget.value},f(o)}})]})]}),Ri("div",{class:"dropdown dropdown-bottom dropdown-end",children:[Ri("button",{tabIndex:0,role:"button",class:"btn btn-sm",children:Ri("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-4 h-4",children:Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 9.776c.112-.017.227-.026.344-.026h15.812c.117 0 .232.009.344.026m-16.5 0a2.25 2.25 0 0 0-1.883 2.542l.857 6a2.25 2.25 0 0 0 2.227 1.932H19.05a2.25 2.25 0 0 0 2.227-1.932l.857-6a2.25 2.25 0 0 0-1.883-2.542m-16.5 0V6A2.25 2.25 0 0 1 6 3.75h3.879a1.5 1.5 0 0 1 1.06.44l2.122 2.12a1.5 1.5 0 0 0 1.06.44H18A2.25 2.25 0 0 1 20.25 9v.776"})})}),Ri("ul",{tabIndex:0,class:"dropdown-content z-[1] menu p-2 shadow bg-base-100 rounded-box w-52 max-h-80 overflow-auto",children:a.map((({name:t,owner:n})=>Ri("li",{onClick:r=>{const o={...u};o[e]={num:e,owner:n,backend:i,drive:t},f(o),r.currentTarget.parentElement.blur()},children:Ri("a",{children:t})})))})]}),Ri("button",{class:"btn btn-sm",onClick:()=>{const t={...u};delete t[e],f(t)},children:Ri("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-4 h-4",children:Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9.75 14.25 12m0 0 2.25 2.25M14.25 12l2.25-2.25M14.25 12 12 14.25m-2.58 4.92-6.374-6.375a1.125 1.125 0 0 1 0-1.59L9.42 4.83c.21-.211.497-.33.795-.33H19.5a2.25 2.25 0 0 1 2.25 2.25v10.5a2.25 2.25 0 0 1-2.25 2.25h-9.284c-.298 0-.585-.119-.795-.33Z"})})})]})}))]}),Ri("textarea",{class:"flex-grow",value:t.dosboxConf,onChange:e=>{var t;return h((null==(t=e.currentTarget)?void 0:t.value)??"")}})]})}var Zi={exports:{}};
|
|
21
|
+
/*! react-checkbox-tree - v1.8.0 | 2022 */self;const Ji=F(Zi.exports=(e=>(()=>{var t={4184:(e,t)=>{var n;!function(){var r={}.hasOwnProperty;function o(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var i=typeof n;if("string"===i||"number"===i)e.push(n);else if(Array.isArray(n)){if(n.length){var s=o.apply(null,n);s&&e.push(s)}}else if("object"===i)if(n.toString===Object.prototype.toString)for(var a in n)r.call(n,a)&&n[a]&&e.push(a);else e.push(n.toString())}}return e.join(" ")}e.exports?(o.default=o,e.exports=o):void 0===(n=function(){return o}.apply(t,[]))||(e.exports=n)}()},8552:(e,t,n)=>{var r=n(852)(n(5639),"DataView");e.exports=r},1989:(e,t,n)=>{var r=n(1789),o=n(401),i=n(7667),s=n(1327),a=n(1866);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=s,c.prototype.set=a,e.exports=c},8407:(e,t,n)=>{var r=n(7040),o=n(4125),i=n(2117),s=n(7518),a=n(4705);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=s,c.prototype.set=a,e.exports=c},7071:(e,t,n)=>{var r=n(852)(n(5639),"Map");e.exports=r},3369:(e,t,n)=>{var r=n(4785),o=n(1285),i=n(6e3),s=n(9916),a=n(5265);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}c.prototype.clear=r,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=s,c.prototype.set=a,e.exports=c},3818:(e,t,n)=>{var r=n(852)(n(5639),"Promise");e.exports=r},8525:(e,t,n)=>{var r=n(852)(n(5639),"Set");e.exports=r},8668:(e,t,n)=>{var r=n(3369),o=n(619),i=n(2385);function s(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}s.prototype.add=s.prototype.push=o,s.prototype.has=i,e.exports=s},6384:(e,t,n)=>{var r=n(8407),o=n(7465),i=n(3779),s=n(7599),a=n(4758),c=n(4309);function l(e){var t=this.__data__=new r(e);this.size=t.size}l.prototype.clear=o,l.prototype.delete=i,l.prototype.get=s,l.prototype.has=a,l.prototype.set=c,e.exports=l},2705:(e,t,n)=>{var r=n(5639).Symbol;e.exports=r},1149:(e,t,n)=>{var r=n(5639).Uint8Array;e.exports=r},577:(e,t,n)=>{var r=n(852)(n(5639),"WeakMap");e.exports=r},4963:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var s=e[n];t(s,n,e)&&(i[o++]=s)}return i}},4636:(e,t,n)=>{var r=n(2545),o=n(5694),i=n(1469),s=n(4144),a=n(5776),c=n(6719),l=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=i(e),u=!n&&o(e),d=!n&&!u&&s(e),f=!n&&!u&&!d&&c(e),h=n||u||d||f,p=h?r(e.length,String):[],v=p.length;for(var m in e)!t&&!l.call(e,m)||h&&("length"==m||d&&("offset"==m||"parent"==m)||f&&("buffer"==m||"byteLength"==m||"byteOffset"==m)||a(m,v))||p.push(m);return p}},2488:e=>{e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},2908:e=>{e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},8470:(e,t,n)=>{var r=n(7813);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},8866:(e,t,n)=>{var r=n(2488),o=n(1469);e.exports=function(e,t,n){var i=t(e);return o(e)?i:r(i,n(e))}},4239:(e,t,n)=>{var r=n(2705),o=n(9607),i=n(2333),s=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?o(e):i(e)}},9454:(e,t,n)=>{var r=n(4239),o=n(7005);e.exports=function(e){return o(e)&&"[object Arguments]"==r(e)}},939:(e,t,n)=>{var r=n(2492),o=n(7005);e.exports=function e(t,n,i,s,a){return t===n||(null==t||null==n||!o(t)&&!o(n)?t!=t&&n!=n:r(t,n,i,s,e,a))}},2492:(e,t,n)=>{var r=n(6384),o=n(7114),i=n(8351),s=n(6096),a=n(4160),c=n(1469),l=n(4144),u=n(6719),d="[object Arguments]",f="[object Array]",h="[object Object]",p=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,v,m,b){var _=c(e),y=c(t),g=_?f:a(e),w=y?f:a(t),k=(g=g==d?h:g)==h,x=(w=w==d?h:w)==h,S=g==w;if(S&&l(e)){if(!l(t))return!1;_=!0,k=!1}if(S&&!k)return b||(b=new r),_||u(e)?o(e,t,n,v,m,b):i(e,t,g,n,v,m,b);if(!(1&n)){var C=k&&p.call(e,"__wrapped__"),P=x&&p.call(t,"__wrapped__");if(C||P){var E=C?e.value():e,O=P?t.value():t;return b||(b=new r),m(E,O,n,v,b)}}return!!S&&(b||(b=new r),s(e,t,n,v,m,b))}},8458:(e,t,n)=>{var r=n(3560),o=n(5346),i=n(3218),s=n(346),a=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp("^"+u.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!i(e)||o(e))&&(r(e)?f:a).test(s(e))}},8749:(e,t,n)=>{var r=n(4239),o=n(1780),i=n(7005),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,e.exports=function(e){return i(e)&&o(e.length)&&!!s[r(e)]}},280:(e,t,n)=>{var r=n(5726),o=n(6916),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))i.call(e,n)&&"constructor"!=n&&t.push(n);return t}},2545:e=>{e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},1717:e=>{e.exports=function(e){return function(t){return e(t)}}},4757:e=>{e.exports=function(e,t){return e.has(t)}},4429:(e,t,n)=>{var r=n(5639)["__core-js_shared__"];e.exports=r},7114:(e,t,n)=>{var r=n(8668),o=n(2908),i=n(4757);e.exports=function(e,t,n,s,a,c){var l=1&n,u=e.length,d=t.length;if(u!=d&&!(l&&d>u))return!1;var f=c.get(e),h=c.get(t);if(f&&h)return f==t&&h==e;var p=-1,v=!0,m=2&n?new r:void 0;for(c.set(e,t),c.set(t,e);++p<u;){var b=e[p],_=t[p];if(s)var y=l?s(_,b,p,t,e,c):s(b,_,p,e,t,c);if(void 0!==y){if(y)continue;v=!1;break}if(m){if(!o(t,(function(e,t){if(!i(m,t)&&(b===e||a(b,e,n,s,c)))return m.push(t)}))){v=!1;break}}else if(b!==_&&!a(b,_,n,s,c)){v=!1;break}}return c.delete(e),c.delete(t),v}},8351:(e,t,n)=>{var r=n(2705),o=n(1149),i=n(7813),s=n(7114),a=n(8776),c=n(1814),l=r?r.prototype:void 0,u=l?l.valueOf:void 0;e.exports=function(e,t,n,r,l,d,f){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new o(e),new o(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return i(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var h=a;case"[object Set]":var p=1&r;if(h||(h=c),e.size!=t.size&&!p)return!1;var v=f.get(e);if(v)return v==t;r|=2,f.set(e,t);var m=s(h(e),h(t),r,l,d,f);return f.delete(e),m;case"[object Symbol]":if(u)return u.call(e)==u.call(t)}return!1}},6096:(e,t,n)=>{var r=n(8234),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,i,s,a){var c=1&n,l=r(e),u=l.length;if(u!=r(t).length&&!c)return!1;for(var d=u;d--;){var f=l[d];if(!(c?f in t:o.call(t,f)))return!1}var h=a.get(e),p=a.get(t);if(h&&p)return h==t&&p==e;var v=!0;a.set(e,t),a.set(t,e);for(var m=c;++d<u;){var b=e[f=l[d]],_=t[f];if(i)var y=c?i(_,b,f,t,e,a):i(b,_,f,e,t,a);if(!(void 0===y?b===_||s(b,_,n,i,a):y)){v=!1;break}m||(m="constructor"==f)}if(v&&!m){var g=e.constructor,w=t.constructor;g==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof w&&w instanceof w||(v=!1)}return a.delete(e),a.delete(t),v}},1957:(e,t,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},8234:(e,t,n)=>{var r=n(8866),o=n(9551),i=n(3674);e.exports=function(e){return r(e,i,o)}},5050:(e,t,n)=>{var r=n(7019);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},852:(e,t,n)=>{var r=n(8458),o=n(7801);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},9607:(e,t,n)=>{var r=n(2705),o=Object.prototype,i=o.hasOwnProperty,s=o.toString,a=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch(c){}var o=s.call(e);return r&&(t?e[a]=n:delete e[a]),o}},9551:(e,t,n)=>{var r=n(4963),o=n(479),i=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols,a=s?function(e){return null==e?[]:(e=Object(e),r(s(e),(function(t){return i.call(e,t)})))}:o;e.exports=a},4160:(e,t,n)=>{var r=n(8552),o=n(7071),i=n(3818),s=n(8525),a=n(577),c=n(4239),l=n(346),u="[object Map]",d="[object Promise]",f="[object Set]",h="[object WeakMap]",p="[object DataView]",v=l(r),m=l(o),b=l(i),_=l(s),y=l(a),g=c;(r&&g(new r(new ArrayBuffer(1)))!=p||o&&g(new o)!=u||i&&g(i.resolve())!=d||s&&g(new s)!=f||a&&g(new a)!=h)&&(g=function(e){var t=c(e),n="[object Object]"==t?e.constructor:void 0,r=n?l(n):"";if(r)switch(r){case v:return p;case m:return u;case b:return d;case _:return f;case y:return h}return t}),e.exports=g},7801:e=>{e.exports=function(e,t){return null==e?void 0:e[t]}},1789:(e,t,n)=>{var r=n(4536);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},401:e=>{e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},7667:(e,t,n)=>{var r=n(4536),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(t,e)?t[e]:void 0}},1327:(e,t,n)=>{var r=n(4536),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},1866:(e,t,n)=>{var r=n(4536);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},5776:e=>{var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},7019:e=>{e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},5346:(e,t,n)=>{var r,o=n(4429),i=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!i&&i in e}},5726:e=>{var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},7040:e=>{e.exports=function(){this.__data__=[],this.size=0}},4125:(e,t,n)=>{var r=n(8470),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():o.call(t,n,1),--this.size,0))}},2117:(e,t,n)=>{var r=n(8470);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},7518:(e,t,n)=>{var r=n(8470);e.exports=function(e){return r(this.__data__,e)>-1}},4705:(e,t,n)=>{var r=n(8470);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},4785:(e,t,n)=>{var r=n(1989),o=n(8407),i=n(7071);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},1285:(e,t,n)=>{var r=n(5050);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},6e3:(e,t,n)=>{var r=n(5050);e.exports=function(e){return r(this,e).get(e)}},9916:(e,t,n)=>{var r=n(5050);e.exports=function(e){return r(this,e).has(e)}},5265:(e,t,n)=>{var r=n(5050);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},8776:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},4536:(e,t,n)=>{var r=n(852)(Object,"create");e.exports=r},6916:(e,t,n)=>{var r=n(5569)(Object.keys,Object);e.exports=r},1167:(e,t,n)=>{e=n.nmd(e);var r=n(1957),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,s=i&&i.exports===o&&r.process,a=function(){try{return i&&i.require&&i.require("util").types||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=a},2333:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},5639:(e,t,n)=>{var r=n(1957),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},619:e=>{e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},2385:e=>{e.exports=function(e){return this.__data__.has(e)}},1814:e=>{e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},7465:(e,t,n)=>{var r=n(8407);e.exports=function(){this.__data__=new r,this.size=0}},3779:e=>{e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},7599:e=>{e.exports=function(e){return this.__data__.get(e)}},4758:e=>{e.exports=function(e){return this.__data__.has(e)}},4309:(e,t,n)=>{var r=n(8407),o=n(7071),i=n(3369);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!o||s.length<199)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(s)}return n.set(e,t),this.size=n.size,this}},346:e=>{var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(n){}try{return e+""}catch(n){}}return""}},7813:e=>{e.exports=function(e,t){return e===t||e!=e&&t!=t}},5694:(e,t,n)=>{var r=n(9454),o=n(7005),i=Object.prototype,s=i.hasOwnProperty,a=i.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(e){return o(e)&&s.call(e,"callee")&&!a.call(e,"callee")};e.exports=c},1469:e=>{var t=Array.isArray;e.exports=t},8612:(e,t,n)=>{var r=n(3560),o=n(1780);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},4144:(e,t,n)=>{e=n.nmd(e);var r=n(5639),o=n(5062),i=t&&!t.nodeType&&t,s=i&&e&&!e.nodeType&&e,a=s&&s.exports===i?r.Buffer:void 0,c=(a?a.isBuffer:void 0)||o;e.exports=c},8446:(e,t,n)=>{var r=n(939);e.exports=function(e,t){return r(e,t)}},3560:(e,t,n)=>{var r=n(4239),o=n(3218);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1780:e=>{e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},3218:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},6719:(e,t,n)=>{var r=n(8749),o=n(1717),i=n(1167),s=i&&i.isTypedArray,a=s?o(s):r;e.exports=a},3674:(e,t,n)=>{var r=n(4636),o=n(280),i=n(8612);e.exports=function(e){return i(e)?r(e):o(e)}},8306:(e,t,n)=>{var r=n(3369);function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=e.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(o.Cache||r),n}o.Cache=r,e.exports=o},479:e=>{e.exports=function(){return[]}},5062:e=>{e.exports=function(){return!1}},2703:(e,t,n)=>{var r=n(414);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,i,s){if(s!==r){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return n.PropTypes=n,n}},5697:(e,t,n)=>{e.exports=n(2703)()},414:e=>{e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},9787:t=>{t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={id:e,loaded:!1,exports:{}};return t[e](i,i.exports,r),i.loaded=!0,i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var o={};return(()=>{r.r(o),r.d(o,{default:()=>le,expandNodesToLevel:()=>ce});var e=r(4184),t=r.n(e),n=r(8446),i=r.n(n),s=r(8306),a=r.n(s);let c=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce(((e,t)=>e+((t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_")),"");var l=r(5697),u=r.n(l),d=r(9787),f=r.n(d);function h(e){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var p=["children","title"];function v(){return v=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},v.apply(this,arguments)}function m(e,t){return(m=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&m(e,t)}(s,e);var t,n,r,o,i=(r=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=b(r);if(o){var n=b(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===h(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function s(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),i.apply(this,arguments)}return t=s,(n=[{key:"render",value:function(){var e=this.props,t=e.children,n=e.title,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,p);return f().createElement("button",v({"aria-label":n,title:n,type:"button"},r),t)}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(f().PureComponent);_(y,"propTypes",{children:u().node.isRequired,title:u().string}),_(y,"defaultProps",{title:null});const g=y,w={ALL:"all",PARENT:"parent",LEAF:"leaf"};function k(e){this.message=e,this.stack=Error().stack}k.prototype=Object.create(Error.prototype),k.prototype.name="CheckboxTreeError";const x=k;function S(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function C(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var P=w;const E=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.props=t,this.flatNodes=n}var t,n;return t=e,n=[{key:"setProps",value:function(e){this.props=e}},{key:"clone",value:function(){var t=this,n={};return Object.keys(this.flatNodes).forEach((function(e){var r=t.flatNodes[e];n[e]=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(Object(n),!0).forEach((function(t){C(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},r)})),new e(this.props,n)}},{key:"getNode",value:function(e){return this.flatNodes[e]}},{key:"reset",value:function(){this.flatNodes={}}},{key:"flattenNodes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(Array.isArray(e)&&0!==e.length){var o=this.props,i=o.disabled,s=o.noCascade;e.forEach((function(e,o){var a=t.nodeHasChildren(e);if(void 0!==t.flatNodes[e.value])throw new x("Duplicate value '".concat(e.value,"' detected. All node values must be unique."));t.flatNodes[e.value]={label:e.label,value:e.value,children:e.children,parent:n,isChild:void 0!==n.value,isParent:a,isLeaf:!a,showCheckbox:void 0===e.showCheckbox||e.showCheckbox,disabled:t.getDisabledState(e,n,i,s),treeDepth:r,index:o},t.flattenNodes(e.children,e,r+1)}))}}},{key:"nodeHasChildren",value:function(e){return Array.isArray(e.children)}},{key:"getDisabledState",value:function(e,t,n,r){return!!n||!(r||!t.disabled)||Boolean(e.disabled)}},{key:"deserializeLists",value:function(e){var t=this,n=["checked","expanded"];Object.keys(this.flatNodes).forEach((function(e){n.forEach((function(n){t.flatNodes[e][n]=!1}))})),n.forEach((function(n){e[n].forEach((function(e){void 0!==t.flatNodes[e]&&(t.flatNodes[e][n]=!0)}))}))}},{key:"serializeList",value:function(e){var t=this,n=[];return Object.keys(this.flatNodes).forEach((function(r){t.flatNodes[r][e]&&n.push(r)})),n}},{key:"expandAllNodes",value:function(e){var t=this;return Object.keys(this.flatNodes).forEach((function(n){t.flatNodes[n].isParent&&(t.flatNodes[n].expanded=e)})),this}},{key:"toggleChecked",value:function(e,t,n,r){var o=this,i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=this.flatNodes[e.value],a=[P.PARENT,P.ALL].indexOf(n)>-1,c=[P.LEAF,P.ALL].indexOf(n)>-1;if(s.isLeaf||r){if(e.disabled)return this;this.toggleNode(e.value,"checked",t)}else(a||0===s.children.length)&&this.toggleNode(e.value,"checked",t),c&&s.children.forEach((function(e){o.toggleChecked(e,t,n,r,!1)}));return i&&!r&&s.isChild&&a&&this.toggleParentStatus(s.parent,n),this}},{key:"toggleParentStatus",value:function(e,t){var n=this.flatNodes[e.value];n.isChild?(t===P.ALL&&this.toggleNode(e.value,"checked",this.isEveryChildChecked(n)),this.toggleParentStatus(n.parent,t)):this.toggleNode(e.value,"checked",this.isEveryChildChecked(n))}},{key:"isEveryChildChecked",value:function(e){var t=this;return e.children.every((function(e){return t.getNode(e.value).checked}))}},{key:"toggleNode",value:function(e,t,n){return this.flatNodes[e][t]=n,this}}],n&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function O(e){return(O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function j(){return j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},j.apply(this,arguments)}function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function M(e,t){return(M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function R(e){return(R=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function T(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var N=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&M(e,t)}(s,e);var t,n,r,o,i=(r=s,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=R(r);if(o){var n=R(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===O(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function s(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),i.apply(this,arguments)}return t=s,n=[{key:"componentDidMount",value:function(){this.updateDeterminateProperty()}},{key:"componentDidUpdate",value:function(){this.updateDeterminateProperty()}},{key:"updateDeterminateProperty",value:function(){var e=this.props.indeterminate;this.checkbox.indeterminate=e}},{key:"render",value:function(){var e=this,t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(Object(n),!0).forEach((function(t){T(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},this.props);return delete t.indeterminate,f().createElement("input",j({},t,{ref:function(t){e.checkbox=t},type:"checkbox"}))}}],n&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(f().PureComponent);T(N,"propTypes",{indeterminate:u().bool}),T(N,"defaultProps",{indeterminate:!1});const z=N,U=u().shape({check:u().node,uncheck:u().node,halfCheck:u().node,expandClose:u().node,expandOpen:u().node,expandAll:u().node,collapseAll:u().node,parentClose:u().node,parentOpen:u().node,leaf:u().node}),I=u().shape({collapseAll:u().string.isRequired,expandAll:u().string.isRequired,toggle:u().string.isRequired});function L(e){return(L="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function B(e,t){return(B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function D(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function H(e){return(H=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function F(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var q=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&B(e,t)}(a,e);var n,r,o,i,s=(o=a,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=H(o);if(i){var n=H(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===L(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return D(e)}(this,e)});function a(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=s.call(this,e)).onCheck=t.onCheck.bind(D(t)),t.onCheckboxKeyPress=t.onCheckboxKeyPress.bind(D(t)),t.onCheckboxKeyUp=t.onCheckboxKeyUp.bind(D(t)),t.onClick=t.onClick.bind(D(t)),t.onExpand=t.onExpand.bind(D(t)),t}return n=a,(r=[{key:"onCheck",value:function(){var e=this.props,t=e.value;(0,e.onCheck)({value:t,checked:this.getCheckState({toggle:!0})})}},{key:"onCheckboxKeyPress",value:function(e){32===e.which&&e.preventDefault()}},{key:"onCheckboxKeyUp",value:function(e){var t=e.keyCode;[13,32].includes(t)&&this.onCheck()}},{key:"onClick",value:function(){var e=this.props,t=e.expandOnClick,n=e.isParent,r=e.value,o=e.onClick;n&&t&&this.onExpand(),o({value:r,checked:this.getCheckState({toggle:!1})})}},{key:"onExpand",value:function(){var e=this.props,t=e.expanded,n=e.value;(0,e.onExpand)({value:n,expanded:!t})}},{key:"getCheckState",value:function(e){var t=e.toggle,n=this.props,r=n.checked,o=n.optimisticToggle;return!(0!==r||!t)||1===r&&!t||2===r&&o}},{key:"renderCollapseButton",value:function(){var e=this.props,t=e.expandDisabled,n=e.isLeaf,r=e.lang;return n?f().createElement("span",{className:"rct-collapse"},f().createElement("span",{className:"rct-icon"})):f().createElement(g,{className:"rct-collapse rct-collapse-btn",disabled:t,title:r.toggle,onClick:this.onExpand},this.renderCollapseIcon())}},{key:"renderCollapseIcon",value:function(){var e=this.props,t=e.expanded,n=e.icons,r=n.expandClose,o=n.expandOpen;return t?o:r}},{key:"renderCheckboxIcon",value:function(){var e=this.props,t=e.checked,n=e.icons,r=n.uncheck,o=n.check,i=n.halfCheck;return 0===t?r:1===t?o:i}},{key:"renderNodeIcon",value:function(){var e=this.props,t=e.expanded,n=e.icon,r=e.icons,o=r.leaf,i=r.parentClose,s=r.parentOpen,a=e.isLeaf;return null!==n?n:a?o:t?s:i}},{key:"renderBareLabel",value:function(e){var t=this.props,n=t.onClick,r=t.title,o=null!==n;return f().createElement("span",{className:"rct-bare-label",title:r},o?f().createElement("span",{className:"rct-node-clickable",onClick:this.onClick,onKeyPress:this.onClick,role:"button",tabIndex:0},e):e)}},{key:"renderCheckboxLabel",value:function(e){var t=this.props,n=t.checked,r=t.disabled,o=t.title,i=t.treeId,s=t.value,a=null!==t.onClick,c="".concat(i,"-").concat(String(s).split(" ").join("_")),l=[f().createElement("label",{key:0,htmlFor:c,title:o},f().createElement(z,{checked:1===n,disabled:r,id:c,indeterminate:2===n,onClick:this.onCheck,onChange:function(){}}),f().createElement("span",{"aria-checked":1===n,"aria-disabled":r,className:"rct-checkbox",role:"checkbox",tabIndex:0,onKeyPress:this.onCheckboxKeyPress,onKeyUp:this.onCheckboxKeyUp},this.renderCheckboxIcon()),a?null:e)];return a&&l.push(f().createElement("span",{key:1,className:"rct-node-clickable",onClick:this.onClick,onKeyPress:this.onClick,role:"link",tabIndex:0},e)),l}},{key:"renderLabel",value:function(){var e=this.props,t=e.label,n=e.showCheckbox,r=[e.showNodeIcon?f().createElement("span",{key:0,className:"rct-node-icon"},this.renderNodeIcon()):null,f().createElement("span",{key:1,className:"rct-title"},t)];return n?this.renderCheckboxLabel(r):this.renderBareLabel(r)}},{key:"renderChildren",value:function(){return this.props.expanded?this.props.children:null}},{key:"render",value:function(){var e=this.props,n=e.className,r=e.disabled,o=e.expanded,i=e.isLeaf,s=t()({"rct-node":!0,"rct-node-leaf":i,"rct-node-parent":!i,"rct-node-expanded":!i&&o,"rct-node-collapsed":!i&&!o,"rct-disabled":r},n);return f().createElement("li",{className:s},f().createElement("span",{className:"rct-text"},this.renderCollapseButton(),this.renderLabel()),this.renderChildren())}}])&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),a}(f().PureComponent);F(q,"propTypes",{checked:u().number.isRequired,disabled:u().bool.isRequired,expandDisabled:u().bool.isRequired,expanded:u().bool.isRequired,icons:U.isRequired,isLeaf:u().bool.isRequired,isParent:u().bool.isRequired,label:u().node.isRequired,lang:I.isRequired,optimisticToggle:u().bool.isRequired,showNodeIcon:u().bool.isRequired,treeId:u().string.isRequired,value:u().oneOfType([u().string,u().number]).isRequired,onCheck:u().func.isRequired,onExpand:u().func.isRequired,children:u().node,className:u().string,expandOnClick:u().bool,icon:u().node,showCheckbox:u().bool,title:u().string,onClick:u().func}),F(q,"defaultProps",{children:null,className:null,expandOnClick:!1,icon:null,showCheckbox:!0,title:null,onClick:function(){}});const W=q,$=u().oneOfType([u().arrayOf(u().string),u().arrayOf(u().number)]);function V(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function X(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?V(Object(n),!0).forEach((function(t){K(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function K(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Q={label:u().node.isRequired,value:u().oneOfType([u().string,u().number]).isRequired,disabled:u().bool,icon:u().node,showCheckbox:u().bool,title:u().string};const G=u().oneOfType([u().shape(Q),u().shape(X(X({},Q),{},{children:u().arrayOf(Q).isRequired}))]);function Y(e){return(Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function J(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(n),!0).forEach((function(t){oe(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Z(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ee(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function te(e,t){return(te=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function ne(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function re(e){return(re=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function oe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ie=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&te(e,t)}(d,e);var n,r,o,s,l,u=(s=d,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=re(s);if(l){var n=re(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===Y(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ne(e)}(this,e)});function d(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d),t=u.call(this,e);var n=new E(e);return n.flattenNodes(e.nodes),n.deserializeLists({checked:e.checked,expanded:e.expanded}),t.state={id:e.id||"rct-".concat(c()),model:n,prevProps:e},t.onCheck=t.onCheck.bind(ne(t)),t.onExpand=t.onExpand.bind(ne(t)),t.onNodeClick=t.onNodeClick.bind(ne(t)),t.onExpandAll=t.onExpandAll.bind(ne(t)),t.onCollapseAll=t.onCollapseAll.bind(ne(t)),t.combineMemorized=a()((function(e,t){return J(J({},e),t)})).bind(ne(t)),t}return n=d,r=[{key:"onCheck",value:function(e){var t=this.props,n=t.checkModel,r=t.noCascade,o=t.onCheck,i=this.state.model.clone(),s=i.getNode(e.value);i.toggleChecked(e,e.checked,n,r),o(i.serializeList("checked"),J(J({},s),e))}},{key:"onExpand",value:function(e){var t=this.props.onExpand,n=this.state.model.clone(),r=n.getNode(e.value);n.toggleNode(e.value,"expanded",e.expanded),t(n.serializeList("expanded"),J(J({},r),e))}},{key:"onNodeClick",value:function(e){(0,this.props.onClick)(J(J({},this.state.model.getNode(e.value)),e))}},{key:"onExpandAll",value:function(){this.expandAllNodes()}},{key:"onCollapseAll",value:function(){this.expandAllNodes(!1)}},{key:"expandAllNodes",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];(0,this.props.onExpand)(this.state.model.clone().expandAllNodes(e).serializeList("expanded"))}},{key:"determineShallowCheckState",value:function(e,t){var n=this.state.model.getNode(e.value);return n.isLeaf||t||0===e.children.length?n.checked?1:0:this.isEveryChildChecked(e)?1:this.isSomeChildChecked(e)?2:0}},{key:"isEveryChildChecked",value:function(e){var t=this;return e.children.every((function(e){return 1===t.state.model.getNode(e.value).checkState}))}},{key:"isSomeChildChecked",value:function(e){var t=this;return e.children.some((function(e){return t.state.model.getNode(e.value).checkState>0}))}},{key:"renderTreeNodes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.props,o=r.expandDisabled,i=r.expandOnClick,s=r.icons,a=r.lang,c=r.noCascade,l=r.onClick,u=r.onlyLeafCheckboxes,h=r.optimisticToggle,p=r.showNodeTitle,v=r.showNodeIcon,m=this.state,b=m.id,_=m.model,y=d.defaultProps.icons,g=e.map((function(e){var r=e.value,d=_.getNode(e.value),m=d.isParent?t.renderTreeNodes(e.children,e):null;d.checkState=t.determineShallowCheckState(e,c);var g=u?d.isLeaf:d.showCheckbox;return!n.value||_.getNode(n.value).expanded?f().createElement(W,{key:r,checked:d.checkState,className:e.className,disabled:d.disabled,expandDisabled:o,expandOnClick:i,expanded:d.expanded,icon:e.icon,icons:t.combineMemorized(y,s),label:e.label,lang:a,optimisticToggle:h,isLeaf:d.isLeaf,isParent:d.isParent,showCheckbox:g,showNodeIcon:v,title:p?e.title||e.label:e.title,treeId:b,value:e.value,onCheck:t.onCheck,onClick:l&&t.onNodeClick,onExpand:t.onExpand},m):null}));return f().createElement("ol",null,g)}},{key:"renderExpandAll",value:function(){var e=this.props,t=e.icons,n=t.expandAll,r=t.collapseAll,o=e.lang;return e.showExpandAll?f().createElement("div",{className:"rct-options"},f().createElement(g,{className:"rct-option rct-option-expand-all",title:o.expandAll,onClick:this.onExpandAll},n),f().createElement(g,{className:"rct-option rct-option-collapse-all",title:o.collapseAll,onClick:this.onCollapseAll},r)):null}},{key:"renderHiddenInput",value:function(){var e=this.props,t=e.name,n=e.nameAsArray;return void 0===t?null:n?this.renderArrayHiddenInput():this.renderJoinedHiddenInput()}},{key:"renderArrayHiddenInput",value:function(){var e=this.props,t=e.checked,n=e.name;return t.map((function(e){var t="".concat(n,"[]");return f().createElement("input",{key:e,name:t,type:"hidden",value:e})}))}},{key:"renderJoinedHiddenInput",value:function(){var e=this.props,t=e.checked,n=e.name,r=t.join(",");return f().createElement("input",{name:n,type:"hidden",value:r})}},{key:"render",value:function(){var e,n=this.props,r=n.direction,o=n.disabled,i=n.iconsClass,s=n.nodes,a=n.nativeCheckboxes,c=this.state.id,l=this.renderTreeNodes(s),u=t()((oe(e={"react-checkbox-tree":!0,"rct-disabled":o},"rct-icons-".concat(i),!0),oe(e,"rct-native-display",a),oe(e,"rct-direction-rtl","rtl"===r),e));return f().createElement("div",{className:u,id:c},this.renderExpandAll(),this.renderHiddenInput(),l)}}],o=[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.model,r=t.prevProps,o=e.disabled,s=e.id,a=e.nodes,c=J(J({},t),{},{prevProps:e});return n.setProps(e),i()(r.nodes,a)&&r.disabled===o||(n.reset(),n.flattenNodes(a)),null!==s&&(c=J(J({},c),{},{id:s})),n.deserializeLists({checked:e.checked,expanded:e.expanded}),c}}],r&&ee(n.prototype,r),o&&ee(n,o),Object.defineProperty(n,"prototype",{writable:!1}),d}(f().Component);function se(e){return function(e){if(Array.isArray(e))return ae(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return ae(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ae(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ae(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ce(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(n>t)return[];var r=[];return e.forEach((function(e){e.children&&(r=[].concat(se(r),[e.value],se(ce(e.children,t,n+1))))})),r}oe(ie,"propTypes",{nodes:u().arrayOf(G).isRequired,checkModel:u().oneOf([w.LEAF,w.ALL]),checked:$,direction:u().string,disabled:u().bool,expandDisabled:u().bool,expandOnClick:u().bool,expanded:$,icons:U,iconsClass:u().string,id:u().string,lang:I,name:u().string,nameAsArray:u().bool,nativeCheckboxes:u().bool,noCascade:u().bool,onlyLeafCheckboxes:u().bool,optimisticToggle:u().bool,showExpandAll:u().bool,showNodeIcon:u().bool,showNodeTitle:u().bool,onCheck:u().func,onClick:u().func,onExpand:u().func}),oe(ie,"defaultProps",{checkModel:w.LEAF,checked:[],direction:"ltr",disabled:!1,expandDisabled:!1,expandOnClick:!1,expanded:[],icons:{check:f().createElement("span",{className:"rct-icon rct-icon-check"}),uncheck:f().createElement("span",{className:"rct-icon rct-icon-uncheck"}),halfCheck:f().createElement("span",{className:"rct-icon rct-icon-half-check"}),expandClose:f().createElement("span",{className:"rct-icon rct-icon-expand-close"}),expandOpen:f().createElement("span",{className:"rct-icon rct-icon-expand-open"}),expandAll:f().createElement("span",{className:"rct-icon rct-icon-expand-all"}),collapseAll:f().createElement("span",{className:"rct-icon rct-icon-collapse-all"}),parentClose:f().createElement("span",{className:"rct-icon rct-icon-parent-close"}),parentOpen:f().createElement("span",{className:"rct-icon rct-icon-parent-open"}),leaf:f().createElement("span",{className:"rct-icon rct-icon-leaf"})},iconsClass:"fa4",id:null,lang:{collapseAll:"Collapse all",expandAll:"Expand all",toggle:"Toggle"},name:void 0,nameAsArray:!1,nativeCheckboxes:!1,noCascade:!1,onlyLeafCheckboxes:!1,optimisticToggle:!0,showExpandAll:!1,showNodeIcon:!0,showNodeTitle:!1,onCheck:function(){},onClick:null,onExpand:function(){}});const le=ie})(),o})())(Pt));function es(e,t){const n=function(e,t){const n=t.lastIndexOf("/"),r=t.substring(n+1);return"personal-v2/"+Ii+"/"+e+"/"+r}(e,t);return Ui+"/"+zi+"/"+n}async function ts(e,t){let n=await fetch(Li+"?bundleUrl="+encodeURIComponent(e));const r=await n.json();if(!r.success)throw new Error("Unable to put personal bundle");const o=r.post,i=new FormData;if(Object.entries(o.fields).forEach((([e,t])=>{i.append(e,t)})),i.append("acl","public-read"),i.append("file",new Blob([t])),n=await fetch(o.url,{method:"post",body:i}),200!==n.status&&204!==n.status)throw new Error("Unable to put changes: "+n.statusText)}function ns(e,t){return os(e.name,function(e,t){return new Promise((n=>{t.dispatch(ii.actions.reset());const r=new FileReader;r.addEventListener("load",(async e=>{n(new Uint8Array(r.result))})),r.addEventListener("progress",(e=>{t.dispatch(ii.actions.progress([e.loaded,e.total]))})),r.readAsArrayBuffer(e)}))}(e,t),null,null,t)}async function rs(e,t){var n;const r=(null==(n=t.getState().auth.account)?void 0:n.email)??"guest",o=await es(r,e);return os(e,async function(e,t){try{return await vi(t).cache.get(e)}catch(u){}t.dispatch(ii.actions.reset());const n=await fetch(e,{cache:"no-store"});if(200!==n.status)throw new Error("Resource not avalible ("+n.status+"): "+n.statusText);const r=n.headers.get("Content-Length"),o=null===r?0:Number.parseInt(r),i=n.body.getReader();let s=0;const a=[];for(;;){const{done:n,value:r}=await i.read();if(n)break;a.push(r),s+=r.length;const c=Math.min(e.startsWith(Hi)?s/2:s,o);t.dispatch(ii.actions.progress([c,o]))}let c=0;const l=new Uint8Array(s);for(const d of a)l.set(d,c),c+=d.length;return vi(t).cache.put(e,l).catch(console.error),l}(e,t),async function(e,t){t.getState().auth.ready||await new Promise((e=>{let n=null;const r=()=>{t.getState().auth.ready&&(n(),e())};n=t.subscribe(r)}));const n=t.getState().auth.account,r=(null==n?void 0:n.email)??"guest",o=es(r,e),i=await async function(e,t,n){if(null===t||!t.premium)return await vi(n).cache.get(e).catch((()=>null));try{const t=await fetch(e,{cache:"no-cache"});if(200!==t.status)throw new Error("Resource not avalible ("+t.status+"): "+t.statusText);return t.arrayBuffer().then((e=>new Uint8Array(e)))}catch(r){return await vi(n).cache.get(e).catch((()=>null))}}(o,n,t);return{url:o,bundle:i}}(o,t),e,t)}async function os(e,t,n,r,o){const i=vi(o),s=o.dispatch;i.loadedBundle=null,s(Si.actions.bndLoad(e));const a=await t;s(ii.actions.ready());const c=await n;s(Si.actions.bndConfig());const l=await emulators.bundleConfig(a);s(ai.actions.init(l)),null===l?s(ji.actions.frameConf()):is(l,s),i.loadedBundle={bundleUrl:r,bundleChangesUrl:(null==c?void 0:c.url)??null,bundle:a,bundleChanges:(null==c?void 0:c.bundle)??null},s(Si.actions.bndReady({}))}function is(e,t){e.dosboxConf.indexOf("sockdrive")>=0&&(t(Si.actions.dosBackendLocked(!0)),t(Si.actions.dosBackend("dosboxX"))),t(Si.actions.mouseCapture(e.dosboxConf.indexOf("autolock=true")>=0))}function ss(e,t){const n=new Blob([t],{type:"application/zip"});!function(e,t,n=!0){const r=document.createElement("a");r.href=t,r.target=n?"_blank":"_self",r.download=e,r.style.display="none",document.body.appendChild(r),r.click(),r.remove()}(e,URL.createObjectURL(n))}function as(){const e=oi(),t=on((e=>e.dos.ci)),n=mi(),[r,o]=ie(0),[i,s]=ie(null),[a,c]=ie([]),[l,u]=ie([]),[d,f]=ie(null),[h,p]=ie(!1);function v(e){s(e),o(Math.round(ps(e)/1024/1024*100)/100)}return ae((()=>{if(null===n.ci||!t)return;let e=!1;return n.ci.fsTree().then((t=>{e||v(cs(t))})).catch((t=>{console.error(t),e||v(null)})),()=>{e=!0}}),[t]),Ri("div",{class:"editor-fs-frame frame-root items-start px-4",children:[(h||null!==d)&&Ri("div",{class:"card card-bordered bg-base-100 shadow-xl w-full",children:Ri("div",{class:"card-body",children:[Ri("div",{class:"card-title",children:e(h?"please_wait":"uploading_file")}),Ri("span",{class:"break-words",children:h?e("making_bundle"):d})]})}),!h&&null===d&&i&&Ri("div",{className:"fs-tree-view",children:[Ri(us,{onRefresh:async function(){if(v(null),null===n.ci||!t)return;v(cs(await n.ci.fsTree()))},onUploadingFile:f,onMakingBundle:p}),Ri("div",{class:"bg-base-200 px-2 py-1 text-right",children:[e("size"),": ",r," Mb"]}),Ri("div",{class:"fs-tree",children:Ri(Ji,{icons:{expandOpen:Ri(fs,{}),expandClose:Ri(hs,{})},iconsClass:"icon",nativeCheckboxes:!1,onlyLeafCheckboxes:!0,nodes:i,checked:l,onCheck:function(e,t){u(e)},expanded:a,onExpand:function(e,t){c(e)}})})]})]})}function cs(e){var t;const n=[];for(const r of(null==(t=e.nodes)?void 0:t.sort(ds))||[])n.push(ls(r,"."));return n}function ls(e,t){const n=t+"/"+e.name,r={label:e.name,value:n,fsNode:e};if(null!==e.nodes){const t=e.nodes.sort(ds).map((e=>ls(e,n)));r.children=t}return r}function us(e){const t=oi(),n=le(null),r=le(null),o=Jn(),i=mi(),{onRefresh:s,onUploadingFile:a,onMakingBundle:c}=e;function l(e){const t=(e?r:n).current;null!==t&&t.click()}async function u(e){const t=i.ci,n=e.target.files;if(null!==t&&null!==n){try{for(const e of n){a(e.name);const n=(e.webkitRelativePath??"").split("/");n.shift();const r=n.join("/");await t.fsWriteFile(0==r.length?e.name:r,e.stream())}}finally{a(null)}await s()}}return ae((()=>{null!==n.current&&(n.current.setAttribute("directory",""),n.current.setAttribute("webkitdirectory",""))}),[n]),Ri("div",{class:"h-6 flex flex-row",children:[Ri("input",{class:"hidden",type:"file",multiple:!0,ref:n,onChange:u}),Ri("input",{class:"hidden",type:"file",multiple:!0,ref:r,onChange:u}),Ri("button",{class:"refresh btn-xs rounded-none",onClick:s,children:Ri("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-4 h-4",children:Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99"})})}),Ri("button",{class:"add-file btn-xs rounded-none",onClick:()=>l(!0),children:Ri("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-4 h-4",children:Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m3.75 9v6m3-3H9m1.5-12H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})})}),Ri("button",{class:"add-dir btn-xs rounded-none",onClick:()=>l(!1),children:Ri("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-4 h-4",children:Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 10.5v6m3-3H9m4.06-7.19l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})})}),Ri("div",{class:"flex-grow"}),Ri("button",{class:"download btn-xs rounded-none",onClick:async function(){const e=i.ci;if(null!==e){c(!0);try{const t=await e.persist(!1);t&&ss("bundle.jsdos",t)}finally{c(!1)}}},children:Ri("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-4 h-4",children:Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 13.5l3 3m0 0l3-3m-3 3v-6m1.06-4.19l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})})}),Ri("button",{class:"restart btn-xs rounded-none",onClick:async function(){const e=i.ci;if(null!==e&&window.confirm(t("fs_restart"))){c(!0);try{const t=await e.persist(!1);t&&async function(e,t,n){await os("bundle.jsdos",Promise.resolve(e),null,null,n),t&&n.dispatch(ji.actions.frameConf())}(t,!0,o)}finally{c(!1)}}},children:Ri("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-4 h-4",children:Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21 7.5V18M15 7.5V18M3 16.811V8.69c0-.864.933-1.406 1.683-.977l7.108 4.061a1.125 1.125 0 010 1.954l-7.108 4.061A1.125 1.125 0 013 16.811z"})})})]})}function ds(e,t){return null!==e.nodes&&null!==t.nodes?t.name.localeCompare(e.name):null===e.nodes?1:-1}function fs(){return Ri("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-4 h-4 mr-2",children:Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"})})}function hs(){return Ri("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-4 h-4 mr-2",children:Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})})}function ps(e){if(!e)return 0;let t=0;for(const n of e)null!==n.fsNode.size?t+=n.fsNode.size:t+=ps(n.children);return t}function vs(e){const t=oi(),n=!0===e.multiline;return Ri("div",{class:e.class+" option flex "+(n?"flex-col":"flex-row items-center"),children:[Ri("div",{class:n?"mb-2":"mr-4",children:e.label}),Ri("div",{class:"flex-grow",children:Ri("select",{class:e.selectClass?e.selectClass:n?"w-full":"w-28",onChange:function(t){void 0!==e.onSelect&&e.onSelect(t.currentTarget.value)},disabled:!0===e.disabled,children:e.values.map((n=>Ri("option",{selected:n===e.selected,value:n,children:t(n)})))})})]})}function ms(){const e=on((e=>e.dos.backendLocked));return Ri(ks,{label:"emulation_backend",values:[...yi],disabled:e,selector:e=>e.dos.backend,dispatch:e=>(Vo.setItem("backend",e),Si.actions.dosBackend(e))})}function bs(){const e="run"===on((e=>e.ui.window));return Ri(ks,{label:"render_backend",values:[...gi],disabled:e,selector:e=>e.dos.renderBackend,dispatch:e=>Si.actions.renderBackend(e)})}function _s(e){return Ri(ks,{label:"render_aspect",multiline:e.multiline,values:[...wi],selector:e=>e.dos.renderAspect,dispatch:e=>Si.actions.renderAspect(e)})}function ys(e){return Ri(ks,{label:"image_rendering",multiline:e.multiline,values:[...xi],selector:e=>e.dos.imageRendering,dispatch:e=>Si.actions.imageRendering(e)})}function gs(e){return Ri(ks,{class:e.class,label:"theme",values:[...Oi],selector:e=>e.ui.theme,dispatch:e=>ji.actions.theme(e),multiline:e.multiline})}function ws(e){return Ri(ks,{class:e.class,label:"FAT16/32 Backend",values:ci,selector:e=>e.init.sockdriveBackendName,dispatch:e=>fi.actions.setSockdriveBackendName(e),multiline:e.multiline})}function ks(e){const t=oi(),n=on(e.selector),r=tr();return Ri(vs,{class:"mt-4 "+e.class,selectClass:e.selectClass,disabled:e.disabled,multiline:e.multiline,label:t(e.label),selected:n,values:e.values,onSelect:function(t){r(e.dispatch(t))}})}function xs(e){return Ri("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",class:e.class??"absolute left-0 top-0 -ml-1 -mt-1 text-error w-4 h-4",children:Ri("path",{"fill-rule":"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z","clip-rule":"evenodd"})})}function Ss(){const e=oi(),t=on((e=>e.auth.account)),{sockdriveEndpoint:n}=on((e=>li[e.init.sockdriveBackendName]??li["js-dos"])),[r,o]=ie([]),i=tr(),s=(null==t?void 0:t.premium)??!1,a=(null==t?void 0:t.email)??"",[c,l]=ie(""),[u,d]=ie(!0),f=le(null),h=le(null),[p,v]=ie(""),[m,b]=ie(""),[_,g]=ie(null),[w,k]=ie(-1);function x(){t&&t.token?(d(!0),fetch(n+"/list/drives/"+t.token.access_token).then((e=>e.json())).then((e=>{console.log(JSON.stringify(e,null,2)),o(e.sort(((e,t)=>e.name.localeCompare(t.name))))})).catch(console.error).finally((()=>d(!1)))):(o([{fork_of:[],name:"fat32-2gb",owner:"system",template:"fat32-2gb"},{fork_of:[],name:"fat16-256m",owner:"system",template:"fat16-256m"},{fork_of:["system/fat16-256m"],name:"win95-v1",owner:"system",template:"fat16-256m"},{fork_of:["system/fat16-256m"],name:"dos7.1-v1",owner:"system",template:"fat16-256m"},{fork_of:["system/fat32-2gb"],name:"win98-v1",owner:"system",template:"fat32-2gb"},{fork_of:["system/fat32-2gb"],name:"win95-v2",owner:"system",template:"fat32-2gb"}]),d(!1))}return ae((()=>{x()}),[null==t?void 0:t.token,n]),Ri("div",{class:"frame-root items-start gap-3 px-4",children:[Ri(ws,{multiline:!0,class:"w-full "}),Ri("input",{class:"input input-bordered input-sm w-full",placeholder:e("filter"),value:c,onChange:e=>l(e.currentTarget.value??"")}),Ri("div",{class:"w-full",children:[!u&&Ri("table",{class:"table w-full",children:[Ri("thead",{children:Ri("tr",{children:[Ri("th",{children:e("net_drives")}),Ri("th",{})]})}),Ri("tbody",{children:r.map((({name:n,owner:r,fork_of:o},l)=>c.length>0&&-1===r.indexOf(c)&&-1===n.indexOf(c)?null:Ri(y,{children:Ri("tr",{children:[Ri("td",{onClick:()=>{},children:[Ri("p",{class:"font-bold",children:n}),o.map((e=>Ri("p",{class:"text-xs",children:[" ",e]}))),r!==(null==t?void 0:t.email)&&Ri("p",{class:"text-xs",children:r})]}),s&&Ri("td",{children:[(null==t?void 0:t.token)&&Ri("div",{class:"btn btn-ghost btn-xs",onClick:()=>{var e;k(l),null==(e=f.current)||e.showModal()},children:"Fork"}),(null==t?void 0:t.token)&&r===a&&Ri("div",{class:"btn btn-xs btn-ghost",onClick:()=>{var e;k(l),null==(e=h.current)||e.showModal()},children:e("delete")})]}),!s&&Ri("td",{children:Ri("div",{class:"cursor-pointer",onClick:()=>Ai(t,i),children:Ri(xs,{class:"text-error"})})})]})})))})]}),u&&Ri("span",{class:"loading loading-spinner loading-lg"})]}),Ri("dialog",{ref:f,class:"modal",children:!u&&w>=0&&null!==t&&Ri("div",{class:"modal-box",children:[Ri("h3",{class:"font-bold text-lg",children:[e("enter_name_of_drive"),":"]}),Ri("p",{class:"text-xs text-neutral-content mt-2",children:["fork of: ",r[w].owner,"/",r[w].name]}),Ri("input",{type:"text",placeholder:"name",value:p,class:"mt-6 input input-bordered input-primary w-full",onChange:e=>v(e.currentTarget.value)}),null!==_&&Ri("p",{class:"mt-2 text-error",children:[e("error"),": ",_]}),Ri("div",{class:"modal-action",children:[p.length>0&&Ri("button",{class:"btn mr-2 btn-primary",onClick:()=>{k(-1),d(!0),fetch(`${n}/fork/drive/${r[w].owner}/${r[w].name}/${p}/${t.token.access_token}`,{method:"POST"}).then((e=>e.json())).then((e=>{var t;if(e.error)throw new Error(e.error);o([]),x(),null==(t=f.current)||t.close()})).catch((e=>{console.error(e.message),i(ji.actions.showToast({message:e.message,intent:"error"}))})).finally((()=>{d(!1)}))},children:e("fork")}),Ri("button",{class:"btn",onClick:()=>{var e;return null==(e=f.current)?void 0:e.close()},children:e("close")})]})]})}),Ri("dialog",{ref:h,class:"modal",children:!u&&w>=0&&null!==t&&Ri("div",{class:"modal-box",children:[Ri("h3",{class:"font-bold text-lg",children:[e("enter_name_of_drive"),":"]}),Ri("p",{class:"text-xs text-neutral mt-2",children:[r[w].owner,"/",r[w].name]}),Ri("input",{type:"text",placeholder:"name",value:m,class:"mt-6 input input-bordered input-primary w-full",onChange:e=>b(e.currentTarget.value)}),null!==_&&Ri("p",{class:"mt-2 text-error",children:[e("error"),": ",g]}),Ri("div",{class:"modal-action",children:[m===r[w].owner+"/"+r[w].name&&Ri("button",{class:"btn mr-2 btn-primary",onClick:()=>{k(-1),d(!0),fetch(`${n}/fork/delete/${r[w].owner}/${r[w].name}/${t.token.access_token}`,{method:"POST"}).then((e=>e.json())).then((e=>{var t;if(e.error)throw new Error(e.error);{const e=[...r];e.splice(w,1),o(e)}null==(t=h.current)||t.close()})).catch((e=>{console.error(e.message),g(e.message),i(ji.actions.showToast({message:e.message,intent:"error"}))})).finally((()=>{d(!1)}))},children:e("delete")}),Ri("button",{class:"btn",onClick:()=>{var e;return null==(e=h.current)?void 0:e.close()},children:e("close")})]})]})})]})}function Cs(e){const t=le(null);return ae((()=>{null!==t&&null!==t.current&&(t.current.indeterminate=e.intermediate)}),[t,e.intermediate]),Ri("div",{className:e.class+" form-control option",onClick:function(){e.onChange&&e.onChange(!(!0===e.checked))},children:Ri("label",{className:"label cursor-pointer",children:[Ri("span",{className:"label-text mr-6",children:e.label}),Ri("input",{ref:t,checked:!0===e.checked,type:"checkbox",className:"toggle "+(e.checked?" toggle-primary ":"")+e.toggleClass,disabled:!0===e.disabled})]})})}function Ps(){const e=on((e=>e.auth.account)),t=on((e=>e.dos.network)),n=t.room,r=t.server,o="disconnected"!==t.ipx,i=oi(),s=tr(),a=!0===(null==e?void 0:e.premium),c="connected"===t.ipx?location.href+function(){if(location.href.endsWith("?")||location.href.endsWith("&"))return"";return location.href.indexOf("?")>0?"&":"?"}()+"ipx=1&server="+t.server+"&room="+n:null;return ae((()=>{"netherlands"!==r&&!0!==(null==e?void 0:e.premium)&&s(Si.actions.setServer("netherlands"))}),[r,e]),Ri("div",{class:"network-frame frame-root items-start px-4 relative",children:[Ri("div",{class:"ml-1 mb-4 w-full flex flex-row items-center",children:[Ri(vs,{class:"text-sm",selectClass:"w-full",label:i("server")+":",selected:r,values:["netherlands","newyork","singapore"],disabled:o,onSelect:function(t){var n;n=t,s(Si.actions.setServer(n)),a||Ai(e,s)}}),Ri("div",{onClick:function(){Ai(e,s)},children:Ri(xs,{class:"cursor-pointer ml-2 w-4 h-4 text-error"})})]}),Ri("div",{class:"form-control w-full",children:[Ri("label",{class:"label",children:Ri("span",{class:"label-text",children:[i("room"),":"]})}),Ri("input",{type:"text",class:"input w-full input-sm input-bordered",disabled:o,onChange:e=>{return t=e.currentTarget.value,void s(Si.actions.setRoom(t));var t},value:n})]}),Ri(Cs,{class:"mt-4 "+("error"===t.ipx?"error":""),onChange:function(){"connected"===t.ipx?s(Si.actions.disconnectIpx({})):s(Si.actions.connectIpx({room:n,address:"wss://"+(a?r:"netherlands")+".dos.zone"}))},label:"IPX",checked:"connected"===t.ipx,disabled:"connecting"===t.ipx,intermediate:"connecting"===t.ipx}),null!==c&&Ri("div",{class:"mt-4 text-sm alert alert-success shadow-lg flex flex-col",children:[Ri("div",{children:[i("copy_net_link"),":"]}),Ri("div",{class:"flex flex-row",children:[Ri("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-6 h-6 mx-1 cursor-pointer hover:text-accent-focus flex-shrink-0",fill:"none",onClick:function(){c&&(!async function(e,t,n){if(!navigator.clipboard)return;try{await navigator.clipboard.writeText(e),n(ji.actions.showToast({message:t("copied"),intent:"success"}))}catch(r){n(ji.actions.showToast({message:t("error"),intent:"error"}))}}(c,i,s),s(ji.actions.frameNone()))},viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",children:Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 01-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 011.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 00-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 01-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 00-3.375-3.375h-1.5a1.125 1.125 0 01-1.125-1.125v-1.5a3.375 3.375 0 00-3.375-3.375H9.75"})}),Ri("div",{class:"contextmenu underline break-all",target:"_blank",children:c})]})]})]})}function Es(e){return Ri("svg",{xmlns:"http://www.w3.org/2000/svg",style:"padding: 2px",viewBox:"0 0 16 16","enable-background":"new 0 0 16 16",fill:"currentColor",class:"w-full h-full rounded-lg "+e.class,children:Ri("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.71,2.29l-2-2C13.53,0.11,13.28,0,13,0h-1v6H4V0H1C0.45,0,0,0.45,0,1v14 c0,0.55,0.45,1,1,1h14c0.55,0,1-0.45,1-1V3C16,2.72,15.89,2.47,15.71,2.29z M14,15H2V9c0-0.55,0.45-1,1-1h10c0.55,0,1,0.45,1,1V15 z M11,1H9v4h2V1z"})})}function Os(e){const[t,n]=ie(!1),r=on((e=>e.auth.account)),o=null===r&&!1,i=tr(),s=oi(),a=on((e=>e.ui.cloudSaves)),c=mi();if(!a||null===c.loadedBundle||null===c.loadedBundle.bundleChangesUrl)return null;return Ri("div",{class:"save-button sidebar-button overflow-hidden "+(t?" sidebar-highlight ":"")+e.class+(o?" opacity-50":""),onClick:async function(){var e;if(o)return void i(ji.actions.modalLogin());if(t)return;const a=c.ci,l=null==(e=c.loadedBundle)?void 0:e.bundleChangesUrl;if(null!==a&&l){n(!0);try{const e=await a.persist(!0);null!==e&&(null!==r&&r.premium?await Promise.all([ts(l,e),c.cache.put(l,e)]):await c.cache.put(l,e)),i(ji.actions.showToast({message:s("success"),intent:"success"}))}catch(u){i(ji.actions.showToast({message:s("unable_to_save"),intent:"error"})),console.error(u)}finally{n(!1)}}},children:Ri("div",{class:"w-full h-full flex justify-center",children:[Ri(Es,{}),t&&Ri("div",{class:"sidebar-badge"}),o&&Ri(xs,{}),Ri("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"absolute bottom-1 w-3 h-3 text-primary-content",children:Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 16.5V9.75m0 0l3 3m-3-3l-3 3M6.75 19.5a4.5 4.5 0 01-1.41-8.775 5.25 5.25 0 0110.233-2.33 3 3 0 013.758 3.848A3.752 3.752 0 0118 19.5H6.75z"})})]})})}function js(){var e;const t=(null==(e=on((e=>e.auth.account)))?void 0:e.premium)&&!1;return Ri("div",{class:"quick-save-frame flex flex-col justify-center items-center -my-2",children:[Ri(Os,{}),Ri(As,{label:"quick",bgcolor:"bg-primary",textcolor:"text-primary-content"}),Ri(Ms,{label:"quick",bgcolor:"bg-primary"}),t&&Ri(y,{children:[Ri(As,{disabled:!t,label:2,bgcolor:"bg-secondary",textcolor:"text-secondary-content"}),Ri(Ms,{disabled:!t,label:2,bgcolor:"bg-secondary"}),Ri(As,{disabled:!t,label:3,bgcolor:"bg-accent",textcolor:"text-accent-content"}),Ri(Ms,{disabled:!t,label:3,bgcolor:"bg-accent"})]})]})}function As(e){const t=on((e=>e.auth.account)),n=tr(),r=mi();return Ri("div",{class:"sidebar-button flex justify-center "+(e.disabled?"opacity-50":""),onClick:function(){!0===e.disabled&&Ai(t,n);const o=r.ci;null!==o&&o.sendBackendEvent({type:"wc-trigger-event",event:"hand_savestate"})},children:[Ri(Es,{}),!0!==e.disabled&&Ri("div",{class:"text-badge "+e.textcolor+" "+e.bgcolor,children:e.label}),!0===e.disabled&&Ri(xs,{}),Ri("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"absolute bottom-1 w-3 h-3",children:Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"})})]})}function Ms(e){const t=on((e=>e.auth.account)),n=tr(),r=mi();return Ri("div",{class:"sidebar-button flex justify-center "+(e.disabled?" opacity-50":""),onClick:function(){!0===e.disabled&&Ai(t,n);const o=r.ci;null!==o&&o.sendBackendEvent({type:"wc-trigger-event",event:"hand_loadstate"})},children:[Ri(Es,{class:"opacity-10"}),!0===e.disabled&&Ri(xs,{}),Ri("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"absolute bottom-1 w-6 h-6 -scale-y-100",children:Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m15 15 6-6m0 0-6-6m6 6H9a6 6 0 0 0 0 12h3"})})]})}function Rs(){const e=oi(),t=tr(),n=on((e=>e.ui.editor));return Ri(Cs,{class:"mt-4",label:e("editor"),checked:n,onChange:e=>t(ji.actions.setEditor(e))})}function Ts(){const e=oi(),t=tr(),n=on((e=>e.dos.mouseCapture));return Ri(Cs,{class:"mt-4",label:e("mouse_lock"),checked:n,onChange:e=>t(Si.actions.mouseCapture(e))})}function Ns(){const e=oi(),t=tr(),n=on((e=>e.dos.paused)),r="run"!==on((e=>e.ui.window));return Ri(Cs,{class:"mt-4",label:e("pause"),checked:n,disabled:r,onChange:e=>t(Si.actions.paused(e))})}function zs(){const e=oi(),t=tr(),n=on((e=>e.dos.worker)),r=on((e=>e.dos.backendHardware)),o="run"===on((e=>e.ui.window)),i=mi();return r&&i.options.backendHardware?null:Ri(Cs,{class:"mt-4",label:e("worker"),checked:n,disabled:o,onChange:e=>t(Si.actions.dosWorker(e))})}function Us(){const e=oi(),t=tr(),n=on((e=>e.dos.backendHardware));return mi().options.backendHardware?Ri(Cs,{class:"mt-4",label:e("hardware"),checked:n,onChange:e=>t(Si.actions.dosBackendHardware(e))}):null}function Is(){const e=oi(),t=tr(),n=on((e=>e.auth.account)),r=!0===(null==n?void 0:n.premium),o=on((e=>"dosboxX"===e.dos.backend)),i=on((e=>e.dos.sockdriveWrite))&&r;return o?Ri(Cs,{class:"mt-4",label:e("fat_write"),checked:i,onChange:e=>{r?t(Si.actions.setSockdriveWrite(e)):Ai(n,t)}}):null}function Ls(e){const t=le(null),n=le(null);ae((()=>{if(null===(null==t?void 0:t.current))return;const n=t.current;let r=!1;function o(t){const r=n.getBoundingClientRect(),o=Math.min(1,Math.max(0,(t.clientX-r.left)/r.width));e.onChange(o)}function i(e){r=!0,o(e)}function s(e){r&&o(e)}function a(e){r=!1}return n.addEventListener("pointerdown",i),n.addEventListener("pointermove",s),n.addEventListener("pointerup",a),n.addEventListener("pointercancel",a),n.addEventListener("pointerleave",a),()=>{n.removeEventListener("pointerdown",i),n.removeEventListener("pointermove",s),n.removeEventListener("pointerup",a),n.removeEventListener("pointercancel",a),n.removeEventListener("pointerleave",a)}}),[t]);const r=Math.min(Math.max(0,100*e.value),100);return Ri("div",{class:e.class+" slider option",children:[Ri("div",{class:"label",children:e.label}),Ri("div",{class:"touch",ref:t,children:[Ri("div",{class:"bg"}),Ri("div",{class:"point",ref:n,style:{left:"calc("+r+"% - 12px)"}})]})]})}function Bs(e){const t=oi(),n=on((e=>e.dos.mouseSensitivity)),r=tr();return Ri(Ls,{class:"mt-4 "+e.class,label:t("mouse_sensitivity"),value:n,onChange:e=>r(Si.actions.mouseSensitivity(e))})}function Ds(e){const t=oi(),n=on((e=>e.dos.volume)),r=tr();return Ri(Ls,{class:e.class,label:t("volume"),value:n,onChange:e=>r(Si.actions.volume(e))})}function Hs(e){return Ri("div",{class:"settings-frame frame-root items-start pl-4",children:[Ri(Ns,{}),Ri(Ts,{}),Ri(Bs,{}),Ri(Ds,{}),Ri(Rs,{}),Ri(gs,{multiline:!0})]})}function Fs(){const e=on((e=>e.dos.ciStartedAt)),t=on((e=>e.dos.stats)),n=Math.round(on((e=>e.dos.stats.cyclesPerMs))/1e3),r=Math.round(t.driveRecv/1024/1024*100)/100,o=t.driveRecvTime/1e3>1?Math.round(r/t.driveRecvTime*1e3*100)/100:0;return Ri("div",{class:"stats-frame frame-root items-start px-4",children:Ri("div",{class:"w-full overflow-x-auto",children:Ri("table",{class:"table table-compact w-full",children:[Ri("thead",{children:Ri("tr",{children:[Ri("th",{children:"Metric"}),Ri("th",{children:"Value"})]})}),Ri("tbody",{children:[Ri("tr",{children:[Ri("td",{children:"Uptime"}),Ri("td",{children:[Math.round((Date.now()-e)/100)/10," s"]})]}),Ri("tr",{children:[Ri("td",{children:"Cycles/ms"}),n<=0&&Ri("td",{children:"~ K"}),n>0&&n<=1e3&&Ri("td",{children:[n," K"]}),n>1e3&&Ri("td",{children:[Math.round(n/1e3)," KK"]})]}),Ri("tr",{children:[Ri("td",{children:"NonSkipSleep COUNT/s"}),Ri("td",{children:t.nonSkippableSleepPreSec})]}),Ri("tr",{children:[Ri("td",{children:"Sleep COUNT/s"}),Ri("td",{children:t.sleepPerSec})]}),Ri("tr",{children:[Ri("td",{children:"Sleep TIME/s"}),Ri("td",{children:t.sleepTimePerSec})]}),Ri("tr",{children:[Ri("td",{children:"Msg FRAME/s"}),Ri("td",{children:t.framePerSec})]}),Ri("tr",{children:[Ri("td",{children:"Msg SOUND/s"}),Ri("td",{children:t.soundPerSec})]}),Ri("tr",{children:[Ri("td",{children:"Msg SENT/s"}),Ri("td",{children:t.msgSentPerSec})]}),Ri("tr",{children:[Ri("td",{children:"Msg RECV/s"}),Ri("td",{children:t.msgRecvPerSec})]}),Ri("tr",{children:[Ri("td",{children:"Net SENT/s"}),Ri("td",{children:[Math.round(t.netSent/1024*100)/100,"Kb"]})]}),Ri("tr",{children:[Ri("td",{children:"Net RECV/s"}),Ri("td",{children:[Math.round(t.netRecv/1024*100)/100,"Kb"]})]}),Ri("tr",{children:[Ri("td",{children:"HDD RECV/s"}),Ri("td",{children:[r,"Mb (~",o,"Mb/s)"]})]}),Ri("tr",{children:[Ri("td",{children:"HDD SENT/s"}),Ri("td",{children:[Math.round(t.driveSent/1024/1024*100)/100,"Mb"]})]}),Ri("tr",{children:[Ri("td",{children:"HDD Cache"}),Ri("td",{children:[Math.round(t.driveCacheUsed/1024/1024*100)/100,"Mb"]})]}),Ri("tr",{children:[Ri("td",{children:"HDD Cache Hit/Miss"}),Ri("td",{children:[t.driveCacheHit," / ",t.driveCacheMiss]})]})]})]})})})}function qs(e){return Ri("div",{class:"image-rendering-frame frame-root items-start pl-4",children:[Ri(_s,{multiline:!0}),Ri(ys,{multiline:!0})]})}function Ws(e){const t=on((e=>e.ui.frame)),n=on((e=>e.ui.frameXs)),r=on((e=>e.ui.wideScreen));return"none"===t?null:Ri("div",{class:"frame "+(n?" frame-xs ":"")+(n||r?"":" frame-md"),children:["account"===t&&Ri(Vi,{}),"settings"===t&&Ri(Hs,{}),"editor-conf"===t&&Ri(Yi,{}),"editor-fs"===t&&Ri(as,{}),"network"===t&&Ri(Ps,{}),"stats"===t&&Ri(Fs,{}),"fat-drives"===t&&Ri(Ss,{}),"quick-save"===t&&Ri(js,{}),"image-rendering"===t&&Ri(qs,{})]})}function $s(e){const t=on((e=>e.auth.account)),n=null!==t,r="account"===on((e=>e.ui.frame)),o=tr();return Ri("div",{class:"sidebar-button "+(r?"sidebar-highlight ":"")+("dz.caiiiycuk@gmail.com"===(null==t?void 0:t.email)?"bg-accent ":"")+e.class,onClick:function(){Ai(t,o)},children:[Ri("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-full h-full",children:Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.982 18.725A7.488 7.488 0 0012 15.75a7.488 7.488 0 00-5.982 2.975m11.963 0a9 9 0 10-11.963 0m11.963 0A8.966 8.966 0 0112 21a8.966 8.966 0 01-5.982-2.275M15 9.75a3 3 0 11-6 0 3 3 0 016 0z"})}),!1===n&&Ri("div",{class:"sidebar-badge"})]})}function Vs(e,t){const n=vi(t).root;e?n.requestFullscreen?n.requestFullscreen():n.webkitRequestFullscreen?n.webkitRequestFullscreen():n.mozRequestFullScreen?n.mozRequestFullScreen():n.msRequestFullscreen?n.msRequestFullscreen():n.webkitEnterFullscreen?n.webkitEnterFullscreen():n.classList.add("jsdos-fullscreen-workaround"):n.classList.contains("jsdos-fullscreen-workaround")?n.classList.remove("jsdos-fullscreen-workaround"):document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen(),t.dispatch(ji.actions.setFullScreen(e))}function Xs(e){const t=on((e=>e.ui.fullScreen)),n=Jn();return Ri("div",{class:"fullscreen-button sidebar-button "+e.class,onClick:function(){Vs(!t,n)},children:Ri("div",{class:"w-full h-full scale-75 hover:scale-90",children:[!t&&Ri("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 16 16",fill:"currentColor",stroke:"none","enable-background":"new 0 0 16 16",children:Ri("g",{children:Ri("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.99,8.99c-0.28,0-0.53,0.11-0.71,0.29l-3.29,3.29v-1.59c0-0.55-0.45-1-1-1 s-1,0.45-1,1v4c0,0.55,0.45,1,1,1h4c0.55,0,1-0.45,1-1s-0.45-1-1-1H3.41L6.7,10.7c0.18-0.18,0.29-0.43,0.29-0.71 C6.99,9.44,6.54,8.99,5.99,8.99z M14.99-0.01h-4c-0.55,0-1,0.45-1,1s0.45,1,1,1h1.59L9.28,5.29C9.1,5.47,8.99,5.72,8.99,5.99 c0,0.55,0.45,1,1,1c0.28,0,0.53-0.11,0.71-0.29l3.29-3.29v1.59c0,0.55,0.45,1,1,1s1-0.45,1-1v-4C15.99,0.44,15.54-0.01,14.99-0.01 z"})})}),t&&Ri("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 16 16",fill:"currentColor",stroke:"none","enable-background":"new 0 0 16 16",children:Ri("g",{children:Ri("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.99,0.99c0-0.55-0.45-1-1-1c-0.28,0-0.53,0.11-0.71,0.29l-3.29,3.29V1.99 c0-0.55-0.45-1-1-1s-1,0.45-1,1v4c0,0.55,0.45,1,1,1h4c0.55,0,1-0.45,1-1s-0.45-1-1-1h-1.59L15.7,1.7 C15.88,1.52,15.99,1.27,15.99,0.99z M5.99,8.99h-4c-0.55,0-1,0.45-1,1s0.45,1,1,1h1.59l-3.29,3.29c-0.18,0.18-0.29,0.43-0.29,0.71 c0,0.55,0.45,1,1,1c0.28,0,0.53-0.11,0.71-0.29l3.29-3.29v1.59c0,0.55,0.45,1,1,1s1-0.45,1-1v-4C6.99,9.44,6.54,8.99,5.99,8.99z"})})})]})})}function Ks(e){const t="network"===on((e=>e.ui.frame)),n=on((e=>"connected"!==e.dos.network.ipx)),r=tr();return Ri("div",{class:"network-button sidebar-button "+(t?" sidebar-highlight ":"")+(n?" inactive ":"")+e.class,onClick:function(){r(t?ji.actions.frameNone():ji.actions.frameNetwork())},children:Ri("div",{class:"w-full h-full",children:[Ri("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-full h-full",children:Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.288 15.038a5.25 5.25 0 017.424 0M5.106 11.856c3.807-3.808 9.98-3.808 13.788 0M1.924 8.674c5.565-5.565 14.587-5.565 20.152 0M12.53 18.22l-.53.53-.53-.53a.75.75 0 011.06 0z"})}),n&&Ri("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-full text-error h-full absolute top-0 left-0",children:Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 4L18 18"})})]})})}function Qs(e){return Ri(ra,{class:e.class,frame:"image-rendering",action:ji.actions.frameImageRendering(),children:Ri("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-full h-full",children:Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 001.5-1.5V6a1.5 1.5 0 00-1.5-1.5H3.75A1.5 1.5 0 002.25 6v12a1.5 1.5 0 001.5 1.5zm10.5-11.25h.008v.008h-.008V8.25zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z"})})})}function Gs(e){const t=null===on((e=>e.auth.account))&&!1,n=t?ji.actions.modalLogin():ji.actions.frameQuickSave();return Ri(ra,{class:e.class+(t?" opacity-50":""),frame:"quick-save",action:n,children:[Ri(Es,{}),t&&Ri(xs,{})]})}function Ys(e){return Ri(ra,{class:e.class,frame:"fat-drives",action:ji.actions.frameFatDrives(),children:Ri("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-full h-full",children:Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5.25 14.25h13.5m-13.5 0a3 3 0 01-3-3m3 3a3 3 0 100 6h13.5a3 3 0 100-6m-16.5-3a3 3 0 013-3h13.5a3 3 0 013 3m-19.5 0a4.5 4.5 0 01.9-2.7L5.737 5.1a3.375 3.375 0 012.7-1.35h7.126c1.062 0 2.062.5 2.7 1.35l2.587 3.45a4.5 4.5 0 01.9 2.7m0 0a3 3 0 01-3 3m0 3h.008v.008h-.008v-.008zm0-6h.008v.008h-.008v-.008zm-3 6h.008v.008h-.008v-.008zm0-6h.008v.008h-.008v-.008z"})})})}function Zs(e){return Ri(ra,{class:e.class,frame:"editor-conf",action:ji.actions.frameConf(),children:Ri("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-full h-full",children:Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})})})}function Js(e){return Ri(ra,{class:e.class,frame:"editor-fs",action:ji.actions.frameFs(),children:Ri("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-full h-full",children:Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21.75 17.25v-.228a4.5 4.5 0 00-.12-1.03l-2.268-9.64a3.375 3.375 0 00-3.285-2.602H7.923a3.375 3.375 0 00-3.285 2.602l-2.268 9.64a4.5 4.5 0 00-.12 1.03v.228m19.5 0a3 3 0 01-3 3H5.25a3 3 0 01-3-3m19.5 0a3 3 0 00-3-3H5.25a3 3 0 00-3 3m16.5 0h.008v.008h-.008v-.008zm-3 0h.008v.008h-.008v-.008z"})})})}function ea(){const e=Math.round(on((e=>e.dos.stats.cyclesPerMs))/1e3);return Ri(ra,{class:"cycles",frame:"stats",action:ji.actions.frameStats(),children:[e<=0&&Ri(y,{children:[Ri("span",{children:"~"}),Ri("sup",{children:"KC"})]}),e>0&&e<=1e3&&Ri(y,{children:[Ri("span",{children:e}),Ri("sup",{children:"KC"})]}),e>0&&e>1e3&&Ri(y,{children:[Ri("span",{children:Math.round(e/1e3)}),Ri("sup",{children:[Ri("strong",{children:"K"}),"KC"]})]})]})}function ta(e){const t=Jn(),n=le(null),[r]=ie({recv:0,enabled:!1,delayLedTo:0});ae((()=>{if(n.current){const e=n.current;e.classList.add("bg-base-300");const o=setInterval((()=>{if(r.delayLedTo<=Date.now()){const n=t.getState().dos.stats.driveRecv,o=r.recv!==n;o!==r.enabled&&(e.classList.remove("bg-base-300","bg-green-300","animate-led"),o?e.classList.add("bg-green-300","animate-led"):e.classList.add("bg-base-300"),r.enabled=o),r.delayLedTo=o?Date.now()+300+1500*Math.random():0,r.recv=n}}),150);return()=>{e.classList.remove("bg-base-300","bg-green-300","animate-led"),clearInterval(o)}}}),[n,r]);const[o,i]=ie(!1),[s,a]=ie({recv:0,timeoutId:null}),c=on((e=>e.dos.stats.driveRecv));if(s.recv!==c){o||i(!0),s.timeoutId&&clearTimeout(s.timeoutId);const e=setTimeout((()=>{i(!1),a({recv:c,timeoutId:null})}),1e3);a({recv:c,timeoutId:e})}return Ri("div",{ref:n,class:"self-end mr-2 -mt-3 w-2 h-1"})}function na(e){return Ri(ra,{class:e.class,action:ji.actions.frameSettings(),frame:"settings",children:Ri("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-full h-full",children:[Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z"}),Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})})}function ra(e){const t=on((e=>e.ui.frame))===e.frame,n=tr();return Ri("div",{class:"sidebar-button "+(t?"sidebar-highlight ":"")+e.class,onClick:function(){n(t?ji.actions.frameNone():e.action)},children:e.children})}function oa(e){const t=on((e=>e.ui.window)),n=on((e=>e.ui.editor)),r=on((e=>e.dos.backend));return on((e=>e.ui.kiosk))?null:Ri("div",{class:"sidebar",children:["run"===t&&"dosbox"===r&&Ri(Os,{}),"run"===t&&"dosboxX"===r&&Ri(Gs,{}),"run"===t&&Ri(Qs,{}),"run"===t&&Ri(Ks,{}),n&&"prerun"===t&&Ri(Zs,{}),n&&"prerun"===t&&"dosboxX"===r&&Ri(Ys,{}),n&&"run"===t&&Ri(Js,{}),Ri("div",{class:"contentbar"}),"run"===t&&Ri(Xs,{}),"run"===t&&Ri(ea,{}),"run"===t&&Ri(ta,{}),("prerun"===t||"run"===t)&&Ri(na,{}),"run"!==t&&Ri($s,{})]})}const ia=48,sa={8:259,9:258,13:257,16:340,17:341,18:342,19:284,27:256,32:32,33:266,34:267,35:269,36:268,37:263,38:265,39:262,40:264,45:260,46:261,48:ia,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,59:59,64:61,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,93:93,96:320,97:321,98:322,99:323,100:324,101:325,102:326,103:327,104:328,105:329,111:331,112:290,113:291,114:292,115:293,116:294,117:295,118:296,119:297,120:298,121:299,122:300,123:301,144:282,145:281,173:45,186:59,187:61,188:44,189:45,190:46,191:47,219:91,220:92,221:93};for(const cc of Object.keys(sa));function aa(e){return sa[e]||0}function ca(e,t,n,r){const o=e.parentElement.getBoundingClientRect(),i=o.width,s=o.height;if(0===n)return;const a=r===ki?i/s:r??t/n;let c=i,l=i/a;l>s&&(l=s,c=s*a),e.style.position="relative",e.style.top=(s-l)/2+"px",e.style.left=(i-c)/2+"px",e.style.width=c+"px",e.style.height=l+"px"}const la="\nattribute vec4 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nvarying highp vec2 vTextureCoord;\n\nvoid main(void) {\n gl_Position = aVertexPosition;\n vTextureCoord = aTextureCoord;\n}\n",ua="\nvarying highp vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\n\nvoid main(void) {\n highp vec4 color = texture2D(uSampler, vTextureCoord);\n gl_FragColor = vec4(color.r, color.g, color.b, 1.0);\n}\n";function da(e,t,n){const r=e.getContext("webgl");if(null===r)throw new Error("Unable to create webgl context on given canvas");const o=function(e,t,n){const r=fa(e,e.VERTEX_SHADER,t),o=fa(e,e.FRAGMENT_SHADER,n),i=e.createProgram();if(e.attachShader(i,r),e.attachShader(i,o),e.linkProgram(i),!e.getProgramParameter(i,e.LINK_STATUS))throw new Error("Unable to initialize the shader program: "+e.getProgramInfoLog(i));return i}(r,la,ua),i=r.getAttribLocation(o,"aVertexPosition"),s=r.getAttribLocation(o,"aTextureCoord"),a=r.getUniformLocation(o,"uSampler");!function(e,t,n){const r=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,r);const o=[-1,-1,0,1,-1,0,1,1,0,-1,-1,0,1,1,0,-1,1,0];e.bufferData(e.ARRAY_BUFFER,new Float32Array(o),e.STATIC_DRAW),e.vertexAttribPointer(t,3,e.FLOAT,!1,0,0),e.enableVertexAttribArray(t);const i=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,i);const s=[0,1,1,1,1,0,0,1,1,0,0,0];e.bufferData(e.ARRAY_BUFFER,new Float32Array(s),e.STATIC_DRAW),e.vertexAttribPointer(n,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(n)}(r,i,s);const c=r.createTexture();r.bindTexture(r.TEXTURE_2D,c),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR);const l=new Uint8Array([0,0,0]);r.texImage2D(r.TEXTURE_2D,0,r.RGB,1,1,0,r.RGB,r.UNSIGNED_BYTE,l),r.useProgram(o),r.activeTexture(r.TEXTURE0),r.uniform1i(a,0);let u=0,d=0,f=null,h=null,p=0;const v=()=>{null!==h&&(r.texImage2D(r.TEXTURE_2D,0,p,u,d,0,p,r.UNSIGNED_BYTE,h),h=null),r.drawArrays(r.TRIANGLES,0,6),f=null},m=()=>{ca(e,u,d,n)},b=(t,n)=>{u=t,d=n,e.width=u,e.height=d,h=null,r.viewport(0,0,u,d),m()};t.events().onFrameSize(b),t.events().onFrame(((e,t)=>{h=null!=e?e:t,p=null!=e?r.RGB:r.RGBA,null===f&&(f=requestAnimationFrame(v))})),b(t.width(),t.height());const _=new ResizeObserver(m);return _.observe(e.parentElement),window.addEventListener("resize",m),()=>{t.events().onFrameSize((()=>{})),t.events().onFrame((()=>{})),_.disconnect(),window.removeEventListener("resize",m)}}function fa(e,t,n){const r=e.createShader(t);if(e.shaderSource(r,n),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS)){const t=e.getShaderInfoLog(r);throw e.deleteShader(r),new Error("An error occurred compiling the shaders: "+t)}return r}function ha(e,t,n){const r=e.getContext("2d");if(null===r)throw new Error("Unable to create 2d context on given canvas");let o=0,i=0;const s=()=>{ca(e,o,i,n)};let a=new Uint8ClampedArray(0);const c=(t,n)=>{o=t,i=n,e.width=o,e.height=i,a=new Uint8ClampedArray(t*n*4),s()};t.events().onFrameSize(c),t.events().onFrame(((e,t)=>{if(null===e&&null===t)return;const n=null!==e?e:t;let s=0,c=0;for(;c<a.length;)a[c++]=n[s++],a[c++]=n[s++],a[c++]=n[s++],a[c++]=255,n.length===a.length&&s++;r.putImageData(new ImageData(a,o,i),0,0)})),c(t.width(),t.height());const l=new ResizeObserver(s);return l.observe(e.parentElement),window.addEventListener("resize",s),()=>{t.events().onFrameSize((()=>{})),t.events().onFrame((()=>{})),l.disconnect(),window.removeEventListener("resize",s)}}class pa{constructor(){t(this,"samplesQueue",[])}push(e){this.samplesQueue.push(e)}length(){let e=0;for(const t of this.samplesQueue)e+=t.length;return e}writeTo(e,t){let n=0;for(;this.samplesQueue.length>0;){const r=this.samplesQueue[0],o=Math.min(t-n,r.length);if(o===r.length?(e.set(r,n),this.samplesQueue.shift()):(e.set(r.slice(0,o),n),this.samplesQueue[0]=r.slice(o)),n+=o,n===t)break}n<t&&e.fill(0,n)}}function va(e,t){if(e.type.match(/^touch/)){const n=e,r=t.getBoundingClientRect();return{x:n.targetTouches[0].clientX-r.x,y:n.targetTouches[0].clientY-r.y,mX:0,mY:0}}if(e.type.match(/^pointer/)){const t=e;return{x:t.offsetX,y:t.offsetY,mX:t.movementX,mY:t.movementY}}{const t=e;return{x:t.offsetX,y:t.offsetY,mX:t.movementX,mY:t.movementY,button:0===t.button?0:1}}}const ma=function(){const e=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),t=e&&!!("ontouchstart"in window),n=e&&!!window.PointerEvent,r=e&&!!window.MSPointerEvent;let o=!e;const i=[],s=[],a=[],c=[],l=[];return n?(i.push("pointerdown"),a.push("pointerup","pointercancel"),s.push("pointermove"),l.push("touchstart","touchmove","touchend")):r?(i.push("MSPointerDown"),s.push("MSPointerMove"),a.push("MSPointerUp")):t?(o=!1,i.push("touchstart","mousedown"),s.push("touchmove"),a.push("touchend","touchcancel","mouseup")):(i.push("mousedown"),s.push("mousemove"),a.push("mouseup"),c.push("mouseleave")),{mobile:e,canLock:o,starters:i,changers:s,enders:a,prevents:l,leavers:c}}();function ba(e,t,n,r,o,i){let s=0;const a=r=>{if(r.target!==e)return;const o=va(r,e);s=void 0===o.button?t:o.button,n(o.x,o.y,s),r.stopPropagation()},c=t=>{if(t.target!==e)return;const n=va(t,e);r(n.x,n.y,n.mX,n.mY),t.stopPropagation()},l=t=>{const n=va(t,e);o(n.x,n.y,s),t.stopPropagation()},u=t=>{if(t.target!==e)return;const n=va(t,e);i(n.x,n.y),t.stopPropagation()},d=e=>{e.stopPropagation()},f={capture:!1};for(const h of ma.starters)e.addEventListener(h,a,f);for(const h of ma.changers)e.addEventListener(h,c,f);for(const h of ma.enders)e.addEventListener(h,l,f);for(const h of ma.prevents)e.addEventListener(h,d,f);for(const h of ma.leavers)e.addEventListener(h,u,f);return()=>{for(const t of ma.starters)e.removeEventListener(t,a,f);for(const t of ma.changers)e.removeEventListener(t,c,f);for(const t of ma.enders)e.removeEventListener(t,l,f);for(const t of ma.prevents)e.removeEventListener(t,d,f);for(const t of ma.leavers)e.removeEventListener(t,u,f)}}const _a=.01;function ya(e,t,n){const r=(e,r)=>function(e,t,n,r){const{width:o,height:i}=n.getBoundingClientRect(),s=r.width(),a=r.height(),c=s/a;let l=o,u=o/c;u>i&&(u=i,l=i*c);const d=(i-u)/2,f=(o-l)/2;let h=Math.max(0,Math.min(1,(e-f)/l)),p=Math.max(0,Math.min(1,(t-d)/u));h<=_a&&(h=0);h>=1-_a&&(h=1);p<=_a&&(p=0);p>=1-_a&&(p=1);return{x:h,y:p}}(e,r,t,n);return document.pointerLockElement===t&&document.exitPointerLock(),ba(t,e,(function(e,t,o){const i=r(e,t);n.sendMouseMotion(i.x,i.y),n.sendMouseButton(o,!0)}),(function(e,t,o,i){const s=r(e,t);n.sendMouseMotion(s.x,s.y)}),(function(e,t,o){const i=r(e,t);n.sendMouseMotion(i.x,i.y),n.sendMouseButton(o,!1)}),(function(e,t){const o=r(e,t);n.sendMouseMotion(o.x,o.y)}))}const ga=500,wa=50;function ka(e,t,n,r,o){return e&&!ma.canLock?function(e,t,n,r){let o=-1,i=0,s=0,a=0;return ba(n,t,((e,t)=>{o=Date.now(),i=0,s=e,a=t}),(function(t,n,o,c){void 0===o&&(o=t-s),void 0===c&&(c=n-a),s=t,a=n,0===o&&0===c||(i+=Math.abs(o)+Math.abs(c),r.sendMouseRelativeMotion(o*e*2,c*e*2))}),((e,n)=>{if(Date.now()-o<ga&&i<wa){const e=t??0;r.sendMouseButton(e,!0),setTimeout((()=>r.sendMouseButton(e,!1)),60)}}),(()=>{}))}(t,n,r,o):e?function(e,t,n,r){function o(){return document.pointerLockElement!==n}return ba(n,t,(function(e,t,i){o()?(n.requestPointerLock||n.mozRequestPointerLock||n.webkitRequestPointerLock).call(n):r.sendMouseButton(i,!0)}),(function(t,n,i,s){o()||0===i&&0===s||r.sendMouseRelativeMotion(i*e,s*e)}),(function(e,t,n){o()||r.sendMouseButton(n,!1)}),(function(e,t){}))}(t,n,r,o):ya(n,r,o)}function xa(e,t){!function(e){const t=tr(),n=oi();ae((()=>{let r=0;const o={};e.events().onMessage(((e,...i)=>{var s,a,c,l,u;if("error"===e&&(null==(s=i[0])?void 0:s.startsWith("[panic]")))t(ji.actions.showToast({message:i[0],intent:"panic"}));else if("log"===e&&-1!==(null==(a=i[0])?void 0:a.indexOf("sockdrive:"))){const e=i[0].substring(i[0].indexOf(" ")+1,i[0].indexOf(","));if(t(ji.actions.cloudSaves(!1)),-1!==(null==(c=i[0])?void 0:c.indexOf("write="))&&console.log("drive",e,"config:",i[0]),-1!==(null==(l=i[0])?void 0:l.indexOf("write=false"))&&t(ji.actions.readOnlyWarning(!0)),-1!==(null==(u=i[0])?void 0:u.indexOf("preload="))){const s=Number.parseInt(i[0].substring(i[0].indexOf("preload=")+8));void 0===o[e]?(o[e]=s,r+=s):o[e]=s;let a=r;for(const e of Object.values(o))a-=e;t(ji.actions.showToast({message:n("preloading_sockdrive")+" "+Math.round(a/1024/1024*100)/100+"/"+Math.round(r/1024/1024*100)/100+"Mb",long:!0}))}}}))}),[e,t])}(t),function(e){const t=on((e=>e.dos.imageRendering));ae((()=>{e.style.imageRendering="smooth"===t?"auto":t}),[e,t])}(e),function(e){const t=tr();ae((()=>{let n=0,r=0,o=0,i=ia,s=0,a=0,c=0,l=0,u=Date.now();const d=setInterval((()=>{e.asyncifyStats().then((e=>{const d=Date.now()-u,f=d/1e3;if(f>0){const h={cyclesPerMs:Math.round((e.cycles-n)/d),nonSkippableSleepPreSec:Math.round((e.nonSkippableSleepCount-r)/f),sleepPerSec:Math.round((e.sleepCount-o)/f),sleepTimePerSec:Math.round((e.sleepTime-i)/f),framePerSec:Math.round((e.messageFrame-s)/f),soundPerSec:Math.round((e.messageSound-a)/f),msgSentPerSec:Math.round((e.messageSent-c)/f),msgRecvPerSec:Math.round((e.messageReceived-l)/f),netSent:e.netSent,netRecv:e.netRecv,driveSent:e.driveSent,driveRecv:e.driveRecv,driveRecvTime:e.driveRecvTime,driveCacheHit:e.driveCacheHit,driveCacheMiss:e.driveCacheMiss,driveCacheUsed:e.driveCacheUsed};t(Si.actions.stats(h)),n=e.cycles,r=e.nonSkippableSleepCount,o=e.sleepCount,i=e.sleepTime,s=e.messageFrame,a=e.messageSound,c=e.messageSent,l=e.messageReceived,u=Date.now()}}))}),3e3);return()=>{clearInterval(d)}}),[t,e])}(t),function(e){const t=on((e=>e.dos.paused));ae((()=>{t?e.pause():e.resume()}),[t,e])}(t),function(e){ae((()=>function(e,t){function n(e){if("text"===e.target.type)return;const n=aa(e.keyCode);t.sendKeyEvent(n,!0),e.stopPropagation(),e.preventDefault()}function r(e){if("text"===e.target.type)return;const n=aa(e.keyCode);t.sendKeyEvent(n,!1),e.stopPropagation(),e.preventDefault()}return e.addEventListener("keydown",n),e.addEventListener("keyup",r),()=>{e.removeEventListener("keydown",n),e.removeEventListener("keyup",r)}}(window,e)),[e])}(t),function(e,t){const n=on((e=>e.dos.mouseCapture)),r=on((e=>e.dos.mouseSensitivity));ae((()=>ka(n,.1+3*r,0,e,t)),[e,t,n,r])}(e,t),function(e,t){const n=on((e=>e.dos.renderBackend)),r=on((e=>e.dos.renderAspect));let o;switch(r){case"1/1":o=1;break;case"5/4":o=5/4;break;case"4/3":o=4/3;break;case"16/10":o=1.6;break;case"16/9":o=16/9;break;case"Fit":o=ki}ae((()=>{let r=()=>{};if("canvas"===n)r=ha(e,t,o);else try{r=da(e,t,o)}catch(i){console.error("Unalbe to start webgl render",i),r=ha(e,t,o)}return r}),[e,t,n,o])}(e,t),function(e){const t=Jn();ae((()=>{const n=function(e,t){const n=e.soundFrequency();if(0===n)return console.warn("Can't create audio node with sampleRate === 0, ingnoring"),()=>{};let r=null;if("undefined"!=typeof AudioContext?r=new AudioContext({sampleRate:n,latencyHint:"interactive"}):void 0!==window.webkitAudioContext&&(r=new window.webkitAudioContext({sampleRate:n,latencyHint:"interactive"})),null==r)return()=>{};const o=new pa;e.events().onSoundPush((e=>{o.length()<6144&&o.push(e)}));const i=r.createScriptProcessor(2048,0,1);let s=!1;i.onaudioprocess=e=>{const t=e.outputBuffer.length,n=e.outputBuffer.numberOfChannels,r=o.length();if(s||(s=r>=2048),s)for(let i=0;i<n;i++){const n=e.outputBuffer.getChannelData(i);o.writeTo(n,t)}};const a=r.createGain();let c;a.connect(r.destination),i.connect(a),a.gain.value=1,t&&(c=t((e=>{a.gain.value=e})));const l=()=>{null!==r&&"suspended"===r.state&&r.resume()};return document.addEventListener("pointerdown",l,{once:!0}),document.addEventListener("keydown",l,{once:!0}),()=>{e.events().onSoundPush((()=>{})),null!==r&&(i.disconnect(),a.disconnect(),r.close().catch(console.error),r=null),void 0!==c&&c(),document.removeEventListener("pointerdown",l),document.removeEventListener("keydown",l)}}(e,(e=>{let n=1;const r=()=>{const r=t.getState().dos.volume;Math.abs(n-r)>=.05&&(e(r),n=r)};return t.subscribe(r)}));return n}),[e])}(t)}const Sa="/b4b5275904d86a4ab8a20917b2b7e34f0df47bf7.jsdos";function Ca(e){const t=e.ci,n=on((e=>e.dos.backend)),r=on((e=>e.dos.worker)),[o,i]=ie({runs:0,time:0,vax:0,pc:null}),[s,a]=ie({sleepPerSec:0,cyclesPerMs:0});return ae((()=>{const e=[];t.events().onStdout((t=>{for(const n of e)n(t)}));const n=t.events().onStdout;t.events().onStdout=t=>{e.push(t)};let r=Date.now(),o=0,s=0;return t.events().onStdout((e=>{if(!e.startsWith("dhry2:"))return;t.asyncifyStats().then((e=>{const t=Date.now()-r;a({sleepPerSec:Math.round(1e3*(e.sleepCount-o)/t),cyclesPerMs:Math.round((e.cycles-s)/t)}),r=Date.now(),o=e.sleepCount,s=e.cycles}));const[n,c,l,u]=e.split(" "),d=Number.parseInt(c),f=Number.parseFloat(l),h=Number.parseFloat(u);i(f>=5e3?{runs:d,time:Math.round(10*f)/10,vax:Math.round(100*h)/100,pc:Pa(h)}:{runs:d,time:Math.round(10*f)/10,vax:Math.round(100*h)/100,pc:null})})),()=>{t.events().onStdout=n}}),[t]),Ri("div",{class:"dhry2-window",children:[Ri("div",{class:"title",children:"Dhrystone 2 Benchmark"}),Ri("div",{class:"backend",children:["Backend: ",n+"-"+(r?"worker":"direct")]}),Ri("div",{class:"results",children:[Ri("div",{children:"VAX:"}),Ri("div",{children:o.vax}),Ri("div",{children:"Cycles p/ms:"}),Ri("div",{children:s.cyclesPerMs}),Ri("div",{children:"Sleep p/sec:"}),Ri("div",{children:s.sleepPerSec}),Ri("div",{children:"Runs:"}),Ri("div",{children:o.runs}),Ri("div",{children:"Time:"}),Ri("div",{children:[o.time," ",Ri("span",{children:"ms"})]}),null!==o.pc&&Ri("div",{children:"PC:"}),null!==o.pc&&Ri("div",{children:o.pc??"..."})]})]})}function Pa(e){let t=0;for(;2*t+1<Ea.length&&!(Ea[2*t+1]>=e);)t++;return t=Math.min(Ea.length/2-1,t),(Ea[2*t]+"").trim()}const Ea=["AMD 80386 40MHz",13.7,"IBM 486D2 50MHz",22.4,"80486 DX2 66MHz",35.3,"IBM 486BL 100MHz",40.9,"AMD 5X86 133MHz",84.5,"Pentium 75MHz",87.1,"Cyrix P150 120MHz",160,"Pentium 100MHz",122,"Cyrix PP166 133MHz",180,"IBM 6x86 150MHz",188,"Pentium 133MHz",181,"Pentium 166MHz",189,"Cyrix PR233 188MHz",232,"Pentium 200MHz",269,"Pentium MMX 200MHz",276,"AMD K6 200MHz",289,"Pentium Pro 200MHz",312,"Celeron A 300MHz",484,"Pentium II 300MHz",477,"AMD K62 500MHz",606,"AMD K63 450MHz",645,"Pentium II 450MHz",713,"Celeron A 450MHz",720,"Pentium III 450MHz",722,"Pentium III 600MHz",959,"Athlon 600MHz",942,"Duron 600MHz",999,"Pentium III 1000MHz",1595,"PIII Tualatin 1200MHz",1907,"Pentium 4 1700MHz",1843,"Athlon Tbird 1000MHz",1659,"Duron 1000MHz",1674,"Celeron M 1295MHz",2273,"Atom 1600MHz",1828,"Pentium 4 1900MHz",2003,"Atom 1666MHz",1948,"P4 Xeon 2200MHz",2265,"Atom Z8300 1840MHz",2686,"Athlon 4 1600MHz",2830,"Pentium M 1862MHz",3933,"Ath4 Barton 1800MHz",3172,"Pentium 4E 3000MHz",3553,"Athlon XP 2080MHz",3700,"Turion 64 M 1900MHz",3742,"Pentium 4 3066MHz",4012,"Opteron 1991MHz",3985,"Core 2 Duo M 1830MHz",4952,"Athlon XP 2338MHz",4160,"Athlon 64 2150MHz",4288,"Pentium 4 3678MHz",4227,"Athlon 64 2211MHz",4462,"Celeron C2 M 2000MHz",5275,"Core 2 Duo 1 CP 2400MHz",6446,"Core i5 2467M 2300MHz",4752,"Phenom II 1 CP 3000MHz",7615,"Core i7 930 3066MHz",8684,"Core i7 860 3460MHz",9978,"Core i7 3930K 3800MHz",11197,"Core i7 4820K 3900MHz",11867,"Core i7 4820K 3900MHz",11978,"Core i7 3930K",13877],Oa=Symbol("newer"),ja=Symbol("older");class Aa{constructor(e,t){"number"!=typeof e&&(t=e,e=0),this.size=0,this.limit=e,this.oldest=this.newest=void 0,this._keymap=new Map,t&&(this.assign(t),e<1&&(this.limit=this.size))}_markEntryAsUsed(e){e!==this.newest&&(e[Oa]&&(e===this.oldest&&(this.oldest=e[Oa]),e[Oa][ja]=e[ja]),e[ja]&&(e[ja][Oa]=e[Oa]),e[Oa]=void 0,e[ja]=this.newest,this.newest&&(this.newest[Oa]=e),this.newest=e)}assign(e){let t,n=this.limit||Number.MAX_VALUE;this._keymap.clear();const r=e[Symbol.iterator]();for(let o=r.next();!o.done;o=r.next()){const e=new Ma(o.value[0],o.value[1]);if(this._keymap.set(e.key,e),t?(t[Oa]=e,e[ja]=t):this.oldest=e,t=e,0==n--)throw new Error("overflow")}this.newest=t,this.size=this._keymap.size}get(e){const t=this._keymap.get(e);if(t)return this._markEntryAsUsed(t),t.value}set(e,t){let n=this._keymap.get(e);return n?(n.value=t,this._markEntryAsUsed(n),this):(this._keymap.set(e,n=new Ma(e,t)),this.newest?(this.newest[Oa]=n,n[ja]=this.newest):this.oldest=n,this.newest=n,++this.size,this.size>this.limit&&this.shift(),this)}shift(){const e=this.oldest;if(e)return this.oldest[Oa]?(this.oldest=this.oldest[Oa],this.oldest[ja]=void 0):(this.oldest=void 0,this.newest=void 0),e[Oa]=e[ja]=void 0,this._keymap.delete(e.key),--this.size,[e.key,e.value]}}function Ma(e,t){this.key=e,this.value=t,this[Oa]=void 0,this[ja]=void 0}class Ra{constructor(e,t,n){this.aheadRange=t,this.sectorSize=e,this.lru=new Aa(Math.floor(n/(t*e)))}read(e,t){const n=this.getOrigin(e),r=this.lru.get(n);if(r){if(t)return r;{const t=e-n;return r.slice(t*this.sectorSize,(t+1)*this.sectorSize)}}return null}write(e,t){const n=this.getOrigin(e),r=this.lru.get(n);return r&&r.set(t,(e-n)*this.sectorSize),void 0!==r}create(e,t){this.lru.set(e,t.slice(0))}getOrigin(e){return e-e%this.aheadRange}memUsed(){return this.lru.size*this.aheadRange*this.sectorSize}}const Ta=67108864;class Na{constructor(e,t,n,r,o,i,s=!0,a=!1){this.socket=Promise.resolve(null),this.aheadRange=0,this.aheadSize=0,this.maxRead=0,this.readBuffer=new Uint8Array(0),this.readAheadBuffer=new Uint8Array(0),this.readAheadPos=0,this.readAheadCompressed=0,this.readStartedAt=0,this.decodeBuffer=new Uint8Array(0),this.cache=null,this.cleanup=()=>{},this.openFn=(e,t,n,r,o)=>{},this.preloadProgressFn=e=>{},this.errorFn=e=>{},this.preloadQueue=[],this.readOnly=!1,this.sectorSize=512,this.module=i,this.endpoint=e,this.owner=t,this.drive=n,this.token=r,this.request=null,this.pendingRequest=null,this.writeBuffer=new Uint8Array(5+this.sectorSize),this.stats=o,this.retries=3,this.preloadSectors=s,this.originReadMode=a,this.reconnect()}onError(e){this.errorFn=e}onOpen(e){this.openFn=e}onPreloadProgress(e){this.preloadProgressFn=e}reconnect(){this.socket=new Promise(((e,t)=>{const n=new WebSocket(this.endpoint);n.binaryType="arraybuffer";const r=this.onMessage.bind(this),o=()=>{const o=i=>{if(n.removeEventListener("message",o),i.data.startsWith("write")||i.data.startsWith("read")){const[o,s,a]=i.data.split(","),c=Number.parseInt(s);this.aheadRange=c,this.aheadSize=c*this.sectorSize,this.maxRead=Math.floor(1048576/this.aheadSize);const l=this.aheadSize*this.maxRead;this.readBuffer=new Uint8Array(5+4*this.maxRead),this.readAheadBuffer=new Uint8Array(l),this.decodeBuffer=new Uint8Array(l),this.cache=new Ra(this.sectorSize,c,Ta);let u=0,d=0,f=new Uint8Array(0);const h=i=>{let s=new Uint8Array(i.data);if(0===u&&(u=s[0]+(s[1]<<8)+(s[2]<<16)+(s[3]<<24),f=new Uint8Array(u-4),s=s.slice(4)),d<u&&(f.set(s,d),d+=s.length),d>f.length){const e=new Error("Preload buffer is bigger then expected");this.errorFn(e),t(e)}else if(d==f.length){if(this.preloadQueue=[],this.preloadSectors)for(let e=0;e<f.length;e+=4)this.preloadQueue.push(f[e]+(f[e+1]<<8)+(f[e+2]<<16)+(f[e+3]<<24));n.removeEventListener("message",h),n.addEventListener("message",r),this.readOnly="write"!==o,this.openFn(!0,!this.readOnly,1024*(Number.parseInt(a)??2097152),this.preloadQueue,c),e(n),this.preloadQueue.length>0&&(this.preloadQueue.length*this.aheadSize>Ta&&(console.log("WARN! preloadQueue size is bigger then allowed",this.preloadQueue.length*this.aheadSize/1024/1024,">",64),this.preloadQueue=this.preloadQueue.slice(0,Math.floor(Ta/this.aheadSize))),this.request=this.makeReadRequest(this.preloadQueue.shift()),this.executeRequest(this.request))}};n.addEventListener("message",h)}else{const e=new Error(i.data??"Unable to establish connection");this.errorFn(e),t(e)}};n.addEventListener("message",o),n.send(this.owner+"&"+this.drive+"&"+this.token)},i=e=>{if(console.error("Network error",e,"will reconnect"),s(),n.close(),this.retries--,0===this.retries){const e=new Error("Network problem");this.errorFn(e),t(e)}else setTimeout(this.reconnect.bind(this),300)};n.addEventListener("error",i),n.addEventListener("open",o);const s=function(){n.removeEventListener("message",r),n.removeEventListener("open",o),n.removeEventListener("error",i)};this.cleanup=s})),null!==this.request&&this.executeRequest(this.request)}makeReadRequest(e,t=-1,n=(()=>{})){const r=[e];if(this.preloadQueue.length>0){for(this.preloadProgressFn(this.preloadQueue.length*this.aheadSize);this.preloadQueue.length>0&&r.length<this.maxRead;){const t=this.preloadQueue.shift();t!==e&&r.push(t)}for(let t=0;t<this.preloadQueue.length;++t)if(this.preloadQueue[t]==e){this.preloadQueue.splice(t,1);break}}return{type:1,sectors:r,buffer:t,resolve:n}}read(e,t,n){const r=this.cache.read(e,this.originReadMode);return null!==r?(this.stats.cacheHit++,this.module.HEAPU8.set(r,t),n?0:Promise.resolve(0)):n?255:new Promise((n=>{this.stats.cacheMiss++;const r=this.makeReadRequest(e,t,n);null!==this.request?null===this.pendingRequest?this.pendingRequest=r:(console.error("New read request while old one is still processed"),n(3)):(this.request=r,this.executeRequest(this.request))}))}write(e,t){const n={type:2,sectors:[e],buffer:this.module.HEAPU8.slice(t,t+this.sectorSize),resolve:()=>{}};return this.cache.write(e,n.buffer),this.executeRequest(n),0}async close(){const e=await this.socket;await new Promise((t=>{const n=setInterval((()=>{0===e.bufferedAmount&&(clearInterval(n),t())}),32)})),this.cleanup(),e.close()}executeRequest(e){this.socket.then((t=>{if(1===e.type){const{sectors:n}=e;this.readStartedAt=Date.now(),this.readAheadPos=0,this.readAheadCompressed=0,this.readBuffer[0]=1,this.readBuffer[1]=255&n.length,this.readBuffer[2]=n.length>>8&255,this.readBuffer[3]=n.length>>16&255,this.readBuffer[4]=n.length>>24&255;for(let t=0;t<n.length;++t){const r=this.cache.getOrigin(n[t]);if(t>0&&r!==n[t])return console.error("Assertion failed orign should equal to sector",r,n[t]),void e.resolve(5);this.readBuffer[5+4*t]=255&r,this.readBuffer[5+4*t+1]=r>>8&255,this.readBuffer[5+4*t+2]=r>>16&255,this.readBuffer[5+4*t+3]=r>>24&255}t.send(this.readBuffer.slice(0,4*n.length+5).buffer)}else if(this.readOnly)e.resolve(0);else{const{sectors:n,buffer:r,resolve:o}=e;this.stats.write+=this.sectorSize,this.writeBuffer[0]=2,this.writeBuffer[1]=255&n[0],this.writeBuffer[2]=n[0]>>8&255,this.writeBuffer[3]=n[0]>>16&255,this.writeBuffer[4]=n[0]>>24&255,this.writeBuffer.set(r,5),t.send(this.writeBuffer.buffer),o(0)}}))}onMessage(e){if(null===this.request)console.error("Received message without request"),this.reconnect();else if(2===this.request.type)console.error("Received read payload while write request"),this.reconnect();else if(e.data instanceof ArrayBuffer){let t=new Uint8Array(e.data);0===this.readAheadCompressed&&(this.readAheadCompressed=t[0]+(t[1]<<8)+(t[2]<<16)+(t[3]<<24),t=t.slice(4));const{sectors:n,buffer:r,resolve:o}=this.request,i=this.readAheadCompressed-this.readAheadPos;if(t.byteLength>i||i<0)console.error("wrong read payload length "+t.byteLength+" instead of "+i),o(3);else{this.readAheadBuffer.set(t,this.readAheadPos),this.readAheadPos+=t.byteLength;const e=this.aheadSize*n.length;if(this.readAheadPos==this.readAheadCompressed){let t=e;if(this.readAheadCompressed<e){const n=function(e,t,n,r){let o,i,s;for(n=n||0,r=r||e.length-n,o=n,i=r,s=0;o<i;){const n=e[o++];let r=n>>4;if(r>0){let n=r+240;for(;255===n;)n=e[o++],r+=n;const a=o+r;for(;o<a;)t[s++]=e[o++];if(o===i)return s}const a=e[o++]|e[o++]<<8;if(0===a)return s;if(a>s)return-(o-2);let c=15&n,l=c+240;for(;255===l;)l=e[o++],c+=l;let u=s-a;const d=s+c+4;for(;s<d;)t[s++]=t[u++]}return s}(this.readAheadBuffer,this.decodeBuffer,0,this.readAheadCompressed);n<0?t=n:this.readAheadBuffer.set(this.decodeBuffer.slice(0,e),0)}if(t!=e)console.error("wrong decode result "+t+" should be "+e),o(4);else{for(let e=0;e<n.length;++e){const t=e*this.aheadSize,o=n[e],i=this.cache.getOrigin(o);if(this.cache.create(i,this.readAheadBuffer.slice(t,t+this.aheadSize)),0==e&&r>=0){if(this.originReadMode&&o!==i)throw new Error("Sector must be one of origins in originReadMode");const e=(o-i)*this.sectorSize;this.module.HEAPU8.set(this.readAheadBuffer.slice(e,e+(this.originReadMode?this.aheadRange:1)*this.sectorSize),r)}}this.stats.cacheUsed=this.cache.memUsed(),this.stats.read+=this.readAheadCompressed,this.stats.readTotalTime+=Date.now()-this.readStartedAt,this.request=null,o(0),null!==this.pendingRequest?(this.request=this.pendingRequest,this.pendingRequest=null,this.executeRequest(this.request)):this.preloadQueue.length>0&&(this.request=this.makeReadRequest(this.preloadQueue.shift()),this.executeRequest(this.request))}}}}else console.error("Received non arraybuffer data"),this.reconnect()}}const za=new TextDecoder,Ua=new TextEncoder,Ia=2e8,La={};["wc-install","wc-run","wc-pack-fs-to-bundle","wc-add-key","wc-mouse-move","wc-mouse-button","wc-mouse-sync","wc-exit","wc-sync-sleep","wc-pause","wc-resume","wc-mute","wc-unmute","wc-connect","wc-disconnect","wc-backend-event","wc-asyncify-stats","wc-fs-tree","wc-fs-get-file","wc-send-data-chunk"].forEach(((e,t)=>La[e]=t));const Ba={};["ws-extract-progress","ws-ready","ws-server-ready","ws-frame-set-size","ws-update-lines","ws-log","ws-warn","ws-err","ws-stdout","ws-exit","ws-persist","ws-sound-init","ws-sound-push","ws-config","ws-sync-sleep","ws-connected","ws-disconnected","ws-asyncify-stats","ws-fs-tree","ws-send-data-chunk"].forEach(((e,t)=>Ba[t]=e));class Da{constructor(e,n){t(this,"socket"),t(this,"sessionId",Date.now()+""),t(this,"hardware"),t(this,"onInit",(()=>{})),t(this,"cycles",0),t(this,"sockdrive",function(e,t,n){let r=0;const o={},i={},s={},a={read:0,write:0,readTotalTime:0,cacheHit:0,cacheMiss:0,cacheUsed:0};return{stats:a,open:async(c,l,u,d)=>{const f=await fetch(c.replace("wss://","https://").replace("ws://","http://")+"/template/"+l+"/"+u),h=await f.json();if(h.error)throw new Error(h.error);r++,i[r]={name:h.name,size:h.size??0,heads:h.heads??1,cylinders:h.cylinders??520,sectors:h.sectors??63,sectorSize:h.sector_size??512};const p=i[r].sectorSize,v={HEAPU8:new Uint8Array(0)};return o[r]=new Na(c,l,u,d,a,v,!0,!0),new Promise(((i,a)=>{const c=l+"/"+u;o[r].onOpen(((t,n,o,a,l)=>{s[r]=new Uint8Array(p+p*l),v.HEAPU8=s[r],e(c,t,n,o,a),i({handle:r,aheadRange:l})})),o[r].onPreloadProgress((e=>{n(c,e)})),o[r].onError((e=>{t(e),a(e)}))}))},read:async(e,t)=>{if(o[e]){const n=i[r].sectorSize;let a=o[e].read(t,n,!0);return(a=255)&&(a=await o[e].read(t,n,!1)),{code:a,buffer:s[e].slice(n)}}return console.error("ERROR! sockdrive handle",e,"not found"),Promise.resolve({code:1})},write:(e,n,r)=>r.byteLength!=i[e].sectorSize?(t(new Error("sockdrive write buffer size "+r.byteLength+" != sector size "+i[e].sectorSize)),1):o[e]?(s[e].set(r,0),o[e].write(n,0)):(console.error("ERROR! sockdrive handle",e,"not found"),1),close:e=>{o[e]&&(o[e].close(),delete s[e],delete i[e],delete o[e])},template:e=>i[e]}}(this.onSockdriveOpen.bind(this),this.onSockdriveError.bind(this),this.onSockdrivePreloadProgress.bind(this))),t(this,"handler",(()=>{})),this.socket=e,this.socket.addEventListener("error",(e=>{this.handler("ws-err",{tag:"ws",message:e.message??"Unknown transport layer error"}),this.handler("ws-exit",{}),this.socket.close()})),this.socket.addEventListener("message",(async e=>{const t=e.data;this.onMessage(new Uint8Array(await t.arrayBuffer()))})),this.sendMessageToSocket("wc-install"),this.hardware=null,this.onInit=n}writeUint32(e,t,n){return e[n]=255&t,e[n+1]=(65280&t)>>8,e[n+2]=(16711680&t)>>16,e[n+3]=(4278190080&t)>>24,n+4}readUint32(e,t){return 255&e[t]|e[t+1]<<8&65280|e[t+2]<<16&16711680|e[t+3]<<24&4278190080}readUint64(e,t){return this.readUint32(e,t)+this.readUint32(e,t+4)*2**32}sendMessageToSocket(e,...t){let n=1;for(const i of t)n+=4+((null==i?void 0:i.length)??0);const r=new Uint8Array(n);r[0]="string"==typeof e?La[e]:e;let o=1;for(const i of t)this.writeUint32(r,(null==i?void 0:i.length)??0,o),o+=4,i&&(r.set(i,o),o+=i.length);this.socket.send(r)}readMessage(e){const t=[];let n=1;for(;n+4<=e.length;){const r=this.readUint32(e,n);if(n+=4,n+r>e.length)throw new Error("read_message out of bounds");t.push(e.slice(n,n+r)),n+=r}return{id:e[0],payload:t}}onMessage(e){var t;const{id:n,payload:r}=this.readMessage(e),o=Ba[n];switch(o){case"ws-ready":this.onInit(r&&r[0]&&r.length>0?r[0][0]:0),this.handler(o,{});break;case"ws-server-ready":case"ws-exit":"ws-server-ready"!==o&&this.handler(o,{});break;case"ws-stdout":case"ws-log":case"ws-warn":case"ws-err":this.handler(o,{tag:za.decode(r[0]),message:za.decode(r[1])});break;case"ws-send-data-chunk":{const e={type:za.decode(r[0]),name:za.decode(r[1]),data:r[2]};this.handler(o,{chunk:e})}break;case"ws-config":this.handler(o,{dosboxConf:r[0],jsdosConf:za.decode(r[1])});break;case"ws-sound-init":this.handler(o,{freq:this.readUint32(r[0],0)}),this.handler("ws-server-ready",{});break;case"ws-sound-push":this.handler(o,{samples:new Float32Array(r[0].buffer)});break;case"ws-frame-set-size":this.handler(o,{width:this.readUint32(r[0],0),height:this.readUint32(r[0],4)});break;case"ws-update-lines":if(r.length>0){const e=[];for(const t of r)e.push({start:this.readUint32(t,0),heapu8:t.slice(4)});this.handler(o,{lines:e})}break;case"ws-asyncify-stats":{this.cycles+=this.readUint32(r[0],0);const e={messageSent:this.readUint32(r[0],4),messageReceived:this.readUint32(r[0],8),messageFrame:this.readUint32(r[0],12),messageSound:this.readUint32(r[0],16),nonSkippableSleepCount:0,sleepCount:0,sleepTime:0,cycles:this.cycles,netSent:0,netRecv:0,driveSent:this.sockdrive.stats.write,driveRecv:this.sockdrive.stats.read,driveRecvTime:this.sockdrive.stats.readTotalTime,driveCacheHit:this.sockdrive.stats.cacheHit,driveCacheMiss:this.sockdrive.stats.cacheMiss,driveCacheUsed:this.sockdrive.stats.cacheUsed};this.handler(o,e)}break;case"ws-connected":this.handler(o,{networkType:r[0][0],address:za.decode(r[1])});break;case"ws-disconnected":this.handler(o,{networkType:r[0][0]});break;case"ws-fs-tree":{let e=function(e){var t;const n=e.split("/");let r=i;for(let o=1;o<n.length-1;++o){const i=n[o];if(r=null==(t=r.nodes)?void 0:t.find((e=>e.name==i)),!r)throw new Error("Unable to find node "+e+", subdir "+i)}return[r,n[n.length-1]]};const n=[];for(let t=0;t<r.length-1;++t)n.push({name:za.decode(r[t]),size:null});const o=r[r.length-1];for(let t=0;t<n.length;++t){const e=this.readUint32(o,4*t);n[t].size=e<0?null:e}const i={name:".",nodes:[],size:null};for(const{name:r,size:s}of n){const[n,o]=e(r);null==(t=n.nodes)||t.push({name:o,size:s,nodes:null===s?[]:null})}this.handler("ws-fs-tree",{fsTree:i})}break;case"ws-persist":this.handler("ws-persist",{bundle:r.length>0?r[0]:null});break;default:void 0===o?(async()=>{switch(n){case 100:{const e=za.decode(r[0]),t=za.decode(r[1]),n=za.decode(r[2]),o=za.decode(r[3]),{handle:i,aheadRange:s}=await this.sockdrive.open(e,t,n,o),a=this.sockdrive.template(i),c=new Uint8Array(28);let l=0;l=this.writeUint32(c,i,l),l=this.writeUint32(c,a.size,l),l=this.writeUint32(c,a.heads,l),l=this.writeUint32(c,a.cylinders,l),l=this.writeUint32(c,a.sectors,l),l=this.writeUint32(c,a.sectorSize,l),this.writeUint32(c,s,l),this.sendMessageToSocket(100,c)}break;case 101:{const e=this.readUint32(r[0],0),t=this.readUint32(r[0],4),n=await this.sockdrive.read(e,t),o=new Uint8Array(4);this.writeUint32(o,n.code,0),this.sendMessageToSocket(101,o,n.buffer??null)}break;case 102:{const e=this.readUint32(r[0],0),t=this.readUint32(r[0],4),n=this.sockdrive.write(e,t,r[1]),o=new Uint8Array(4);this.writeUint32(o,n,0)}break;case 103:this.sockdrive.close(this.readUint32(r[0],0));break;default:console.log("WARN! Unhandled server non standard message",n,r)}})().catch((e=>{this.handler("ws-err",{tag:"panic",message:"sockdrive error: "+(e.message??"???")})})):console.warn("WARN! Unhandled server message",o)}}async sendMessageToServer(e,t){if(void 0===t||(null==t?void 0:t.sessionId)!==this.sessionId)return;const n=La[e];switch(e){case"wc-run":{const e=t.token??"";this.sendMessageToSocket(n,Ua.encode(e))}break;case"wc-send-data-chunk":{const e=t.chunk;this.sendMessageToSocket(n,Ua.encode(e.type),Ua.encode(e.name),e.data?new Uint8Array(e.data):null)}break;case"wc-asyncify-stats":case"wc-fs-tree":this.sendMessageToSocket(n);break;case"wc-add-key":{const e=new Uint8Array(12);let r=0;r=this.writeUint32(e,t.key,r),r=this.writeUint32(e,t.pressed?1:0,r),this.writeUint32(e,t.timeMs,r),this.sendMessageToSocket(n,e)}break;case"wc-mouse-move":{const e=new Uint8Array(15);let r=0;r=this.writeUint32(e,Math.abs(t.x)*Ia,r),r=this.writeUint32(e,Math.abs(t.y)*Ia,r),r=this.writeUint32(e,t.timeMs,r),e[r]=t.relative?1:0,e[r+1]=t.x>=0?0:1,e[r+2]=t.y>=0?0:1,this.sendMessageToSocket(n,e)}break;case"wc-mouse-button":{const e=new Uint8Array(6);e[0]=t.button,e[1]=t.pressed?1:0,this.writeUint32(e,t.timeMs,2),this.sendMessageToSocket(n,e)}break;case"wc-mouse-sync":{const e=new Uint8Array(4);this.writeUint32(e,t.timeMs,0),this.sendMessageToSocket(n,e)}break;case"wc-connect":this.sendMessageToSocket(n,new Uint8Array([t.networkType]),Ua.encode(t.address));break;case"wc-pack-fs-to-bundle":this.sendMessageToSocket(n,new Uint8Array([t.onlyChanges?1:0]));break;default:console.log("Unhandled client message (wc):",e,n,t)}}initMessageHandler(e){this.handler=(t,n)=>{n.sessionId=this.sessionId,e(t,n)}}exit(){this.sendMessageToSocket("wc-exit")}onSockdriveOpen(e,t,n,r,o){this.handler("ws-log",{tag:"worker",message:"sockdrive: "+e+", read="+t+", write="+n+", imageSize="+Math.round(r/1024/1024)+"Mb, preloadQueue="+o.length})}onSockdriveError(e){this.handler("ws-err",{tag:"panic",message:e.message??"unable to open sockdrive"})}onSockdrivePreloadProgress(e,t){this.handler("ws-log",{tag:"worker",message:"sockdrive: "+e+", preload="+t})}}function Ha(e){const t=le(null),[n,r]=ie(null),o=on((e=>e.dos.sockdriveWrite)),i=on((e=>{var t;return null==(t=e.auth.account)?void 0:t.token.access_token})),s=o?i:void 0,a=on((e=>e.dos.worker)),c=on((e=>e.dos.backend)),l=on((e=>e.dos.backendHardware)),u=tr(),d=mi();return ae((()=>{try{const e=null!==d.loadedBundle.bundleChanges?[d.loadedBundle.bundle,d.loadedBundle.bundleChanges]:d.loadedBundle.bundle;d.loadedBundle.bundle=null,d.loadedBundle.bundleChanges=null;const t=(async()=>{if(l&&d.options.backendHardware){const r=await d.options.backendHardware(c);if(null!==r)return emulators.backend(e,await(t=r,n=e=>{e<qi&&u(ji.actions.updateWsWarning(!0)),console.log("wsServer:",e," expected:",qi)},new Promise((e=>{let r=!1;const o=setInterval((()=>{if(r)return;r=!0;const i=new WebSocket(t),s=()=>{clearInterval(o),console.log("Connected to",t),e(new Da(i,n))};i.addEventListener("error",(e=>{console.error("Can't conect to ",t,e),i.removeEventListener("open",s),i.close(),r=!1})),i.addEventListener("open",s)}),1e3)}))),{token:s})}var t,n;return emulators[c+(a?"Worker":"Direct")](e,{token:s})})();return t.then((e=>{r(e),u(Si.actions.ci(!0)),d.ci=e,bi(d,"ci-ready",e),window.ci=e})).catch((e=>u(Si.actions.emuError(e.message)))),()=>{t.then((e=>{u(Si.actions.ci(!1)),d.ci=null,e.exit()}))}}catch(e){u(Si.actions.emuError(e.message))}}),[a,c,s??null]),Ri("div",{class:"bg-black h-full flex-grow overflow-hidden relative",children:[Ri("canvas",{ref:t}),t.current&&n&&Ri(Fa,{canvas:t.current,ci:n})]})}function Fa(e){const{canvas:t,ci:n}=e,r=on((e=>e.dos.bundle));return xa(t,n),Ri(y,{children:(null==r?void 0:r.endsWith(Sa))&&Ri(Ca,{ci:n})})}function qa(e){const t=oi(),n=e.error??"Unexpected error";return Ri("div",{class:"flex-grow flex flex-col items-center justify-center px-8 m-auto",children:[Ri("div",{class:"text-2xl text-center",children:t("error")}),Ri("div",{class:"text-red-400 mt-8 text-2xl text-center",children:['"',n,'"']}),Ri("div",{class:"mt-8 text-sm text-center",children:t("consult_logs")}),e.onSkip&&Ri("button",{class:"mt-8 btn-primary",onClick:e.onSkip,children:t("skip")})]})}function Wa(){return Ri(qa,{error:on((e=>e.dos.error))})}function $a(e){const{head:t,message:n}=e;return Ri("div",{class:"flex flex-col items-center justify-center frame-color px-8",children:[Ri("div",{class:"text-2xl text-center",children:t}),Ri("div",{class:"mt-2 text-center",children:n})]})}function Va(e){return e<1024?e+"b":(e/=1024)<1024?Math.round(e)+"kb":(e/=1024,Math.round(10*e)/10+"mb")}function Xa(){const e=oi(),t=on((e=>e.dos.step)),n=on((e=>e.storage.recived)),r=on((e=>e.storage.total)),o=on((e=>e.storage.ready));let i=e("loading"),s="100%";switch(t){case"bnd-load":i=e("bundle_loading"),n>0&&(s=`${Va(n)} / ${Va(r)}`,r>0&&(s+=` (${Math.round(1e3*n/r)/10}%)`));break;case"bnd-config":i=e("bundle_config")}return Ri("div",{class:"flex flex-col w-full h-full items-center justify-center",children:[Ri($a,{head:i,message:s}),"bnd-load"===t&&o&&Ri(Ka,{})]})}function Ka(){const e=oi(),t=tr();return Ri(y,{children:[Ri("div",{class:"mt-16 text-2xl",children:e("loading_saves")}),Ri("div",{onClick:function(){t(Zo.actions.ready())},class:"self-center cursor-pointer underline mt-4 text-lg animate-pulse",children:e("account_not_ready")})]})}function Qa(){const e=on((e=>e.auth.account)),t=on((e=>e.dos.emuVersion)),n=tr(),r=on((e=>e.ui.kiosk)),o=oi();function i(){Ai(e,n)}return Ri("div",{class:"pre-run-window",children:[Ri(Ga,{class:"mb-8"}),!r&&null===e&&Ri("div",{class:"flex flex-row mb-4 -mt-4 items-center",children:[Ri("div",{class:"btn btn-accent",onClick:i,children:[Ri("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",class:"w-6 h-6",children:Ri("path",{"fill-rule":"evenodd",d:"M7.5 6a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM3.751 20.105a8.25 8.25 0 0 1 16.498 0 .75.75 0 0 1-.437.695A18.683 18.683 0 0 1 12 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 0 1-.437-.695Z","clip-rule":"evenodd"})}),o("please_login")]}),Ri("div",{class:"ml-2 cursor-pointer",onClick:function(){window.open("https://js-dos.com/cloud-overview.html","_blank")},children:Ri("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-6 h-6",children:Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"})})})]}),!r&&e&&Ri("div",{class:"flex flex-row mb-4 -mt-4 items-center",children:Ri("div",{class:"btn btn-ghost",onClick:i,children:[Ri("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",class:"w-6 h-6",children:Ri("path",{"fill-rule":"evenodd",d:"M7.5 6a4.5 4.5 0 1 1 9 0 4.5 4.5 0 0 1-9 0ZM3.751 20.105a8.25 8.25 0 0 1 16.498 0 .75.75 0 0 1-.437.695A18.683 18.683 0 0 1 12 22.5c-2.786 0-5.433-.608-7.812-1.7a.75.75 0 0 1-.437-.695Z","clip-rule":"evenodd"})}),e.name??e.email]})}),Ri("div",{class:"flex flex-row flex-wrap justify-end",children:[Ri("div",{class:"flex flex-col items-end",children:[Ri(ms,{}),Ri(bs,{}),Ri(Is,{})]}),Ri("div",{class:"ml-10 flex flex-col items-end",children:[Ri(Us,{}),Ri(zs,{}),Ri(_s,{}),Ri(Ts,{})]})]}),Ri(Bs,{class:"mt-4 w-full max-w-sm"}),Ri(Ds,{class:"w-full max-w-sm"}),Ri("div",{class:"text-center mt-8",children:["jsdos/emu version: ",Ri("span",{class:"text-ellipsis overflow-hidden",children:["8.1.10","/",t]})]})]})}function Ga(e){const t=on((e=>e.editor.configChanged)),n=on((e=>e.editor.bundleConfig)),r=mi(),o=tr();return Ri("div",{class:e.class+" cursor-pointer",onClick:async function(){var e;if(t){const t=n,s=null==(e=r.loadedBundle)?void 0:e.bundle;if(null===s||null===t||!ArrayBuffer.isView(s))throw new Error("Unexpected behaviour (internal state is broken), bundle is null");try{r.loadedBundle.bundle=await emulators.bundleUpdateConfig(s,t),o(Si.actions.bndPlay({}))}catch(i){o(Si.actions.bndError(i.message??"unexpected error"))}}else o(Si.actions.bndPlay({}))},children:Ri("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-48 h-48 play-button",children:[Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}),Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.91 11.672a.375.375 0 010 .656l-5.603 3.113a.375.375 0 01-.557-.328V8.887c0-.286.307-.466.557-.327l5.603 3.112z"})]})})}const Ya=document.createElement("input");function Za(){const e=oi(),t=Jn(),[n,r]=ie(!1);if(n)return Ri("div",{class:"select-window overflow-hidden flex-grow flex flex-col items-center justify-center px-8 py-8",children:Ri(Ja,{})});return Ri("div",{class:"select-window overflow-hidden flex-grow flex flex-col items-center justify-center px-8",children:[Ri("div",{class:"mb-4 text-center underline cursor-pointer hover:text-accent",onClick:()=>r(!0),children:e("load_by_url")}),Ri(ec,{}),Ri("div",{class:"mt-4 text-center",children:e("upload_file")}),Ri("div",{class:"mt-4 text-center underline cursor-pointer hover:text-accent",onClick:async function(){try{await async function(e){await os("empty.jsdos",(async()=>(await emulators.bundle()).toUint8Array())(),null,null,e),e.dispatch(ji.actions.frameConf()),e.dispatch(ji.actions.setEditor(!0))}(t).catch(console.error)}catch(e){t.dispatch(Si.actions.bndError(e.message??"unexpected error"))}},children:e("create_empty")})]})}function Ja(){const e=oi(),t=Jn(),n=tr(),[r,o]=ie(""),[i,s]=ie(null);return Ri(y,{children:[Ri("div",{class:"form-control w-3/4 mb-4",children:[Ri("label",{class:"label",children:Ri("span",{class:"label-text",children:[e("enter_url"),":"]})}),Ri("input",{type:"text",class:"input w-full input-sm input-bordered",onChange:e=>o(e.currentTarget.value??""),value:r})]}),Ri("div",{class:"mt-4 text-center underline cursor-pointer hover:text-accent",onClick:()=>async function(e){let r;n(ji.actions.frameNone());try{r=new URL(e)}catch(o){return void s(o.message)}try{await rs(r.toString(),t)}catch(o){n(Si.actions.bndError(o.message??"unexpected error"))}}(r),children:e("load")}),null!==i&&Ri("div",{class:"mt-8 text-center text-error",children:i})]})}function ec(){const e=Jn();async function t(){if(Ya.removeEventListener("change",t),null===Ya.files||0===Ya.files.length)return;const n=Ya.files[0];try{await ns(n,e).catch((t=>e.dispatch(Si.actions.bndError(t.message))))}catch(r){e.dispatch(Si.actions.bndError(r.message??"unexpected error"))}}return Ri("div",{class:"cursor-pointer",onClick:function(){Ya.addEventListener("change",t),Ya.click()},children:Ri("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-48 h-48 play-button",children:Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 13.5l3 3m0 0l3-3m-3 3v-6m1.06-4.19l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})})})}function tc(e){const t="none"!==on((e=>e.ui.frame)),n=on((e=>e.ui.frameXs)),r=on((e=>e.ui.window)),o=on((e=>e.ui.background)),i=on((e=>e.ui.kiosk));let s=Ri(nc,{});switch(r){case"error":s=Ri(Wa,{});break;case"loading":s=Ri(Xa,{});break;case"prerun":s=Ri(Qa,{});break;case"run":s=Ri(Ha,{});break;case"select":s=Ri(Za,{})}return Ri("div",{class:"window absolute w-full h-full bg-base-100",children:[Ri("div",{class:"background-image",style:{backgroundImage:o?"url("+o+")":void 0}}),Ri("div",{class:"relative flex flex-row h-full w-full items-start justify-start overflow-auto",children:[!i&&Ri("div",{class:(t?n?"w-24":"w-96":"w-12")+" flex-shrink-0"}),s]})]})}function nc(){return Ri("div",{class:"w-full h-full flex justify-center items-center",children:Ri("div",{class:"radial-progress animate-spin",style:"--value:70;"})})}Ya.type="file";let rc=ji.getInitialState().wideScreen;function oc(){const e=le(null),t=on((e=>e.ui.theme)),n=tr();return ae((()=>{if(null===e||null===e.current)return;const t=e.current;function r(){const e=t.getBoundingClientRect().width>640;e!==rc&&(rc=e,n(ji.actions.setWideScreen(rc)))}const o=new ResizeObserver(r);return o.observe(t),window.addEventListener("resize",r),()=>{o.disconnect(),window.removeEventListener("resize",r)}}),[e,n]),Ri("div",{ref:e,class:"w-full h-full relative","data-theme":t,children:[Ri(tc,{}),Ri(Ws,{}),Ri(oa,{}),Ri(Wi,{}),Ri(ic,{}),Ri(sc,{}),Ri(ac,{})]})}function ic(){const e=on((e=>e.ui.toast)),t=on((e=>e.ui.toastIntent)),n=on((e=>e.ui.readOnlyWarning));return null===e?null:Ri("div",{class:"absolute right-10 "+(n?"bottom-32":"bottom-10"),children:Ri("div",{class:"alert alert-"+("panic"===t?"error":t),children:e})})}function sc(){const e=on((e=>e.ui.readOnlyWarning)),t=on((e=>e.auth.account)),n=oi(),r=tr();if(!e)return null;return Ri("div",{class:"absolute right-10 bottom-10",children:Ri("div",{class:"alert",children:[Ri("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",class:"stroke-info shrink-0 w-6 h-6",children:Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),Ri("span",{children:n("read_only_access")}),Ri("div",{children:[Ri("button",{class:"btn btn-sm btn-primary mr-2",onClick:function(){r(ji.actions.readOnlyWarning(!1)),Ai(t,r)},children:n("fix")}),Ri("button",{class:"btn btn-sm",onClick:function(){r(ji.actions.readOnlyWarning(!1))},children:n("close")})]})]})})}function ac(){const e=on((e=>e.ui.updateWsWarning)),t=oi(),n=tr();if(!e)return null;return Ri("div",{class:"absolute left-20 right-10 top-10 flex justify-center",children:Ri("div",{class:"alert w-auto",children:[Ri("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"size-6 text-error",children:Ri("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})}),Ri("span",{children:t("ws_outdated")}),Ri("div",{children:[Ri("button",{class:"btn btn-sm btn-primary mr-2",onClick:function(){window.open("https://dos.zone/download/","_blank"),n(ji.actions.updateWsWarning(!1))},children:t("update")}),Ri("button",{class:"btn btn-sm",onClick:function(){n(ji.actions.updateWsWarning(!1))},children:t("close")})]})]})})}window.Dos=(e,t={})=>{var n,r;const o=function(e){return{root:null,loadedBundle:null,ci:null,cache:new Xo,options:e}}(t),i=function(e,t){const{storeUid:n,slice:r}=di(),o=Uo({reducer:{init:r.reducer,i18n:ri.reducer,auth:Zo.reducer,ui:ji.reducer,dos:Si.reducer,storage:ii.reducer,editor:ai.reducer},middleware:e=>{const t=e();return t.push(hi),t}});return pi[n]=e,t.sockdriveBackend&&-1===ci.indexOf(t.sockdriveBackend.name)&&(ci.push(t.sockdriveBackend.name),li[t.sockdriveBackend.name]={sockdriveEndpoint:"https://"+t.sockdriveBackend.host,sockdriveWssEndpoint:"wss://"+t.sockdriveBackend.host},o.dispatch(fi.actions.setSockdriveBackendName(t.sockdriveBackend.name))),o}(o,t);"dz.caiiiycuk@gmail.com"!==(null==(n=i.getState().auth.account)?void 0:n.email)&&"caiiiycuk@gmail.com"!==(null==(r=i.getState().auth.account)?void 0:r.email)||i.dispatch(Si.actions.setSockdriveWrite(!1)),function(e,t,n){t.root=e,e.classList.add("jsdos-rso"),e.addEventListener("contextmenu",(e=>{var t;if(null===e.target||!(null==(t=e.target.classList)?void 0:t.contains("contextmenu")))return e.stopPropagation(),e.preventDefault(),!1})),document.addEventListener("fullscreenchange",(()=>{const t=document.fullscreenElement===e;n.dispatch(ji.actions.setFullScreen(t))}))}(e,o,i);let s="none";function a(e){i.dispatch(ji.actions.theme(e))}function c(e){i.dispatch(ri.actions.setLang(e))}function l(e){i.dispatch(Si.actions.dosBackend(e))}function u(e){i.dispatch(Si.actions.dosBackendLocked(e))}function d(e){i.dispatch(Si.actions.dosWorker(e))}function f(e){i.dispatch(Si.actions.mouseCapture(e))}function h(e){i.dispatch(Si.actions.setServer(e))}function p(e){i.dispatch(Si.actions.setRoom(e))}function v(e){i.dispatch(ji.actions.background(e))}function m(e){Vs(e,i)}function b(e){i.dispatch(ji.actions.autoStart(e))}function _(e){i.dispatch(ji.actions.kiosk(e))}return i.subscribe((function(){(async()=>{var e;const t=i.getState(),n=t.dos.step;if(n!==s&&(s=n,"emu-ready"===t.dos.step)){const n=null==(e=t.auth.account)?void 0:e.email;if(o.cache=await Qo(n??"guest"),o.options.url)try{await rs(o.options.url,i)}catch(r){i.dispatch(Si.actions.bndError(r.message))}else o.options.dosboxConf?async function(e,t){const n=vi(t),r=t.dispatch;n.loadedBundle=null,r(ai.actions.init(e)),is(e,r),n.loadedBundle={bundleUrl:null,bundleChangesUrl:null,bundle:e,bundleChanges:null},r(Si.actions.bndReady({}))}({dosboxConf:o.options.dosboxConf,jsdosConf:{version:"8"}},i):i.dispatch(ji.actions.windowSelect());bi(o,"emu-ready")}})().catch(console.error)})),Pi(i,t.pathPrefix??"https://v8.js-dos.com/latest/emulators/"),t.theme&&a(t.theme),t.lang&&c(t.lang),t.backend&&l(t.backend),t.backendLocked&&u(t.backendLocked),void 0!==t.workerThread&&d(t.workerThread),void 0!==t.mouseCapture&&f(t.mouseCapture),t.server&&h(t.server),t.room&&p(t.room),t.background&&v(t.background),void 0!==t.fullScreen&&m(t.fullScreen),void 0!==t.loginUrl&&i.dispatch(Zo.actions.setLoginUrl(t.loginUrl)),void 0!==t.autoStart&&b(t.autoStart),void 0!==t.kiosk&&_(t.kiosk),L(Ri(Yn,{store:i,children:Ri(oc,{})}),e),{setTheme:a,setLang:c,setBackend:l,setBackendLocked:u,setWorkerThread:d,setMouseCapture:f,setServer:h,setRoom:p,setFrame:function(e){i.dispatch(ji.actions.frameNetwork())},setBackground:v,setFullScreen:m,setAutoStart:b,setKiosk:_}};
|
|
22
22
|
//# sourceMappingURL=js-dos.js.map
|