gaesup-world 0.9.786 → 0.9.787

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.
@@ -1,4 +1,4 @@
1
- "use strict";var vi=Object.defineProperty;var Nr=r=>{throw TypeError(r)};var gi=(r,e,t)=>e in r?vi(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var q=(r,e,t)=>gi(r,typeof e!="symbol"?e+"":e,t),Gt=(r,e,t)=>e.has(r)||Nr("Cannot "+t);var u=(r,e,t)=>(Gt(r,e,"read from private field"),t?t.call(r):e.get(r)),I=(r,e,t)=>e.has(r)?Nr("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),j=(r,e,t,n)=>(Gt(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),A=(r,e,t)=>(Gt(r,e,"access private method"),t);var Ct=(r,e,t,n)=>({set _(i){j(r,e,i,t)},get _(){return u(r,e,n)}});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),E=require("@react-three/rapier"),ge=require("three"),Pe=require("@react-three/drei"),je=require("@react-three/fiber");function yi(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const L=yi(ge);function dn(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Yt={exports:{}},ot={};/**
1
+ "use strict";var vi=Object.defineProperty;var Nr=r=>{throw TypeError(r)};var gi=(r,e,t)=>e in r?vi(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var $=(r,e,t)=>gi(r,typeof e!="symbol"?e+"":e,t),Bt=(r,e,t)=>e.has(r)||Nr("Cannot "+t);var u=(r,e,t)=>(Bt(r,e,"read from private field"),t?t.call(r):e.get(r)),I=(r,e,t)=>e.has(r)?Nr("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),j=(r,e,t,n)=>(Bt(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),A=(r,e,t)=>(Bt(r,e,"access private method"),t);var Ct=(r,e,t,n)=>({set _(i){j(r,e,i,t)},get _(){return u(r,e,n)}});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),E=require("@react-three/rapier"),ge=require("three"),Pe=require("@react-three/drei"),je=require("@react-three/fiber");function yi(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const L=yi(ge);function dn(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Yt={exports:{}},ot={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -14,20 +14,20 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Lr;function wi(){return Lr||(Lr=1,process.env.NODE_ENV!=="production"&&function(){var r=w,e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),l=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),p=Symbol.iterator,y="@@iterator";function g(f){if(f===null||typeof f!="object")return null;var b=p&&f[p]||f[y];return typeof b=="function"?b:null}var C=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function R(f){{for(var b=arguments.length,O=new Array(b>1?b-1:0),M=1;M<b;M++)O[M-1]=arguments[M];k("error",f,O)}}function k(f,b,O){{var M=C.ReactDebugCurrentFrame,N=M.getStackAddendum();N!==""&&(b+="%s",O=O.concat([N]));var U=O.map(function(z){return String(z)});U.unshift("Warning: "+b),Function.prototype.apply.call(console[f],console,U)}}var P=!1,_=!1,D=!1,V=!1,G=!1,H;H=Symbol.for("react.module.reference");function Ie(f){return!!(typeof f=="string"||typeof f=="function"||f===n||f===a||G||f===i||f===c||f===h||V||f===v||P||_||D||typeof f=="object"&&f!==null&&(f.$$typeof===m||f.$$typeof===d||f.$$typeof===o||f.$$typeof===l||f.$$typeof===s||f.$$typeof===H||f.getModuleId!==void 0))}function rt(f,b,O){var M=f.displayName;if(M)return M;var N=b.displayName||b.name||"";return N!==""?O+"("+N+")":O}function pr(f){return f.displayName||"Context"}function Ee(f){if(f==null)return null;if(typeof f.tag=="number"&&R("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof f=="function")return f.displayName||f.name||null;if(typeof f=="string")return f;switch(f){case n:return"Fragment";case t:return"Portal";case a:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case h:return"SuspenseList"}if(typeof f=="object")switch(f.$$typeof){case l:var b=f;return pr(b)+".Consumer";case o:var O=f;return pr(O._context)+".Provider";case s:return rt(f,f.render,"ForwardRef");case d:var M=f.displayName||null;return M!==null?M:Ee(f.type)||"Memo";case m:{var N=f,U=N._payload,z=N._init;try{return Ee(z(U))}catch{return null}}}return null}var Ne=Object.assign,nt=0,vr,gr,yr,br,wr,Cr,xr;function Sr(){}Sr.__reactDisabledLog=!0;function Gn(){{if(nt===0){vr=console.log,gr=console.info,yr=console.warn,br=console.error,wr=console.group,Cr=console.groupCollapsed,xr=console.groupEnd;var f={configurable:!0,enumerable:!0,value:Sr,writable:!0};Object.defineProperties(console,{info:f,log:f,warn:f,error:f,group:f,groupCollapsed:f,groupEnd:f})}nt++}}function qn(){{if(nt--,nt===0){var f={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Ne({},f,{value:vr}),info:Ne({},f,{value:gr}),warn:Ne({},f,{value:yr}),error:Ne({},f,{value:br}),group:Ne({},f,{value:wr}),groupCollapsed:Ne({},f,{value:Cr}),groupEnd:Ne({},f,{value:xr})})}nt<0&&R("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Tt=C.ReactCurrentDispatcher,zt;function gt(f,b,O){{if(zt===void 0)try{throw Error()}catch(N){var M=N.stack.trim().match(/\n( *(at )?)/);zt=M&&M[1]||""}return`
18
- `+zt+f}}var Dt=!1,yt;{var $n=typeof WeakMap=="function"?WeakMap:Map;yt=new $n}function Rr(f,b){if(!f||Dt)return"";{var O=yt.get(f);if(O!==void 0)return O}var M;Dt=!0;var N=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var U;U=Tt.current,Tt.current=null,Gn();try{if(b){var z=function(){throw Error()};if(Object.defineProperty(z.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(z,[])}catch(le){M=le}Reflect.construct(f,[],z)}else{try{z.call()}catch(le){M=le}f.call(z.prototype)}}else{try{throw Error()}catch(le){M=le}f()}}catch(le){if(le&&M&&typeof le.stack=="string"){for(var T=le.stack.split(`
17
+ */var Lr;function wi(){return Lr||(Lr=1,process.env.NODE_ENV!=="production"&&function(){var r=w,e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),l=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),p=Symbol.iterator,y="@@iterator";function g(f){if(f===null||typeof f!="object")return null;var b=p&&f[p]||f[y];return typeof b=="function"?b:null}var C=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function R(f){{for(var b=arguments.length,O=new Array(b>1?b-1:0),M=1;M<b;M++)O[M-1]=arguments[M];k("error",f,O)}}function k(f,b,O){{var M=C.ReactDebugCurrentFrame,N=M.getStackAddendum();N!==""&&(b+="%s",O=O.concat([N]));var U=O.map(function(z){return String(z)});U.unshift("Warning: "+b),Function.prototype.apply.call(console[f],console,U)}}var P=!1,_=!1,D=!1,V=!1,q=!1,H;H=Symbol.for("react.module.reference");function Ie(f){return!!(typeof f=="string"||typeof f=="function"||f===n||f===a||q||f===i||f===c||f===h||V||f===v||P||_||D||typeof f=="object"&&f!==null&&(f.$$typeof===m||f.$$typeof===d||f.$$typeof===o||f.$$typeof===l||f.$$typeof===s||f.$$typeof===H||f.getModuleId!==void 0))}function rt(f,b,O){var M=f.displayName;if(M)return M;var N=b.displayName||b.name||"";return N!==""?O+"("+N+")":O}function pr(f){return f.displayName||"Context"}function Ee(f){if(f==null)return null;if(typeof f.tag=="number"&&R("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof f=="function")return f.displayName||f.name||null;if(typeof f=="string")return f;switch(f){case n:return"Fragment";case t:return"Portal";case a:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case h:return"SuspenseList"}if(typeof f=="object")switch(f.$$typeof){case l:var b=f;return pr(b)+".Consumer";case o:var O=f;return pr(O._context)+".Provider";case s:return rt(f,f.render,"ForwardRef");case d:var M=f.displayName||null;return M!==null?M:Ee(f.type)||"Memo";case m:{var N=f,U=N._payload,z=N._init;try{return Ee(z(U))}catch{return null}}}return null}var Ne=Object.assign,nt=0,vr,gr,yr,br,wr,Cr,xr;function Sr(){}Sr.__reactDisabledLog=!0;function Bn(){{if(nt===0){vr=console.log,gr=console.info,yr=console.warn,br=console.error,wr=console.group,Cr=console.groupCollapsed,xr=console.groupEnd;var f={configurable:!0,enumerable:!0,value:Sr,writable:!0};Object.defineProperties(console,{info:f,log:f,warn:f,error:f,group:f,groupCollapsed:f,groupEnd:f})}nt++}}function qn(){{if(nt--,nt===0){var f={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Ne({},f,{value:vr}),info:Ne({},f,{value:gr}),warn:Ne({},f,{value:yr}),error:Ne({},f,{value:br}),group:Ne({},f,{value:wr}),groupCollapsed:Ne({},f,{value:Cr}),groupEnd:Ne({},f,{value:xr})})}nt<0&&R("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Tt=C.ReactCurrentDispatcher,zt;function gt(f,b,O){{if(zt===void 0)try{throw Error()}catch(N){var M=N.stack.trim().match(/\n( *(at )?)/);zt=M&&M[1]||""}return`
18
+ `+zt+f}}var Dt=!1,yt;{var $n=typeof WeakMap=="function"?WeakMap:Map;yt=new $n}function Rr(f,b){if(!f||Dt)return"";{var O=yt.get(f);if(O!==void 0)return O}var M;Dt=!0;var N=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var U;U=Tt.current,Tt.current=null,Bn();try{if(b){var z=function(){throw Error()};if(Object.defineProperty(z.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(z,[])}catch(le){M=le}Reflect.construct(f,[],z)}else{try{z.call()}catch(le){M=le}f.call(z.prototype)}}else{try{throw Error()}catch(le){M=le}f()}}catch(le){if(le&&M&&typeof le.stack=="string"){for(var T=le.stack.split(`
19
19
  `),ae=M.stack.split(`
20
20
  `),X=T.length-1,J=ae.length-1;X>=1&&J>=0&&T[X]!==ae[J];)J--;for(;X>=1&&J>=0;X--,J--)if(T[X]!==ae[J]){if(X!==1||J!==1)do if(X--,J--,J<0||T[X]!==ae[J]){var ve=`
21
21
  `+T[X].replace(" at new "," at ");return f.displayName&&ve.includes("<anonymous>")&&(ve=ve.replace("<anonymous>",f.displayName)),typeof f=="function"&&yt.set(f,ve),ve}while(X>=1&&J>=0);break}}}finally{Dt=!1,Tt.current=U,qn(),Error.prepareStackTrace=N}var Ve=f?f.displayName||f.name:"",Ue=Ve?gt(Ve):"";return typeof f=="function"&&yt.set(f,Ue),Ue}function Vn(f,b,O){return Rr(f,!1)}function Hn(f){var b=f.prototype;return!!(b&&b.isReactComponent)}function bt(f,b,O){if(f==null)return"";if(typeof f=="function")return Rr(f,Hn(f));if(typeof f=="string")return gt(f);switch(f){case c:return gt("Suspense");case h:return gt("SuspenseList")}if(typeof f=="object")switch(f.$$typeof){case s:return Vn(f.render);case d:return bt(f.type,b,O);case m:{var M=f,N=M._payload,U=M._init;try{return bt(U(N),b,O)}catch{}}}return""}var it=Object.prototype.hasOwnProperty,Or={},Ar=C.ReactDebugCurrentFrame;function wt(f){if(f){var b=f._owner,O=bt(f.type,f._source,b?b.type:null);Ar.setExtraStackFrame(O)}else Ar.setExtraStackFrame(null)}function Yn(f,b,O,M,N){{var U=Function.call.bind(it);for(var z in f)if(U(f,z)){var T=void 0;try{if(typeof f[z]!="function"){var ae=Error((M||"React class")+": "+O+" type `"+z+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof f[z]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ae.name="Invariant Violation",ae}T=f[z](b,z,M,O,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(X){T=X}T&&!(T instanceof Error)&&(wt(N),R("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",M||"React class",O,z,typeof T),wt(null)),T instanceof Error&&!(T.message in Or)&&(Or[T.message]=!0,wt(N),R("Failed %s type: %s",O,T.message),wt(null))}}}var Kn=Array.isArray;function It(f){return Kn(f)}function Xn(f){{var b=typeof Symbol=="function"&&Symbol.toStringTag,O=b&&f[Symbol.toStringTag]||f.constructor.name||"Object";return O}}function Zn(f){try{return Er(f),!1}catch{return!0}}function Er(f){return""+f}function jr(f){if(Zn(f))return R("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Xn(f)),Er(f)}var at=C.ReactCurrentOwner,Jn={key:!0,ref:!0,__self:!0,__source:!0},kr,Mr,Nt;Nt={};function Qn(f){if(it.call(f,"ref")){var b=Object.getOwnPropertyDescriptor(f,"ref").get;if(b&&b.isReactWarning)return!1}return f.ref!==void 0}function ei(f){if(it.call(f,"key")){var b=Object.getOwnPropertyDescriptor(f,"key").get;if(b&&b.isReactWarning)return!1}return f.key!==void 0}function ti(f,b){if(typeof f.ref=="string"&&at.current&&b&&at.current.stateNode!==b){var O=Ee(at.current.type);Nt[O]||(R('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',Ee(at.current.type),f.ref),Nt[O]=!0)}}function ri(f,b){{var O=function(){kr||(kr=!0,R("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",b))};O.isReactWarning=!0,Object.defineProperty(f,"key",{get:O,configurable:!0})}}function ni(f,b){{var O=function(){Mr||(Mr=!0,R("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",b))};O.isReactWarning=!0,Object.defineProperty(f,"ref",{get:O,configurable:!0})}}var ii=function(f,b,O,M,N,U,z){var T={$$typeof:e,type:f,key:b,ref:O,props:z,_owner:U};return T._store={},Object.defineProperty(T._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(T,"_self",{configurable:!1,enumerable:!1,writable:!1,value:M}),Object.defineProperty(T,"_source",{configurable:!1,enumerable:!1,writable:!1,value:N}),Object.freeze&&(Object.freeze(T.props),Object.freeze(T)),T};function ai(f,b,O,M,N){{var U,z={},T=null,ae=null;O!==void 0&&(jr(O),T=""+O),ei(b)&&(jr(b.key),T=""+b.key),Qn(b)&&(ae=b.ref,ti(b,N));for(U in b)it.call(b,U)&&!Jn.hasOwnProperty(U)&&(z[U]=b[U]);if(f&&f.defaultProps){var X=f.defaultProps;for(U in X)z[U]===void 0&&(z[U]=X[U])}if(T||ae){var J=typeof f=="function"?f.displayName||f.name||"Unknown":f;T&&ri(z,J),ae&&ni(z,J)}return ii(f,T,ae,N,M,at.current,z)}}var Ut=C.ReactCurrentOwner,Pr=C.ReactDebugCurrentFrame;function $e(f){if(f){var b=f._owner,O=bt(f.type,f._source,b?b.type:null);Pr.setExtraStackFrame(O)}else Pr.setExtraStackFrame(null)}var Lt;Lt=!1;function Wt(f){return typeof f=="object"&&f!==null&&f.$$typeof===e}function Fr(){{if(Ut.current){var f=Ee(Ut.current.type);if(f)return`
22
22
 
23
23
  Check the render method of \``+f+"`."}return""}}function oi(f){return""}var _r={};function si(f){{var b=Fr();if(!b){var O=typeof f=="string"?f:f.displayName||f.name;O&&(b=`
24
24
 
25
- Check the top-level render call using <`+O+">.")}return b}}function Tr(f,b){{if(!f._store||f._store.validated||f.key!=null)return;f._store.validated=!0;var O=si(b);if(_r[O])return;_r[O]=!0;var M="";f&&f._owner&&f._owner!==Ut.current&&(M=" It was passed a child from "+Ee(f._owner.type)+"."),$e(f),R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',O,M),$e(null)}}function zr(f,b){{if(typeof f!="object")return;if(It(f))for(var O=0;O<f.length;O++){var M=f[O];Wt(M)&&Tr(M,b)}else if(Wt(f))f._store&&(f._store.validated=!0);else if(f){var N=g(f);if(typeof N=="function"&&N!==f.entries)for(var U=N.call(f),z;!(z=U.next()).done;)Wt(z.value)&&Tr(z.value,b)}}}function li(f){{var b=f.type;if(b==null||typeof b=="string")return;var O;if(typeof b=="function")O=b.propTypes;else if(typeof b=="object"&&(b.$$typeof===s||b.$$typeof===d))O=b.propTypes;else return;if(O){var M=Ee(b);Yn(O,f.props,"prop",M,f)}else if(b.PropTypes!==void 0&&!Lt){Lt=!0;var N=Ee(b);R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",N||"Unknown")}typeof b.getDefaultProps=="function"&&!b.getDefaultProps.isReactClassApproved&&R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ui(f){{for(var b=Object.keys(f.props),O=0;O<b.length;O++){var M=b[O];if(M!=="children"&&M!=="key"){$e(f),R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",M),$e(null);break}}f.ref!==null&&($e(f),R("Invalid attribute `ref` supplied to `React.Fragment`."),$e(null))}}var Dr={};function Ir(f,b,O,M,N,U){{var z=Ie(f);if(!z){var T="";(f===void 0||typeof f=="object"&&f!==null&&Object.keys(f).length===0)&&(T+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ae=oi();ae?T+=ae:T+=Fr();var X;f===null?X="null":It(f)?X="array":f!==void 0&&f.$$typeof===e?(X="<"+(Ee(f.type)||"Unknown")+" />",T=" Did you accidentally export a JSX literal instead of a component?"):X=typeof f,R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",X,T)}var J=ai(f,b,O,N,U);if(J==null)return J;if(z){var ve=b.children;if(ve!==void 0)if(M)if(It(ve)){for(var Ve=0;Ve<ve.length;Ve++)zr(ve[Ve],f);Object.freeze&&Object.freeze(ve)}else R("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else zr(ve,f)}if(it.call(b,"key")){var Ue=Ee(f),le=Object.keys(b).filter(function(pi){return pi!=="key"}),Bt=le.length>0?"{key: someKey, "+le.join(": ..., ")+": ...}":"{key: someKey}";if(!Dr[Ue+Bt]){var mi=le.length>0?"{"+le.join(": ..., ")+": ...}":"{}";R(`A props object containing a "key" prop is being spread into JSX:
25
+ Check the top-level render call using <`+O+">.")}return b}}function Tr(f,b){{if(!f._store||f._store.validated||f.key!=null)return;f._store.validated=!0;var O=si(b);if(_r[O])return;_r[O]=!0;var M="";f&&f._owner&&f._owner!==Ut.current&&(M=" It was passed a child from "+Ee(f._owner.type)+"."),$e(f),R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',O,M),$e(null)}}function zr(f,b){{if(typeof f!="object")return;if(It(f))for(var O=0;O<f.length;O++){var M=f[O];Wt(M)&&Tr(M,b)}else if(Wt(f))f._store&&(f._store.validated=!0);else if(f){var N=g(f);if(typeof N=="function"&&N!==f.entries)for(var U=N.call(f),z;!(z=U.next()).done;)Wt(z.value)&&Tr(z.value,b)}}}function li(f){{var b=f.type;if(b==null||typeof b=="string")return;var O;if(typeof b=="function")O=b.propTypes;else if(typeof b=="object"&&(b.$$typeof===s||b.$$typeof===d))O=b.propTypes;else return;if(O){var M=Ee(b);Yn(O,f.props,"prop",M,f)}else if(b.PropTypes!==void 0&&!Lt){Lt=!0;var N=Ee(b);R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",N||"Unknown")}typeof b.getDefaultProps=="function"&&!b.getDefaultProps.isReactClassApproved&&R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ui(f){{for(var b=Object.keys(f.props),O=0;O<b.length;O++){var M=b[O];if(M!=="children"&&M!=="key"){$e(f),R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",M),$e(null);break}}f.ref!==null&&($e(f),R("Invalid attribute `ref` supplied to `React.Fragment`."),$e(null))}}var Dr={};function Ir(f,b,O,M,N,U){{var z=Ie(f);if(!z){var T="";(f===void 0||typeof f=="object"&&f!==null&&Object.keys(f).length===0)&&(T+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ae=oi();ae?T+=ae:T+=Fr();var X;f===null?X="null":It(f)?X="array":f!==void 0&&f.$$typeof===e?(X="<"+(Ee(f.type)||"Unknown")+" />",T=" Did you accidentally export a JSX literal instead of a component?"):X=typeof f,R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",X,T)}var J=ai(f,b,O,N,U);if(J==null)return J;if(z){var ve=b.children;if(ve!==void 0)if(M)if(It(ve)){for(var Ve=0;Ve<ve.length;Ve++)zr(ve[Ve],f);Object.freeze&&Object.freeze(ve)}else R("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else zr(ve,f)}if(it.call(b,"key")){var Ue=Ee(f),le=Object.keys(b).filter(function(pi){return pi!=="key"}),Gt=le.length>0?"{key: someKey, "+le.join(": ..., ")+": ...}":"{key: someKey}";if(!Dr[Ue+Gt]){var mi=le.length>0?"{"+le.join(": ..., ")+": ...}":"{}";R(`A props object containing a "key" prop is being spread into JSX:
26
26
  let props = %s;
27
27
  <%s {...props} />
28
28
  React keys must be passed directly to JSX without using spread:
29
29
  let props = %s;
30
- <%s key={someKey} {...props} />`,Bt,Ue,mi,Ue),Dr[Ue+Bt]=!0}}return f===n?ui(J):li(J),J}}function ci(f,b,O){return Ir(f,b,O,!0)}function fi(f,b,O){return Ir(f,b,O,!1)}var hi=fi,di=ci;st.Fragment=n,st.jsx=hi,st.jsxs=di}()),st}process.env.NODE_ENV==="production"?Yt.exports=bi():Yt.exports=wi();var S=Yt.exports;function Wr(r,e,t){return Math.sqrt(Math.pow(r.x-e.x,2)+t+Math.pow(r.z-e.z,2))}function K(r,e,t){return new L.Vector3(r,e,t)}function Ci(){return new L.Vector3(0,0,0)}function xi(){return new L.Vector3(1,1,1)}function Si(r,e,t,n){return new L.Quaternion(r,e,t,n)}function Ri(r,e,t){return new L.Euler(r,e,t)}function Oi(r){const e=K(0,0,1),t=Math.acos(r.dot(e)/r.length()),n=r.cross(e),i=Math.sin(n.y)||1;return Math.PI-t*i}const ue={activeState:{position:K(0,5,5),impulse:E.vec3(),velocity:E.vec3(),acceleration:E.vec3(),quat:E.quat(),euler:E.euler(),rotation:E.euler(),dir:E.vec3(),direction:E.vec3()},mode:{},urls:{characterUrl:null,vehicleUrl:null,airplaneUrl:null,wheelUrl:null,ridingUrl:null},states:{rideableId:null,isMoving:!1,isNotMoving:!1,isOnTheGround:!1,isOnMoving:!1,isRotated:!1,isRunning:!1,isJumping:!1,enableRiding:!1,isRiderOn:!1,isLanding:!1,isFalling:!1,isRiding:!1,isPush:{forward:!1,backward:!1,leftward:!1,rightward:!1}},minimap:{props:{}},clicker:{point:K(0,0,0),angle:Math.PI/2,isOn:!1,isRun:!1},control:{forward:!1,backward:!1,leftward:!1,rightward:!1},refs:null,animationState:{character:{current:"idle",default:"idle",store:{}},vehicle:{current:"idle",default:"idle",store:{}},airplane:{current:"idle",default:"idle",store:{}}},cameraOption:{offset:K(-10,-10,-10),maxDistance:-7,distance:-1,XDistance:20,YDistance:10,ZDistance:20,zoom:1,target:E.vec3(),position:E.vec3(),focus:!1},rideable:{},sizes:{},block:{camera:!1,control:!1,animation:!1,scroll:!0},clickerOption:{isRun:!0,throttle:100,autoStart:!1,track:!1,loop:!1,queue:[],line:!1}},$=w.createContext(null),pe=w.createContext(null),ir=w.forwardRef(({children:r},e)=>S.jsx("group",{ref:e,userData:{intangible:!0},children:r}));function mn(r,e,t={}){const n=new ge.Vector3,i=new ge.Quaternion,a=new ge.Vector3,o=new ge.Matrix4,l=new ge.Matrix4,s=new ge.Matrix4;t.preserveMatrix=t.preserveMatrix!==void 0?t.preserveMatrix:!0,t.preservePosition=t.preservePosition!==void 0?t.preservePosition:!0,t.preserveHipPosition=t.preserveHipPosition!==void 0?t.preserveHipPosition:!1,t.useTargetMatrix=t.useTargetMatrix!==void 0?t.useTargetMatrix:!1,t.hip=t.hip!==void 0?t.hip:"hip",t.names=t.names||{};const c=e.isObject3D?e.skeleton.bones:Et(e),h=r.isObject3D?r.skeleton.bones:Et(r);let d,m,v,p,y;if(r.isObject3D?r.skeleton.pose():(t.useTargetMatrix=!0,t.preserveMatrix=!1),t.preservePosition){y=[];for(let g=0;g<h.length;g++)y.push(h[g].position.clone())}if(t.preserveMatrix){r.updateMatrixWorld(),r.matrixWorld.identity();for(let g=0;g<r.children.length;++g)r.children[g].updateMatrixWorld(!0)}if(t.offsets){d=[];for(let g=0;g<h.length;++g)m=h[g],v=t.names[m.name]||m.name,t.offsets[v]&&(m.matrix.multiply(t.offsets[v]),m.matrix.decompose(m.position,m.quaternion,m.scale),m.updateMatrixWorld()),d.push(m.matrixWorld.clone())}for(let g=0;g<h.length;++g){if(m=h[g],v=t.names[m.name]||m.name,p=pn(v,c),s.copy(m.matrixWorld),p){if(p.updateMatrixWorld(),t.useTargetMatrix?l.copy(p.matrixWorld):(l.copy(r.matrixWorld).invert(),l.multiply(p.matrixWorld)),a.setFromMatrixScale(l),l.scale(a.set(1/a.x,1/a.y,1/a.z)),s.makeRotationFromQuaternion(i.setFromRotationMatrix(l)),r.isObject3D){const C=h.indexOf(m),R=d?d[C]:o.copy(r.skeleton.boneInverses[C]).invert();s.multiply(R)}s.copyPosition(l)}m.parent&&m.parent.isBone?(m.matrix.copy(m.parent.matrixWorld).invert(),m.matrix.multiply(s)):m.matrix.copy(s),t.preserveHipPosition&&v===t.hip&&m.matrix.setPosition(n.set(0,m.position.y,0)),m.matrix.decompose(m.position,m.quaternion,m.scale),m.updateMatrixWorld()}if(t.preservePosition)for(let g=0;g<h.length;++g)m=h[g],v=t.names[m.name]||m.name,v!==t.hip&&m.position.copy(y[g]);t.preserveMatrix&&r.updateMatrixWorld(!0)}function Ai(r,e,t,n={}){n.useFirstFramePosition=n.useFirstFramePosition!==void 0?n.useFirstFramePosition:!1,n.fps=n.fps!==void 0?n.fps:30,n.names=n.names||[],e.isObject3D||(e=ji(e));const i=Math.round(t.duration*(n.fps/1e3)*1e3),a=1/n.fps,o=[],l=new ge.AnimationMixer(e),s=Et(r.skeleton),c=[];let h,d,m,v,p;l.clipAction(t).play(),l.update(0),e.updateMatrixWorld();for(let y=0;y<i;++y){const g=y*a;mn(r,e,n);for(let C=0;C<s.length;++C)p=n.names[s[C].name]||s[C].name,m=pn(p,e.skeleton),m&&(d=s[C],v=c[C]=c[C]||{bone:d},n.hip===p&&(v.pos||(v.pos={times:new Float32Array(i),values:new Float32Array(i*3)}),n.useFirstFramePosition&&(y===0&&(h=d.position.clone()),d.position.sub(h)),v.pos.times[y]=g,d.position.toArray(v.pos.values,y*3)),v.quat||(v.quat={times:new Float32Array(i),values:new Float32Array(i*4)}),v.quat.times[y]=g,d.quaternion.toArray(v.quat.values,y*4));l.update(a),e.updateMatrixWorld()}for(let y=0;y<c.length;++y)v=c[y],v&&(v.pos&&o.push(new ge.VectorKeyframeTrack(".bones["+v.bone.name+"].position",v.pos.times,v.pos.values)),o.push(new ge.QuaternionKeyframeTrack(".bones["+v.bone.name+"].quaternion",v.quat.times,v.quat.values)));return l.uncacheAction(t),new ge.AnimationClip(t.name,-1,o)}function Ei(r){const e=new Map,t=new Map,n=r.clone();return vn(r,n,function(i,a){e.set(a,i),t.set(i,a)}),n.traverse(function(i){if(!i.isSkinnedMesh)return;const a=i,o=e.get(i),l=o.skeleton.bones;a.skeleton=o.skeleton.clone(),a.bindMatrix.copy(o.bindMatrix),a.skeleton.bones=l.map(function(s){return t.get(s)}),a.bind(a.skeleton,a.bindMatrix)}),n}function pn(r,e){for(let t=0,n=Et(e);t<n.length;t++)if(r===n[t].name)return n[t]}function Et(r){return Array.isArray(r)?r:r.bones}function ji(r){const e=new ge.SkeletonHelper(r.bones[0]);return e.skeleton=r,e}function vn(r,e,t){t(r,e);for(let n=0;n<r.children.length;n++)vn(r.children[n],e.children[n],t)}const gn={retarget:mn,retargetClip:Ai,clone:Ei};function ft({type:r}){const{animationState:e}=w.useContext($),t=w.useContext(pe),n=s=>{const c=e[r].store[s];return c?c.condition()?{name:c.animationName,isValid:!0}:{name:e[r].default,isValid:!1}:{name:e[r].default,isValid:!1}},i=()=>{let s=e[r].default;for(const c of Object.keys(e[r].store)){const h=n(c);if(h.isValid){s=h.name;break}}return e[r].current=s,t({type:"update",payload:{animationState:{...e}}}),s},a=s=>{delete e[r].store[s],t({type:"update",payload:{animationState:{...e}}})};return{subscribe:({tag:s,condition:c,action:h,animationName:d,key:m})=>{e[r].store[s]={condition:c,action:h||(()=>{}),animationName:d||s,key:m||s},t({type:"update",payload:{animationState:{...e}}})},subscribeAll:s=>{const c=[];return s.forEach(h=>{e[r].store[h.tag]={condition:h.condition,action:h.action,animationName:h.animationName,key:h.key},c.push(h.tag)}),t({type:"update",payload:{animationState:{...e}}}),()=>{c.forEach(h=>{delete e[r].store[h]}),t({type:"update",payload:{animationState:{...e}}})}},store:e==null?void 0:e[r].store,unsubscribe:a,notify:i}}function ki({type:r}){const{states:e}=w.useContext($),{subscribeAll:t}=ft({type:r});w.useEffect(()=>{t([{tag:"walk",condition:()=>!e.isRunning&&e.isMoving,action:()=>{},animationName:"walk",key:"walk"},{tag:"run",condition:()=>e.isRunning,action:()=>{},animationName:"run",key:"run"},{tag:"jump",condition:()=>e.isJumping,action:()=>{},animationName:"jump",key:"jump"},{tag:"ride",condition:()=>e.isPush.keyR,action:()=>{},animationName:"ride",key:"ride"},{tag:"land",condition:()=>e.isLanding,action:()=>{},animationName:"land",key:"land"},{tag:"fall",condition:()=>e.isFalling,action:()=>{},animationName:"fall",key:"fall"}])},[])}function ar({type:r,actions:e,animationRef:t,currentAnimation:n,isActive:i}){var m,v;const{mode:a,animationState:o,block:l}=w.useContext($),s=w.useContext(pe),{notify:c,store:h}=ft({type:r});i&&(n=(m=o==null?void 0:o[r])==null?void 0:m.current);const d=p=>{o[r].current=p;const y=h[p];y!=null&&y.action&&y.action(),s({type:"update",payload:{animationState:{...o}}})};return w.useEffect(()=>{var g;let p="idle";l.animation?p="idle":n?p=n:o[r].current&&(p=o[r].current);const y=(g=e[p])==null?void 0:g.reset().fadeIn(.2).play();return()=>{y==null||y.fadeOut(.2)}},[n,a.type,l.animation,r]),je.useFrame(()=>{if(i){const p=c();d(p)}}),{animationRef:t,currentAnimation:(v=o==null?void 0:o[r])==null?void 0:v.current}}const Mi=(r,e)=>{const{XDistance:t,YDistance:n,ZDistance:i}=e;return r.position.clone().add(K(t,n,i))};function Pi(r){const{state:e,worldContext:{cameraOption:t},controllerOptions:{lerp:n}}=r;!e||!e.camera||(e.camera.position.lerp(t.position.clone(),n.cameraPosition),e.camera.lookAt(t.target))}const Fi=(r,e)=>{const{XDistance:t,YDistance:n,ZDistance:i}=e;return r.position.clone().add(K(Math.sin(r.euler.y),1,Math.cos(r.euler.y)).normalize().clone().multiply(K(-t,n,-i)))};function _i(r){const{state:e,worldContext:{activeState:t,cameraOption:n},controllerOptions:{lerp:i}}=r;if(!e||!e.camera)return;const a=Fi(t,n);e.camera.position.lerp(a.clone(),i.cameraTurn),e.camera.quaternion.copy(t.quat.clone().multiply(E.quat().setFromAxisAngle(K(0,1,0),Math.PI))),e.camera.rotation.copy(t.euler),e.camera.lookAt(t.position.clone())}function Ti(r){je.useFrame(e=>{r.state=e,r.worldContext.block.camera||(r.worldContext.mode.control==="orbit"?_i(r):r.worldContext.mode.control==="normal"&&Pi(r))}),je.useFrame(()=>{r.worldContext.cameraOption.focus||(r.worldContext.cameraOption.target=r.worldContext.activeState.position,r.worldContext.cameraOption.position=Mi(r.worldContext.activeState,r.worldContext.cameraOption))})}const Xe={airplane:{angleDelta:K(Math.PI/256,Math.PI/256,Math.PI/256),maxAngle:K(Math.PI/8,Math.PI/8,Math.PI/8),maxSpeed:60,accelRatio:2,brakeRatio:5,buoyancy:.2,linearDamping:1},vehicle:{maxSpeed:60,accelRatio:2,brakeRatio:5,wheelOffset:.1,linearDamping:.5},character:{walkSpeed:10,runSpeed:20,turnSpeed:10,jumpSpeed:1,linearDamping:1},callbacks:{onReady:()=>{},onFrame:()=>{},onDestory:()=>{},onAnimate:()=>{}},refs:{colliderRef:null,rigidBodyRef:null,outerGroupRef:null,innerGroupRef:null,characterInnerRef:null},controllerOptions:{lerp:{cameraTurn:1,cameraPosition:1}}},jt=w.createContext({...Xe}),zi=w.createContext(null);function Di({props:r,actions:e,componentType:t}){const{animationState:n}=w.useContext($),i=w.useContext(pe),{store:a}=ft({type:t}),{activeState:o,states:l,control:s}=w.useContext($),{subscribe:c}=ft({type:t}),h=(m,v)=>{if(v in s&&s[v]&&n[t]){n[t].current=m;const p=a[m];p!=null&&p.action&&p.action(),i({type:"update",payload:{animationState:{...n}}})}},d={activeState:o,control:s,states:l,subscribe:c};return w.useEffect(()=>(r.onReady&&r.onReady(d),()=>{r.onDestory&&r.onDestory(d)}),[]),je.useFrame(m=>{r.onFrame&&r.onFrame({...d,...m}),r.onAnimate&&r.onAnimate({...d,...m,actions:e,animationState:n,playAnimation:h})}),{subscribe:c,playAnimation:h,dispatch:i}}const yn=({url:r})=>{const{sizes:e}=w.useContext($),t=w.useContext(pe),n=Pe.useGLTF(r),{scene:i}=n,a=()=>new L.Box3().setFromObject(i).getSize(new L.Vector3),o=s=>{const c=s||r;return c in e?e[c]:null},l=(s,c)=>{const h=c||r;return h in e||(e[h]=s||a(),t({type:"update",payload:{sizes:{...e}}})),e[h]};return{gltf:n,size:l(),setSize:l,getSize:o}},bn=()=>{const{sizes:r}=w.useContext($);return{getSizesByUrls:t=>{const n={};return t&&Object.keys(t).forEach(i=>{const a=t[i];a in r?n[i]=r[a]:n[i]=null}),n}}};function Ii(r){const{rigidBodyRef:e,controllerContext:{airplane:t}}=r,{linearDamping:n}=t;e.current.setLinearDamping(n)}function Ni(r){const{innerGroupRef:e,worldContext:{activeState:t,control:n},controllerContext:{airplane:i},matchSizes:a}=r,{forward:o,backward:l,leftward:s,rightward:c,shift:h,space:d}=n,{angleDelta:m,maxAngle:v,accelRatio:p}=i;if(!a||!a.airplaneUrl)return null;let y=0;y=d?Number(h):Number(h)*p;const g=Number(l)-Number(o),C=Number(c)-Number(s),R=K().set(y,y,y);t.euler.y+=-C*m.y;const k=v.x*g,P=v.z*C,_=e.current.rotation.x,D=e.current.rotation.z,V=v.x,G=v.z,H=e.current.clone();_<-V?H.rotation.x=-V+k:_>V?H.rotation.x=V+k:H.rotateX(k),D<-G?H.rotation.z=-G+P:D>G?H.rotation.z=G+P:H.rotateZ(P),t.euler.x=H.rotation.x,t.euler.z=H.rotation.z,H.rotation.y=0,e.current.setRotationFromQuaternion(E.quat().setFromEuler(e.current.rotation.clone()).slerp(E.quat().setFromEuler(H.rotation.clone()),.2)),t.rotation=H.rotation,t.direction=R.multiply(K(Math.sin(t.euler.y),-g,Math.cos(t.euler.y))),t.dir=t.direction.normalize()}function Ui(r){const{rigidBodyRef:e,worldContext:{activeState:t}}=r;e.current.setGravityScale(t.position.y<10?(1-.1)/-10*t.position.y+1:.1,!1)}function Li(r){const{rigidBodyRef:e,worldContext:{activeState:t},controllerContext:{airplane:n}}=r,{maxSpeed:i}=n,a=e.current.linvel();if(E.vec3(a).length()<i){const l=e.current.mass();e.current.applyImpulse(E.vec3({x:t.direction.x,y:t.direction.y,z:t.direction.z}).multiplyScalar(l),!1)}}function Wi(r){const{rigidBodyRef:e,worldContext:{activeState:t},dispatch:n}=r;t.position=E.vec3(e.current.translation()),t.velocity=E.vec3(e.current.linvel());const i=t.euler.clone();i.x=0,i.z=0,e.current.setRotation(E.quat().setFromEuler(i),!0),n({type:"update",payload:{activeState:{...t}}})}function Bi(r){const{worldContext:{states:e,rideable:t,mode:n},dispatch:i}=r,{isRiding:a}=e;a&&(t.objectType=null,t.key=null,n.type="character",e.isRiding=!1,e.enableRiding=!1),i({type:"update",payload:{mode:{...n},rideable:{...t}}})}function Gi(r){Ni(r),Li(r),Ii(r),Ui(r),Bi(r),Wi(r)}function qi({activeState:r,control:e,mode:t,clicker:n}){const{forward:i,backward:a,leftward:o,rightward:l}=e,s=Number(o)-Number(l),c=Number(i)-Number(a);let h=0;if(t.controller==="clicker")r.euler.y=Math.PI/2-n.angle,h=1;else{if(s===0&&c===0)return;r.euler.y+=s*Math.PI/32,h=c}const d=K(h,0,h);r.direction=d.multiply(K(-Math.sin(r.euler.y),0,-Math.cos(r.euler.y))),r.dir=r.direction.normalize()}function $i({activeState:r,control:e,mode:t,clicker:n}){const{forward:i,backward:a,leftward:o,rightward:l}=e;if(t.controller==="clicker")r.euler.y=Math.PI/2-n.angle,r.dir.set(-Math.sin(r.euler.y),0,-Math.cos(r.euler.y));else{const s=Number(o)-Number(l),c=Number(i)-Number(a);if(s===0&&c===0)return;const h=K(s,0,c),d=Oi(h);r.euler.y=d,r.dir.set(s,0,c)}}function Vi(r){const{worldContext:e}=r;e.mode.control==="normal"?$i(e):e.mode.control==="orbit"&&qi(e)}function Hi(r){const{rigidBodyRef:e,worldContext:{states:t,activeState:n}}=r,{isMoving:i,isRunning:a}=t,{controllerContext:{character:{walkSpeed:o,runSpeed:l,jumpSpeed:s}}}=r,{isOnTheGround:c,isJumping:h}=t,d=E.vec3();if(h&&c&&d.setY(s*e.current.mass()),i){const m=a?l:o,v=E.vec3().addScalar(m).multiply(n.dir.clone().normalize().negate()),p=e.current.mass(),g=v.clone().sub(n.velocity).multiplyScalar(p);d.setX(g.x),d.setZ(g.z)}e.current.applyImpulse(d,!0),n.position=E.vec3(e.current.translation()),n.velocity=E.vec3(e.current.linvel())}function Yi(r){const{rigidBodyRef:e,innerGroupRef:t,controllerContext:{character:{linearDamping:n}},worldContext:{activeState:i,states:a,block:o},delta:l}=r;a.isJumping||e.current.linvel().y<0?e.current.setLinearDamping(n):e.current.setLinearDamping(a.isNotMoving?n*5:n),e.current.setEnabledRotations(!1,!1,!1,!1),t.current.quaternion.rotateTowards(E.quat().setFromEuler(i.euler),10*l)}function Ki(r){var c;const{rigidBodyRef:e,state:t,worldContext:{clicker:n,mode:i,clickerOption:a,block:o}}=r,l=E.vec3((c=e.current)==null?void 0:c.translation());let s=Wr(l,n.point,!1);if(a.autoStart&&a.queue[0]instanceof L.Vector3){n.isOn=!0,s=Wr(l,a.queue[0],!1);const h=E.vec3(a.queue[0]),d=Math.atan2(h.z-l.z,h.x-l.x);n.angle=d}if(s<1&&i.controller==="clicker")if(a.track&&a.queue.length!==0){const h=a.queue.shift();if(h instanceof L.Vector3){n.point=h;const d=E.vec3(n.point),m=Math.atan2(d.z-l.z,d.x-l.x);n.angle=m}else{const{action:d,beforeCB:m,afterCB:v,time:p}=h;d==="stop"&&(t.clock.stop(),m(t),console.log(),setTimeout(()=>{t.clock.start(),v(t)},p))}a.loop&&a.queue.push(h)}else n.isOn=!1,n.isRun=!1}function Xi(r){const{worldContext:{control:e,clicker:t,mode:n}}=r,{keyS:i}=e;i&&n.controller==="clicker"&&(t.isOn=!1,t.isRun=!1)}function Zi(r){Vi(r),Hi(r),Yi(r),Xi(r),Ki(r)}function Ji(r){const{colliderRef:e,groundRay:t,worldContext:{states:n,activeState:i}}=r;if(t.origin.addVectors(i.position,E.vec3(t.offset)),(!t.hit||!t.rayCast||!e.current)&&(n.isOnTheGround=!1),t.hit){const a=t.length*2,o=t.length*.8;t.hit.toi>=a?(n.isFalling=!0,n.isOnTheGround=!1):o<=t.hit.toi&&t.hit.toi<a?n.isFalling=!0:t.hit.toi<o&&(n.isFalling=!1,n.isOnTheGround=!0)}}function Qi(r){const{worldContext:{states:e,mode:t,control:n,clicker:i,clickerOption:a}}=r,{shift:o,space:l}=n;t.controller==="clicker"&&(e.isMoving=i.isOn,e.isNotMoving=!i.isOn,e.isRunning=(o||i.isRun)&&e.isMoving&&a.isRun,e.isJumping=l)}function ea(r){const{worldContext:{states:e,control:t}}=r;Object.keys(t).forEach(n=>{e.isPush[n]=t[n]})}function ta(r){const{worldContext:{states:e}}=r,{isRiderOn:t}=e;t&&e.isPush.keyR&&(e.isRiding=!0)}function ra(r){const{outerGroupRef:e,worldContext:{states:t,activeState:n}}=r;t.isMoving&&e&&e.current&&(t.isRotated=Math.sin(e.current.rotation.y).toFixed(3)===Math.sin(n.euler.y).toFixed(3))}function na(r){Ji(r),Qi(r),ra(r),ea(r),ta(r)}function ia(r){const{rigidBodyRef:e,worldContext:{control:t},controllerContext:{vehicle:n}}=r,{space:i}=t,{brakeRatio:a,linearDamping:o}=n;e.current.setLinearDamping(i?a:o)}function aa(r){const{worldContext:{activeState:e,control:t}}=r,{forward:n,backward:i,leftward:a,rightward:o}=t,l=Number(a)-Number(o),s=Number(n)-Number(i),c=E.vec3().set(s,0,s);return e.euler.y+=l*(Math.PI/64),c}function oa(r){const{worldContext:{mode:e,activeState:t}}=r,n=E.vec3();n.copy(aa(r)),t.direction=n.multiply(K(Math.sin(t.euler.y),0,Math.cos(t.euler.y))),t.dir=t.direction.normalize()}function sa(r){const{rigidBodyRef:e,worldContext:{activeState:t,control:n},controllerContext:{vehicle:i}}=r,{shift:a}=n,{maxSpeed:o,accelRatio:l}=i,s=e.current.linvel();if(E.vec3(s).length()<o){const h=e.current.mass();let d=a?l:1;e.current.applyImpulse(E.vec3().addScalar(d).multiply(t.dir.clone().normalize()).multiplyScalar(h),!1)}}function la(r){const{rigidBodyRef:e,worldContext:{activeState:t}}=r;t.position=E.vec3(e.current.translation()),t.velocity=E.vec3(e.current.linvel()),e.current.setRotation(E.quat().setFromEuler(t.euler.clone()),!1)}function ua(r){const{worldContext:{states:e,rideable:t,mode:n},dispatch:i}=r,{isRiding:a}=e;a&&(t.objectType=null,t.key=null,n.type="character",e.isRiding=!1,e.enableRiding=!1),i({type:"update",payload:{mode:{...n},rideable:{...t}}})}function ca(r){oa(r),sa(r),ia(r),ua(r),la(r)}function fa({groundRay:r,rigidBodyRef:e,outerGroupRef:t,innerGroupRef:n,colliderRef:i}){const a=w.useContext($),o=w.useContext(jt),l=w.useContext(pe),{mode:s,activeState:c,block:h}=a,{getSizesByUrls:d}=bn();w.useEffect(()=>{!e||!n||e.current&&n.current&&(e.current.lockRotations(!1,!0),c.euler.set(0,0,0),e.current.setTranslation(c.position.clone().add(K(0,5,0)),!0))},[s.type]),w.useEffect(()=>{e&&e.current&&h.control&&(e.current.resetForces(!1),e.current.resetTorques(!1))},[h.control,e.current]),je.useFrame((m,v)=>{if(!e||!e.current||!t||!t.current||!n||!n.current||h.control)return null;const p={rigidBodyRef:e,outerGroupRef:t,innerGroupRef:n,colliderRef:i,groundRay:r,state:m,delta:v,worldContext:a,controllerContext:o,dispatch:l,matchSizes:d(a==null?void 0:a.urls)};s.type==="vehicle"?ca(p):s.type==="character"?Zi(p):s.type==="airplane"&&Gi(p),na(p)})}function ha({url:r,children:e,offset:t,currentAnimation:n}){const{gltf:i}=yn({url:r}),{animations:a,scene:o}=i,{actions:l,ref:s}=Pe.useAnimations(a),c=w.useMemo(()=>gn.clone(o),[o]),{nodes:h}=je.useGraph(c),d=Object.values(h).find(m=>m.type==="Object3D");return ar({type:"character",currentAnimation:n||"ride",actions:l,animationRef:s,isActive:!1}),S.jsx(S.Fragment,{children:S.jsxs("group",{position:t,children:[d&&S.jsx("primitive",{object:d,visible:!1,receiveShadow:!0,castShadow:!0,ref:s}),Object.keys(h).map((m,v)=>{const p=h[m];if(p instanceof L.SkinnedMesh)return S.jsx("skinnedMesh",{castShadow:!0,receiveShadow:!0,material:p.material,geometry:p.geometry,skeleton:p.skeleton},v);if(p instanceof L.Mesh)return S.jsx("mesh",{castShadow:!0,receiveShadow:!0,material:p.material,geometry:p.geometry},v)}),e]})})}const da=w.forwardRef((r,e)=>S.jsxs("group",{receiveShadow:!0,castShadow:!0,ref:e,userData:{intangible:!0},children:[r.isRiderOn&&r.enableRiding&&r.isActive&&r.ridingUrl&&S.jsx(ha,{url:r.ridingUrl,offset:r.offset}),r.children,r.objectNode&&r.animationRef&&S.jsx("primitive",{object:r.objectNode,visible:!1,receiveShadow:!0,castShadow:!0,ref:r.animationRef}),Object.keys(r.nodes).map((t,n)=>{const i=r.nodes[t];if(i instanceof L.SkinnedMesh)return S.jsx("skinnedMesh",{castShadow:!0,receiveShadow:!0,material:i.material,geometry:i.geometry,skeleton:i.skeleton},n);if(i instanceof L.Mesh)return S.jsx("mesh",{castShadow:!0,receiveShadow:!0,material:i.material,geometry:i.geometry},n)})]})),ma=({url:r,isActive:e,componentType:t,currentAnimation:n,color:i,skeleton:a})=>{const{scene:o,animations:l}=Pe.useGLTF(r),{actions:s,ref:c}=Pe.useAnimations(l),h=w.useMemo(()=>{const d=[];return o.traverse(m=>{if(m instanceof L.SkinnedMesh){const v=m.clone();v.skeleton=a,v.bind(a,v.bindMatrix),d.push(v)}}),d},[o,a]);return ar({type:t,actions:s,animationRef:c,currentAnimation:e?void 0:n,isActive:e}),S.jsx(S.Fragment,{children:h.map((d,m)=>S.jsx("skinnedMesh",{castShadow:!0,receiveShadow:!0,geometry:d.geometry,skeleton:a,material:d.name==="color"&&i?new L.MeshStandardMaterial({color:i}):d.material},m))})};function pa(){const r=E.useRapier();return w.useCallback(({ray:t,ref:n})=>r.world.castRay(t.rayCast,t.length,!0,void 0,void 0,n.current,void 0),[r])}function va(){const{rapier:r}=E.useRapier(),e=pa();return({groundRay:n,length:i,colliderRef:a})=>{var o;n.length=i,n.rayCast=new r.Ray(n.origin,n.dir),n.hit=e({ray:n,ref:a}),n.parent=(o=n.hit)==null?void 0:o.collider.parent()}}const or=w.forwardRef((r,e)=>{var p;const{size:t}=yn({url:r.url}),n=va();w.useEffect(()=>{r.groundRay&&r.colliderRef&&n({groundRay:r.groundRay,length:.5,colliderRef:r.colliderRef})},[r.groundRay,r.colliderRef,n]);const{scene:i,animations:a}=Pe.useGLTF(r.url),{actions:o,ref:l}=Pe.useAnimations(a),s=w.useContext($),c=w.useContext(jt),h=w.useMemo(()=>gn.clone(i),[i]),d=w.useMemo(()=>{let y=null;return h.traverse(g=>{g instanceof L.SkinnedMesh&&(y=g.skeleton)}),y},[h]);if(r.isActive){ki({type:r.componentType,groundRay:r.groundRay,animations:a});const y={state:null,worldContext:s,controllerContext:c,controllerOptions:r.controllerOptions};Ti(y),fa({outerGroupRef:r.outerGroupRef,innerGroupRef:r.innerGroupRef,rigidBodyRef:e,colliderRef:r.colliderRef,groundRay:r.groundRay})}ar({type:r.componentType,actions:o,animationRef:l,currentAnimation:r.isActive?void 0:r.currentAnimation,isActive:r.isActive}),Di({props:r,actions:o,componentType:r.componentType});const{nodes:m}=je.useGraph(h),v=Object.values(m).find(y=>y.type==="Object3D");return je.useFrame(()=>{r.isActive||!r.position||!e||!e.current||e.current.setTranslation(K(L.MathUtils.lerp(e.current.translation().x,r.position.x,r.controllerOptions.lerp.cameraPosition),L.MathUtils.lerp(e.current.translation().y,r.position.y,r.controllerOptions.lerp.cameraPosition),L.MathUtils.lerp(e.current.translation().z,r.position.z,r.controllerOptions.lerp.cameraPosition)),!1)}),S.jsxs(E.RigidBody,{colliders:!1,ref:e,name:r.name,rotation:E.euler().set(0,((p=r.rotation)==null?void 0:p.clone().y)||0,0).clone(),userData:r.userData,type:r.rigidbodyType||(r.isActive?"dynamic":"fixed"),sensor:r.sensor,onIntersectionEnter:r.onIntersectionEnter,onCollisionEnter:r.onCollisionEnter,...r.rigidBodyProps,children:[!r.isNotColliding&&S.jsx(E.CapsuleCollider,{ref:r.colliderRef,args:[(t.y/2-t.x)*1.2,t.x*1.2],position:[0,(t.y/2+t.x/2)*1.2,0]}),S.jsxs(da,{objectNode:v,animationRef:l,nodes:m,ref:r.innerGroupRef,isActive:r.isActive,isRiderOn:r.isRiderOn,enableRiding:r.enableRiding,ridingUrl:r.ridingUrl,offset:r.offset,parts:r.parts,children:[r.children,r.parts&&r.parts.length>0&&r.parts.map(({url:y,color:g},C)=>y?S.jsx(ma,{url:y,isActive:r.isActive,componentType:r.componentType,currentAnimation:r.currentAnimation,color:g,skeleton:d},C+y):null)]})]})});function wn(r){const{rigidBodyRef:e,outerGroupRef:t}=r;return S.jsx(ir,{ref:t,children:S.jsx(or,{ref:e,name:r.name,componentType:"airplane",ridingUrl:r.ridingUrl,...r,children:r.children})})}function ga(r){return S.jsx(wn,{name:"airplane",isActive:!0,currentAnimation:"idle",componentType:"airplane",ridingUrl:r.ridingUrl,...r,children:r.children})}function Cn(r){const{outerGroupRef:e}=r;return S.jsx(ir,{ref:e,children:S.jsx(or,{name:"character",url:r.url,controllerOptions:r.controllerOptions,ref:r.rigidBodyRef,groundRay:r.groundRay,isNotColliding:r.isNotColliding,...r,children:r.children})})}function ya({children:r,props:e,refs:t,urls:n}){return S.jsx(Cn,{url:n.characterUrl,isActive:!0,componentType:"character",rigidbodyType:"dynamic",controllerOptions:e.controllerOptions,groundRay:e.groundRay,onAnimate:e.onAnimate,onFrame:e.onFrame,onReady:e.onReady,onDestory:e.onDestory,rigidBodyProps:e.rigidBodyProps,parts:e.parts,...t,children:r})}function xn(r){const{rigidBodyRef:e,outerGroupRef:t}=r;return S.jsx(ir,{ref:t,children:S.jsx(or,{ref:e,name:r.name,componentType:"vehicle",ridingUrl:r.ridingUrl,...r,children:r.children})})}function ba(r){return S.jsx(xn,{name:"vehicle",isActive:!0,currentAnimation:"idle",componentType:"vehicle",ridingUrl:r.ridingUrl,...r,children:r.children})}function Sn({props:r,refs:e}){const{mode:t,states:n,rideable:i,urls:a}=w.useContext($),{enableRiding:o,isRiderOn:l,rideableId:s}=n;return S.jsxs(S.Fragment,{children:[t.type==="character"&&S.jsx(ya,{props:r,refs:e,urls:a,children:r.children}),t.type==="vehicle"&&S.jsx(ba,{controllerOptions:r.controllerOptions,url:a.vehicleUrl,wheelUrl:a.wheelUrl,ridingUrl:a.ridingUrl,enableRiding:o,isRiderOn:l,groundRay:r.groundRay,offset:s&&i[s]?i[s].offset:E.vec3(),...e,children:r.children}),t.type==="airplane"&&S.jsx(ga,{controllerOptions:r.controllerOptions,url:a.airplaneUrl,ridingUrl:a.ridingUrl,enableRiding:o,isRiderOn:l,groundRay:r.groundRay,offset:s&&i[s]?i[s].offset:E.vec3(),...e,children:r.children})]})}function wa(r){const e=w.useRef(null),t=w.useRef(null),n=w.useRef(null),i=w.useRef(null),a={rigidBodyRef:e,outerGroupRef:t,innerGroupRef:n,colliderRef:i};return je.useFrame(()=>{if(n&&n.current){const o=r.rotation.clone();o.y=0,n.current.setRotationFromQuaternion(E.quat().setFromEuler(n.current.rotation.clone()).slerp(E.quat().setFromEuler(o),.2))}e&&e.current&&e.current.setGravityScale(r.position.y<10?(1-.1)/-10*r.position.y+1:.1,!1)}),S.jsx(wn,{isActive:!1,componentType:"airplane",name:"airplane",controllerOptions:r.controllerOptions||{lerp:{cameraTurn:1,cameraPosition:1}},position:r.position,rotation:r.rotation,currentAnimation:r.currentAnimation,ridingUrl:r.ridingUrl,...r,...a,children:r.children})}function Ca(r){const e=w.useRef(null),t=w.useRef(null),n=w.useRef(null),i=w.useRef(null),a={rigidBodyRef:e,outerGroupRef:t,innerGroupRef:n,colliderRef:i};return w.useEffect(()=>{e&&e.current&&e.current.setEnabledRotations(!1,!1,!1,!1)},[]),S.jsx(Cn,{isActive:!1,componentType:"character",controllerOptions:r.controllerOptions||{lerp:{cameraTurn:1,cameraPosition:1}},position:r.position,rotation:r.rotation,groundRay:r.groundRay,currentAnimation:r.currentAnimation,...a,...r,children:r.children})}function xa(r){const e=w.useRef(null),t=w.useRef(null),n=w.useRef(null),i=w.useRef(null),a={rigidBodyRef:e,outerGroupRef:t,innerGroupRef:n,colliderRef:i};return S.jsx(xn,{isActive:!1,componentType:"vehicle",name:"vehicle",controllerOptions:r.controllerOptions||{lerp:{cameraTurn:1,cameraPosition:1}},position:r.position,rotation:r.rotation,currentAnimation:r.currentAnimation,url:r.url,ridingUrl:r.ridingUrl,...r,...a,children:r.children})}function Sa(r,e){switch(e.type){case"init":return{...r};case"update":return{...r,...e.payload}}}const Ra=(r,e)=>{e({type:"update",payload:r})};function Oa(r){const e=w.useContext($),t=w.useContext(pe);w.useEffect(()=>{if(e&&e.control){let o={};e.mode.controller==="clicker"?e.mode.isButton&&(o={...e.control}):o={...e.control},t({type:"update",payload:{control:{...o}}})}},[e==null?void 0:e.mode.controller,e==null?void 0:e.control]);const n=w.useMemo(()=>({origin:E.vec3(),dir:E.vec3({x:0,y:-1,z:0}),offset:E.vec3({x:0,y:-1,z:0}),hit:null,parent:null,rayCast:null,length:10}),[]),i=w.useMemo(()=>({origin:E.vec3(),hit:new L.Raycaster,rayCast:new L.Raycaster(E.vec3(),E.vec3(),0,-7),dir:E.vec3(),position:E.vec3(),length:-e.cameraOption.maxDistance,detected:[],intersects:[],intersectObjectMap:{}}),[]),a=w.useCallback(o=>{Ra({refs:{...o}},t)},[r.refs]);return w.useEffect(()=>{r.refs&&a(r.refs)},[]),{groundRay:n,cameraRay:i}}function Aa(r){return S.jsx(S.Fragment,{children:S.jsx(Ea,{...r,children:r.children})})}function Ea(r){const e=w.useRef(null),t=w.useRef(null),n=w.useRef(null),i=w.useRef(null),a=w.useRef(null),o=w.useRef(null),[l,s]=w.useReducer(Sa,{airplane:Object.assign(Xe.airplane,r.airplane||{}),vehicle:Object.assign(Xe.vehicle,r.vehicle||{}),character:Object.assign(Xe.character,r.character||{}),callbacks:Object.assign(Xe.callbacks,{onReady:r.onReady,onFrame:r.onFrame,onDestory:r.onDestory,onAnimate:r.onAnimate}),refs:{colliderRef:e,rigidBodyRef:t,outerGroupRef:n,innerGroupRef:i,characterInnerRef:a},controllerOptions:Object.assign(Xe.controllerOptions,r.controllerOptions||{})}),c=w.useMemo(()=>({value:l,dispatch:s}),[]),h=w.useMemo(()=>({colliderRef:e,rigidBodyRef:t,outerGroupRef:n,innerGroupRef:i,characterInnerRef:a,passiveRigidBodyRef:o}),[]),d={...Oa({refs:h}),children:r.children,groupProps:r.groupProps,rigidBodyProps:r.rigidBodyProps,controllerOptions:c.value.controllerOptions,parts:r.parts,...c.value.callbacks,...h},m=Pe.useContextBridge($,jt);return S.jsx(m,{children:S.jsx(jt.Provider,{value:c.value,children:S.jsx(zi.Provider,{value:c.dispatch,children:S.jsx(Sn,{props:d,refs:h})})})})}function Rn(){const{activeState:r,mode:e}=w.useContext($),t=w.useContext(pe);return{moveClicker:(i,a,o)=>{if(e.controller!=="clicker"||o!=="ground")return;const l=r.position,s=K(i.point.x,i.point.y,i.point.z),c=Math.atan2(s.z-l.z,s.x-l.x);t({type:"update",payload:{clicker:{point:K(s.x,0,s.z),angle:c,isOn:!0,isRun:a}}})}}}function ja({type:r="normal",text:e,position:t,children:n}){const i=w.useRef(null),{minimap:a,activeState:o,clickerOption:l}=w.useContext($),s=w.useContext(pe),{moveClicker:c}=Rn();return w.useEffect(()=>{if(i.current){const h=new L.Box3().setFromObject(i.current),d=E.vec3(h.getSize(new L.Vector3)).clone(),m=E.vec3(h.getCenter(new L.Vector3)).clone(),v={type:r||"normal",text:e,size:d,center:m};a.props[e]=v,s({type:"update",payload:{minimap:{...a}}})}},[]),S.jsx("group",{ref:i,position:t,onPointerDown:h=>{h.srcElement instanceof HTMLDivElement||c(h,!1,r)},children:n})}function ka({onMarker:r,runMarker:e}){const{clicker:t,mode:n,clickerOption:i}=w.useContext($),a=[];for(let o=0;o<i.queue.length;o++)i.queue[o]instanceof L.Vector3&&a.push(i.queue[o]);return S.jsxs(S.Fragment,{children:[n.controller==="clicker"&&S.jsxs("group",{position:t.point,children:[t.isOn&&r,t.isOn&&i.isRun&&t.isRun&&e]}),i.line&&a.map((o,l)=>{if(o instanceof L.Vector3){const s=l,c=l===0?a.length-1:l-1;return S.jsxs("group",{position:[0,1,0],children:[S.jsx(Pe.Line,{worldUnits:!0,points:[a[c],a[s]],color:"turquoise",transparent:!0,opacity:.5,lineWidth:.4}),S.jsxs("mesh",{position:o,children:[S.jsx("sphereGeometry",{args:[.6,30,.6]}),S.jsx("meshStandardMaterial",{color:"turquoise",transparent:!0,opacity:.8})]},l)]},l)}})]})}function On(){const{control:r}=w.useContext($),e=w.useContext(pe);return{pushKey:(n,i)=>{r[n]=i,e({type:"update",payload:{control:{...r}}})}}}var Br={},Ma=r=>{var{fileScope:e,css:t}=r,n=e.packageName?[e.packageName,e.filePath].join("/"):e.filePath,i=Br[n];if(!i){var a=document.createElement("style");e.packageName&&a.setAttribute("data-package",e.packageName),a.setAttribute("data-file",e.filePath),a.setAttribute("type","text/css"),i=Br[n]=a,document.head.appendChild(a)}i.innerHTML=t};function Pa(r){var e=r.match(/^var\((.*)\)$/);return e?e[1]:r}/*! https://mths.be/cssesc v3.0.0 by @mathias */var Fa={},_a=Fa.hasOwnProperty,Ta=function(e,t){if(!e)return t;var n={};for(var i in t)n[i]=_a.call(e,i)?e[i]:t[i];return n},za=/[ -,\.\/:-@\[-\^`\{-~]/,Da=/[ -,\.\/:-@\[\]\^`\{-~]/,Ia=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g,sr=function r(e,t){t=Ta(t,r.options),t.quotes!="single"&&t.quotes!="double"&&(t.quotes="single");for(var n=t.quotes=="double"?'"':"'",i=t.isIdentifier,a=e.charAt(0),o="",l=0,s=e.length;l<s;){var c=e.charAt(l++),h=c.charCodeAt(),d=void 0;if(h<32||h>126){if(h>=55296&&h<=56319&&l<s){var m=e.charCodeAt(l++);(m&64512)==56320?h=((h&1023)<<10)+(m&1023)+65536:l--}d="\\"+h.toString(16).toUpperCase()+" "}else t.escapeEverything?za.test(c)?d="\\"+c:d="\\"+h.toString(16).toUpperCase()+" ":/[\t\n\f\r\x0B]/.test(c)?d="\\"+h.toString(16).toUpperCase()+" ":c=="\\"||!i&&(c=='"'&&n==c||c=="'"&&n==c)||i&&Da.test(c)?d="\\"+c:d=c;o+=d}return i&&(/^-[-\d]/.test(o)?o="\\-"+o.slice(1):/\d/.test(a)&&(o="\\3"+a+" "+o.slice(1))),o=o.replace(Ia,function(v,p,y){return p&&p.length%2?v:(p||"")+y}),!i&&t.wrap?n+o+n:o};sr.options={escapeEverything:!1,isIdentifier:!1,quotes:"single",wrap:!1};sr.version="3.0.0";var Na=sr;const lr=dn(Na);class Ua{constructor(e){const{failure:t,gotoFn:n,output:i}=this._buildTables(e);this.gotoFn=n,this.output=i,this.failure=t}_buildTables(e){const t={0:{}},n={};let i=0;for(const l of e){let s=0;for(const c of l)t[s]&&c in t[s]?s=t[s][c]:(i++,t[s][c]=i,t[i]={},s=i,n[i]=[]);n[s].push(l)}const a={},o=[];for(const l in t[0]){const s=t[0][l];a[s]=0,o.push(s)}for(;o.length>0;){const l=o.shift();if(l!==void 0)for(const s in t[l]){const c=t[l][s];o.push(c);let h=a[l];for(;h>0&&!(s in t[h]);)h=a[h];if(s in t[h]){const d=t[h][s];a[c]=d,n[c]=[...n[c],...n[d]]}else a[c]=0}}return{gotoFn:t,output:n,failure:a}}search(e){let t=0;const n=[];for(let i=0;i<e.length;i++){const a=e[i];for(;t>0&&!(a in this.gotoFn[t]);)t=this.failure[t];if(a in this.gotoFn[t]&&(t=this.gotoFn[t][a],this.output[t].length>0)){const o=this.output[t];n.push([i,o])}}return n}}var La={appendCss:()=>{},registerClassName:()=>{},onEndFileScope:()=>{},registerComposition:()=>{},markCompositionUsed:()=>{},getIdentOption:()=>process.env.NODE_ENV==="production"?"short":"debug"},St=[La],pt=()=>{if(St.length<1)throw new Error("No adapter configured");return St[St.length-1]},An=!1,Wa=r=>{An||Ba(r)},Ba=r=>{if(!r)throw new Error('No adapter provided when calling "setAdapter"');An=!0,St.push(r)},Ft=function(){return pt().appendCss(...arguments)},En=function(){return pt().registerClassName(...arguments)},Ga=function(){return pt().registerComposition(...arguments)},jn=function(){return pt().markCompositionUsed(...arguments)},qa=function(){var e=pt();return"getIdentOption"in e?e.getIdentOption(...arguments):process.env.NODE_ENV==="production"?"short":"debug"};function ur(r,e){return e||(e=r.slice(0)),Object.freeze(Object.defineProperties(r,{raw:{value:Object.freeze(e)}}))}var Y;(function(r){r.Attribute="attribute",r.Pseudo="pseudo",r.PseudoElement="pseudo-element",r.Tag="tag",r.Universal="universal",r.Adjacent="adjacent",r.Child="child",r.Descendant="descendant",r.Parent="parent",r.Sibling="sibling",r.ColumnCombinator="column-combinator"})(Y||(Y={}));var ye;(function(r){r.Any="any",r.Element="element",r.End="end",r.Equals="equals",r.Exists="exists",r.Hyphen="hyphen",r.Not="not",r.Start="start"})(ye||(ye={}));const Gr=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,$a=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,Va=new Map([[126,ye.Element],[94,ye.Start],[36,ye.End],[42,ye.Any],[33,ye.Not],[124,ye.Hyphen]]),Ha=new Set(["has","not","matches","is","where","host","host-context"]);function Ya(r){switch(r.type){case Y.Adjacent:case Y.Child:case Y.Descendant:case Y.Parent:case Y.Sibling:case Y.ColumnCombinator:return!0;default:return!1}}const Ka=new Set(["contains","icontains"]);function Xa(r,e,t){const n=parseInt(e,16)-65536;return n!==n||t?e:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,n&1023|56320)}function lt(r){return r.replace($a,Xa)}function qt(r){return r===39||r===34}function qr(r){return r===32||r===9||r===10||r===12||r===13}function Za(r){const e=[],t=kn(e,`${r}`,0);if(t<r.length)throw new Error(`Unmatched selector: ${r.slice(t)}`);return e}function kn(r,e,t){let n=[];function i(m){const v=e.slice(t+m).match(Gr);if(!v)throw new Error(`Expected name, found ${e.slice(t)}`);const[p]=v;return t+=m+p.length,lt(p)}function a(m){for(t+=m;t<e.length&&qr(e.charCodeAt(t));)t++}function o(){t+=1;const m=t;let v=1;for(;v>0&&t<e.length;t++)e.charCodeAt(t)===40&&!l(t)?v++:e.charCodeAt(t)===41&&!l(t)&&v--;if(v)throw new Error("Parenthesis not matched");return lt(e.slice(m,t-1))}function l(m){let v=0;for(;e.charCodeAt(--m)===92;)v++;return(v&1)===1}function s(){if(n.length>0&&Ya(n[n.length-1]))throw new Error("Did not expect successive traversals.")}function c(m){if(n.length>0&&n[n.length-1].type===Y.Descendant){n[n.length-1].type=m;return}s(),n.push({type:m})}function h(m,v){n.push({type:Y.Attribute,name:m,action:v,value:i(1),namespace:null,ignoreCase:"quirks"})}function d(){if(n.length&&n[n.length-1].type===Y.Descendant&&n.pop(),n.length===0)throw new Error("Empty sub-selector");r.push(n)}if(a(0),e.length===t)return t;e:for(;t<e.length;){const m=e.charCodeAt(t);switch(m){case 32:case 9:case 10:case 12:case 13:{(n.length===0||n[0].type!==Y.Descendant)&&(s(),n.push({type:Y.Descendant})),a(1);break}case 62:{c(Y.Child),a(1);break}case 60:{c(Y.Parent),a(1);break}case 126:{c(Y.Sibling),a(1);break}case 43:{c(Y.Adjacent),a(1);break}case 46:{h("class",ye.Element);break}case 35:{h("id",ye.Equals);break}case 91:{a(1);let v,p=null;e.charCodeAt(t)===124?v=i(1):e.startsWith("*|",t)?(p="*",v=i(2)):(v=i(0),e.charCodeAt(t)===124&&e.charCodeAt(t+1)!==61&&(p=v,v=i(1))),a(0);let y=ye.Exists;const g=Va.get(e.charCodeAt(t));if(g){if(y=g,e.charCodeAt(t+1)!==61)throw new Error("Expected `=`");a(2)}else e.charCodeAt(t)===61&&(y=ye.Equals,a(1));let C="",R=null;if(y!=="exists"){if(qt(e.charCodeAt(t))){const _=e.charCodeAt(t);let D=t+1;for(;D<e.length&&(e.charCodeAt(D)!==_||l(D));)D+=1;if(e.charCodeAt(D)!==_)throw new Error("Attribute value didn't end");C=lt(e.slice(t+1,D)),t=D+1}else{const _=t;for(;t<e.length&&(!qr(e.charCodeAt(t))&&e.charCodeAt(t)!==93||l(t));)t+=1;C=lt(e.slice(_,t))}a(0);const P=e.charCodeAt(t)|32;P===115?(R=!1,a(1)):P===105&&(R=!0,a(1))}if(e.charCodeAt(t)!==93)throw new Error("Attribute selector didn't terminate");t+=1;const k={type:Y.Attribute,name:v,action:y,value:C,namespace:p,ignoreCase:R};n.push(k);break}case 58:{if(e.charCodeAt(t+1)===58){n.push({type:Y.PseudoElement,name:i(2).toLowerCase(),data:e.charCodeAt(t)===40?o():null});continue}const v=i(1).toLowerCase();let p=null;if(e.charCodeAt(t)===40)if(Ha.has(v)){if(qt(e.charCodeAt(t+1)))throw new Error(`Pseudo-selector ${v} cannot be quoted`);if(p=[],t=kn(p,e,t+1),e.charCodeAt(t)!==41)throw new Error(`Missing closing parenthesis in :${v} (${e})`);t+=1}else{if(p=o(),Ka.has(v)){const y=p.charCodeAt(0);y===p.charCodeAt(p.length-1)&&qt(y)&&(p=p.slice(1,-1))}p=lt(p)}n.push({type:Y.Pseudo,name:v,data:p});break}case 44:{d(),n=[],a(1);break}default:{if(e.startsWith("/*",t)){const y=e.indexOf("*/",t+2);if(y<0)throw new Error("Comment was not terminated");t=y+2,n.length===0&&a(0);break}let v=null,p;if(m===42)t+=1,p="*";else if(m===124){if(p="",e.charCodeAt(t+1)===124){c(Y.ColumnCombinator),a(2);break}}else if(Gr.test(e.slice(t)))p=i(0);else break e;e.charCodeAt(t)===124&&e.charCodeAt(t+1)!==124&&(v=p,e.charCodeAt(t+1)===42?(p="*",t+=2):p=i(1)),n.push(p==="*"?{type:Y.Universal,namespace:v}:{type:Y.Tag,name:p,namespace:v})}}}return d(),t}function $r(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Vr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?$r(Object(t),!0).forEach(function(n){Ja(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):$r(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ja(r,e,t){return e=Qa(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Qa(r){var e=eo(r,"string");return typeof e=="symbol"?e:String(e)}function eo(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}const cr=Mn({});function Mn(r){return e.withOptions=t=>Mn(Vr(Vr({},r),t)),e;function e(t,...n){const i=typeof t=="string"?[t]:t.raw,{escapeSpecialCharacters:a=Array.isArray(t)}=r;let o="";for(let c=0;c<i.length;c++){let h=i[c];a&&(h=h.replace(/\\\n[ \t]*/g,"").replace(/\\`/g,"`").replace(/\\\$/g,"$").replace(/\\\{/g,"{")),o+=h,c<n.length&&(o+=n[c])}const l=o.split(`
30
+ <%s key={someKey} {...props} />`,Gt,Ue,mi,Ue),Dr[Ue+Gt]=!0}}return f===n?ui(J):li(J),J}}function ci(f,b,O){return Ir(f,b,O,!0)}function fi(f,b,O){return Ir(f,b,O,!1)}var hi=fi,di=ci;st.Fragment=n,st.jsx=hi,st.jsxs=di}()),st}process.env.NODE_ENV==="production"?Yt.exports=bi():Yt.exports=wi();var S=Yt.exports;function Wr(r,e,t){return Math.sqrt(Math.pow(r.x-e.x,2)+t+Math.pow(r.z-e.z,2))}function K(r,e,t){return new L.Vector3(r,e,t)}function Ci(){return new L.Vector3(0,0,0)}function xi(){return new L.Vector3(1,1,1)}function Si(r,e,t,n){return new L.Quaternion(r,e,t,n)}function Ri(r,e,t){return new L.Euler(r,e,t)}function Oi(r){const e=K(0,0,1),t=Math.acos(r.dot(e)/r.length()),n=r.cross(e),i=Math.sin(n.y)||1;return Math.PI-t*i}const ue={activeState:{position:K(0,5,5),impulse:E.vec3(),velocity:E.vec3(),acceleration:E.vec3(),quat:E.quat(),euler:E.euler(),rotation:E.euler(),dir:E.vec3(),direction:E.vec3()},mode:{},urls:{characterUrl:null,vehicleUrl:null,airplaneUrl:null,wheelUrl:null,ridingUrl:null},states:{rideableId:null,isMoving:!1,isNotMoving:!1,isOnTheGround:!1,isOnMoving:!1,isRotated:!1,isRunning:!1,isJumping:!1,enableRiding:!1,isRiderOn:!1,isLanding:!1,isFalling:!1,isRiding:!1,isPush:{forward:!1,backward:!1,leftward:!1,rightward:!1}},minimap:{props:{}},clicker:{point:K(0,0,0),angle:Math.PI/2,isOn:!1,isRun:!1},control:{forward:!1,backward:!1,leftward:!1,rightward:!1},refs:null,animationState:{character:{current:"idle",default:"idle",store:{}},vehicle:{current:"idle",default:"idle",store:{}},airplane:{current:"idle",default:"idle",store:{}}},cameraOption:{offset:K(-10,-10,-10),maxDistance:-7,distance:-1,XDistance:20,YDistance:10,ZDistance:20,zoom:1,target:E.vec3(),position:E.vec3(),focus:!1},rideable:{},sizes:{},block:{camera:!1,control:!1,animation:!1,scroll:!0},clickerOption:{isRun:!0,throttle:100,autoStart:!1,track:!1,loop:!1,queue:[],line:!1}},B=w.createContext(null),pe=w.createContext(null),ir=w.forwardRef(({children:r},e)=>S.jsx("group",{ref:e,userData:{intangible:!0},children:r}));function mn(r,e,t={}){const n=new ge.Vector3,i=new ge.Quaternion,a=new ge.Vector3,o=new ge.Matrix4,l=new ge.Matrix4,s=new ge.Matrix4;t.preserveMatrix=t.preserveMatrix!==void 0?t.preserveMatrix:!0,t.preservePosition=t.preservePosition!==void 0?t.preservePosition:!0,t.preserveHipPosition=t.preserveHipPosition!==void 0?t.preserveHipPosition:!1,t.useTargetMatrix=t.useTargetMatrix!==void 0?t.useTargetMatrix:!1,t.hip=t.hip!==void 0?t.hip:"hip",t.names=t.names||{};const c=e.isObject3D?e.skeleton.bones:Et(e),h=r.isObject3D?r.skeleton.bones:Et(r);let d,m,v,p,y;if(r.isObject3D?r.skeleton.pose():(t.useTargetMatrix=!0,t.preserveMatrix=!1),t.preservePosition){y=[];for(let g=0;g<h.length;g++)y.push(h[g].position.clone())}if(t.preserveMatrix){r.updateMatrixWorld(),r.matrixWorld.identity();for(let g=0;g<r.children.length;++g)r.children[g].updateMatrixWorld(!0)}if(t.offsets){d=[];for(let g=0;g<h.length;++g)m=h[g],v=t.names[m.name]||m.name,t.offsets[v]&&(m.matrix.multiply(t.offsets[v]),m.matrix.decompose(m.position,m.quaternion,m.scale),m.updateMatrixWorld()),d.push(m.matrixWorld.clone())}for(let g=0;g<h.length;++g){if(m=h[g],v=t.names[m.name]||m.name,p=pn(v,c),s.copy(m.matrixWorld),p){if(p.updateMatrixWorld(),t.useTargetMatrix?l.copy(p.matrixWorld):(l.copy(r.matrixWorld).invert(),l.multiply(p.matrixWorld)),a.setFromMatrixScale(l),l.scale(a.set(1/a.x,1/a.y,1/a.z)),s.makeRotationFromQuaternion(i.setFromRotationMatrix(l)),r.isObject3D){const C=h.indexOf(m),R=d?d[C]:o.copy(r.skeleton.boneInverses[C]).invert();s.multiply(R)}s.copyPosition(l)}m.parent&&m.parent.isBone?(m.matrix.copy(m.parent.matrixWorld).invert(),m.matrix.multiply(s)):m.matrix.copy(s),t.preserveHipPosition&&v===t.hip&&m.matrix.setPosition(n.set(0,m.position.y,0)),m.matrix.decompose(m.position,m.quaternion,m.scale),m.updateMatrixWorld()}if(t.preservePosition)for(let g=0;g<h.length;++g)m=h[g],v=t.names[m.name]||m.name,v!==t.hip&&m.position.copy(y[g]);t.preserveMatrix&&r.updateMatrixWorld(!0)}function Ai(r,e,t,n={}){n.useFirstFramePosition=n.useFirstFramePosition!==void 0?n.useFirstFramePosition:!1,n.fps=n.fps!==void 0?n.fps:30,n.names=n.names||[],e.isObject3D||(e=ji(e));const i=Math.round(t.duration*(n.fps/1e3)*1e3),a=1/n.fps,o=[],l=new ge.AnimationMixer(e),s=Et(r.skeleton),c=[];let h,d,m,v,p;l.clipAction(t).play(),l.update(0),e.updateMatrixWorld();for(let y=0;y<i;++y){const g=y*a;mn(r,e,n);for(let C=0;C<s.length;++C)p=n.names[s[C].name]||s[C].name,m=pn(p,e.skeleton),m&&(d=s[C],v=c[C]=c[C]||{bone:d},n.hip===p&&(v.pos||(v.pos={times:new Float32Array(i),values:new Float32Array(i*3)}),n.useFirstFramePosition&&(y===0&&(h=d.position.clone()),d.position.sub(h)),v.pos.times[y]=g,d.position.toArray(v.pos.values,y*3)),v.quat||(v.quat={times:new Float32Array(i),values:new Float32Array(i*4)}),v.quat.times[y]=g,d.quaternion.toArray(v.quat.values,y*4));l.update(a),e.updateMatrixWorld()}for(let y=0;y<c.length;++y)v=c[y],v&&(v.pos&&o.push(new ge.VectorKeyframeTrack(".bones["+v.bone.name+"].position",v.pos.times,v.pos.values)),o.push(new ge.QuaternionKeyframeTrack(".bones["+v.bone.name+"].quaternion",v.quat.times,v.quat.values)));return l.uncacheAction(t),new ge.AnimationClip(t.name,-1,o)}function Ei(r){const e=new Map,t=new Map,n=r.clone();return vn(r,n,function(i,a){e.set(a,i),t.set(i,a)}),n.traverse(function(i){if(!i.isSkinnedMesh)return;const a=i,o=e.get(i),l=o.skeleton.bones;a.skeleton=o.skeleton.clone(),a.bindMatrix.copy(o.bindMatrix),a.skeleton.bones=l.map(function(s){return t.get(s)}),a.bind(a.skeleton,a.bindMatrix)}),n}function pn(r,e){for(let t=0,n=Et(e);t<n.length;t++)if(r===n[t].name)return n[t]}function Et(r){return Array.isArray(r)?r:r.bones}function ji(r){const e=new ge.SkeletonHelper(r.bones[0]);return e.skeleton=r,e}function vn(r,e,t){t(r,e);for(let n=0;n<r.children.length;n++)vn(r.children[n],e.children[n],t)}const gn={retarget:mn,retargetClip:Ai,clone:Ei};function ft({type:r}){const{animationState:e}=w.useContext(B),t=w.useContext(pe),n=s=>{const c=e[r].store[s];return c?c.condition()?{name:c.animationName,isValid:!0}:{name:e[r].default,isValid:!1}:{name:e[r].default,isValid:!1}},i=()=>{let s=e[r].default;for(const c of Object.keys(e[r].store)){const h=n(c);if(h.isValid){s=h.name;break}}return e[r].current=s,t({type:"update",payload:{animationState:{...e}}}),s},a=s=>{delete e[r].store[s],t({type:"update",payload:{animationState:{...e}}})};return{subscribe:({tag:s,condition:c,action:h,animationName:d,key:m})=>{e[r].store[s]={condition:c,action:h||(()=>{}),animationName:d||s,key:m||s},t({type:"update",payload:{animationState:{...e}}})},subscribeAll:s=>{const c=[];return s.forEach(h=>{e[r].store[h.tag]={condition:h.condition,action:h.action,animationName:h.animationName,key:h.key},c.push(h.tag)}),t({type:"update",payload:{animationState:{...e}}}),()=>{c.forEach(h=>{delete e[r].store[h]}),t({type:"update",payload:{animationState:{...e}}})}},store:e==null?void 0:e[r].store,unsubscribe:a,notify:i}}function ki({type:r}){const{states:e}=w.useContext(B),{subscribeAll:t}=ft({type:r});w.useEffect(()=>{t([{tag:"walk",condition:()=>!e.isRunning&&e.isMoving,action:()=>{},animationName:"walk",key:"walk"},{tag:"run",condition:()=>e.isRunning,action:()=>{},animationName:"run",key:"run"},{tag:"jump",condition:()=>e.isJumping,action:()=>{},animationName:"jump",key:"jump"},{tag:"ride",condition:()=>e.isPush.keyR,action:()=>{},animationName:"ride",key:"ride"},{tag:"land",condition:()=>e.isLanding,action:()=>{},animationName:"land",key:"land"},{tag:"fall",condition:()=>e.isFalling,action:()=>{},animationName:"fall",key:"fall"}])},[])}function ar({type:r,actions:e,animationRef:t,currentAnimation:n,isActive:i}){var m,v;const{mode:a,animationState:o,block:l}=w.useContext(B),s=w.useContext(pe),{notify:c,store:h}=ft({type:r});i&&(n=(m=o==null?void 0:o[r])==null?void 0:m.current);const d=p=>{o[r].current=p;const y=h[p];y!=null&&y.action&&y.action(),s({type:"update",payload:{animationState:{...o}}})};return w.useEffect(()=>{var g;let p="idle";l.animation?p="idle":n?p=n:o[r].current&&(p=o[r].current);const y=(g=e[p])==null?void 0:g.reset().fadeIn(.2).play();return()=>{y==null||y.fadeOut(.2)}},[n,a.type,l.animation,r]),je.useFrame(()=>{if(i){const p=c();d(p)}}),{animationRef:t,currentAnimation:(v=o==null?void 0:o[r])==null?void 0:v.current}}const Mi=(r,e)=>{const{XDistance:t,YDistance:n,ZDistance:i}=e;return r.position.clone().add(K(t,n,i))};function Pi(r){const{state:e,worldContext:{cameraOption:t},controllerOptions:{lerp:n}}=r;!e||!e.camera||(e.camera.position.lerp(t.position.clone(),n.cameraPosition),e.camera.lookAt(t.target))}const Fi=(r,e)=>{const{XDistance:t,YDistance:n,ZDistance:i}=e;return r.position.clone().add(K(Math.sin(r.euler.y),1,Math.cos(r.euler.y)).normalize().clone().multiply(K(-t,n,-i)))};function _i(r){const{state:e,worldContext:{activeState:t,cameraOption:n},controllerOptions:{lerp:i}}=r;if(!e||!e.camera)return;const a=Fi(t,n);e.camera.position.lerp(a.clone(),i.cameraTurn),e.camera.quaternion.copy(t.quat.clone().multiply(E.quat().setFromAxisAngle(K(0,1,0),Math.PI))),e.camera.rotation.copy(t.euler),e.camera.lookAt(t.position.clone())}function Ti(r){je.useFrame(e=>{r.state=e,r.worldContext.block.camera||(r.worldContext.mode.control==="orbit"?_i(r):r.worldContext.mode.control==="normal"&&Pi(r))}),je.useFrame(()=>{r.worldContext.cameraOption.focus||(r.worldContext.cameraOption.target=r.worldContext.activeState.position,r.worldContext.cameraOption.position=Mi(r.worldContext.activeState,r.worldContext.cameraOption))})}const Xe={airplane:{angleDelta:K(Math.PI/256,Math.PI/256,Math.PI/256),maxAngle:K(Math.PI/8,Math.PI/8,Math.PI/8),maxSpeed:60,accelRatio:2,brakeRatio:5,buoyancy:.2,linearDamping:1},vehicle:{maxSpeed:60,accelRatio:2,brakeRatio:5,wheelOffset:.1,linearDamping:.5},character:{walkSpeed:10,runSpeed:20,turnSpeed:10,jumpSpeed:1,linearDamping:1},callbacks:{onReady:()=>{},onFrame:()=>{},onDestory:()=>{},onAnimate:()=>{}},refs:{colliderRef:null,rigidBodyRef:null,outerGroupRef:null,innerGroupRef:null,characterInnerRef:null},controllerOptions:{lerp:{cameraTurn:1,cameraPosition:1}}},jt=w.createContext({...Xe}),zi=w.createContext(null);function Di({props:r,actions:e,componentType:t}){const{animationState:n}=w.useContext(B),i=w.useContext(pe),{store:a}=ft({type:t}),{activeState:o,states:l,control:s}=w.useContext(B),{subscribe:c}=ft({type:t}),h=(m,v)=>{if(v in s&&s[v]&&n[t]){n[t].current=m;const p=a[m];p!=null&&p.action&&p.action(),i({type:"update",payload:{animationState:{...n}}})}},d={activeState:o,control:s,states:l,subscribe:c};return w.useEffect(()=>(r.onReady&&r.onReady(d),()=>{r.onDestory&&r.onDestory(d)}),[]),je.useFrame(m=>{r.onFrame&&r.onFrame({...d,...m}),r.onAnimate&&r.onAnimate({...d,...m,actions:e,animationState:n,playAnimation:h})}),{subscribe:c,playAnimation:h,dispatch:i}}const yn=({url:r})=>{const{sizes:e}=w.useContext(B),t=w.useContext(pe),n=Pe.useGLTF(r),{scene:i}=n,a=()=>new L.Box3().setFromObject(i).getSize(new L.Vector3),o=s=>{const c=s||r;return c in e?e[c]:null},l=(s,c)=>{const h=c||r;return h in e||(e[h]=s||a(),t({type:"update",payload:{sizes:{...e}}})),e[h]};return{gltf:n,size:l(),setSize:l,getSize:o}},bn=()=>{const{sizes:r}=w.useContext(B);return{getSizesByUrls:t=>{const n={};return t&&Object.keys(t).forEach(i=>{const a=t[i];a in r?n[i]=r[a]:n[i]=null}),n}}};function Ii(r){const{rigidBodyRef:e,controllerContext:{airplane:t}}=r,{linearDamping:n}=t;e.current.setLinearDamping(n)}function Ni(r){const{innerGroupRef:e,worldContext:{activeState:t,control:n},controllerContext:{airplane:i},matchSizes:a}=r,{forward:o,backward:l,leftward:s,rightward:c,shift:h,space:d}=n,{angleDelta:m,maxAngle:v,accelRatio:p}=i;if(!a||!a.airplaneUrl)return null;let y=0;y=d?Number(h):Number(h)*p;const g=Number(l)-Number(o),C=Number(c)-Number(s),R=K().set(y,y,y);t.euler.y+=-C*m.y;const k=v.x*g,P=v.z*C,_=e.current.rotation.x,D=e.current.rotation.z,V=v.x,q=v.z,H=e.current.clone();_<-V?H.rotation.x=-V+k:_>V?H.rotation.x=V+k:H.rotateX(k),D<-q?H.rotation.z=-q+P:D>q?H.rotation.z=q+P:H.rotateZ(P),t.euler.x=H.rotation.x,t.euler.z=H.rotation.z,H.rotation.y=0,e.current.setRotationFromQuaternion(E.quat().setFromEuler(e.current.rotation.clone()).slerp(E.quat().setFromEuler(H.rotation.clone()),.2)),t.rotation=H.rotation,t.direction=R.multiply(K(Math.sin(t.euler.y),-g,Math.cos(t.euler.y))),t.dir=t.direction.normalize()}function Ui(r){const{rigidBodyRef:e,worldContext:{activeState:t}}=r;e.current.setGravityScale(t.position.y<10?(1-.1)/-10*t.position.y+1:.1,!1)}function Li(r){const{rigidBodyRef:e,worldContext:{activeState:t},controllerContext:{airplane:n}}=r,{maxSpeed:i}=n,a=e.current.linvel();if(E.vec3(a).length()<i){const l=e.current.mass();e.current.applyImpulse(E.vec3({x:t.direction.x,y:t.direction.y,z:t.direction.z}).multiplyScalar(l),!1)}}function Wi(r){const{rigidBodyRef:e,worldContext:{activeState:t},dispatch:n}=r;t.position=E.vec3(e.current.translation()),t.velocity=E.vec3(e.current.linvel());const i=t.euler.clone();i.x=0,i.z=0,e.current.setRotation(E.quat().setFromEuler(i),!0),n({type:"update",payload:{activeState:{...t}}})}function Gi(r){const{worldContext:{states:e,rideable:t,mode:n},dispatch:i}=r,{isRiding:a}=e;a&&(t.objectType=null,t.key=null,n.type="character",e.isRiding=!1,e.enableRiding=!1),i({type:"update",payload:{mode:{...n},rideable:{...t}}})}function Bi(r){Ni(r),Li(r),Ii(r),Ui(r),Gi(r),Wi(r)}function qi({activeState:r,control:e,mode:t,clicker:n}){const{forward:i,backward:a,leftward:o,rightward:l}=e,s=Number(o)-Number(l),c=Number(i)-Number(a);let h=0;if(t.controller==="clicker")r.euler.y=Math.PI/2-n.angle,h=1;else{if(s===0&&c===0)return;r.euler.y+=s*Math.PI/32,h=c}const d=K(h,0,h);r.direction=d.multiply(K(-Math.sin(r.euler.y),0,-Math.cos(r.euler.y))),r.dir=r.direction.normalize()}function $i({activeState:r,control:e,mode:t,clicker:n}){const{forward:i,backward:a,leftward:o,rightward:l}=e;if(t.controller==="clicker")r.euler.y=Math.PI/2-n.angle,r.dir.set(-Math.sin(r.euler.y),0,-Math.cos(r.euler.y));else{const s=Number(o)-Number(l),c=Number(i)-Number(a);if(s===0&&c===0)return;const h=K(s,0,c),d=Oi(h);r.euler.y=d,r.dir.set(s,0,c)}}function Vi(r){const{worldContext:e}=r;e.mode.control==="normal"?$i(e):e.mode.control==="orbit"&&qi(e)}function Hi(r){const{rigidBodyRef:e,worldContext:{states:t,activeState:n}}=r,{isMoving:i,isRunning:a}=t,{controllerContext:{character:{walkSpeed:o,runSpeed:l,jumpSpeed:s}}}=r,{isOnTheGround:c,isJumping:h}=t,d=E.vec3();if(h&&c&&d.setY(s*e.current.mass()),i){const m=a?l:o,v=E.vec3().addScalar(m).multiply(n.dir.clone().normalize().negate()),p=e.current.mass(),g=v.clone().sub(n.velocity).multiplyScalar(p);d.setX(g.x),d.setZ(g.z)}e.current.applyImpulse(d,!0),n.position=E.vec3(e.current.translation()),n.velocity=E.vec3(e.current.linvel())}function Yi(r){const{rigidBodyRef:e,innerGroupRef:t,controllerContext:{character:{linearDamping:n}},worldContext:{activeState:i,states:a,block:o},delta:l}=r;a.isJumping||e.current.linvel().y<0?e.current.setLinearDamping(n):e.current.setLinearDamping(a.isNotMoving?n*5:n),e.current.setEnabledRotations(!1,!1,!1,!1),t.current.quaternion.rotateTowards(E.quat().setFromEuler(i.euler),10*l)}function Ki(r){var c;const{rigidBodyRef:e,state:t,worldContext:{clicker:n,mode:i,clickerOption:a,block:o}}=r,l=E.vec3((c=e.current)==null?void 0:c.translation());let s=Wr(l,n.point,!1);if(a.autoStart&&a.queue[0]instanceof L.Vector3){n.isOn=!0,s=Wr(l,a.queue[0],!1);const h=E.vec3(a.queue[0]),d=Math.atan2(h.z-l.z,h.x-l.x);n.angle=d}if(s<1&&i.controller==="clicker")if(a.track&&a.queue.length!==0){const h=a.queue.shift();if(h instanceof L.Vector3){n.point=h;const d=E.vec3(n.point),m=Math.atan2(d.z-l.z,d.x-l.x);n.angle=m}else{const{action:d,beforeCB:m,afterCB:v,time:p}=h;d==="stop"&&(t.clock.stop(),m(t),console.log(),setTimeout(()=>{t.clock.start(),v(t)},p))}a.loop&&a.queue.push(h)}else n.isOn=!1,n.isRun=!1}function Xi(r){const{worldContext:{control:e,clicker:t,mode:n}}=r,{keyS:i}=e;i&&n.controller==="clicker"&&(t.isOn=!1,t.isRun=!1)}function Zi(r){Vi(r),Hi(r),Yi(r),Xi(r),Ki(r)}function Ji(r){const{colliderRef:e,groundRay:t,worldContext:{states:n,activeState:i}}=r;if(t.origin.addVectors(i.position,E.vec3(t.offset)),(!t.hit||!t.rayCast||!e.current)&&(n.isOnTheGround=!1),t.hit){const a=t.length*2,o=t.length*.8;t.hit.toi>=a?(n.isFalling=!0,n.isOnTheGround=!1):o<=t.hit.toi&&t.hit.toi<a?n.isFalling=!0:t.hit.toi<o&&(n.isFalling=!1,n.isOnTheGround=!0)}}function Qi(r){const{worldContext:{states:e,mode:t,control:n,clicker:i,clickerOption:a}}=r,{shift:o,space:l}=n;t.controller==="clicker"&&(e.isMoving=i.isOn,e.isNotMoving=!i.isOn,e.isRunning=(o||i.isRun)&&e.isMoving&&a.isRun,e.isJumping=l)}function ea(r){const{worldContext:{states:e,control:t}}=r;Object.keys(t).forEach(n=>{e.isPush[n]=t[n]})}function ta(r){const{worldContext:{states:e}}=r,{isRiderOn:t}=e;t&&e.isPush.keyR&&(e.isRiding=!0)}function ra(r){const{outerGroupRef:e,worldContext:{states:t,activeState:n}}=r;t.isMoving&&e&&e.current&&(t.isRotated=Math.sin(e.current.rotation.y).toFixed(3)===Math.sin(n.euler.y).toFixed(3))}function na(r){Ji(r),Qi(r),ra(r),ea(r),ta(r)}function ia(r){const{rigidBodyRef:e,worldContext:{control:t},controllerContext:{vehicle:n}}=r,{space:i}=t,{brakeRatio:a,linearDamping:o}=n;e.current.setLinearDamping(i?a:o)}function aa(r){const{worldContext:{activeState:e,control:t}}=r,{forward:n,backward:i,leftward:a,rightward:o}=t,l=Number(a)-Number(o),s=Number(n)-Number(i),c=E.vec3().set(s,0,s);return e.euler.y+=l*(Math.PI/64),c}function oa(r){const{worldContext:{mode:e,activeState:t}}=r,n=E.vec3();n.copy(aa(r)),t.direction=n.multiply(K(Math.sin(t.euler.y),0,Math.cos(t.euler.y))),t.dir=t.direction.normalize()}function sa(r){const{rigidBodyRef:e,worldContext:{activeState:t,control:n},controllerContext:{vehicle:i}}=r,{shift:a}=n,{maxSpeed:o,accelRatio:l}=i,s=e.current.linvel();if(E.vec3(s).length()<o){const h=e.current.mass();let d=a?l:1;e.current.applyImpulse(E.vec3().addScalar(d).multiply(t.dir.clone().normalize()).multiplyScalar(h),!1)}}function la(r){const{rigidBodyRef:e,worldContext:{activeState:t}}=r;t.position=E.vec3(e.current.translation()),t.velocity=E.vec3(e.current.linvel()),e.current.setRotation(E.quat().setFromEuler(t.euler.clone()),!1)}function ua(r){const{worldContext:{states:e,rideable:t,mode:n},dispatch:i}=r,{isRiding:a}=e;a&&(t.objectType=null,t.key=null,n.type="character",e.isRiding=!1,e.enableRiding=!1),i({type:"update",payload:{mode:{...n},rideable:{...t}}})}function ca(r){oa(r),sa(r),ia(r),ua(r),la(r)}function fa({groundRay:r,rigidBodyRef:e,outerGroupRef:t,innerGroupRef:n,colliderRef:i}){const a=w.useContext(B),o=w.useContext(jt),l=w.useContext(pe),{mode:s,activeState:c,block:h}=a,{getSizesByUrls:d}=bn();w.useEffect(()=>{!e||!n||e.current&&n.current&&(e.current.lockRotations(!1,!0),c.euler.set(0,0,0),e.current.setTranslation(c.position.clone().add(K(0,5,0)),!0))},[s.type]),w.useEffect(()=>{e&&e.current&&h.control&&(e.current.resetForces(!1),e.current.resetTorques(!1))},[h.control,e.current]),je.useFrame((m,v)=>{if(!e||!e.current||!t||!t.current||!n||!n.current||h.control)return null;const p={rigidBodyRef:e,outerGroupRef:t,innerGroupRef:n,colliderRef:i,groundRay:r,state:m,delta:v,worldContext:a,controllerContext:o,dispatch:l,matchSizes:d(a==null?void 0:a.urls)};s.type==="vehicle"?ca(p):s.type==="character"?Zi(p):s.type==="airplane"&&Bi(p),na(p)})}function ha({url:r,children:e,offset:t,currentAnimation:n}){const{gltf:i}=yn({url:r}),{animations:a,scene:o}=i,{actions:l,ref:s}=Pe.useAnimations(a),c=w.useMemo(()=>gn.clone(o),[o]),{nodes:h}=je.useGraph(c),d=Object.values(h).find(m=>m.type==="Object3D");return ar({type:"character",currentAnimation:n||"ride",actions:l,animationRef:s,isActive:!1}),S.jsx(S.Fragment,{children:S.jsxs("group",{position:t,children:[d&&S.jsx("primitive",{object:d,visible:!1,receiveShadow:!0,castShadow:!0,ref:s}),Object.keys(h).map((m,v)=>{const p=h[m];if(p instanceof L.SkinnedMesh)return S.jsx("skinnedMesh",{castShadow:!0,receiveShadow:!0,material:p.material,geometry:p.geometry,skeleton:p.skeleton},v);if(p instanceof L.Mesh)return S.jsx("mesh",{castShadow:!0,receiveShadow:!0,material:p.material,geometry:p.geometry},v)}),e]})})}const da=w.forwardRef((r,e)=>S.jsxs("group",{receiveShadow:!0,castShadow:!0,ref:e,userData:{intangible:!0},children:[r.isRiderOn&&r.enableRiding&&r.isActive&&r.ridingUrl&&S.jsx(ha,{url:r.ridingUrl,offset:r.offset}),r.children,r.objectNode&&r.animationRef&&S.jsx("primitive",{object:r.objectNode,visible:!1,receiveShadow:!0,castShadow:!0,ref:r.animationRef}),Object.keys(r.nodes).map((t,n)=>{const i=r.nodes[t];if(i instanceof L.SkinnedMesh)return S.jsx("skinnedMesh",{castShadow:!0,receiveShadow:!0,material:i.material,geometry:i.geometry,skeleton:i.skeleton},n);if(i instanceof L.Mesh)return S.jsx("mesh",{castShadow:!0,receiveShadow:!0,material:i.material,geometry:i.geometry},n)})]})),ma=({url:r,isActive:e,componentType:t,currentAnimation:n,color:i,skeleton:a})=>{const{scene:o,animations:l}=Pe.useGLTF(r),{actions:s,ref:c}=Pe.useAnimations(l),h=w.useMemo(()=>{const d=[];return o.traverse(m=>{if(m instanceof L.SkinnedMesh){const v=m.clone();v.skeleton=a,v.bind(a,v.bindMatrix),d.push(v)}}),d},[o,a]);return ar({type:t,actions:s,animationRef:c,currentAnimation:e?void 0:n,isActive:e}),S.jsx(S.Fragment,{children:h.map((d,m)=>S.jsx("skinnedMesh",{castShadow:!0,receiveShadow:!0,geometry:d.geometry,skeleton:a,material:d.name==="color"&&i?new L.MeshStandardMaterial({color:i}):d.material},m))})};function pa(){const r=E.useRapier();return w.useCallback(({ray:t,ref:n})=>r.world.castRay(t.rayCast,t.length,!0,void 0,void 0,n.current,void 0),[r])}function va(){const{rapier:r}=E.useRapier(),e=pa();return({groundRay:n,length:i,colliderRef:a})=>{var o;n.length=i,n.rayCast=new r.Ray(n.origin,n.dir),n.hit=e({ray:n,ref:a}),n.parent=(o=n.hit)==null?void 0:o.collider.parent()}}const or=w.forwardRef((r,e)=>{var p;const{size:t}=yn({url:r.url}),n=va();w.useEffect(()=>{r.groundRay&&r.colliderRef&&n({groundRay:r.groundRay,length:.5,colliderRef:r.colliderRef})},[r.groundRay,r.colliderRef,n]);const{scene:i,animations:a}=Pe.useGLTF(r.url),{actions:o,ref:l}=Pe.useAnimations(a),s=w.useContext(B),c=w.useContext(jt),h=w.useMemo(()=>gn.clone(i),[i]),d=w.useMemo(()=>{let y=null;return h.traverse(g=>{g instanceof L.SkinnedMesh&&(y=g.skeleton)}),y},[h]);if(r.isActive){ki({type:r.componentType,groundRay:r.groundRay,animations:a});const y={state:null,worldContext:s,controllerContext:c,controllerOptions:r.controllerOptions};Ti(y),fa({outerGroupRef:r.outerGroupRef,innerGroupRef:r.innerGroupRef,rigidBodyRef:e,colliderRef:r.colliderRef,groundRay:r.groundRay})}ar({type:r.componentType,actions:o,animationRef:l,currentAnimation:r.isActive?void 0:r.currentAnimation,isActive:r.isActive}),Di({props:r,actions:o,componentType:r.componentType});const{nodes:m}=je.useGraph(h),v=Object.values(m).find(y=>y.type==="Object3D");return je.useFrame(()=>{r.isActive||!r.position||!e||!e.current||e.current.setTranslation(K(L.MathUtils.lerp(e.current.translation().x,r.position.x,r.controllerOptions.lerp.cameraPosition),L.MathUtils.lerp(e.current.translation().y,r.position.y,r.controllerOptions.lerp.cameraPosition),L.MathUtils.lerp(e.current.translation().z,r.position.z,r.controllerOptions.lerp.cameraPosition)),!1)}),S.jsxs(E.RigidBody,{colliders:!1,ref:e,name:r.name,rotation:E.euler().set(0,((p=r.rotation)==null?void 0:p.clone().y)||0,0).clone(),userData:r.userData,type:r.rigidbodyType||(r.isActive?"dynamic":"fixed"),sensor:r.sensor,onIntersectionEnter:r.onIntersectionEnter,onCollisionEnter:r.onCollisionEnter,...r.rigidBodyProps,children:[!r.isNotColliding&&S.jsx(E.CapsuleCollider,{ref:r.colliderRef,args:[(t.y/2-t.x)*1.2,t.x*1.2],position:[0,(t.y/2+t.x/2)*1.2,0]}),S.jsxs(da,{objectNode:v,animationRef:l,nodes:m,ref:r.innerGroupRef,isActive:r.isActive,isRiderOn:r.isRiderOn,enableRiding:r.enableRiding,ridingUrl:r.ridingUrl,offset:r.offset,parts:r.parts,children:[r.children,r.parts&&r.parts.length>0&&r.parts.map(({url:y,color:g},C)=>y?S.jsx(ma,{url:y,isActive:r.isActive,componentType:r.componentType,currentAnimation:r.currentAnimation,color:g,skeleton:d},C+y):null)]})]})});function wn(r){const{rigidBodyRef:e,outerGroupRef:t}=r;return S.jsx(ir,{ref:t,children:S.jsx(or,{ref:e,name:r.name,componentType:"airplane",ridingUrl:r.ridingUrl,...r,children:r.children})})}function ga(r){return S.jsx(wn,{name:"airplane",isActive:!0,currentAnimation:"idle",componentType:"airplane",ridingUrl:r.ridingUrl,...r,children:r.children})}function Cn(r){const{outerGroupRef:e}=r;return S.jsx(ir,{ref:e,children:S.jsx(or,{name:"character",url:r.url,controllerOptions:r.controllerOptions,ref:r.rigidBodyRef,groundRay:r.groundRay,isNotColliding:r.isNotColliding,...r,children:r.children})})}function ya({children:r,props:e,refs:t,urls:n}){return S.jsx(Cn,{url:n.characterUrl,isActive:!0,componentType:"character",rigidbodyType:"dynamic",controllerOptions:e.controllerOptions,groundRay:e.groundRay,onAnimate:e.onAnimate,onFrame:e.onFrame,onReady:e.onReady,onDestory:e.onDestory,rigidBodyProps:e.rigidBodyProps,parts:e.parts,...t,children:r})}function xn(r){const{rigidBodyRef:e,outerGroupRef:t}=r;return S.jsx(ir,{ref:t,children:S.jsx(or,{ref:e,name:r.name,componentType:"vehicle",ridingUrl:r.ridingUrl,...r,children:r.children})})}function ba(r){return S.jsx(xn,{name:"vehicle",isActive:!0,currentAnimation:"idle",componentType:"vehicle",ridingUrl:r.ridingUrl,...r,children:r.children})}function Sn({props:r,refs:e}){const{mode:t,states:n,rideable:i,urls:a}=w.useContext(B),{enableRiding:o,isRiderOn:l,rideableId:s}=n;return S.jsxs(S.Fragment,{children:[t.type==="character"&&S.jsx(ya,{props:r,refs:e,urls:a,children:r.children}),t.type==="vehicle"&&S.jsx(ba,{controllerOptions:r.controllerOptions,url:a.vehicleUrl,wheelUrl:a.wheelUrl,ridingUrl:a.ridingUrl,enableRiding:o,isRiderOn:l,groundRay:r.groundRay,offset:s&&i[s]?i[s].offset:E.vec3(),...e,children:r.children}),t.type==="airplane"&&S.jsx(ga,{controllerOptions:r.controllerOptions,url:a.airplaneUrl,ridingUrl:a.ridingUrl,enableRiding:o,isRiderOn:l,groundRay:r.groundRay,offset:s&&i[s]?i[s].offset:E.vec3(),...e,children:r.children})]})}function wa(r){const e=w.useRef(null),t=w.useRef(null),n=w.useRef(null),i=w.useRef(null),a={rigidBodyRef:e,outerGroupRef:t,innerGroupRef:n,colliderRef:i};return je.useFrame(()=>{if(n&&n.current){const o=r.rotation.clone();o.y=0,n.current.setRotationFromQuaternion(E.quat().setFromEuler(n.current.rotation.clone()).slerp(E.quat().setFromEuler(o),.2))}e&&e.current&&e.current.setGravityScale(r.position.y<10?(1-.1)/-10*r.position.y+1:.1,!1)}),S.jsx(wn,{isActive:!1,componentType:"airplane",name:"airplane",controllerOptions:r.controllerOptions||{lerp:{cameraTurn:1,cameraPosition:1}},position:r.position,rotation:r.rotation,currentAnimation:r.currentAnimation,ridingUrl:r.ridingUrl,...r,...a,children:r.children})}function Ca(r){const e=w.useRef(null),t=w.useRef(null),n=w.useRef(null),i=w.useRef(null),a={rigidBodyRef:e,outerGroupRef:t,innerGroupRef:n,colliderRef:i};return w.useEffect(()=>{e&&e.current&&e.current.setEnabledRotations(!1,!1,!1,!1)},[]),S.jsx(Cn,{isActive:!1,componentType:"character",controllerOptions:r.controllerOptions||{lerp:{cameraTurn:1,cameraPosition:1}},position:r.position,rotation:r.rotation,groundRay:r.groundRay,currentAnimation:r.currentAnimation,...a,...r,children:r.children})}function xa(r){const e=w.useRef(null),t=w.useRef(null),n=w.useRef(null),i=w.useRef(null),a={rigidBodyRef:e,outerGroupRef:t,innerGroupRef:n,colliderRef:i};return S.jsx(xn,{isActive:!1,componentType:"vehicle",name:"vehicle",controllerOptions:r.controllerOptions||{lerp:{cameraTurn:1,cameraPosition:1}},position:r.position,rotation:r.rotation,currentAnimation:r.currentAnimation,url:r.url,ridingUrl:r.ridingUrl,...r,...a,children:r.children})}function Sa(r,e){switch(e.type){case"init":return{...r};case"update":return{...r,...e.payload}}}const Ra=(r,e)=>{e({type:"update",payload:r})};function Oa(r){const e=w.useContext(B),t=w.useContext(pe);w.useEffect(()=>{if(e&&e.control){let o={};e.mode.controller==="clicker"?e.mode.isButton&&(o={...e.control}):o={...e.control},t({type:"update",payload:{control:{...o}}})}},[e==null?void 0:e.mode.controller,e==null?void 0:e.control]);const n=w.useMemo(()=>({origin:E.vec3(),dir:E.vec3({x:0,y:-1,z:0}),offset:E.vec3({x:0,y:-1,z:0}),hit:null,parent:null,rayCast:null,length:10}),[]),i=w.useMemo(()=>({origin:E.vec3(),hit:new L.Raycaster,rayCast:new L.Raycaster(E.vec3(),E.vec3(),0,-7),dir:E.vec3(),position:E.vec3(),length:-e.cameraOption.maxDistance,detected:[],intersects:[],intersectObjectMap:{}}),[]),a=w.useCallback(o=>{Ra({refs:{...o}},t)},[r.refs]);return w.useEffect(()=>{r.refs&&a(r.refs)},[]),{groundRay:n,cameraRay:i}}function Aa(r){return S.jsx(S.Fragment,{children:S.jsx(Ea,{...r,children:r.children})})}function Ea(r){const e=w.useRef(null),t=w.useRef(null),n=w.useRef(null),i=w.useRef(null),a=w.useRef(null),o=w.useRef(null),[l,s]=w.useReducer(Sa,{airplane:Object.assign(Xe.airplane,r.airplane||{}),vehicle:Object.assign(Xe.vehicle,r.vehicle||{}),character:Object.assign(Xe.character,r.character||{}),callbacks:Object.assign(Xe.callbacks,{onReady:r.onReady,onFrame:r.onFrame,onDestory:r.onDestory,onAnimate:r.onAnimate}),refs:{colliderRef:e,rigidBodyRef:t,outerGroupRef:n,innerGroupRef:i,characterInnerRef:a},controllerOptions:Object.assign(Xe.controllerOptions,r.controllerOptions||{})}),c=w.useMemo(()=>({value:l,dispatch:s}),[]),h=w.useMemo(()=>({colliderRef:e,rigidBodyRef:t,outerGroupRef:n,innerGroupRef:i,characterInnerRef:a,passiveRigidBodyRef:o}),[]),d={...Oa({refs:h}),children:r.children,groupProps:r.groupProps,rigidBodyProps:r.rigidBodyProps,controllerOptions:c.value.controllerOptions,parts:r.parts,...c.value.callbacks,...h},m=Pe.useContextBridge(B,jt);return S.jsx(m,{children:S.jsx(jt.Provider,{value:c.value,children:S.jsx(zi.Provider,{value:c.dispatch,children:S.jsx(Sn,{props:d,refs:h})})})})}function Rn(){const{activeState:r,mode:e}=w.useContext(B),t=w.useContext(pe);return{moveClicker:(i,a,o)=>{if(e.controller!=="clicker"||o!=="ground")return;const l=r.position,s=K(i.point.x,i.point.y,i.point.z),c=Math.atan2(s.z-l.z,s.x-l.x);t({type:"update",payload:{clicker:{point:K(s.x,0,s.z),angle:c,isOn:!0,isRun:a}}})}}}function ja({type:r="normal",text:e,position:t,children:n}){const i=w.useRef(null),{minimap:a,activeState:o,clickerOption:l}=w.useContext(B),s=w.useContext(pe),{moveClicker:c}=Rn();return w.useEffect(()=>{if(i.current){const h=new L.Box3().setFromObject(i.current),d=E.vec3(h.getSize(new L.Vector3)).clone(),m=E.vec3(h.getCenter(new L.Vector3)).clone(),v={type:r||"normal",text:e,size:d,center:m};a.props[e]=v,s({type:"update",payload:{minimap:{...a}}})}},[]),S.jsx("group",{ref:i,position:t,onPointerDown:h=>{h.srcElement instanceof HTMLDivElement||c(h,!1,r)},children:n})}function ka({onMarker:r,runMarker:e}){const{clicker:t,mode:n,clickerOption:i}=w.useContext(B),a=[];for(let o=0;o<i.queue.length;o++)i.queue[o]instanceof L.Vector3&&a.push(i.queue[o]);return S.jsxs(S.Fragment,{children:[n.controller==="clicker"&&S.jsxs("group",{position:t.point,children:[t.isOn&&r,t.isOn&&i.isRun&&t.isRun&&e]}),i.line&&a.map((o,l)=>{if(o instanceof L.Vector3){const s=l,c=l===0?a.length-1:l-1;return S.jsxs("group",{position:[0,1,0],children:[S.jsx(Pe.Line,{worldUnits:!0,points:[a[c],a[s]],color:"turquoise",transparent:!0,opacity:.5,lineWidth:.4}),S.jsxs("mesh",{position:o,children:[S.jsx("sphereGeometry",{args:[.6,30,.6]}),S.jsx("meshStandardMaterial",{color:"turquoise",transparent:!0,opacity:.8})]},l)]},l)}})]})}function On(){const{control:r}=w.useContext(B),e=w.useContext(pe);return{pushKey:(n,i)=>{r[n]=i,e({type:"update",payload:{control:{...r}}})}}}var Gr={},Ma=r=>{var{fileScope:e,css:t}=r,n=e.packageName?[e.packageName,e.filePath].join("/"):e.filePath,i=Gr[n];if(!i){var a=document.createElement("style");e.packageName&&a.setAttribute("data-package",e.packageName),a.setAttribute("data-file",e.filePath),a.setAttribute("type","text/css"),i=Gr[n]=a,document.head.appendChild(a)}i.innerHTML=t};function Pa(r){var e=r.match(/^var\((.*)\)$/);return e?e[1]:r}/*! https://mths.be/cssesc v3.0.0 by @mathias */var Fa={},_a=Fa.hasOwnProperty,Ta=function(e,t){if(!e)return t;var n={};for(var i in t)n[i]=_a.call(e,i)?e[i]:t[i];return n},za=/[ -,\.\/:-@\[-\^`\{-~]/,Da=/[ -,\.\/:-@\[\]\^`\{-~]/,Ia=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g,sr=function r(e,t){t=Ta(t,r.options),t.quotes!="single"&&t.quotes!="double"&&(t.quotes="single");for(var n=t.quotes=="double"?'"':"'",i=t.isIdentifier,a=e.charAt(0),o="",l=0,s=e.length;l<s;){var c=e.charAt(l++),h=c.charCodeAt(),d=void 0;if(h<32||h>126){if(h>=55296&&h<=56319&&l<s){var m=e.charCodeAt(l++);(m&64512)==56320?h=((h&1023)<<10)+(m&1023)+65536:l--}d="\\"+h.toString(16).toUpperCase()+" "}else t.escapeEverything?za.test(c)?d="\\"+c:d="\\"+h.toString(16).toUpperCase()+" ":/[\t\n\f\r\x0B]/.test(c)?d="\\"+h.toString(16).toUpperCase()+" ":c=="\\"||!i&&(c=='"'&&n==c||c=="'"&&n==c)||i&&Da.test(c)?d="\\"+c:d=c;o+=d}return i&&(/^-[-\d]/.test(o)?o="\\-"+o.slice(1):/\d/.test(a)&&(o="\\3"+a+" "+o.slice(1))),o=o.replace(Ia,function(v,p,y){return p&&p.length%2?v:(p||"")+y}),!i&&t.wrap?n+o+n:o};sr.options={escapeEverything:!1,isIdentifier:!1,quotes:"single",wrap:!1};sr.version="3.0.0";var Na=sr;const lr=dn(Na);class Ua{constructor(e){const{failure:t,gotoFn:n,output:i}=this._buildTables(e);this.gotoFn=n,this.output=i,this.failure=t}_buildTables(e){const t={0:{}},n={};let i=0;for(const l of e){let s=0;for(const c of l)t[s]&&c in t[s]?s=t[s][c]:(i++,t[s][c]=i,t[i]={},s=i,n[i]=[]);n[s].push(l)}const a={},o=[];for(const l in t[0]){const s=t[0][l];a[s]=0,o.push(s)}for(;o.length>0;){const l=o.shift();if(l!==void 0)for(const s in t[l]){const c=t[l][s];o.push(c);let h=a[l];for(;h>0&&!(s in t[h]);)h=a[h];if(s in t[h]){const d=t[h][s];a[c]=d,n[c]=[...n[c],...n[d]]}else a[c]=0}}return{gotoFn:t,output:n,failure:a}}search(e){let t=0;const n=[];for(let i=0;i<e.length;i++){const a=e[i];for(;t>0&&!(a in this.gotoFn[t]);)t=this.failure[t];if(a in this.gotoFn[t]&&(t=this.gotoFn[t][a],this.output[t].length>0)){const o=this.output[t];n.push([i,o])}}return n}}var La={appendCss:()=>{},registerClassName:()=>{},onEndFileScope:()=>{},registerComposition:()=>{},markCompositionUsed:()=>{},getIdentOption:()=>process.env.NODE_ENV==="production"?"short":"debug"},St=[La],pt=()=>{if(St.length<1)throw new Error("No adapter configured");return St[St.length-1]},An=!1,Wa=r=>{An||Ga(r)},Ga=r=>{if(!r)throw new Error('No adapter provided when calling "setAdapter"');An=!0,St.push(r)},Ft=function(){return pt().appendCss(...arguments)},En=function(){return pt().registerClassName(...arguments)},Ba=function(){return pt().registerComposition(...arguments)},jn=function(){return pt().markCompositionUsed(...arguments)},qa=function(){var e=pt();return"getIdentOption"in e?e.getIdentOption(...arguments):process.env.NODE_ENV==="production"?"short":"debug"};function ur(r,e){return e||(e=r.slice(0)),Object.freeze(Object.defineProperties(r,{raw:{value:Object.freeze(e)}}))}var Y;(function(r){r.Attribute="attribute",r.Pseudo="pseudo",r.PseudoElement="pseudo-element",r.Tag="tag",r.Universal="universal",r.Adjacent="adjacent",r.Child="child",r.Descendant="descendant",r.Parent="parent",r.Sibling="sibling",r.ColumnCombinator="column-combinator"})(Y||(Y={}));var ye;(function(r){r.Any="any",r.Element="element",r.End="end",r.Equals="equals",r.Exists="exists",r.Hyphen="hyphen",r.Not="not",r.Start="start"})(ye||(ye={}));const Br=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,$a=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,Va=new Map([[126,ye.Element],[94,ye.Start],[36,ye.End],[42,ye.Any],[33,ye.Not],[124,ye.Hyphen]]),Ha=new Set(["has","not","matches","is","where","host","host-context"]);function Ya(r){switch(r.type){case Y.Adjacent:case Y.Child:case Y.Descendant:case Y.Parent:case Y.Sibling:case Y.ColumnCombinator:return!0;default:return!1}}const Ka=new Set(["contains","icontains"]);function Xa(r,e,t){const n=parseInt(e,16)-65536;return n!==n||t?e:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,n&1023|56320)}function lt(r){return r.replace($a,Xa)}function qt(r){return r===39||r===34}function qr(r){return r===32||r===9||r===10||r===12||r===13}function Za(r){const e=[],t=kn(e,`${r}`,0);if(t<r.length)throw new Error(`Unmatched selector: ${r.slice(t)}`);return e}function kn(r,e,t){let n=[];function i(m){const v=e.slice(t+m).match(Br);if(!v)throw new Error(`Expected name, found ${e.slice(t)}`);const[p]=v;return t+=m+p.length,lt(p)}function a(m){for(t+=m;t<e.length&&qr(e.charCodeAt(t));)t++}function o(){t+=1;const m=t;let v=1;for(;v>0&&t<e.length;t++)e.charCodeAt(t)===40&&!l(t)?v++:e.charCodeAt(t)===41&&!l(t)&&v--;if(v)throw new Error("Parenthesis not matched");return lt(e.slice(m,t-1))}function l(m){let v=0;for(;e.charCodeAt(--m)===92;)v++;return(v&1)===1}function s(){if(n.length>0&&Ya(n[n.length-1]))throw new Error("Did not expect successive traversals.")}function c(m){if(n.length>0&&n[n.length-1].type===Y.Descendant){n[n.length-1].type=m;return}s(),n.push({type:m})}function h(m,v){n.push({type:Y.Attribute,name:m,action:v,value:i(1),namespace:null,ignoreCase:"quirks"})}function d(){if(n.length&&n[n.length-1].type===Y.Descendant&&n.pop(),n.length===0)throw new Error("Empty sub-selector");r.push(n)}if(a(0),e.length===t)return t;e:for(;t<e.length;){const m=e.charCodeAt(t);switch(m){case 32:case 9:case 10:case 12:case 13:{(n.length===0||n[0].type!==Y.Descendant)&&(s(),n.push({type:Y.Descendant})),a(1);break}case 62:{c(Y.Child),a(1);break}case 60:{c(Y.Parent),a(1);break}case 126:{c(Y.Sibling),a(1);break}case 43:{c(Y.Adjacent),a(1);break}case 46:{h("class",ye.Element);break}case 35:{h("id",ye.Equals);break}case 91:{a(1);let v,p=null;e.charCodeAt(t)===124?v=i(1):e.startsWith("*|",t)?(p="*",v=i(2)):(v=i(0),e.charCodeAt(t)===124&&e.charCodeAt(t+1)!==61&&(p=v,v=i(1))),a(0);let y=ye.Exists;const g=Va.get(e.charCodeAt(t));if(g){if(y=g,e.charCodeAt(t+1)!==61)throw new Error("Expected `=`");a(2)}else e.charCodeAt(t)===61&&(y=ye.Equals,a(1));let C="",R=null;if(y!=="exists"){if(qt(e.charCodeAt(t))){const _=e.charCodeAt(t);let D=t+1;for(;D<e.length&&(e.charCodeAt(D)!==_||l(D));)D+=1;if(e.charCodeAt(D)!==_)throw new Error("Attribute value didn't end");C=lt(e.slice(t+1,D)),t=D+1}else{const _=t;for(;t<e.length&&(!qr(e.charCodeAt(t))&&e.charCodeAt(t)!==93||l(t));)t+=1;C=lt(e.slice(_,t))}a(0);const P=e.charCodeAt(t)|32;P===115?(R=!1,a(1)):P===105&&(R=!0,a(1))}if(e.charCodeAt(t)!==93)throw new Error("Attribute selector didn't terminate");t+=1;const k={type:Y.Attribute,name:v,action:y,value:C,namespace:p,ignoreCase:R};n.push(k);break}case 58:{if(e.charCodeAt(t+1)===58){n.push({type:Y.PseudoElement,name:i(2).toLowerCase(),data:e.charCodeAt(t)===40?o():null});continue}const v=i(1).toLowerCase();let p=null;if(e.charCodeAt(t)===40)if(Ha.has(v)){if(qt(e.charCodeAt(t+1)))throw new Error(`Pseudo-selector ${v} cannot be quoted`);if(p=[],t=kn(p,e,t+1),e.charCodeAt(t)!==41)throw new Error(`Missing closing parenthesis in :${v} (${e})`);t+=1}else{if(p=o(),Ka.has(v)){const y=p.charCodeAt(0);y===p.charCodeAt(p.length-1)&&qt(y)&&(p=p.slice(1,-1))}p=lt(p)}n.push({type:Y.Pseudo,name:v,data:p});break}case 44:{d(),n=[],a(1);break}default:{if(e.startsWith("/*",t)){const y=e.indexOf("*/",t+2);if(y<0)throw new Error("Comment was not terminated");t=y+2,n.length===0&&a(0);break}let v=null,p;if(m===42)t+=1,p="*";else if(m===124){if(p="",e.charCodeAt(t+1)===124){c(Y.ColumnCombinator),a(2);break}}else if(Br.test(e.slice(t)))p=i(0);else break e;e.charCodeAt(t)===124&&e.charCodeAt(t+1)!==124&&(v=p,e.charCodeAt(t+1)===42?(p="*",t+=2):p=i(1)),n.push(p==="*"?{type:Y.Universal,namespace:v}:{type:Y.Tag,name:p,namespace:v})}}}return d(),t}function $r(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Vr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?$r(Object(t),!0).forEach(function(n){Ja(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):$r(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ja(r,e,t){return e=Qa(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Qa(r){var e=eo(r,"string");return typeof e=="symbol"?e:String(e)}function eo(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}const cr=Mn({});function Mn(r){return e.withOptions=t=>Mn(Vr(Vr({},r),t)),e;function e(t,...n){const i=typeof t=="string"?[t]:t.raw,{escapeSpecialCharacters:a=Array.isArray(t)}=r;let o="";for(let c=0;c<i.length;c++){let h=i[c];a&&(h=h.replace(/\\\n[ \t]*/g,"").replace(/\\`/g,"`").replace(/\\\$/g,"$").replace(/\\\{/g,"{")),o+=h,c<n.length&&(o+=n[c])}const l=o.split(`
31
31
  `);let s=null;for(const c of l){const h=c.match(/^(\s+)\S+/);if(h){const d=h[1].length;s?s=Math.min(s,d):s=d}}if(s!==null){const c=s;o=l.map(h=>h[0]===" "||h[0]===" "?h.slice(c):h).join(`
32
32
  `)}return o=o.trim(),a&&(o=o.replace(/\\n/g,`
33
33
  `)),o}}/*! @license MediaQueryParser - MIT License - Tom Golden (github@tbjgolden.com) *//*! *****************************************************************************
@@ -44,13 +44,13 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
44
44
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
45
45
  PERFORMANCE OF THIS SOFTWARE.
46
46
  ***************************************************************************** */var kt=function(){return kt=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},kt.apply(this,arguments)};function Kt(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function to(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function te(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return a}var ro=/(\u000D|\u000C|\u000D\u000A)/g,no=/[\u0000\uD800-\uDFFF]/g,io=/(\/\*)[\s\S]*?(\*\/)/g,ao=function(e,t){t===void 0&&(t=0),e=e.replace(ro,`
47
- `).replace(no,"�"),e=e.replace(io,"");for(var n=[];t<e.length;t+=1){var i=e.charCodeAt(t);if(i===9||i===32||i===10){for(var a=e.charCodeAt(++t);a===9||a===32||a===10;)a=e.charCodeAt(++t);t-=1,n.push({type:"<whitespace-token>"})}else if(i===34){var o=Hr(e,t);if(o===null)return null;var l=te(o,2),s=l[0],c=l[1];n.push({type:"<string-token>",value:c}),t=s}else if(i===35){if(t+1<e.length){var h=e.charCodeAt(t+1);if(h===95||h>=65&&h<=90||h>=97&&h<=122||h>=128||h>=48&&h<=57||h===92&&t+2<e.length&&e.charCodeAt(t+2)!==10){var d=Pn(e,t+1)?"id":"unrestricted",o=so(e,t+1);if(o!==null){var m=te(o,2),s=m[0],c=m[1];n.push({type:"<hash-token>",value:c.toLowerCase(),flag:d}),t=s;continue}}}n.push({type:"<delim-token>",value:i})}else if(i===39){var o=Hr(e,t);if(o===null)return null;var v=te(o,2),s=v[0],c=v[1];n.push({type:"<string-token>",value:c}),t=s}else if(i===40)n.push({type:"<(-token>"});else if(i===41)n.push({type:"<)-token>"});else if(i===43){var p=xt(e,t);if(p===null)n.push({type:"<delim-token>",value:i});else{var y=te(p,2),s=y[0],g=y[1];g[0]==="<dimension-token>"?n.push({type:"<dimension-token>",value:g[1],unit:g[2].toLowerCase(),flag:"number"}):g[0]==="<number-token>"?n.push({type:g[0],value:g[1],flag:g[2]}):n.push({type:g[0],value:g[1],flag:"number"}),t=s}}else if(i===44)n.push({type:"<comma-token>"});else if(i===45){var C=xt(e,t);if(C!==null){var R=te(C,2),s=R[0],g=R[1];g[0]==="<dimension-token>"?n.push({type:"<dimension-token>",value:g[1],unit:g[2].toLowerCase(),flag:"number"}):g[0]==="<number-token>"?n.push({type:g[0],value:g[1],flag:g[2]}):n.push({type:g[0],value:g[1],flag:"number"}),t=s;continue}if(t+2<e.length){var h=e.charCodeAt(t+1),k=e.charCodeAt(t+2);if(h===45&&k===62){n.push({type:"<CDC-token>"}),t+=2;continue}}var o=Yr(e,t);if(o!==null){var P=te(o,3),s=P[0],c=P[1],_=P[2];n.push({type:_,value:c}),t=s;continue}n.push({type:"<delim-token>",value:i})}else if(i===46){var C=xt(e,t);if(C===null)n.push({type:"<delim-token>",value:i});else{var D=te(C,2),s=D[0],g=D[1];g[0]==="<dimension-token>"?n.push({type:"<dimension-token>",value:g[1],unit:g[2].toLowerCase(),flag:"number"}):g[0]==="<number-token>"?n.push({type:g[0],value:g[1],flag:g[2]}):n.push({type:g[0],value:g[1],flag:"number"}),t=s;continue}}else if(i===58)n.push({type:"<colon-token>"});else if(i===59)n.push({type:"<semicolon-token>"});else if(i===60){if(t+3<e.length){var h=e.charCodeAt(t+1),k=e.charCodeAt(t+2),V=e.charCodeAt(t+3);if(h===33&&k===45&&V===45){n.push({type:"<CDO-token>"}),t+=3;continue}}n.push({type:"<delim-token>",value:i})}else if(i===64){var o=fr(e,t+1);if(o!==null){var G=te(o,2),s=G[0],c=G[1];n.push({type:"<at-keyword-token>",value:c.toLowerCase()}),t=s;continue}n.push({type:"<delim-token>",value:i})}else if(i===91)n.push({type:"<[-token>"});else if(i===92){var o=vt(e,t);if(o===null)return null;var H=te(o,2),s=H[0],c=H[1];e=e.slice(0,t)+c+e.slice(s+1),t-=1}else if(i===93)n.push({type:"<]-token>"});else if(i===123)n.push({type:"<{-token>"});else if(i===125)n.push({type:"<}-token>"});else if(i>=48&&i<=57){var o=xt(e,t),Ie=te(o,2),s=Ie[0],g=Ie[1];g[0]==="<dimension-token>"?n.push({type:"<dimension-token>",value:g[1],unit:g[2].toLowerCase(),flag:"number"}):g[0]==="<number-token>"?n.push({type:g[0],value:g[1],flag:g[2]}):n.push({type:g[0],value:g[1],flag:"number"}),t=s}else if(i===95||i>=65&&i<=90||i>=97&&i<=122||i>=128){var o=Yr(e,t);if(o===null)return null;var rt=te(o,3),s=rt[0],c=rt[1],_=rt[2];n.push({type:_,value:c}),t=s}else n.push({type:"<delim-token>",value:i})}return n.push({type:"<EOF-token>"}),n},Hr=function(e,t){if(e.length<=t+1)return null;for(var n=e.charCodeAt(t),i=[],a=t+1;a<e.length;a+=1){var o=e.charCodeAt(a);if(o===n)return[a,String.fromCharCode.apply(null,i)];if(o===92){var l=vt(e,a);if(l===null)return null;var s=te(l,2),c=s[0],h=s[1];i.push(h),a=c}else{if(o===10)return null;i.push(o)}}return null},Pn=function(e,t){if(e.length<=t)return!1;var n=e.charCodeAt(t);if(n===45){if(e.length<=t+1)return!1;var i=e.charCodeAt(t+1);if(i===45||i===95||i>=65&&i<=90||i>=97&&i<=122||i>=128)return!0;if(i===92){if(e.length<=t+2)return!1;var a=e.charCodeAt(t+2);return a!==10}else return!1}else{if(n===95||n>=65&&n<=90||n>=97&&n<=122||n>=128)return!0;if(n===92){if(e.length<=t+1)return!1;var i=e.charCodeAt(t+1);return i!==10}else return!1}},vt=function(e,t){if(e.length<=t+1||e.charCodeAt(t)!==92)return null;var n=e.charCodeAt(t+1);if(n===10)return null;if(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102){for(var i=[n],a=Math.min(t+7,e.length),o=t+2;o<a;o+=1){var l=e.charCodeAt(o);if(l>=48&&l<=57||l>=65&&l<=70||l>=97&&l<=102)i.push(l);else break}if(o<e.length){var s=e.charCodeAt(o);(s===9||s===32||s===10)&&(o+=1)}return[o-1,parseInt(String.fromCharCode.apply(null,i),16)]}else return[t+1,n]},xt=function(e,t){var n=oo(e,t);if(n===null)return null;var i=te(n,3),a=i[0],o=i[1],l=i[2],s=fr(e,a+1);if(s!==null){var c=te(s,2),h=c[0],d=c[1];return[h,["<dimension-token>",o,d]]}return a+1<e.length&&e.charCodeAt(a+1)===37?[a+1,["<percentage-token>",o]]:[a,["<number-token>",o,l]]},oo=function(e,t){if(e.length<=t)return null;var n="integer",i=[],a=e.charCodeAt(t);for((a===43||a===45)&&(t+=1,a===45&&i.push(45));t<e.length;){var o=e.charCodeAt(t);if(o>=48&&o<=57)i.push(o),t+=1;else break}if(t+1<e.length){var l=e.charCodeAt(t),s=e.charCodeAt(t+1);if(l===46&&s>=48&&s<=57)for(i.push(l,s),n="number",t+=2;t<e.length;){var o=e.charCodeAt(t);if(o>=48&&o<=57)i.push(o),t+=1;else break}}if(t+1<e.length){var l=e.charCodeAt(t),s=e.charCodeAt(t+1),c=e.charCodeAt(t+2);if(l===69||l===101){var h=s>=48&&s<=57;if(h||(s===43||s===45)&&c>=48&&c<=57)for(n="number",h?(i.push(69,s),t+=2):s===45?(i.push(69,45,c),t+=3):(i.push(69,c),t+=3);t<e.length;){var o=e.charCodeAt(t);if(o>=48&&o<=57)i.push(o),t+=1;else break}}}var d=String.fromCharCode.apply(null,i),m=n==="number"?parseFloat(d):parseInt(d);return m===-0&&(m=0),Number.isNaN(m)?null:[t-1,m,n]},so=function(e,t){if(e.length<=t)return null;for(var n=[],i=e.charCodeAt(t);t<e.length;i=e.charCodeAt(++t)){if(i===45||i===95||i>=65&&i<=90||i>=97&&i<=122||i>=128||i>=48&&i<=57){n.push(i);continue}else{var a=vt(e,t);if(a!==null){var o=te(a,2),l=o[0],s=o[1];n.push(s),t=l;continue}}break}return t===0?null:[t-1,String.fromCharCode.apply(null,n)]},fr=function(e,t){if(e.length<=t||!Pn(e,t))return null;for(var n=[],i=e.charCodeAt(t);t<e.length;i=e.charCodeAt(++t)){if(i===45||i===95||i>=65&&i<=90||i>=97&&i<=122||i>=128||i>=48&&i<=57){n.push(i);continue}else{var a=vt(e,t);if(a!==null){var o=te(a,2),l=o[0],s=o[1];n.push(s),t=l;continue}}break}return[t-1,String.fromCharCode.apply(null,n)]},lo=function(e,t){for(var n=e.charCodeAt(t);n===9||n===32||n===10;)n=e.charCodeAt(++t);for(var i=[],a=!1;t<e.length;){if(n===41)return[t,String.fromCharCode.apply(null,i)];if(n===34||n===39||n===40)return null;if(n===9||n===32||n===10)!a&&i.length!==0&&(a=!0);else if(n===92){var o=vt(e,t);if(o===null||a)return null;var l=te(o,2),s=l[0],c=l[1];i.push(c),t=s}else{if(a)return null;i.push(n)}n=e.charCodeAt(++t)}return null},Yr=function(e,t){var n=fr(e,t);if(n===null)return null;var i=te(n,2),a=i[0],o=i[1];if(o.toLowerCase()==="url"){if(e.length>a+1){var l=e.charCodeAt(a+1);if(l===40){for(var s=2;a+s<e.length;s+=1){var c=e.charCodeAt(a+s);if(c===34||c===39)return[a+1,o.toLowerCase(),"<function-token>"];if(c!==9&&c!==32&&c!==10){var h=lo(e,a+s);if(h===null)return null;var d=te(h,2),m=d[0],v=d[1];return[m,v,"<url-token>"]}}return[a+1,o.toLowerCase(),"<function-token>"]}}}else if(e.length>a+1){var l=e.charCodeAt(a+1);if(l===40)return[a+1,o.toLowerCase(),"<function-token>"]}return[a,o.toLowerCase(),"<ident-token>"]},uo=function(e){for(var t=e.length-1;t>=0;t--)e[t]=co(e[t]);return e},co=function(e){if(e.mediaCondition===null)return e;var t=fo(e.mediaCondition);return t.operator===null&&t.children.length===1&&"children"in t.children[0]&&(t=t.children[0]),{mediaPrefix:e.mediaPrefix,mediaType:e.mediaType,mediaCondition:t}},fo=function r(e){for(var t=e.children.length-1;t>=0;t--){var n=e.children[t];if(!("context"in n)){var i=r(n);if(i.operator===null&&i.children.length===1)e.children[t]=i.children[0];else if(i.operator===e.operator&&(i.operator==="and"||i.operator==="or")){for(var a=[t,1],o=0;o<i.children.length;o++)a.push(i.children[o]);e.children.splice.apply(e.children,a)}}}return e},ce=function(e,t){return t instanceof Error?new Error("".concat(t.message.trim(),`
47
+ `).replace(no,"�"),e=e.replace(io,"");for(var n=[];t<e.length;t+=1){var i=e.charCodeAt(t);if(i===9||i===32||i===10){for(var a=e.charCodeAt(++t);a===9||a===32||a===10;)a=e.charCodeAt(++t);t-=1,n.push({type:"<whitespace-token>"})}else if(i===34){var o=Hr(e,t);if(o===null)return null;var l=te(o,2),s=l[0],c=l[1];n.push({type:"<string-token>",value:c}),t=s}else if(i===35){if(t+1<e.length){var h=e.charCodeAt(t+1);if(h===95||h>=65&&h<=90||h>=97&&h<=122||h>=128||h>=48&&h<=57||h===92&&t+2<e.length&&e.charCodeAt(t+2)!==10){var d=Pn(e,t+1)?"id":"unrestricted",o=so(e,t+1);if(o!==null){var m=te(o,2),s=m[0],c=m[1];n.push({type:"<hash-token>",value:c.toLowerCase(),flag:d}),t=s;continue}}}n.push({type:"<delim-token>",value:i})}else if(i===39){var o=Hr(e,t);if(o===null)return null;var v=te(o,2),s=v[0],c=v[1];n.push({type:"<string-token>",value:c}),t=s}else if(i===40)n.push({type:"<(-token>"});else if(i===41)n.push({type:"<)-token>"});else if(i===43){var p=xt(e,t);if(p===null)n.push({type:"<delim-token>",value:i});else{var y=te(p,2),s=y[0],g=y[1];g[0]==="<dimension-token>"?n.push({type:"<dimension-token>",value:g[1],unit:g[2].toLowerCase(),flag:"number"}):g[0]==="<number-token>"?n.push({type:g[0],value:g[1],flag:g[2]}):n.push({type:g[0],value:g[1],flag:"number"}),t=s}}else if(i===44)n.push({type:"<comma-token>"});else if(i===45){var C=xt(e,t);if(C!==null){var R=te(C,2),s=R[0],g=R[1];g[0]==="<dimension-token>"?n.push({type:"<dimension-token>",value:g[1],unit:g[2].toLowerCase(),flag:"number"}):g[0]==="<number-token>"?n.push({type:g[0],value:g[1],flag:g[2]}):n.push({type:g[0],value:g[1],flag:"number"}),t=s;continue}if(t+2<e.length){var h=e.charCodeAt(t+1),k=e.charCodeAt(t+2);if(h===45&&k===62){n.push({type:"<CDC-token>"}),t+=2;continue}}var o=Yr(e,t);if(o!==null){var P=te(o,3),s=P[0],c=P[1],_=P[2];n.push({type:_,value:c}),t=s;continue}n.push({type:"<delim-token>",value:i})}else if(i===46){var C=xt(e,t);if(C===null)n.push({type:"<delim-token>",value:i});else{var D=te(C,2),s=D[0],g=D[1];g[0]==="<dimension-token>"?n.push({type:"<dimension-token>",value:g[1],unit:g[2].toLowerCase(),flag:"number"}):g[0]==="<number-token>"?n.push({type:g[0],value:g[1],flag:g[2]}):n.push({type:g[0],value:g[1],flag:"number"}),t=s;continue}}else if(i===58)n.push({type:"<colon-token>"});else if(i===59)n.push({type:"<semicolon-token>"});else if(i===60){if(t+3<e.length){var h=e.charCodeAt(t+1),k=e.charCodeAt(t+2),V=e.charCodeAt(t+3);if(h===33&&k===45&&V===45){n.push({type:"<CDO-token>"}),t+=3;continue}}n.push({type:"<delim-token>",value:i})}else if(i===64){var o=fr(e,t+1);if(o!==null){var q=te(o,2),s=q[0],c=q[1];n.push({type:"<at-keyword-token>",value:c.toLowerCase()}),t=s;continue}n.push({type:"<delim-token>",value:i})}else if(i===91)n.push({type:"<[-token>"});else if(i===92){var o=vt(e,t);if(o===null)return null;var H=te(o,2),s=H[0],c=H[1];e=e.slice(0,t)+c+e.slice(s+1),t-=1}else if(i===93)n.push({type:"<]-token>"});else if(i===123)n.push({type:"<{-token>"});else if(i===125)n.push({type:"<}-token>"});else if(i>=48&&i<=57){var o=xt(e,t),Ie=te(o,2),s=Ie[0],g=Ie[1];g[0]==="<dimension-token>"?n.push({type:"<dimension-token>",value:g[1],unit:g[2].toLowerCase(),flag:"number"}):g[0]==="<number-token>"?n.push({type:g[0],value:g[1],flag:g[2]}):n.push({type:g[0],value:g[1],flag:"number"}),t=s}else if(i===95||i>=65&&i<=90||i>=97&&i<=122||i>=128){var o=Yr(e,t);if(o===null)return null;var rt=te(o,3),s=rt[0],c=rt[1],_=rt[2];n.push({type:_,value:c}),t=s}else n.push({type:"<delim-token>",value:i})}return n.push({type:"<EOF-token>"}),n},Hr=function(e,t){if(e.length<=t+1)return null;for(var n=e.charCodeAt(t),i=[],a=t+1;a<e.length;a+=1){var o=e.charCodeAt(a);if(o===n)return[a,String.fromCharCode.apply(null,i)];if(o===92){var l=vt(e,a);if(l===null)return null;var s=te(l,2),c=s[0],h=s[1];i.push(h),a=c}else{if(o===10)return null;i.push(o)}}return null},Pn=function(e,t){if(e.length<=t)return!1;var n=e.charCodeAt(t);if(n===45){if(e.length<=t+1)return!1;var i=e.charCodeAt(t+1);if(i===45||i===95||i>=65&&i<=90||i>=97&&i<=122||i>=128)return!0;if(i===92){if(e.length<=t+2)return!1;var a=e.charCodeAt(t+2);return a!==10}else return!1}else{if(n===95||n>=65&&n<=90||n>=97&&n<=122||n>=128)return!0;if(n===92){if(e.length<=t+1)return!1;var i=e.charCodeAt(t+1);return i!==10}else return!1}},vt=function(e,t){if(e.length<=t+1||e.charCodeAt(t)!==92)return null;var n=e.charCodeAt(t+1);if(n===10)return null;if(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102){for(var i=[n],a=Math.min(t+7,e.length),o=t+2;o<a;o+=1){var l=e.charCodeAt(o);if(l>=48&&l<=57||l>=65&&l<=70||l>=97&&l<=102)i.push(l);else break}if(o<e.length){var s=e.charCodeAt(o);(s===9||s===32||s===10)&&(o+=1)}return[o-1,parseInt(String.fromCharCode.apply(null,i),16)]}else return[t+1,n]},xt=function(e,t){var n=oo(e,t);if(n===null)return null;var i=te(n,3),a=i[0],o=i[1],l=i[2],s=fr(e,a+1);if(s!==null){var c=te(s,2),h=c[0],d=c[1];return[h,["<dimension-token>",o,d]]}return a+1<e.length&&e.charCodeAt(a+1)===37?[a+1,["<percentage-token>",o]]:[a,["<number-token>",o,l]]},oo=function(e,t){if(e.length<=t)return null;var n="integer",i=[],a=e.charCodeAt(t);for((a===43||a===45)&&(t+=1,a===45&&i.push(45));t<e.length;){var o=e.charCodeAt(t);if(o>=48&&o<=57)i.push(o),t+=1;else break}if(t+1<e.length){var l=e.charCodeAt(t),s=e.charCodeAt(t+1);if(l===46&&s>=48&&s<=57)for(i.push(l,s),n="number",t+=2;t<e.length;){var o=e.charCodeAt(t);if(o>=48&&o<=57)i.push(o),t+=1;else break}}if(t+1<e.length){var l=e.charCodeAt(t),s=e.charCodeAt(t+1),c=e.charCodeAt(t+2);if(l===69||l===101){var h=s>=48&&s<=57;if(h||(s===43||s===45)&&c>=48&&c<=57)for(n="number",h?(i.push(69,s),t+=2):s===45?(i.push(69,45,c),t+=3):(i.push(69,c),t+=3);t<e.length;){var o=e.charCodeAt(t);if(o>=48&&o<=57)i.push(o),t+=1;else break}}}var d=String.fromCharCode.apply(null,i),m=n==="number"?parseFloat(d):parseInt(d);return m===-0&&(m=0),Number.isNaN(m)?null:[t-1,m,n]},so=function(e,t){if(e.length<=t)return null;for(var n=[],i=e.charCodeAt(t);t<e.length;i=e.charCodeAt(++t)){if(i===45||i===95||i>=65&&i<=90||i>=97&&i<=122||i>=128||i>=48&&i<=57){n.push(i);continue}else{var a=vt(e,t);if(a!==null){var o=te(a,2),l=o[0],s=o[1];n.push(s),t=l;continue}}break}return t===0?null:[t-1,String.fromCharCode.apply(null,n)]},fr=function(e,t){if(e.length<=t||!Pn(e,t))return null;for(var n=[],i=e.charCodeAt(t);t<e.length;i=e.charCodeAt(++t)){if(i===45||i===95||i>=65&&i<=90||i>=97&&i<=122||i>=128||i>=48&&i<=57){n.push(i);continue}else{var a=vt(e,t);if(a!==null){var o=te(a,2),l=o[0],s=o[1];n.push(s),t=l;continue}}break}return[t-1,String.fromCharCode.apply(null,n)]},lo=function(e,t){for(var n=e.charCodeAt(t);n===9||n===32||n===10;)n=e.charCodeAt(++t);for(var i=[],a=!1;t<e.length;){if(n===41)return[t,String.fromCharCode.apply(null,i)];if(n===34||n===39||n===40)return null;if(n===9||n===32||n===10)!a&&i.length!==0&&(a=!0);else if(n===92){var o=vt(e,t);if(o===null||a)return null;var l=te(o,2),s=l[0],c=l[1];i.push(c),t=s}else{if(a)return null;i.push(n)}n=e.charCodeAt(++t)}return null},Yr=function(e,t){var n=fr(e,t);if(n===null)return null;var i=te(n,2),a=i[0],o=i[1];if(o.toLowerCase()==="url"){if(e.length>a+1){var l=e.charCodeAt(a+1);if(l===40){for(var s=2;a+s<e.length;s+=1){var c=e.charCodeAt(a+s);if(c===34||c===39)return[a+1,o.toLowerCase(),"<function-token>"];if(c!==9&&c!==32&&c!==10){var h=lo(e,a+s);if(h===null)return null;var d=te(h,2),m=d[0],v=d[1];return[m,v,"<url-token>"]}}return[a+1,o.toLowerCase(),"<function-token>"]}}}else if(e.length>a+1){var l=e.charCodeAt(a+1);if(l===40)return[a+1,o.toLowerCase(),"<function-token>"]}return[a,o.toLowerCase(),"<ident-token>"]},uo=function(e){for(var t=e.length-1;t>=0;t--)e[t]=co(e[t]);return e},co=function(e){if(e.mediaCondition===null)return e;var t=fo(e.mediaCondition);return t.operator===null&&t.children.length===1&&"children"in t.children[0]&&(t=t.children[0]),{mediaPrefix:e.mediaPrefix,mediaType:e.mediaType,mediaCondition:t}},fo=function r(e){for(var t=e.children.length-1;t>=0;t--){var n=e.children[t];if(!("context"in n)){var i=r(n);if(i.operator===null&&i.children.length===1)e.children[t]=i.children[0];else if(i.operator===e.operator&&(i.operator==="and"||i.operator==="or")){for(var a=[t,1],o=0;o<i.children.length;o++)a.push(i.children[o]);e.children.splice.apply(e.children,a)}}}return e},ce=function(e,t){return t instanceof Error?new Error("".concat(t.message.trim(),`
48
48
  `).concat(e.trim())):new Error(e.trim())},ho=function(e){return uo(mo(e))},mo=function(e){var t=ao(e.trim());if(t===null)throw ce("Failed tokenizing");var n=0,i=t.length-1;if(t[0].type==="<at-keyword-token>"&&t[0].value==="media"){if(t[1].type!=="<whitespace-token>")throw ce("Expected whitespace after media");n=2;for(var a=2;a<t.length-1;a++){var o=t[a];if(o.type==="<{-token>"){i=a;break}else if(o.type==="<semicolon-token>")throw ce("Expected '{' in media query but found ';'")}}return t=t.slice(n,i),vo(t)},po=function(e){for(var t=[],n=!1,i=0;i<e.length;i++)e[i].type==="<whitespace-token>"?(n=!0,t.length>0&&(t[t.length-1].wsAfter=!0)):(t.push(kt(kt({},e[i]),{wsBefore:n,wsAfter:!1})),n=!1);return t},vo=function(e){for(var t,n,i=[[]],a=0;a<e.length;a++){var o=e[a];o.type==="<comma-token>"?i.push([]):i[i.length-1].push(o)}var l=i.map(po);if(l.length===1&&l[0].length===0)return[{mediaCondition:null,mediaPrefix:null,mediaType:"all"}];var s=l.map(function(v){return v.length===0?null:go(v)}),c=[];try{for(var h=to(s),d=h.next();!d.done;d=h.next()){var m=d.value;m!==null&&c.push(m)}}catch(v){t={error:v}}finally{try{d&&!d.done&&(n=h.return)&&n.call(h)}finally{if(t)throw t.error}}if(c.length===0)throw ce("No valid media queries");return c},go=function(e){var t=e[0];if(t.type==="<(-token>")try{return{mediaPrefix:null,mediaType:"all",mediaCondition:$t(e,!0)}}catch(d){throw ce("Expected media condition after '('",d)}else if(t.type==="<ident-token>"){var n=null,i=void 0,a=t.value;(a==="only"||a==="not")&&(n=a);var o=n===null?0:1;if(e.length<=o)throw ce("Expected extra token in media query");var l=e[o];if(l.type==="<ident-token>"){var s=l.value;if(s==="all")i="all";else if(s==="print"||s==="screen")i=s;else if(s==="tty"||s==="tv"||s==="projection"||s==="handheld"||s==="braille"||s==="embossed"||s==="aural"||s==="speech")n=n==="not"?null:"not",i="all";else throw ce("Unknown ident '".concat(s,"' in media query"))}else if(n==="not"&&l.type==="<(-token>"){var c=[{type:"<(-token>",wsBefore:!1,wsAfter:!1}];c.push.apply(c,e),c.push({type:"<)-token>",wsBefore:!1,wsAfter:!1});try{return{mediaPrefix:null,mediaType:"all",mediaCondition:$t(c,!0)}}catch(d){throw ce("Expected media condition after '('",d)}}else throw ce("Invalid media query");if(o+1===e.length)return{mediaPrefix:n,mediaType:i,mediaCondition:null};if(o+4<e.length){var h=e[o+1];if(h.type==="<ident-token>"&&h.value==="and")try{return{mediaPrefix:n,mediaType:i,mediaCondition:$t(e.slice(o+2),!1)}}catch(d){throw ce("Expected media condition after 'and'",d)}else throw ce("Expected 'and' after media prefix")}else throw ce("Expected media condition after media prefix")}else throw ce("Expected media condition or media prefix")},$t=function r(e,t,n){if(n===void 0&&(n=null),e.length<3||e[0].type!=="<(-token>"||e[e.length-1].type!=="<)-token>")throw new Error("Invalid media condition");for(var i=e.length-1,a=0,o=0,l=0;l<e.length;l++){var s=e[l];if(s.type==="<(-token>"?(o+=1,a=Math.max(a,o)):s.type==="<)-token>"&&(o-=1),o===0){i=l;break}}if(o!==0)throw new Error(`Mismatched parens
49
49
  Invalid media condition`);var c,h=e.slice(0,i+1);if(a===1?c=yo(h):h[1].type==="<ident-token>"&&h[1].value==="not"?c=r(h.slice(2,-1),!0,"not"):c=r(h.slice(1,-1),!0),i===e.length-1)return{operator:n,children:[c]};var d=e[i+1];if(d.type!=="<ident-token>")throw new Error(`Invalid operator
50
50
  Invalid media condition`);if(n!==null&&n!==d.value)throw new Error("'".concat(d.value,"' and '").concat(n,`' must not be at same level
51
51
  Invalid media condition`));if(d.value==="or"&&!t)throw new Error(`Cannot use 'or' at top level of a media query
52
52
  Invalid media condition`);if(d.value!=="and"&&d.value!=="or")throw new Error("Invalid operator: '".concat(d.value,`'
53
- Invalid media condition`));var m=r(e.slice(i+2),t,d.value);return{operator:d.value,children:[c].concat(m.children)}},yo=function(e){if(e.length<3||e[0].type!=="<(-token>"||e[e.length-1].type!=="<)-token>")throw new Error("Invalid media feature");for(var t=[e[0]],n=1;n<e.length;n++){if(n<e.length-2){var i=e[n],a=e[n+1],o=e[n+2];if(i.type==="<number-token>"&&i.value>0&&a.type==="<delim-token>"&&a.value===47&&o.type==="<number-token>"&&o.value>0){t.push({type:"<ratio-token>",numerator:i.value,denominator:o.value,wsBefore:i.wsBefore,wsAfter:o.wsAfter}),n+=2;continue}}t.push(e[n])}var l=t[1];if(l.type==="<ident-token>"&&t.length===3)return{context:"boolean",feature:l.value};if(t.length===5&&t[1].type==="<ident-token>"&&t[2].type==="<colon-token>"){var s=t[3];if(s.type==="<number-token>"||s.type==="<dimension-token>"||s.type==="<ratio-token>"||s.type==="<ident-token>"){var c=t[1].value,h=null,d=c.slice(0,4);d==="min-"?(h="min",c=c.slice(4)):d==="max-"&&(h="max",c=c.slice(4)),s.wsBefore,s.wsAfter;var m=Kt(s,["wsBefore","wsAfter"]);return{context:"value",prefix:h,feature:c,value:m}}}else if(t.length>=5)try{var v=bo(t);return{context:"range",feature:v.featureName,range:v}}catch(p){throw ce("Invalid media feature",p)}throw new Error("Invalid media feature")},bo=function(e){var t,n,i,a;if(e.length<5||e[0].type!=="<(-token>"||e[e.length-1].type!=="<)-token>")throw new Error("Invalid range");var o={leftToken:null,leftOp:null,featureName:"",rightOp:null,rightToken:null},l=e[1].type==="<number-token>"||e[1].type==="<dimension-token>"||e[1].type==="<ratio-token>"||e[1].type==="<ident-token>"&&e[1].value==="infinite";if(e[2].type==="<delim-token>"){if(e[2].value===60)e[3].type==="<delim-token>"&&e[3].value===61&&!e[3].wsBefore?o[l?"leftOp":"rightOp"]="<=":o[l?"leftOp":"rightOp"]="<";else if(e[2].value===62)e[3].type==="<delim-token>"&&e[3].value===61&&!e[3].wsBefore?o[l?"leftOp":"rightOp"]=">=":o[l?"leftOp":"rightOp"]=">";else if(e[2].value===61)o[l?"leftOp":"rightOp"]="=";else throw new Error("Invalid range");if(l)o.leftToken=e[1];else if(e[1].type==="<ident-token>")o.featureName=e[1].value;else throw new Error("Invalid range");var s=2+((n=(t=o[l?"leftOp":"rightOp"])===null||t===void 0?void 0:t.length)!==null&&n!==void 0?n:0),c=e[s];if(l)if(c.type==="<ident-token>"){if(o.featureName=c.value,e.length>=7){var h=e[s+1],d=e[s+2];if(h.type==="<delim-token>"){var m=h.value;if(m===60)d.type==="<delim-token>"&&d.value===61&&!d.wsBefore?o.rightOp="<=":o.rightOp="<";else if(m===62)d.type==="<delim-token>"&&d.value===61&&!d.wsBefore?o.rightOp=">=":o.rightOp=">";else throw new Error("Invalid range");var v=e[s+1+((a=(i=o.rightOp)===null||i===void 0?void 0:i.length)!==null&&a!==void 0?a:0)];o.rightToken=v}else throw new Error("Invalid range")}else if(s+2!==e.length)throw new Error("Invalid range")}else throw new Error("Invalid range");else o.rightToken=c;var p=null,y=o.leftToken,g=o.leftOp,C=o.featureName,R=o.rightOp,k=o.rightToken,P=null;if(y!==null){if(y.type==="<ident-token>"){var _=y.type,D=y.value;D==="infinite"&&(P={type:_,value:D})}else if(y.type==="<number-token>"||y.type==="<dimension-token>"||y.type==="<ratio-token>"){y.wsBefore,y.wsAfter;var V=Kt(y,["wsBefore","wsAfter"]);P=V}}var G=null;if(k!==null){if(k.type==="<ident-token>"){var _=k.type,D=k.value;D==="infinite"&&(G={type:_,value:D})}else if(k.type==="<number-token>"||k.type==="<dimension-token>"||k.type==="<ratio-token>"){k.wsBefore,k.wsAfter;var H=Kt(k,["wsBefore","wsAfter"]);G=H}}if(P!==null&&G!==null)if((g==="<"||g==="<=")&&(R==="<"||R==="<="))p={leftToken:P,leftOp:g,featureName:C,rightOp:R,rightToken:G};else if((g===">"||g===">=")&&(R===">"||R===">="))p={leftToken:P,leftOp:g,featureName:C,rightOp:R,rightToken:G};else throw new Error("Invalid range");else P===null&&g===null&&R!==null&&G!==null?p={leftToken:P,leftOp:g,featureName:C,rightOp:R,rightToken:G}:P!==null&&g!==null&&R===null&&G===null&&(p={leftToken:P,leftOp:g,featureName:C,rightOp:R,rightToken:G});return p}else throw new Error("Invalid range")};function wo(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Co(r){var e=wo(r,"string");return typeof e=="symbol"?e:String(e)}function xo(r,e,t){return e=Co(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Kr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function qe(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Kr(Object(t),!0).forEach(function(n){xo(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Kr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function So(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,a;for(a=0;a<n.length;a++)i=n[a],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}function Xr(r,e){if(r==null)return{};var t=So(r,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function ut(r,e){for(var t in r)e(r[t],t)}function He(r,e){var t={};for(var n in r)e.indexOf(n)===-1&&(t[n]=r[n]);return t}function Ro(r,e){var t={};for(var n in r)t[e(r[n],n)]=r[n];return t}function Xt(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];for(var i of t)i.length!==0&&(typeof i=="string"?i.includes(" ")?Xt(r,...i.trim().split(" ")):r.add(i):Array.isArray(i)&&Xt(r,...i))}function Oo(r){var e=new Set;return Xt(e,...r),Array.from(e).join(" ")}var Zr;function Ao(r){return r.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var Eo=(r,e)=>{var t=()=>{var i=new RegExp(".".concat(Ao(lr(e,{isIdentifier:!0}))),"g");return r.replace(i,"&")},n;try{n=Za(r)}catch{throw new Error("Invalid selector: ".concat(t()))}n.forEach(i=>{try{for(var a=i.length-1;a>=-1;a--){if(!i[a])throw new Error;var o=i[a];if(o.type==="child"||o.type==="parent"||o.type==="sibling"||o.type==="adjacent"||o.type==="descendant")throw new Error;if(o.type==="attribute"&&o.name==="class"&&o.value===e)return}}catch{throw new Error(cr(Zr||(Zr=ur([`
53
+ Invalid media condition`));var m=r(e.slice(i+2),t,d.value);return{operator:d.value,children:[c].concat(m.children)}},yo=function(e){if(e.length<3||e[0].type!=="<(-token>"||e[e.length-1].type!=="<)-token>")throw new Error("Invalid media feature");for(var t=[e[0]],n=1;n<e.length;n++){if(n<e.length-2){var i=e[n],a=e[n+1],o=e[n+2];if(i.type==="<number-token>"&&i.value>0&&a.type==="<delim-token>"&&a.value===47&&o.type==="<number-token>"&&o.value>0){t.push({type:"<ratio-token>",numerator:i.value,denominator:o.value,wsBefore:i.wsBefore,wsAfter:o.wsAfter}),n+=2;continue}}t.push(e[n])}var l=t[1];if(l.type==="<ident-token>"&&t.length===3)return{context:"boolean",feature:l.value};if(t.length===5&&t[1].type==="<ident-token>"&&t[2].type==="<colon-token>"){var s=t[3];if(s.type==="<number-token>"||s.type==="<dimension-token>"||s.type==="<ratio-token>"||s.type==="<ident-token>"){var c=t[1].value,h=null,d=c.slice(0,4);d==="min-"?(h="min",c=c.slice(4)):d==="max-"&&(h="max",c=c.slice(4)),s.wsBefore,s.wsAfter;var m=Kt(s,["wsBefore","wsAfter"]);return{context:"value",prefix:h,feature:c,value:m}}}else if(t.length>=5)try{var v=bo(t);return{context:"range",feature:v.featureName,range:v}}catch(p){throw ce("Invalid media feature",p)}throw new Error("Invalid media feature")},bo=function(e){var t,n,i,a;if(e.length<5||e[0].type!=="<(-token>"||e[e.length-1].type!=="<)-token>")throw new Error("Invalid range");var o={leftToken:null,leftOp:null,featureName:"",rightOp:null,rightToken:null},l=e[1].type==="<number-token>"||e[1].type==="<dimension-token>"||e[1].type==="<ratio-token>"||e[1].type==="<ident-token>"&&e[1].value==="infinite";if(e[2].type==="<delim-token>"){if(e[2].value===60)e[3].type==="<delim-token>"&&e[3].value===61&&!e[3].wsBefore?o[l?"leftOp":"rightOp"]="<=":o[l?"leftOp":"rightOp"]="<";else if(e[2].value===62)e[3].type==="<delim-token>"&&e[3].value===61&&!e[3].wsBefore?o[l?"leftOp":"rightOp"]=">=":o[l?"leftOp":"rightOp"]=">";else if(e[2].value===61)o[l?"leftOp":"rightOp"]="=";else throw new Error("Invalid range");if(l)o.leftToken=e[1];else if(e[1].type==="<ident-token>")o.featureName=e[1].value;else throw new Error("Invalid range");var s=2+((n=(t=o[l?"leftOp":"rightOp"])===null||t===void 0?void 0:t.length)!==null&&n!==void 0?n:0),c=e[s];if(l)if(c.type==="<ident-token>"){if(o.featureName=c.value,e.length>=7){var h=e[s+1],d=e[s+2];if(h.type==="<delim-token>"){var m=h.value;if(m===60)d.type==="<delim-token>"&&d.value===61&&!d.wsBefore?o.rightOp="<=":o.rightOp="<";else if(m===62)d.type==="<delim-token>"&&d.value===61&&!d.wsBefore?o.rightOp=">=":o.rightOp=">";else throw new Error("Invalid range");var v=e[s+1+((a=(i=o.rightOp)===null||i===void 0?void 0:i.length)!==null&&a!==void 0?a:0)];o.rightToken=v}else throw new Error("Invalid range")}else if(s+2!==e.length)throw new Error("Invalid range")}else throw new Error("Invalid range");else o.rightToken=c;var p=null,y=o.leftToken,g=o.leftOp,C=o.featureName,R=o.rightOp,k=o.rightToken,P=null;if(y!==null){if(y.type==="<ident-token>"){var _=y.type,D=y.value;D==="infinite"&&(P={type:_,value:D})}else if(y.type==="<number-token>"||y.type==="<dimension-token>"||y.type==="<ratio-token>"){y.wsBefore,y.wsAfter;var V=Kt(y,["wsBefore","wsAfter"]);P=V}}var q=null;if(k!==null){if(k.type==="<ident-token>"){var _=k.type,D=k.value;D==="infinite"&&(q={type:_,value:D})}else if(k.type==="<number-token>"||k.type==="<dimension-token>"||k.type==="<ratio-token>"){k.wsBefore,k.wsAfter;var H=Kt(k,["wsBefore","wsAfter"]);q=H}}if(P!==null&&q!==null)if((g==="<"||g==="<=")&&(R==="<"||R==="<="))p={leftToken:P,leftOp:g,featureName:C,rightOp:R,rightToken:q};else if((g===">"||g===">=")&&(R===">"||R===">="))p={leftToken:P,leftOp:g,featureName:C,rightOp:R,rightToken:q};else throw new Error("Invalid range");else P===null&&g===null&&R!==null&&q!==null?p={leftToken:P,leftOp:g,featureName:C,rightOp:R,rightToken:q}:P!==null&&g!==null&&R===null&&q===null&&(p={leftToken:P,leftOp:g,featureName:C,rightOp:R,rightToken:q});return p}else throw new Error("Invalid range")};function wo(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Co(r){var e=wo(r,"string");return typeof e=="symbol"?e:String(e)}function xo(r,e,t){return e=Co(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Kr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function qe(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Kr(Object(t),!0).forEach(function(n){xo(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Kr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function So(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,a;for(a=0;a<n.length;a++)i=n[a],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}function Xr(r,e){if(r==null)return{};var t=So(r,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function ut(r,e){for(var t in r)e(r[t],t)}function He(r,e){var t={};for(var n in r)e.indexOf(n)===-1&&(t[n]=r[n]);return t}function Ro(r,e){var t={};for(var n in r)t[e(r[n],n)]=r[n];return t}function Xt(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];for(var i of t)i.length!==0&&(typeof i=="string"?i.includes(" ")?Xt(r,...i.trim().split(" ")):r.add(i):Array.isArray(i)&&Xt(r,...i))}function Oo(r){var e=new Set;return Xt(e,...r),Array.from(e).join(" ")}var Zr;function Ao(r){return r.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var Eo=(r,e)=>{var t=()=>{var i=new RegExp(".".concat(Ao(lr(e,{isIdentifier:!0}))),"g");return r.replace(i,"&")},n;try{n=Za(r)}catch{throw new Error("Invalid selector: ".concat(t()))}n.forEach(i=>{try{for(var a=i.length-1;a>=-1;a--){if(!i[a])throw new Error;var o=i[a];if(o.type==="child"||o.type==="parent"||o.type==="sibling"||o.type==="adjacent"||o.type==="descendant")throw new Error;if(o.type==="attribute"&&o.name==="class"&&o.value===e)return}}catch{throw new Error(cr(Zr||(Zr=ur([`
54
54
  Invalid selector: `,`
55
55
 
56
56
  Style selectors must target the '&' character (along with any modifiers), e.g. `," or ",`.
@@ -74,8 +74,8 @@ Invalid media condition`));var m=r(e.slice(i+2),t,d.value);return{operator:d.val
74
74
 
75
75
  - You may have created styles outside of a '.css.ts' context
76
76
  - You may have incorrect configuration. See https://vanilla-extract.style/documentation/getting-started
77
- `]))));return tn[0]}function Wo(){return Lo++}const Ke=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Tn=new Set,Zt=typeof process=="object"&&process?process:{},zn=(r,e,t,n)=>{typeof Zt.emitWarning=="function"?Zt.emitWarning(r,e,t,n):console.error(`[${t}] ${e}: ${r}`)};let Pt=globalThis.AbortController,rn=globalThis.AbortSignal;var cn;if(typeof Pt>"u"){rn=class{constructor(){q(this,"onabort");q(this,"_onabort",[]);q(this,"reason");q(this,"aborted",!1)}addEventListener(n,i){this._onabort.push(i)}},Pt=class{constructor(){q(this,"signal",new rn);e()}abort(n){var i,a;if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(const o of this.signal._onabort)o(n);(a=(i=this.signal).onabort)==null||a.call(i,n)}}};let r=((cn=Zt.env)==null?void 0:cn.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{r&&(r=!1,zn("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}const Bo=r=>!Tn.has(r),Fe=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),Dn=r=>Fe(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?Rt:null:null;class Rt extends Array{constructor(e){super(e),this.fill(0)}}var Ze;const We=class We{constructor(e,t){q(this,"heap");q(this,"length");if(!u(We,Ze))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}static create(e){const t=Dn(e);if(!t)return[];j(We,Ze,!0);const n=new We(e,t);return j(We,Ze,!1),n}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};Ze=new WeakMap,I(We,Ze,!1);let Jt=We;var fn,hn,be,fe,we,Ce,Je,Qe,ee,xe,Q,B,F,oe,he,ie,re,Se,ne,Re,Oe,de,Ae,De,se,x,er,Be,ke,dt,me,In,Ge,et,mt,_e,Te,tr,Ot,At,W,rr,ct,ze,nr;const mr=class mr{constructor(e){I(this,x);I(this,be);I(this,fe);I(this,we);I(this,Ce);I(this,Je);I(this,Qe);q(this,"ttl");q(this,"ttlResolution");q(this,"ttlAutopurge");q(this,"updateAgeOnGet");q(this,"updateAgeOnHas");q(this,"allowStale");q(this,"noDisposeOnSet");q(this,"noUpdateTTL");q(this,"maxEntrySize");q(this,"sizeCalculation");q(this,"noDeleteOnFetchRejection");q(this,"noDeleteOnStaleGet");q(this,"allowStaleOnFetchAbort");q(this,"allowStaleOnFetchRejection");q(this,"ignoreFetchAbort");I(this,ee);I(this,xe);I(this,Q);I(this,B);I(this,F);I(this,oe);I(this,he);I(this,ie);I(this,re);I(this,Se);I(this,ne);I(this,Re);I(this,Oe);I(this,de);I(this,Ae);I(this,De);I(this,se);I(this,Be,()=>{});I(this,ke,()=>{});I(this,dt,()=>{});I(this,me,()=>!1);I(this,Ge,e=>{});I(this,et,(e,t,n)=>{});I(this,mt,(e,t,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});q(this,fn,"LRUCache");const{max:t=0,ttl:n,ttlResolution:i=1,ttlAutopurge:a,updateAgeOnGet:o,updateAgeOnHas:l,allowStale:s,dispose:c,disposeAfter:h,noDisposeOnSet:d,noUpdateTTL:m,maxSize:v=0,maxEntrySize:p=0,sizeCalculation:y,fetchMethod:g,memoMethod:C,noDeleteOnFetchRejection:R,noDeleteOnStaleGet:k,allowStaleOnFetchRejection:P,allowStaleOnFetchAbort:_,ignoreFetchAbort:D}=e;if(t!==0&&!Fe(t))throw new TypeError("max option must be a nonnegative integer");const V=t?Dn(t):Array;if(!V)throw new Error("invalid max value: "+t);if(j(this,be,t),j(this,fe,v),this.maxEntrySize=p||u(this,fe),this.sizeCalculation=y,this.sizeCalculation){if(!u(this,fe)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(C!==void 0&&typeof C!="function")throw new TypeError("memoMethod must be a function if defined");if(j(this,Qe,C),g!==void 0&&typeof g!="function")throw new TypeError("fetchMethod must be a function if specified");if(j(this,Je,g),j(this,De,!!g),j(this,Q,new Map),j(this,B,new Array(t).fill(void 0)),j(this,F,new Array(t).fill(void 0)),j(this,oe,new V(t)),j(this,he,new V(t)),j(this,ie,0),j(this,re,0),j(this,Se,Jt.create(t)),j(this,ee,0),j(this,xe,0),typeof c=="function"&&j(this,we,c),typeof h=="function"?(j(this,Ce,h),j(this,ne,[])):(j(this,Ce,void 0),j(this,ne,void 0)),j(this,Ae,!!u(this,we)),j(this,se,!!u(this,Ce)),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!R,this.allowStaleOnFetchRejection=!!P,this.allowStaleOnFetchAbort=!!_,this.ignoreFetchAbort=!!D,this.maxEntrySize!==0){if(u(this,fe)!==0&&!Fe(u(this,fe)))throw new TypeError("maxSize must be a positive integer if specified");if(!Fe(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");A(this,x,In).call(this)}if(this.allowStale=!!s,this.noDeleteOnStaleGet=!!k,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!l,this.ttlResolution=Fe(i)||i===0?i:1,this.ttlAutopurge=!!a,this.ttl=n||0,this.ttl){if(!Fe(this.ttl))throw new TypeError("ttl must be a positive integer if specified");A(this,x,er).call(this)}if(u(this,be)===0&&this.ttl===0&&u(this,fe)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!u(this,be)&&!u(this,fe)){const G="LRU_CACHE_UNBOUNDED";Bo(G)&&(Tn.add(G),zn("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",G,mr))}}static unsafeExposeInternals(e){return{starts:u(e,Oe),ttls:u(e,de),sizes:u(e,Re),keyMap:u(e,Q),keyList:u(e,B),valList:u(e,F),next:u(e,oe),prev:u(e,he),get head(){return u(e,ie)},get tail(){return u(e,re)},free:u(e,Se),isBackgroundFetch:t=>{var n;return A(n=e,x,W).call(n,t)},backgroundFetch:(t,n,i,a)=>{var o;return A(o=e,x,At).call(o,t,n,i,a)},moveToTail:t=>{var n;return A(n=e,x,ct).call(n,t)},indexes:t=>{var n;return A(n=e,x,_e).call(n,t)},rindexes:t=>{var n;return A(n=e,x,Te).call(n,t)},isStale:t=>{var n;return u(n=e,me).call(n,t)}}}get max(){return u(this,be)}get maxSize(){return u(this,fe)}get calculatedSize(){return u(this,xe)}get size(){return u(this,ee)}get fetchMethod(){return u(this,Je)}get memoMethod(){return u(this,Qe)}get dispose(){return u(this,we)}get disposeAfter(){return u(this,Ce)}getRemainingTTL(e){return u(this,Q).has(e)?1/0:0}*entries(){for(const e of A(this,x,_e).call(this))u(this,F)[e]!==void 0&&u(this,B)[e]!==void 0&&!A(this,x,W).call(this,u(this,F)[e])&&(yield[u(this,B)[e],u(this,F)[e]])}*rentries(){for(const e of A(this,x,Te).call(this))u(this,F)[e]!==void 0&&u(this,B)[e]!==void 0&&!A(this,x,W).call(this,u(this,F)[e])&&(yield[u(this,B)[e],u(this,F)[e]])}*keys(){for(const e of A(this,x,_e).call(this)){const t=u(this,B)[e];t!==void 0&&!A(this,x,W).call(this,u(this,F)[e])&&(yield t)}}*rkeys(){for(const e of A(this,x,Te).call(this)){const t=u(this,B)[e];t!==void 0&&!A(this,x,W).call(this,u(this,F)[e])&&(yield t)}}*values(){for(const e of A(this,x,_e).call(this))u(this,F)[e]!==void 0&&!A(this,x,W).call(this,u(this,F)[e])&&(yield u(this,F)[e])}*rvalues(){for(const e of A(this,x,Te).call(this))u(this,F)[e]!==void 0&&!A(this,x,W).call(this,u(this,F)[e])&&(yield u(this,F)[e])}[(hn=Symbol.iterator,fn=Symbol.toStringTag,hn)](){return this.entries()}find(e,t={}){for(const n of A(this,x,_e).call(this)){const i=u(this,F)[n],a=A(this,x,W).call(this,i)?i.__staleWhileFetching:i;if(a!==void 0&&e(a,u(this,B)[n],this))return this.get(u(this,B)[n],t)}}forEach(e,t=this){for(const n of A(this,x,_e).call(this)){const i=u(this,F)[n],a=A(this,x,W).call(this,i)?i.__staleWhileFetching:i;a!==void 0&&e.call(t,a,u(this,B)[n],this)}}rforEach(e,t=this){for(const n of A(this,x,Te).call(this)){const i=u(this,F)[n],a=A(this,x,W).call(this,i)?i.__staleWhileFetching:i;a!==void 0&&e.call(t,a,u(this,B)[n],this)}}purgeStale(){let e=!1;for(const t of A(this,x,Te).call(this,{allowStale:!0}))u(this,me).call(this,t)&&(A(this,x,ze).call(this,u(this,B)[t],"expire"),e=!0);return e}info(e){const t=u(this,Q).get(e);if(t===void 0)return;const n=u(this,F)[t],i=A(this,x,W).call(this,n)?n.__staleWhileFetching:n;if(i===void 0)return;const a={value:i};if(u(this,de)&&u(this,Oe)){const o=u(this,de)[t],l=u(this,Oe)[t];if(o&&l){const s=o-(Ke.now()-l);a.ttl=s,a.start=Date.now()}}return u(this,Re)&&(a.size=u(this,Re)[t]),a}dump(){const e=[];for(const t of A(this,x,_e).call(this,{allowStale:!0})){const n=u(this,B)[t],i=u(this,F)[t],a=A(this,x,W).call(this,i)?i.__staleWhileFetching:i;if(a===void 0||n===void 0)continue;const o={value:a};if(u(this,de)&&u(this,Oe)){o.ttl=u(this,de)[t];const l=Ke.now()-u(this,Oe)[t];o.start=Math.floor(Date.now()-l)}u(this,Re)&&(o.size=u(this,Re)[t]),e.unshift([n,o])}return e}load(e){this.clear();for(const[t,n]of e){if(n.start){const i=Date.now()-n.start;n.start=Ke.now()-i}this.set(t,n.value,n)}}set(e,t,n={}){var m,v,p,y,g;if(t===void 0)return this.delete(e),this;const{ttl:i=this.ttl,start:a,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:s}=n;let{noUpdateTTL:c=this.noUpdateTTL}=n;const h=u(this,mt).call(this,e,t,n.size||0,l);if(this.maxEntrySize&&h>this.maxEntrySize)return s&&(s.set="miss",s.maxEntrySizeExceeded=!0),A(this,x,ze).call(this,e,"set"),this;let d=u(this,ee)===0?void 0:u(this,Q).get(e);if(d===void 0)d=u(this,ee)===0?u(this,re):u(this,Se).length!==0?u(this,Se).pop():u(this,ee)===u(this,be)?A(this,x,Ot).call(this,!1):u(this,ee),u(this,B)[d]=e,u(this,F)[d]=t,u(this,Q).set(e,d),u(this,oe)[u(this,re)]=d,u(this,he)[d]=u(this,re),j(this,re,d),Ct(this,ee)._++,u(this,et).call(this,d,h,s),s&&(s.set="add"),c=!1;else{A(this,x,ct).call(this,d);const C=u(this,F)[d];if(t!==C){if(u(this,De)&&A(this,x,W).call(this,C)){C.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:R}=C;R!==void 0&&!o&&(u(this,Ae)&&((m=u(this,we))==null||m.call(this,R,e,"set")),u(this,se)&&((v=u(this,ne))==null||v.push([R,e,"set"])))}else o||(u(this,Ae)&&((p=u(this,we))==null||p.call(this,C,e,"set")),u(this,se)&&((y=u(this,ne))==null||y.push([C,e,"set"])));if(u(this,Ge).call(this,d),u(this,et).call(this,d,h,s),u(this,F)[d]=t,s){s.set="replace";const R=C&&A(this,x,W).call(this,C)?C.__staleWhileFetching:C;R!==void 0&&(s.oldValue=R)}}else s&&(s.set="update")}if(i!==0&&!u(this,de)&&A(this,x,er).call(this),u(this,de)&&(c||u(this,dt).call(this,d,i,a),s&&u(this,ke).call(this,s,d)),!o&&u(this,se)&&u(this,ne)){const C=u(this,ne);let R;for(;R=C==null?void 0:C.shift();)(g=u(this,Ce))==null||g.call(this,...R)}return this}pop(){var e;try{for(;u(this,ee);){const t=u(this,F)[u(this,ie)];if(A(this,x,Ot).call(this,!0),A(this,x,W).call(this,t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(u(this,se)&&u(this,ne)){const t=u(this,ne);let n;for(;n=t==null?void 0:t.shift();)(e=u(this,Ce))==null||e.call(this,...n)}}}has(e,t={}){const{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=t,a=u(this,Q).get(e);if(a!==void 0){const o=u(this,F)[a];if(A(this,x,W).call(this,o)&&o.__staleWhileFetching===void 0)return!1;if(u(this,me).call(this,a))i&&(i.has="stale",u(this,ke).call(this,i,a));else return n&&u(this,Be).call(this,a),i&&(i.has="hit",u(this,ke).call(this,i,a)),!0}else i&&(i.has="miss");return!1}peek(e,t={}){const{allowStale:n=this.allowStale}=t,i=u(this,Q).get(e);if(i===void 0||!n&&u(this,me).call(this,i))return;const a=u(this,F)[i];return A(this,x,W).call(this,a)?a.__staleWhileFetching:a}async fetch(e,t={}){const{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:s=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:h=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:v=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:y,forceRefresh:g=!1,status:C,signal:R}=t;if(!u(this,De))return C&&(C.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:a,status:C});const k={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:a,ttl:o,noDisposeOnSet:l,size:s,sizeCalculation:c,noUpdateTTL:h,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:p,ignoreFetchAbort:v,status:C,signal:R};let P=u(this,Q).get(e);if(P===void 0){C&&(C.fetch="miss");const _=A(this,x,At).call(this,e,P,k,y);return _.__returned=_}else{const _=u(this,F)[P];if(A(this,x,W).call(this,_)){const Ie=n&&_.__staleWhileFetching!==void 0;return C&&(C.fetch="inflight",Ie&&(C.returnedStale=!0)),Ie?_.__staleWhileFetching:_.__returned=_}const D=u(this,me).call(this,P);if(!g&&!D)return C&&(C.fetch="hit"),A(this,x,ct).call(this,P),i&&u(this,Be).call(this,P),C&&u(this,ke).call(this,C,P),_;const V=A(this,x,At).call(this,e,P,k,y),H=V.__staleWhileFetching!==void 0&&n;return C&&(C.fetch=D?"stale":"refresh",H&&D&&(C.returnedStale=!0)),H?V.__staleWhileFetching:V.__returned=V}}async forceFetch(e,t={}){const n=await this.fetch(e,t);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,t={}){const n=u(this,Qe);if(!n)throw new Error("no memoMethod provided to constructor");const{context:i,forceRefresh:a,...o}=t,l=this.get(e,o);if(!a&&l!==void 0)return l;const s=n(e,l,{options:o,context:i});return this.set(e,s,o),s}get(e,t={}){const{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,status:o}=t,l=u(this,Q).get(e);if(l!==void 0){const s=u(this,F)[l],c=A(this,x,W).call(this,s);return o&&u(this,ke).call(this,o,l),u(this,me).call(this,l)?(o&&(o.get="stale"),c?(o&&n&&s.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?s.__staleWhileFetching:void 0):(a||A(this,x,ze).call(this,e,"expire"),o&&n&&(o.returnedStale=!0),n?s:void 0)):(o&&(o.get="hit"),c?s.__staleWhileFetching:(A(this,x,ct).call(this,l),i&&u(this,Be).call(this,l),s))}else o&&(o.get="miss")}delete(e){return A(this,x,ze).call(this,e,"delete")}clear(){return A(this,x,nr).call(this,"delete")}};be=new WeakMap,fe=new WeakMap,we=new WeakMap,Ce=new WeakMap,Je=new WeakMap,Qe=new WeakMap,ee=new WeakMap,xe=new WeakMap,Q=new WeakMap,B=new WeakMap,F=new WeakMap,oe=new WeakMap,he=new WeakMap,ie=new WeakMap,re=new WeakMap,Se=new WeakMap,ne=new WeakMap,Re=new WeakMap,Oe=new WeakMap,de=new WeakMap,Ae=new WeakMap,De=new WeakMap,se=new WeakMap,x=new WeakSet,er=function(){const e=new Rt(u(this,be)),t=new Rt(u(this,be));j(this,de,e),j(this,Oe,t),j(this,dt,(a,o,l=Ke.now())=>{if(t[a]=o!==0?l:0,e[a]=o,o!==0&&this.ttlAutopurge){const s=setTimeout(()=>{u(this,me).call(this,a)&&A(this,x,ze).call(this,u(this,B)[a],"expire")},o+1);s.unref&&s.unref()}}),j(this,Be,a=>{t[a]=e[a]!==0?Ke.now():0}),j(this,ke,(a,o)=>{if(e[o]){const l=e[o],s=t[o];if(!l||!s)return;a.ttl=l,a.start=s,a.now=n||i();const c=a.now-s;a.remainingTTL=l-c}});let n=0;const i=()=>{const a=Ke.now();if(this.ttlResolution>0){n=a;const o=setTimeout(()=>n=0,this.ttlResolution);o.unref&&o.unref()}return a};this.getRemainingTTL=a=>{const o=u(this,Q).get(a);if(o===void 0)return 0;const l=e[o],s=t[o];if(!l||!s)return 1/0;const c=(n||i())-s;return l-c},j(this,me,a=>{const o=t[a],l=e[a];return!!l&&!!o&&(n||i())-o>l})},Be=new WeakMap,ke=new WeakMap,dt=new WeakMap,me=new WeakMap,In=function(){const e=new Rt(u(this,be));j(this,xe,0),j(this,Re,e),j(this,Ge,t=>{j(this,xe,u(this,xe)-e[t]),e[t]=0}),j(this,mt,(t,n,i,a)=>{if(A(this,x,W).call(this,n))return 0;if(!Fe(i))if(a){if(typeof a!="function")throw new TypeError("sizeCalculation must be a function");if(i=a(n,t),!Fe(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i}),j(this,et,(t,n,i)=>{if(e[t]=n,u(this,fe)){const a=u(this,fe)-e[t];for(;u(this,xe)>a;)A(this,x,Ot).call(this,!0)}j(this,xe,u(this,xe)+e[t]),i&&(i.entrySize=n,i.totalCalculatedSize=u(this,xe))})},Ge=new WeakMap,et=new WeakMap,mt=new WeakMap,_e=function*({allowStale:e=this.allowStale}={}){if(u(this,ee))for(let t=u(this,re);!(!A(this,x,tr).call(this,t)||((e||!u(this,me).call(this,t))&&(yield t),t===u(this,ie)));)t=u(this,he)[t]},Te=function*({allowStale:e=this.allowStale}={}){if(u(this,ee))for(let t=u(this,ie);!(!A(this,x,tr).call(this,t)||((e||!u(this,me).call(this,t))&&(yield t),t===u(this,re)));)t=u(this,oe)[t]},tr=function(e){return e!==void 0&&u(this,Q).get(u(this,B)[e])===e},Ot=function(e){var a,o;const t=u(this,ie),n=u(this,B)[t],i=u(this,F)[t];return u(this,De)&&A(this,x,W).call(this,i)?i.__abortController.abort(new Error("evicted")):(u(this,Ae)||u(this,se))&&(u(this,Ae)&&((a=u(this,we))==null||a.call(this,i,n,"evict")),u(this,se)&&((o=u(this,ne))==null||o.push([i,n,"evict"]))),u(this,Ge).call(this,t),e&&(u(this,B)[t]=void 0,u(this,F)[t]=void 0,u(this,Se).push(t)),u(this,ee)===1?(j(this,ie,j(this,re,0)),u(this,Se).length=0):j(this,ie,u(this,oe)[t]),u(this,Q).delete(n),Ct(this,ee)._--,t},At=function(e,t,n,i){const a=t===void 0?void 0:u(this,F)[t];if(A(this,x,W).call(this,a))return a;const o=new Pt,{signal:l}=n;l==null||l.addEventListener("abort",()=>o.abort(l.reason),{signal:o.signal});const s={signal:o.signal,options:n,context:i},c=(y,g=!1)=>{const{aborted:C}=o.signal,R=n.ignoreFetchAbort&&y!==void 0;if(n.status&&(C&&!g?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,R&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),C&&!R&&!g)return d(o.signal.reason);const k=v;return u(this,F)[t]===v&&(y===void 0?k.__staleWhileFetching?u(this,F)[t]=k.__staleWhileFetching:A(this,x,ze).call(this,e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,y,s.options))),y},h=y=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=y),d(y)),d=y=>{const{aborted:g}=o.signal,C=g&&n.allowStaleOnFetchAbort,R=C||n.allowStaleOnFetchRejection,k=R||n.noDeleteOnFetchRejection,P=v;if(u(this,F)[t]===v&&(!k||P.__staleWhileFetching===void 0?A(this,x,ze).call(this,e,"fetch"):C||(u(this,F)[t]=P.__staleWhileFetching)),R)return n.status&&P.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),P.__staleWhileFetching;if(P.__returned===P)throw y},m=(y,g)=>{var R;const C=(R=u(this,Je))==null?void 0:R.call(this,e,a,s);C&&C instanceof Promise&&C.then(k=>y(k===void 0?void 0:k),g),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(y(void 0),n.allowStaleOnFetchAbort&&(y=k=>c(k,!0)))})};n.status&&(n.status.fetchDispatched=!0);const v=new Promise(m).then(c,h),p=Object.assign(v,{__abortController:o,__staleWhileFetching:a,__returned:void 0});return t===void 0?(this.set(e,p,{...s.options,status:void 0}),t=u(this,Q).get(e)):u(this,F)[t]=p,p},W=function(e){if(!u(this,De))return!1;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Pt},rr=function(e,t){u(this,he)[t]=e,u(this,oe)[e]=t},ct=function(e){e!==u(this,re)&&(e===u(this,ie)?j(this,ie,u(this,oe)[e]):A(this,x,rr).call(this,u(this,he)[e],u(this,oe)[e]),A(this,x,rr).call(this,u(this,re),e),j(this,re,e))},ze=function(e,t){var i,a,o,l;let n=!1;if(u(this,ee)!==0){const s=u(this,Q).get(e);if(s!==void 0)if(n=!0,u(this,ee)===1)A(this,x,nr).call(this,t);else{u(this,Ge).call(this,s);const c=u(this,F)[s];if(A(this,x,W).call(this,c)?c.__abortController.abort(new Error("deleted")):(u(this,Ae)||u(this,se))&&(u(this,Ae)&&((i=u(this,we))==null||i.call(this,c,e,t)),u(this,se)&&((a=u(this,ne))==null||a.push([c,e,t]))),u(this,Q).delete(e),u(this,B)[s]=void 0,u(this,F)[s]=void 0,s===u(this,re))j(this,re,u(this,he)[s]);else if(s===u(this,ie))j(this,ie,u(this,oe)[s]);else{const h=u(this,he)[s];u(this,oe)[h]=u(this,oe)[s];const d=u(this,oe)[s];u(this,he)[d]=u(this,he)[s]}Ct(this,ee)._--,u(this,Se).push(s)}}if(u(this,se)&&((o=u(this,ne))!=null&&o.length)){const s=u(this,ne);let c;for(;c=s==null?void 0:s.shift();)(l=u(this,Ce))==null||l.call(this,...c)}return n},nr=function(e){var t,n,i;for(const a of A(this,x,Te).call(this,{allowStale:!0})){const o=u(this,F)[a];if(A(this,x,W).call(this,o))o.__abortController.abort(new Error("deleted"));else{const l=u(this,B)[a];u(this,Ae)&&((t=u(this,we))==null||t.call(this,o,l,e)),u(this,se)&&((n=u(this,ne))==null||n.push([o,l,e]))}}if(u(this,Q).clear(),u(this,F).fill(void 0),u(this,B).fill(void 0),u(this,de)&&u(this,Oe)&&(u(this,de).fill(0),u(this,Oe).fill(0)),u(this,Re)&&u(this,Re).fill(0),j(this,ie,0),j(this,re,0),u(this,Se).length=0,j(this,xe,0),j(this,ee,0),u(this,se)&&u(this,ne)){const a=u(this,ne);let o;for(;o=a==null?void 0:a.shift();)(i=u(this,Ce))==null||i.call(this,...o)}};let Qt=mr;var Go=function(e){return qo(e)&&!$o(e)};function qo(r){return!!r&&typeof r=="object"}function $o(r){var e=Object.prototype.toString.call(r);return e==="[object RegExp]"||e==="[object Date]"||Yo(r)}var Vo=typeof Symbol=="function"&&Symbol.for,Ho=Vo?Symbol.for("react.element"):60103;function Yo(r){return r.$$typeof===Ho}function Ko(r){return Array.isArray(r)?[]:{}}function ht(r,e){return e.clone!==!1&&e.isMergeableObject(r)?tt(Ko(r),r,e):r}function Xo(r,e,t){return r.concat(e).map(function(n){return ht(n,t)})}function Zo(r,e){if(!e.customMerge)return tt;var t=e.customMerge(r);return typeof t=="function"?t:tt}function Jo(r){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(r).filter(function(e){return Object.propertyIsEnumerable.call(r,e)}):[]}function nn(r){return Object.keys(r).concat(Jo(r))}function Nn(r,e){try{return e in r}catch{return!1}}function Qo(r,e){return Nn(r,e)&&!(Object.hasOwnProperty.call(r,e)&&Object.propertyIsEnumerable.call(r,e))}function es(r,e,t){var n={};return t.isMergeableObject(r)&&nn(r).forEach(function(i){n[i]=ht(r[i],t)}),nn(e).forEach(function(i){Qo(r,i)||(Nn(r,i)&&t.isMergeableObject(e[i])?n[i]=Zo(i,t)(r[i],e[i],t):n[i]=ht(e[i],t))}),n}function tt(r,e,t){t=t||{},t.arrayMerge=t.arrayMerge||Xo,t.isMergeableObject=t.isMergeableObject||Go,t.cloneUnlessOtherwiseSpecified=ht;var n=Array.isArray(e),i=Array.isArray(r),a=n===i;return a?n?t.arrayMerge(r,e,t):es(r,e,t):ht(e,t)}tt.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(n,i){return tt(n,i,t)},{})};var ts=tt,rs=ts;const ns=dn(rs);var an=new Set,on=[],Vt=[],is={appendCss:r=>{Vt.push(r)},registerClassName:r=>{an.add(r)},registerComposition:r=>{on.push(r)},markCompositionUsed:()=>{},onEndFileScope:r=>{var e=No({localClassNames:Array.from(an),composedClassLists:on,cssObjs:Vt}).join(`
78
- `);Ma({fileScope:r,css:e}),Vt=[]},getIdentOption:()=>process.env.NODE_ENV==="production"?"short":"debug"};Wa(is);var sn=(r,e)=>{for(var t=e-1;t>=0;){if(r[t]==="/")return t;t--}return-1},as=r=>{var e,t=r.lastIndexOf(".css");if(t===-1)return"";var n=sn(r,t);if(e=r.slice(n+1,t),n===-1)return e;var i=sn(r,n-1),a=r.slice(i+1,n),o=e!=="index"?e:a;return o},os=()=>{var r=new Qt({max:500});return e=>{var t=r.get(e);if(t)return t;var n=as(e);return r.set(e,n),n}},ss=os();function ls(r){var{debugId:e,debugFileName:t}=r,n=e?[e.replace(/\s/g,"_")]:[];if(t){var{filePath:i}=Me(),a=ss(i);a&&n.unshift(a)}return n.join("_")}function ln(r){return r.match(/^[0-9]/)?"_".concat(r):r}function hr(r){var e=qa(),{debugId:t,debugFileName:n=!0}=qe(qe({},null),null),i=Wo().toString(36),{filePath:a,packageName:o}=Me(),l=Uo(o?"".concat(o).concat(a):a),s="".concat(l).concat(i);if(e==="debug"){var c=ls({debugId:t,debugFileName:n});return c&&(s="".concat(c,"__").concat(s)),ln(s)}if(typeof e=="function"){if(s=e({hash:s,debugId:t,filePath:a,packageName:o}),!s.match(/^[A-Z_][0-9A-Z_-]+$/i))throw new Error('Identifier function returned invalid indentifier: "'.concat(s,'"'));return s}return ln(s)}function us(r,e){var t=hr();En(t,Me());var n=[],i=[];for(var a of r)typeof a=="string"?n.push(a):i.push(a);var o=t;if(n.length>0&&(o="".concat(t," ").concat(Oo(n)),Ga({identifier:t,classList:o},Me()),i.length>0&&jn(t)),i.length>0){var l=ns.all(i,{arrayMerge:(s,c)=>c});Ft({type:"local",selector:t,rule:l},Me())}return o}function Z(r,e){if(Array.isArray(r))return us(r);var t=hr();return En(t,Me()),Ft({type:"local",selector:t,rule:r},Me()),t}function cs(r,e){Ft({type:"global",selector:r,rule:e},Me())}function fs(r,e){var t=lr(hr(),{isIdentifier:!0});return Ft({type:"keyframes",name:t,rule:r},Me()),t}const Un=Z({display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center"}),Ln=Z([Un,{width:"5rem",height:"5rem",cursor:"pointer",transition:"all 0.3s ease-in",boxShadow:"0 0 0.5rem rgba(0, 0, 0, 0.5)",backgroundColor:"rgba(0, 0, 0, 0.5)",color:"white",selectors:{"&:hover":{boxShadow:"0 0 1rem rgba(0, 0, 0, 0.5)"}}}]),dr={width:"18rem",height:"18rem","@media":{"screen and (max-width: 1024px)":{width:"17rem",height:"17rem"},"screen and (max-width: 768px)":{width:"16rem",height:"16rem"}}},Wn=Z({display:"grid",alignItems:"center",justifyContent:"center",gridTemplateColumns:"repeat(3, 1fr)",gridTemplateRows:"repeat(3, 1fr)"}),hs=Z([Ln,{position:"relative",fontSize:"1rem",margin:"0.5rem",borderRadius:"50%",selectors:{"&::after":{content:'""',position:"absolute",width:"4rem",height:"4rem",borderRadius:"50%",background:"rgba(0, 0, 0, 0.2)",zIndex:1e5}}}]),ds=Z({background:"radial-gradient(circle at center, rgba(245, 177, 97, 1) 0.4%, rgba(236, 54, 110, 1) 100.2%)",boxShadow:"0 0 1rem rgba(245, 177, 97, 1)",color:"black",transition:"all 0.3s ease-in",borderRadius:"50%",selectors:{"&:hover":{boxShadow:"0 0 2rem rgba(245, 177, 97, 1)"}}});cs(`${Wn} *`,{WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"});function ms({value:r,name:e,gamePadButtonStyle:t}){const[n,i]=w.useState(!1),{pushKey:a}=On(),o=()=>{a(r,!0),i(!0)},l=()=>{a(r,!1),i(!1)};return S.jsx("button",{className:`${hs} ${n?ds:""}`,onMouseDown:o,onMouseUp:l,onMouseLeave:l,onContextMenu:s=>{s.preventDefault(),l()},onPointerDown:o,onPointerUp:l,style:t,children:e})}function ps(r){const{gamePadStyle:e,gamePadButtonStyle:t,label:n}=r,{control:i,mode:a}=w.useContext($),o=Object.keys(i).map(l=>{const s=(n==null?void 0:n[l])||l;if(l!=="forward"&&l!=="backward"&&l!=="leftward"&&l!=="rightward")return{tag:l,value:l,name:s}}).filter(l=>l!==void 0).filter(l=>l.tag!=="run");return S.jsx(S.Fragment,{children:a.controller==="clicker"&&S.jsx("div",{className:Wn,style:e,children:o.map((l,s)=>S.jsx(ms,{value:l.value,name:l.name,gamePadButtonStyle:t},s))})})}const vs=fs({"0%":{boxShadow:"0 0 0 0 rgba(255, 255, 255, 0.7)",opacity:1},"70%":{boxShadow:"0 0 0 10px rgba(255, 255, 255, 0)",opacity:.7},"100%":{boxShadow:"0 0 0 0 rgba(255, 255, 255, 0)",opacity:1}}),gs=Z([{margin:"1rem",borderRadius:"50%",background:"rgba(0, 0, 0, 0.6)",boxShadow:"0 0 10px rgba(0, 0, 0, 0.5)",backdropFilter:"blur(1rem)",WebkitBackdropFilter:"blur(1rem)",border:"4px solid rgba(0, 0, 0, 0.5)",overflow:"hidden"},dr]),ys=Z([Un,{position:"absolute",textAlign:"center",overflow:"hidden"},dr]),bs=Z([{position:"relative",display:"flex",top:"50%",left:"50%",transformOrigin:"50% 50%",borderRadius:"50%",overflow:"hidden"},dr]),ws=Z([{position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"2rem",height:"2rem",borderRadius:"50%",background:"rgba(5, 222, 250, 1)",boxShadow:"0 0 10px rgba(5, 222, 250, 1)",border:"2px solid transparent",objectFit:"cover",zIndex:100,animation:`${vs} 2s infinite`}]),un=Z([{position:"relative",display:"flex",justifyContent:"center",alignItems:"center",width:"2rem",height:"2rem",borderRadius:"50%",background:"rgba(0, 0, 0, 0.5)",boxShadow:"0 0 5px rgba(0, 0, 0, 0.5)",transition:"all 0.5s ease-in",cursor:"pointer",border:"2px solid transparent",selectors:{"&:hover":{boxShadow:"0 0 10px rgba(0, 0, 0, 0.5)"}}}]),Cs=Z([{position:"absolute",width:"13rem",bottom:"-5rem",left:"50%",transform:"translateX(-50%)",display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:"1.2rem",color:"white",textShadow:"0 0 10px black",padding:"0.5rem",borderRadius:"0.5rem",boxShadow:"0 0 10px black",background:"rgba(0, 0, 0, 0.5)",zIndex:3,WebkitBackdropFilter:"blur(2rem)",backdropFilter:"blur(2rem)",fontFamily:'"Open Sans", sans-serif',fontWeight:300}]),xs=Z({position:"relative",fontSize:"1rem",color:"black",padding:"0.5rem",borderRadius:"0.5rem",background:"rgba(255, 255, 255, 0.5)",boxShadow:"0 0 10px rgba(255, 255, 255, 0.5)",zIndex:3}),Ss=Z({position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",borderRadius:"2px",background:"rgba(0, 0, 0, 0.3)"}),Rs=Z({position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",background:`
77
+ `]))));return tn[0]}function Wo(){return Lo++}const Ke=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Tn=new Set,Zt=typeof process=="object"&&process?process:{},zn=(r,e,t,n)=>{typeof Zt.emitWarning=="function"?Zt.emitWarning(r,e,t,n):console.error(`[${t}] ${e}: ${r}`)};let Pt=globalThis.AbortController,rn=globalThis.AbortSignal;var cn;if(typeof Pt>"u"){rn=class{constructor(){$(this,"onabort");$(this,"_onabort",[]);$(this,"reason");$(this,"aborted",!1)}addEventListener(n,i){this._onabort.push(i)}},Pt=class{constructor(){$(this,"signal",new rn);e()}abort(n){var i,a;if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(const o of this.signal._onabort)o(n);(a=(i=this.signal).onabort)==null||a.call(i,n)}}};let r=((cn=Zt.env)==null?void 0:cn.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{r&&(r=!1,zn("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}const Go=r=>!Tn.has(r),Fe=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),Dn=r=>Fe(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?Rt:null:null;class Rt extends Array{constructor(e){super(e),this.fill(0)}}var Ze;const We=class We{constructor(e,t){$(this,"heap");$(this,"length");if(!u(We,Ze))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}static create(e){const t=Dn(e);if(!t)return[];j(We,Ze,!0);const n=new We(e,t);return j(We,Ze,!1),n}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};Ze=new WeakMap,I(We,Ze,!1);let Jt=We;var fn,hn,be,fe,we,Ce,Je,Qe,ee,xe,Q,G,F,oe,he,ie,re,Se,ne,Re,Oe,de,Ae,De,se,x,er,Ge,ke,dt,me,In,Be,et,mt,_e,Te,tr,Ot,At,W,rr,ct,ze,nr;const mr=class mr{constructor(e){I(this,x);I(this,be);I(this,fe);I(this,we);I(this,Ce);I(this,Je);I(this,Qe);$(this,"ttl");$(this,"ttlResolution");$(this,"ttlAutopurge");$(this,"updateAgeOnGet");$(this,"updateAgeOnHas");$(this,"allowStale");$(this,"noDisposeOnSet");$(this,"noUpdateTTL");$(this,"maxEntrySize");$(this,"sizeCalculation");$(this,"noDeleteOnFetchRejection");$(this,"noDeleteOnStaleGet");$(this,"allowStaleOnFetchAbort");$(this,"allowStaleOnFetchRejection");$(this,"ignoreFetchAbort");I(this,ee);I(this,xe);I(this,Q);I(this,G);I(this,F);I(this,oe);I(this,he);I(this,ie);I(this,re);I(this,Se);I(this,ne);I(this,Re);I(this,Oe);I(this,de);I(this,Ae);I(this,De);I(this,se);I(this,Ge,()=>{});I(this,ke,()=>{});I(this,dt,()=>{});I(this,me,()=>!1);I(this,Be,e=>{});I(this,et,(e,t,n)=>{});I(this,mt,(e,t,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});$(this,fn,"LRUCache");const{max:t=0,ttl:n,ttlResolution:i=1,ttlAutopurge:a,updateAgeOnGet:o,updateAgeOnHas:l,allowStale:s,dispose:c,disposeAfter:h,noDisposeOnSet:d,noUpdateTTL:m,maxSize:v=0,maxEntrySize:p=0,sizeCalculation:y,fetchMethod:g,memoMethod:C,noDeleteOnFetchRejection:R,noDeleteOnStaleGet:k,allowStaleOnFetchRejection:P,allowStaleOnFetchAbort:_,ignoreFetchAbort:D}=e;if(t!==0&&!Fe(t))throw new TypeError("max option must be a nonnegative integer");const V=t?Dn(t):Array;if(!V)throw new Error("invalid max value: "+t);if(j(this,be,t),j(this,fe,v),this.maxEntrySize=p||u(this,fe),this.sizeCalculation=y,this.sizeCalculation){if(!u(this,fe)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(C!==void 0&&typeof C!="function")throw new TypeError("memoMethod must be a function if defined");if(j(this,Qe,C),g!==void 0&&typeof g!="function")throw new TypeError("fetchMethod must be a function if specified");if(j(this,Je,g),j(this,De,!!g),j(this,Q,new Map),j(this,G,new Array(t).fill(void 0)),j(this,F,new Array(t).fill(void 0)),j(this,oe,new V(t)),j(this,he,new V(t)),j(this,ie,0),j(this,re,0),j(this,Se,Jt.create(t)),j(this,ee,0),j(this,xe,0),typeof c=="function"&&j(this,we,c),typeof h=="function"?(j(this,Ce,h),j(this,ne,[])):(j(this,Ce,void 0),j(this,ne,void 0)),j(this,Ae,!!u(this,we)),j(this,se,!!u(this,Ce)),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!R,this.allowStaleOnFetchRejection=!!P,this.allowStaleOnFetchAbort=!!_,this.ignoreFetchAbort=!!D,this.maxEntrySize!==0){if(u(this,fe)!==0&&!Fe(u(this,fe)))throw new TypeError("maxSize must be a positive integer if specified");if(!Fe(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");A(this,x,In).call(this)}if(this.allowStale=!!s,this.noDeleteOnStaleGet=!!k,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!l,this.ttlResolution=Fe(i)||i===0?i:1,this.ttlAutopurge=!!a,this.ttl=n||0,this.ttl){if(!Fe(this.ttl))throw new TypeError("ttl must be a positive integer if specified");A(this,x,er).call(this)}if(u(this,be)===0&&this.ttl===0&&u(this,fe)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!u(this,be)&&!u(this,fe)){const q="LRU_CACHE_UNBOUNDED";Go(q)&&(Tn.add(q),zn("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",q,mr))}}static unsafeExposeInternals(e){return{starts:u(e,Oe),ttls:u(e,de),sizes:u(e,Re),keyMap:u(e,Q),keyList:u(e,G),valList:u(e,F),next:u(e,oe),prev:u(e,he),get head(){return u(e,ie)},get tail(){return u(e,re)},free:u(e,Se),isBackgroundFetch:t=>{var n;return A(n=e,x,W).call(n,t)},backgroundFetch:(t,n,i,a)=>{var o;return A(o=e,x,At).call(o,t,n,i,a)},moveToTail:t=>{var n;return A(n=e,x,ct).call(n,t)},indexes:t=>{var n;return A(n=e,x,_e).call(n,t)},rindexes:t=>{var n;return A(n=e,x,Te).call(n,t)},isStale:t=>{var n;return u(n=e,me).call(n,t)}}}get max(){return u(this,be)}get maxSize(){return u(this,fe)}get calculatedSize(){return u(this,xe)}get size(){return u(this,ee)}get fetchMethod(){return u(this,Je)}get memoMethod(){return u(this,Qe)}get dispose(){return u(this,we)}get disposeAfter(){return u(this,Ce)}getRemainingTTL(e){return u(this,Q).has(e)?1/0:0}*entries(){for(const e of A(this,x,_e).call(this))u(this,F)[e]!==void 0&&u(this,G)[e]!==void 0&&!A(this,x,W).call(this,u(this,F)[e])&&(yield[u(this,G)[e],u(this,F)[e]])}*rentries(){for(const e of A(this,x,Te).call(this))u(this,F)[e]!==void 0&&u(this,G)[e]!==void 0&&!A(this,x,W).call(this,u(this,F)[e])&&(yield[u(this,G)[e],u(this,F)[e]])}*keys(){for(const e of A(this,x,_e).call(this)){const t=u(this,G)[e];t!==void 0&&!A(this,x,W).call(this,u(this,F)[e])&&(yield t)}}*rkeys(){for(const e of A(this,x,Te).call(this)){const t=u(this,G)[e];t!==void 0&&!A(this,x,W).call(this,u(this,F)[e])&&(yield t)}}*values(){for(const e of A(this,x,_e).call(this))u(this,F)[e]!==void 0&&!A(this,x,W).call(this,u(this,F)[e])&&(yield u(this,F)[e])}*rvalues(){for(const e of A(this,x,Te).call(this))u(this,F)[e]!==void 0&&!A(this,x,W).call(this,u(this,F)[e])&&(yield u(this,F)[e])}[(hn=Symbol.iterator,fn=Symbol.toStringTag,hn)](){return this.entries()}find(e,t={}){for(const n of A(this,x,_e).call(this)){const i=u(this,F)[n],a=A(this,x,W).call(this,i)?i.__staleWhileFetching:i;if(a!==void 0&&e(a,u(this,G)[n],this))return this.get(u(this,G)[n],t)}}forEach(e,t=this){for(const n of A(this,x,_e).call(this)){const i=u(this,F)[n],a=A(this,x,W).call(this,i)?i.__staleWhileFetching:i;a!==void 0&&e.call(t,a,u(this,G)[n],this)}}rforEach(e,t=this){for(const n of A(this,x,Te).call(this)){const i=u(this,F)[n],a=A(this,x,W).call(this,i)?i.__staleWhileFetching:i;a!==void 0&&e.call(t,a,u(this,G)[n],this)}}purgeStale(){let e=!1;for(const t of A(this,x,Te).call(this,{allowStale:!0}))u(this,me).call(this,t)&&(A(this,x,ze).call(this,u(this,G)[t],"expire"),e=!0);return e}info(e){const t=u(this,Q).get(e);if(t===void 0)return;const n=u(this,F)[t],i=A(this,x,W).call(this,n)?n.__staleWhileFetching:n;if(i===void 0)return;const a={value:i};if(u(this,de)&&u(this,Oe)){const o=u(this,de)[t],l=u(this,Oe)[t];if(o&&l){const s=o-(Ke.now()-l);a.ttl=s,a.start=Date.now()}}return u(this,Re)&&(a.size=u(this,Re)[t]),a}dump(){const e=[];for(const t of A(this,x,_e).call(this,{allowStale:!0})){const n=u(this,G)[t],i=u(this,F)[t],a=A(this,x,W).call(this,i)?i.__staleWhileFetching:i;if(a===void 0||n===void 0)continue;const o={value:a};if(u(this,de)&&u(this,Oe)){o.ttl=u(this,de)[t];const l=Ke.now()-u(this,Oe)[t];o.start=Math.floor(Date.now()-l)}u(this,Re)&&(o.size=u(this,Re)[t]),e.unshift([n,o])}return e}load(e){this.clear();for(const[t,n]of e){if(n.start){const i=Date.now()-n.start;n.start=Ke.now()-i}this.set(t,n.value,n)}}set(e,t,n={}){var m,v,p,y,g;if(t===void 0)return this.delete(e),this;const{ttl:i=this.ttl,start:a,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:s}=n;let{noUpdateTTL:c=this.noUpdateTTL}=n;const h=u(this,mt).call(this,e,t,n.size||0,l);if(this.maxEntrySize&&h>this.maxEntrySize)return s&&(s.set="miss",s.maxEntrySizeExceeded=!0),A(this,x,ze).call(this,e,"set"),this;let d=u(this,ee)===0?void 0:u(this,Q).get(e);if(d===void 0)d=u(this,ee)===0?u(this,re):u(this,Se).length!==0?u(this,Se).pop():u(this,ee)===u(this,be)?A(this,x,Ot).call(this,!1):u(this,ee),u(this,G)[d]=e,u(this,F)[d]=t,u(this,Q).set(e,d),u(this,oe)[u(this,re)]=d,u(this,he)[d]=u(this,re),j(this,re,d),Ct(this,ee)._++,u(this,et).call(this,d,h,s),s&&(s.set="add"),c=!1;else{A(this,x,ct).call(this,d);const C=u(this,F)[d];if(t!==C){if(u(this,De)&&A(this,x,W).call(this,C)){C.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:R}=C;R!==void 0&&!o&&(u(this,Ae)&&((m=u(this,we))==null||m.call(this,R,e,"set")),u(this,se)&&((v=u(this,ne))==null||v.push([R,e,"set"])))}else o||(u(this,Ae)&&((p=u(this,we))==null||p.call(this,C,e,"set")),u(this,se)&&((y=u(this,ne))==null||y.push([C,e,"set"])));if(u(this,Be).call(this,d),u(this,et).call(this,d,h,s),u(this,F)[d]=t,s){s.set="replace";const R=C&&A(this,x,W).call(this,C)?C.__staleWhileFetching:C;R!==void 0&&(s.oldValue=R)}}else s&&(s.set="update")}if(i!==0&&!u(this,de)&&A(this,x,er).call(this),u(this,de)&&(c||u(this,dt).call(this,d,i,a),s&&u(this,ke).call(this,s,d)),!o&&u(this,se)&&u(this,ne)){const C=u(this,ne);let R;for(;R=C==null?void 0:C.shift();)(g=u(this,Ce))==null||g.call(this,...R)}return this}pop(){var e;try{for(;u(this,ee);){const t=u(this,F)[u(this,ie)];if(A(this,x,Ot).call(this,!0),A(this,x,W).call(this,t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(u(this,se)&&u(this,ne)){const t=u(this,ne);let n;for(;n=t==null?void 0:t.shift();)(e=u(this,Ce))==null||e.call(this,...n)}}}has(e,t={}){const{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=t,a=u(this,Q).get(e);if(a!==void 0){const o=u(this,F)[a];if(A(this,x,W).call(this,o)&&o.__staleWhileFetching===void 0)return!1;if(u(this,me).call(this,a))i&&(i.has="stale",u(this,ke).call(this,i,a));else return n&&u(this,Ge).call(this,a),i&&(i.has="hit",u(this,ke).call(this,i,a)),!0}else i&&(i.has="miss");return!1}peek(e,t={}){const{allowStale:n=this.allowStale}=t,i=u(this,Q).get(e);if(i===void 0||!n&&u(this,me).call(this,i))return;const a=u(this,F)[i];return A(this,x,W).call(this,a)?a.__staleWhileFetching:a}async fetch(e,t={}){const{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:s=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:h=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:v=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:y,forceRefresh:g=!1,status:C,signal:R}=t;if(!u(this,De))return C&&(C.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:a,status:C});const k={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:a,ttl:o,noDisposeOnSet:l,size:s,sizeCalculation:c,noUpdateTTL:h,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:p,ignoreFetchAbort:v,status:C,signal:R};let P=u(this,Q).get(e);if(P===void 0){C&&(C.fetch="miss");const _=A(this,x,At).call(this,e,P,k,y);return _.__returned=_}else{const _=u(this,F)[P];if(A(this,x,W).call(this,_)){const Ie=n&&_.__staleWhileFetching!==void 0;return C&&(C.fetch="inflight",Ie&&(C.returnedStale=!0)),Ie?_.__staleWhileFetching:_.__returned=_}const D=u(this,me).call(this,P);if(!g&&!D)return C&&(C.fetch="hit"),A(this,x,ct).call(this,P),i&&u(this,Ge).call(this,P),C&&u(this,ke).call(this,C,P),_;const V=A(this,x,At).call(this,e,P,k,y),H=V.__staleWhileFetching!==void 0&&n;return C&&(C.fetch=D?"stale":"refresh",H&&D&&(C.returnedStale=!0)),H?V.__staleWhileFetching:V.__returned=V}}async forceFetch(e,t={}){const n=await this.fetch(e,t);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,t={}){const n=u(this,Qe);if(!n)throw new Error("no memoMethod provided to constructor");const{context:i,forceRefresh:a,...o}=t,l=this.get(e,o);if(!a&&l!==void 0)return l;const s=n(e,l,{options:o,context:i});return this.set(e,s,o),s}get(e,t={}){const{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,status:o}=t,l=u(this,Q).get(e);if(l!==void 0){const s=u(this,F)[l],c=A(this,x,W).call(this,s);return o&&u(this,ke).call(this,o,l),u(this,me).call(this,l)?(o&&(o.get="stale"),c?(o&&n&&s.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?s.__staleWhileFetching:void 0):(a||A(this,x,ze).call(this,e,"expire"),o&&n&&(o.returnedStale=!0),n?s:void 0)):(o&&(o.get="hit"),c?s.__staleWhileFetching:(A(this,x,ct).call(this,l),i&&u(this,Ge).call(this,l),s))}else o&&(o.get="miss")}delete(e){return A(this,x,ze).call(this,e,"delete")}clear(){return A(this,x,nr).call(this,"delete")}};be=new WeakMap,fe=new WeakMap,we=new WeakMap,Ce=new WeakMap,Je=new WeakMap,Qe=new WeakMap,ee=new WeakMap,xe=new WeakMap,Q=new WeakMap,G=new WeakMap,F=new WeakMap,oe=new WeakMap,he=new WeakMap,ie=new WeakMap,re=new WeakMap,Se=new WeakMap,ne=new WeakMap,Re=new WeakMap,Oe=new WeakMap,de=new WeakMap,Ae=new WeakMap,De=new WeakMap,se=new WeakMap,x=new WeakSet,er=function(){const e=new Rt(u(this,be)),t=new Rt(u(this,be));j(this,de,e),j(this,Oe,t),j(this,dt,(a,o,l=Ke.now())=>{if(t[a]=o!==0?l:0,e[a]=o,o!==0&&this.ttlAutopurge){const s=setTimeout(()=>{u(this,me).call(this,a)&&A(this,x,ze).call(this,u(this,G)[a],"expire")},o+1);s.unref&&s.unref()}}),j(this,Ge,a=>{t[a]=e[a]!==0?Ke.now():0}),j(this,ke,(a,o)=>{if(e[o]){const l=e[o],s=t[o];if(!l||!s)return;a.ttl=l,a.start=s,a.now=n||i();const c=a.now-s;a.remainingTTL=l-c}});let n=0;const i=()=>{const a=Ke.now();if(this.ttlResolution>0){n=a;const o=setTimeout(()=>n=0,this.ttlResolution);o.unref&&o.unref()}return a};this.getRemainingTTL=a=>{const o=u(this,Q).get(a);if(o===void 0)return 0;const l=e[o],s=t[o];if(!l||!s)return 1/0;const c=(n||i())-s;return l-c},j(this,me,a=>{const o=t[a],l=e[a];return!!l&&!!o&&(n||i())-o>l})},Ge=new WeakMap,ke=new WeakMap,dt=new WeakMap,me=new WeakMap,In=function(){const e=new Rt(u(this,be));j(this,xe,0),j(this,Re,e),j(this,Be,t=>{j(this,xe,u(this,xe)-e[t]),e[t]=0}),j(this,mt,(t,n,i,a)=>{if(A(this,x,W).call(this,n))return 0;if(!Fe(i))if(a){if(typeof a!="function")throw new TypeError("sizeCalculation must be a function");if(i=a(n,t),!Fe(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i}),j(this,et,(t,n,i)=>{if(e[t]=n,u(this,fe)){const a=u(this,fe)-e[t];for(;u(this,xe)>a;)A(this,x,Ot).call(this,!0)}j(this,xe,u(this,xe)+e[t]),i&&(i.entrySize=n,i.totalCalculatedSize=u(this,xe))})},Be=new WeakMap,et=new WeakMap,mt=new WeakMap,_e=function*({allowStale:e=this.allowStale}={}){if(u(this,ee))for(let t=u(this,re);!(!A(this,x,tr).call(this,t)||((e||!u(this,me).call(this,t))&&(yield t),t===u(this,ie)));)t=u(this,he)[t]},Te=function*({allowStale:e=this.allowStale}={}){if(u(this,ee))for(let t=u(this,ie);!(!A(this,x,tr).call(this,t)||((e||!u(this,me).call(this,t))&&(yield t),t===u(this,re)));)t=u(this,oe)[t]},tr=function(e){return e!==void 0&&u(this,Q).get(u(this,G)[e])===e},Ot=function(e){var a,o;const t=u(this,ie),n=u(this,G)[t],i=u(this,F)[t];return u(this,De)&&A(this,x,W).call(this,i)?i.__abortController.abort(new Error("evicted")):(u(this,Ae)||u(this,se))&&(u(this,Ae)&&((a=u(this,we))==null||a.call(this,i,n,"evict")),u(this,se)&&((o=u(this,ne))==null||o.push([i,n,"evict"]))),u(this,Be).call(this,t),e&&(u(this,G)[t]=void 0,u(this,F)[t]=void 0,u(this,Se).push(t)),u(this,ee)===1?(j(this,ie,j(this,re,0)),u(this,Se).length=0):j(this,ie,u(this,oe)[t]),u(this,Q).delete(n),Ct(this,ee)._--,t},At=function(e,t,n,i){const a=t===void 0?void 0:u(this,F)[t];if(A(this,x,W).call(this,a))return a;const o=new Pt,{signal:l}=n;l==null||l.addEventListener("abort",()=>o.abort(l.reason),{signal:o.signal});const s={signal:o.signal,options:n,context:i},c=(y,g=!1)=>{const{aborted:C}=o.signal,R=n.ignoreFetchAbort&&y!==void 0;if(n.status&&(C&&!g?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,R&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),C&&!R&&!g)return d(o.signal.reason);const k=v;return u(this,F)[t]===v&&(y===void 0?k.__staleWhileFetching?u(this,F)[t]=k.__staleWhileFetching:A(this,x,ze).call(this,e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,y,s.options))),y},h=y=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=y),d(y)),d=y=>{const{aborted:g}=o.signal,C=g&&n.allowStaleOnFetchAbort,R=C||n.allowStaleOnFetchRejection,k=R||n.noDeleteOnFetchRejection,P=v;if(u(this,F)[t]===v&&(!k||P.__staleWhileFetching===void 0?A(this,x,ze).call(this,e,"fetch"):C||(u(this,F)[t]=P.__staleWhileFetching)),R)return n.status&&P.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),P.__staleWhileFetching;if(P.__returned===P)throw y},m=(y,g)=>{var R;const C=(R=u(this,Je))==null?void 0:R.call(this,e,a,s);C&&C instanceof Promise&&C.then(k=>y(k===void 0?void 0:k),g),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(y(void 0),n.allowStaleOnFetchAbort&&(y=k=>c(k,!0)))})};n.status&&(n.status.fetchDispatched=!0);const v=new Promise(m).then(c,h),p=Object.assign(v,{__abortController:o,__staleWhileFetching:a,__returned:void 0});return t===void 0?(this.set(e,p,{...s.options,status:void 0}),t=u(this,Q).get(e)):u(this,F)[t]=p,p},W=function(e){if(!u(this,De))return!1;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Pt},rr=function(e,t){u(this,he)[t]=e,u(this,oe)[e]=t},ct=function(e){e!==u(this,re)&&(e===u(this,ie)?j(this,ie,u(this,oe)[e]):A(this,x,rr).call(this,u(this,he)[e],u(this,oe)[e]),A(this,x,rr).call(this,u(this,re),e),j(this,re,e))},ze=function(e,t){var i,a,o,l;let n=!1;if(u(this,ee)!==0){const s=u(this,Q).get(e);if(s!==void 0)if(n=!0,u(this,ee)===1)A(this,x,nr).call(this,t);else{u(this,Be).call(this,s);const c=u(this,F)[s];if(A(this,x,W).call(this,c)?c.__abortController.abort(new Error("deleted")):(u(this,Ae)||u(this,se))&&(u(this,Ae)&&((i=u(this,we))==null||i.call(this,c,e,t)),u(this,se)&&((a=u(this,ne))==null||a.push([c,e,t]))),u(this,Q).delete(e),u(this,G)[s]=void 0,u(this,F)[s]=void 0,s===u(this,re))j(this,re,u(this,he)[s]);else if(s===u(this,ie))j(this,ie,u(this,oe)[s]);else{const h=u(this,he)[s];u(this,oe)[h]=u(this,oe)[s];const d=u(this,oe)[s];u(this,he)[d]=u(this,he)[s]}Ct(this,ee)._--,u(this,Se).push(s)}}if(u(this,se)&&((o=u(this,ne))!=null&&o.length)){const s=u(this,ne);let c;for(;c=s==null?void 0:s.shift();)(l=u(this,Ce))==null||l.call(this,...c)}return n},nr=function(e){var t,n,i;for(const a of A(this,x,Te).call(this,{allowStale:!0})){const o=u(this,F)[a];if(A(this,x,W).call(this,o))o.__abortController.abort(new Error("deleted"));else{const l=u(this,G)[a];u(this,Ae)&&((t=u(this,we))==null||t.call(this,o,l,e)),u(this,se)&&((n=u(this,ne))==null||n.push([o,l,e]))}}if(u(this,Q).clear(),u(this,F).fill(void 0),u(this,G).fill(void 0),u(this,de)&&u(this,Oe)&&(u(this,de).fill(0),u(this,Oe).fill(0)),u(this,Re)&&u(this,Re).fill(0),j(this,ie,0),j(this,re,0),u(this,Se).length=0,j(this,xe,0),j(this,ee,0),u(this,se)&&u(this,ne)){const a=u(this,ne);let o;for(;o=a==null?void 0:a.shift();)(i=u(this,Ce))==null||i.call(this,...o)}};let Qt=mr;var Bo=function(e){return qo(e)&&!$o(e)};function qo(r){return!!r&&typeof r=="object"}function $o(r){var e=Object.prototype.toString.call(r);return e==="[object RegExp]"||e==="[object Date]"||Yo(r)}var Vo=typeof Symbol=="function"&&Symbol.for,Ho=Vo?Symbol.for("react.element"):60103;function Yo(r){return r.$$typeof===Ho}function Ko(r){return Array.isArray(r)?[]:{}}function ht(r,e){return e.clone!==!1&&e.isMergeableObject(r)?tt(Ko(r),r,e):r}function Xo(r,e,t){return r.concat(e).map(function(n){return ht(n,t)})}function Zo(r,e){if(!e.customMerge)return tt;var t=e.customMerge(r);return typeof t=="function"?t:tt}function Jo(r){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(r).filter(function(e){return Object.propertyIsEnumerable.call(r,e)}):[]}function nn(r){return Object.keys(r).concat(Jo(r))}function Nn(r,e){try{return e in r}catch{return!1}}function Qo(r,e){return Nn(r,e)&&!(Object.hasOwnProperty.call(r,e)&&Object.propertyIsEnumerable.call(r,e))}function es(r,e,t){var n={};return t.isMergeableObject(r)&&nn(r).forEach(function(i){n[i]=ht(r[i],t)}),nn(e).forEach(function(i){Qo(r,i)||(Nn(r,i)&&t.isMergeableObject(e[i])?n[i]=Zo(i,t)(r[i],e[i],t):n[i]=ht(e[i],t))}),n}function tt(r,e,t){t=t||{},t.arrayMerge=t.arrayMerge||Xo,t.isMergeableObject=t.isMergeableObject||Bo,t.cloneUnlessOtherwiseSpecified=ht;var n=Array.isArray(e),i=Array.isArray(r),a=n===i;return a?n?t.arrayMerge(r,e,t):es(r,e,t):ht(e,t)}tt.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(n,i){return tt(n,i,t)},{})};var ts=tt,rs=ts;const ns=dn(rs);var an=new Set,on=[],Vt=[],is={appendCss:r=>{Vt.push(r)},registerClassName:r=>{an.add(r)},registerComposition:r=>{on.push(r)},markCompositionUsed:()=>{},onEndFileScope:r=>{var e=No({localClassNames:Array.from(an),composedClassLists:on,cssObjs:Vt}).join(`
78
+ `);Ma({fileScope:r,css:e}),Vt=[]},getIdentOption:()=>process.env.NODE_ENV==="production"?"short":"debug"};Wa(is);var sn=(r,e)=>{for(var t=e-1;t>=0;){if(r[t]==="/")return t;t--}return-1},as=r=>{var e,t=r.lastIndexOf(".css");if(t===-1)return"";var n=sn(r,t);if(e=r.slice(n+1,t),n===-1)return e;var i=sn(r,n-1),a=r.slice(i+1,n),o=e!=="index"?e:a;return o},os=()=>{var r=new Qt({max:500});return e=>{var t=r.get(e);if(t)return t;var n=as(e);return r.set(e,n),n}},ss=os();function ls(r){var{debugId:e,debugFileName:t}=r,n=e?[e.replace(/\s/g,"_")]:[];if(t){var{filePath:i}=Me(),a=ss(i);a&&n.unshift(a)}return n.join("_")}function ln(r){return r.match(/^[0-9]/)?"_".concat(r):r}function hr(r){var e=qa(),{debugId:t,debugFileName:n=!0}=qe(qe({},null),null),i=Wo().toString(36),{filePath:a,packageName:o}=Me(),l=Uo(o?"".concat(o).concat(a):a),s="".concat(l).concat(i);if(e==="debug"){var c=ls({debugId:t,debugFileName:n});return c&&(s="".concat(c,"__").concat(s)),ln(s)}if(typeof e=="function"){if(s=e({hash:s,debugId:t,filePath:a,packageName:o}),!s.match(/^[A-Z_][0-9A-Z_-]+$/i))throw new Error('Identifier function returned invalid indentifier: "'.concat(s,'"'));return s}return ln(s)}function us(r,e){var t=hr();En(t,Me());var n=[],i=[];for(var a of r)typeof a=="string"?n.push(a):i.push(a);var o=t;if(n.length>0&&(o="".concat(t," ").concat(Oo(n)),Ba({identifier:t,classList:o},Me()),i.length>0&&jn(t)),i.length>0){var l=ns.all(i,{arrayMerge:(s,c)=>c});Ft({type:"local",selector:t,rule:l},Me())}return o}function Z(r,e){if(Array.isArray(r))return us(r);var t=hr();return En(t,Me()),Ft({type:"local",selector:t,rule:r},Me()),t}function cs(r,e){Ft({type:"global",selector:r,rule:e},Me())}function fs(r,e){var t=lr(hr(),{isIdentifier:!0});return Ft({type:"keyframes",name:t,rule:r},Me()),t}const Un=Z({display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center"}),Ln=Z([Un,{width:"5rem",height:"5rem",cursor:"pointer",transition:"all 0.3s ease-in",boxShadow:"0 0 0.5rem rgba(0, 0, 0, 0.5)",backgroundColor:"rgba(0, 0, 0, 0.5)",color:"white",selectors:{"&:hover":{boxShadow:"0 0 1rem rgba(0, 0, 0, 0.5)"}}}]),dr={width:"18rem",height:"18rem","@media":{"screen and (max-width: 1024px)":{width:"17rem",height:"17rem"},"screen and (max-width: 768px)":{width:"16rem",height:"16rem"}}},Wn=Z({display:"grid",alignItems:"center",justifyContent:"center",gridTemplateColumns:"repeat(3, 1fr)",gridTemplateRows:"repeat(3, 1fr)"}),hs=Z([Ln,{position:"relative",fontSize:"1rem",margin:"0.5rem",borderRadius:"50%",selectors:{"&::after":{content:'""',position:"absolute",width:"4rem",height:"4rem",borderRadius:"50%",background:"rgba(0, 0, 0, 0.2)",zIndex:1e5}}}]),ds=Z({background:"radial-gradient(circle at center, rgba(245, 177, 97, 1) 0.4%, rgba(236, 54, 110, 1) 100.2%)",boxShadow:"0 0 1rem rgba(245, 177, 97, 1)",color:"black",transition:"all 0.3s ease-in",borderRadius:"50%",selectors:{"&:hover":{boxShadow:"0 0 2rem rgba(245, 177, 97, 1)"}}});cs(`${Wn} *`,{WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"});function ms({value:r,name:e,gamePadButtonStyle:t}){const[n,i]=w.useState(!1),{pushKey:a}=On(),o=()=>{a(r,!0),i(!0)},l=()=>{a(r,!1),i(!1)};return S.jsx("button",{className:`${hs} ${n?ds:""}`,onMouseDown:o,onMouseUp:l,onMouseLeave:l,onContextMenu:s=>{s.preventDefault(),l()},onPointerDown:o,onPointerUp:l,style:t,children:e})}function ps(r){const{gamePadStyle:e,gamePadButtonStyle:t,label:n}=r,{control:i,mode:a}=w.useContext(B),o=Object.keys(i).map(l=>{const s=(n==null?void 0:n[l])||l;if(l!=="forward"&&l!=="backward"&&l!=="leftward"&&l!=="rightward")return{tag:l,value:l,name:s}}).filter(l=>l!==void 0).filter(l=>l.tag!=="run");return S.jsx(S.Fragment,{children:a.controller==="clicker"&&S.jsx("div",{className:Wn,style:e,children:o.map((l,s)=>S.jsx(ms,{value:l.value,name:l.name,gamePadButtonStyle:t},s))})})}const vs=fs({"0%":{boxShadow:"0 0 0 0 rgba(255, 255, 255, 0.7)",opacity:1},"70%":{boxShadow:"0 0 0 10px rgba(255, 255, 255, 0)",opacity:.7},"100%":{boxShadow:"0 0 0 0 rgba(255, 255, 255, 0)",opacity:1}}),gs=Z([{margin:"1rem",borderRadius:"50%",background:"rgba(0, 0, 0, 0.6)",boxShadow:"0 0 10px rgba(0, 0, 0, 0.5)",backdropFilter:"blur(1rem)",WebkitBackdropFilter:"blur(1rem)",border:"4px solid rgba(0, 0, 0, 0.5)",overflow:"hidden"},dr]),ys=Z([Un,{position:"absolute",textAlign:"center",overflow:"hidden"},dr]),bs=Z([{position:"relative",display:"flex",top:"50%",left:"50%",transformOrigin:"50% 50%",borderRadius:"50%",overflow:"hidden"},dr]),ws=Z([{position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"2rem",height:"2rem",borderRadius:"50%",background:"rgba(5, 222, 250, 1)",boxShadow:"0 0 10px rgba(5, 222, 250, 1)",border:"2px solid transparent",objectFit:"cover",zIndex:100,animation:`${vs} 2s infinite`}]),un=Z([{position:"relative",display:"flex",justifyContent:"center",alignItems:"center",width:"2rem",height:"2rem",borderRadius:"50%",background:"rgba(0, 0, 0, 0.5)",boxShadow:"0 0 5px rgba(0, 0, 0, 0.5)",transition:"all 0.5s ease-in",cursor:"pointer",border:"2px solid transparent",selectors:{"&:hover":{boxShadow:"0 0 10px rgba(0, 0, 0, 0.5)"}}}]),Cs=Z([{position:"absolute",width:"13rem",bottom:"-5rem",left:"50%",transform:"translateX(-50%)",display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:"1.2rem",color:"white",textShadow:"0 0 10px black",padding:"0.5rem",borderRadius:"0.5rem",boxShadow:"0 0 10px black",background:"rgba(0, 0, 0, 0.5)",zIndex:3,WebkitBackdropFilter:"blur(2rem)",backdropFilter:"blur(2rem)",fontFamily:'"Open Sans", sans-serif',fontWeight:300}]),xs=Z({position:"relative",fontSize:"1rem",color:"black",padding:"0.5rem",borderRadius:"0.5rem",background:"rgba(255, 255, 255, 0.5)",boxShadow:"0 0 10px rgba(255, 255, 255, 0.5)",zIndex:3}),Ss=Z({position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",borderRadius:"2px",background:"rgba(0, 0, 0, 0.3)"}),Rs=Z({position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",background:`
79
79
  linear-gradient(to bottom, transparent 95%, rgba(0, 0, 0, 0.2) 20%) 0 0 / 100% 40px repeat-y,
80
80
  linear-gradient(to right, transparent 38px, rgba(0, 0, 0, 0.2) 38px) 0 0 / 40px 100% repeat-x transparent
81
- `}),Os=Z({position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center"}),_t=Z({position:"absolute",color:"white",fontSize:"1.5rem",zIndex:2e3}),As=Z([_t,{top:"50%",right:0}]),Es=Z([_t,{top:"50%",left:0}]),js=Z([_t,{top:0,left:"50%"}]),ks=Z([_t,{bottom:0,left:"50%"}]),Ht={scale:.5,minScale:.1,maxScale:2,blockScale:!1};function Ms(r){const{minimap:e,activeState:t,mode:n}=w.useContext($),[i,a]=w.useState(r.scale||Ht.scale),{minimapInnerStyle:o,textStyle:l,minimapObjectStyle:s,avatarStyle:c,scaleStyle:h,directionStyle:d,plusMinusStyle:m,imageStyle:v,minimapStyle:p,minimapOuterStyle:y}=r,g=w.useCallback(()=>{const R=r.maxScale||Ht.maxScale;a(k=>Math.min(R,k+.1))},[r.maxScale]),C=w.useCallback(()=>{const R=r.minScale||Ht.minScale;a(k=>Math.max(R,k-.1))},[r.minScale]);return S.jsxs("div",{className:gs,onWheel:R=>{r.blockScale||(R.deltaY<=0?g():C())},style:p,children:[S.jsx("div",{className:ys,style:y}),S.jsxs("div",{className:bs,style:{transform:r.blockRotate||n.control==="normal"?"translate(-50%, -50%) rotate(180deg)":`translate(-50%, -50%) rotate(${t.euler.y*180/Math.PI+180}deg)`,...o},children:[S.jsx("div",{className:As,style:{transform:r.blockRotate||n.control==="normal"?"translate(-50%, -50%) rotate(180deg)":`translate(-50%, -50%) rotate(-${t.euler.y*180/Math.PI+180}deg)`,...d},children:"E"}),S.jsx("div",{className:Es,style:{transform:r.blockRotate||n.control==="normal"?"translate(50%, -50%) rotate(180deg)":`translate(50%, -50%) rotate(-${t.euler.y*180/Math.PI+180}deg)`,...d},children:"W"}),S.jsx("div",{className:js,style:{transform:r.blockRotate||n.control==="normal"?"translate(-50%, 50%) rotate(180deg)":`translate(-50%, 50%) rotate(-${t.euler.y*180/Math.PI+180}deg)`,...d},children:"S"}),S.jsx("div",{className:ks,style:{transform:r.blockRotate||n.control==="normal"?"translate(-50%, -50%) rotate(180deg)":`translate(-50%, -50%) rotate(-${t.euler.y*180/Math.PI+180}deg)`,...d},children:"N"}),Object.values(e.props).map(({center:R,size:k,text:P},_)=>{const D=(R.x-t.position.x)*(r.angle?Math.sin(r.angle):1)*i,V=(R.z-t.position.z)*(r.angle?-Math.cos(r.angle):1)*i;return S.jsxs("div",{children:[S.jsx("div",{className:Ss,style:{width:`${k.x*i}rem`,height:`${k.z*i}rem`,top:"50%",left:"50%",transform:`translate(-50.1%, -50.1%) translate(${-D}rem, ${-V}rem) rotate(${Math.PI*3/2+r.angle||0}rad)`,transformOrigin:"50% 50%",zIndex:1+_,...s}}),_===0&&S.jsx("div",{className:Rs,style:{width:`${k.x*i}rem`,height:`${k.z*i}rem`,top:"50%",left:"50%",transform:`translate(-50.1%, -50.1%) translate(${-D}rem, ${-V}rem) rotate(${Math.PI*3/2+r.angle||0}rad)`,transformOrigin:"50% 50%",zIndex:10+_,...v}}),S.jsx("div",{className:Os,style:{width:`${k.x*i}rem`,height:`${k.z*i}rem`,top:"50.1%",left:"50.1%",transform:`translate(-50.1%, -50.1%) translate(${-D}rem, ${-V}rem)`,transformOrigin:"50.1% 50.1%",zIndex:1001+_},children:P&&S.jsx("div",{className:xs,style:{...l,zIndex:1001+_,transform:r.blockRotate||n.control==="normal"?"rotate(180deg)":`rotate(-${t.euler.y*180/Math.PI+180}deg)`},children:P})})]},_)}),S.jsx("div",{className:ws,style:c})]}),!r.blockScaleControl&&S.jsxs("div",{className:Cs,style:h,children:[S.jsx("div",{className:un,style:m,onClick:()=>{r.blockScale||C()},children:"+"}),"SCALE 1:",Math.round(100/i),S.jsx("div",{className:un,style:m,onClick:()=>{r.blockScale||g()},children:"-"})]})]})}function Ps(r){}function Bn(){const r=w.useContext($);return{Teleport:t=>{var n,i,a;r&&(r!=null&&r.refs)&&((n=r==null?void 0:r.refs)!=null&&n.rigidBodyRef)&&((a=(i=r==null?void 0:r.refs)==null?void 0:i.rigidBodyRef)!=null&&a.current)&&r.refs.rigidBodyRef.current.setTranslation(t,!0)}}}const Fs=Z([Ln,{margin:"1rem",fontSize:"0.8rem",background:"rgba(0, 0, 0, 0.6)",boxShadow:"0 0 5px 0 rgba(0, 0, 0, 0.6)",transition:"all 0.2s ease-in",borderRadius:"50%"}]);function _s({text:r,position:e,teleportStyle:t}){const{Teleport:n}=Bn();return S.jsx("div",{className:Fs,onClick:()=>{n(e)},style:t,children:r})}function Ts({children:r,...e}){const t=w.useRef(),[n,i]=w.useState(),a=new L.Vector3;return je.useFrame(o=>{const l=o.camera.position.distanceTo(t.current.getWorldPosition(a))<=10;l!==n&&i(l)}),S.jsx("group",{ref:t,children:S.jsx(Pe.Html,{transform:!0,occlude:!0,...e,children:r})})}function zs(r,e){switch(e.type){case"init":return{...r};case"update":return{...r,...e.payload}}}function Ds(r){const[e,t]=w.useReducer(zs,{activeState:{...ue.activeState,position:r.startPosition||ue.activeState.position},cameraOption:Object.assign(ue.cameraOption,r.cameraOption||{}),mode:Object.assign(ue.mode,r.mode||{}),urls:Object.assign(ue.urls,r.urls||{}),refs:null,states:ue.states,rideable:ue.rideable,minimap:ue.minimap,control:ue.control,clicker:ue.clicker,clickerOption:Object.assign(ue.clickerOption,r.clickerOption||{}),animationState:ue.animationState,block:Object.assign(ue.block,r.block||{}),sizes:ue.sizes});return{gaesupProps:w.useMemo(()=>({value:e,dispatch:t}),[e,e.block,t])}}function Is(r){const{gaesupProps:e}=Ds(r);return S.jsx($.Provider,{value:e.value,children:S.jsx(pe.Provider,{value:e.dispatch,children:r.children})})}function Ns(){const r=w.useContext($);return{state:r.activeState,mode:r.mode,urls:r.urls,currentAnimation:r.mode.type?r.animationState[r.mode.type].current:"idle"}}function Us(){const{activeState:r,clicker:e}=w.useContext($),t=w.useContext(pe);return{move:(i,a)=>{const o=r.position,l=E.vec3(i),s=Math.atan2(l.z-o.z,l.x-o.x);t({type:"update",payload:{clicker:{point:K(i.x,0,i.z),angle:s,isOn:!0,isRun:a}}})}}}const Ls={objectkey:null,objectType:null,isRiderOn:!1,url:null,wheelUrl:null,position:E.vec3(),rotation:E.euler(),offset:E.vec3(),visible:!0};function Ws(){const r=w.useContext($),{urls:e,states:t,rideable:n,mode:i}=r,a=w.useContext(pe),{getSizesByUrls:o}=bn(),l=p=>{n[p.objectkey]={...Ls,...p}},s=p=>{n[p.objectkey]=p},c=p=>n[p],h=p=>{const{activeState:y,refs:g}=r;t.enableRiding=!1,t.isRiderOn=!1,t.rideableId=null;const C=n[p].objectType,{vehicleUrl:R,airplaneUrl:k,characterUrl:P}=o(e),_=C==="vehicle"?R:k,D=P;n[p].visible=!0,n[p].position.copy(y.position.clone()),g&&g.rigidBodyRef&&g.rigidBodyRef.current.setTranslation(y.position.clone().add(_.clone().add(D.clone()).addScalar(1)),!1),a({type:"update",payload:{rideable:{...n},states:{...t},activeState:{...y}}})},d=async p=>{e.ridingUrl=p.ridingUrl||e.characterUrl||null,p.objectType==="vehicle"?(e.vehicleUrl=p.url,e.wheelUrl=p.wheelUrl||null):p.objectType==="airplane"&&(e.airplaneUrl=p.url),a({type:"update",payload:{urls:{...e}}})},m=async p=>{i.type=p.objectType,t.enableRiding=p.enableRiding,t.isRiderOn=!0,t.rideableId=p.objectkey,n[p.objectkey].visible=!1,a({type:"update",payload:{mode:{...i},states:{...t}}})};return{initRideable:l,setRideable:s,getRideable:c,ride:async(p,y)=>{p.other.rigidBodyObject.name==="character"&&(await d(y),await m(y))},landing:h}}function Bs(){const{cameraOption:r}=w.useContext($),e=w.useContext(pe);return{zoom:n=>{r.zoom=n,e({type:"update",payload:{cameraOption:r}})}}}exports.Clicker=ka;exports.Elr=Ri;exports.GaeSupProps=ja;exports.GaesupComponent=Sn;exports.GaesupController=Aa;exports.GaesupWorld=Is;exports.GamePad=ps;exports.InnerHtml=Ts;exports.MiniMap=Ms;exports.PassiveAirplane=wa;exports.PassiveCharacter=Ca;exports.PassiveVehicle=xa;exports.Qt=Si;exports.Rideable=Ps;exports.V3=K;exports.V30=Ci;exports.V31=xi;exports.teleport=_s;exports.useClicker=Rn;exports.useGaesupAnimation=ft;exports.useGaesupController=Ns;exports.useMovePoint=Us;exports.usePushKey=On;exports.useRideable=Ws;exports.useTeleport=Bn;exports.useZoom=Bs;
81
+ `}),Os=Z({position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center"}),_t=Z({position:"absolute",color:"white",fontSize:"1.5rem",zIndex:2e3}),As=Z([_t,{top:"50%",right:0}]),Es=Z([_t,{top:"50%",left:0}]),js=Z([_t,{top:0,left:"50%"}]),ks=Z([_t,{bottom:0,left:"50%"}]),Ht={scale:.5,minScale:.1,maxScale:2,blockScale:!1};function Ms(r){const{minimap:e,activeState:t,mode:n}=w.useContext(B),[i,a]=w.useState(r.scale||Ht.scale),{minimapInnerStyle:o,textStyle:l,minimapObjectStyle:s,avatarStyle:c,scaleStyle:h,directionStyle:d,plusMinusStyle:m,imageStyle:v,minimapStyle:p,minimapOuterStyle:y}=r,g=w.useCallback(()=>{const R=r.maxScale||Ht.maxScale;a(k=>Math.min(R,k+.1))},[r.maxScale]),C=w.useCallback(()=>{const R=r.minScale||Ht.minScale;a(k=>Math.max(R,k-.1))},[r.minScale]);return S.jsxs("div",{className:gs,onWheel:R=>{r.blockScale||(R.deltaY<=0?g():C())},style:p,children:[S.jsx("div",{className:ys,style:y}),S.jsxs("div",{className:bs,style:{transform:r.blockRotate||n.control==="normal"?"translate(-50%, -50%) rotate(180deg)":`translate(-50%, -50%) rotate(${t.euler.y*180/Math.PI+180}deg)`,...o},children:[S.jsx("div",{className:As,style:{transform:r.blockRotate||n.control==="normal"?"translate(-50%, -50%) rotate(180deg)":`translate(-50%, -50%) rotate(-${t.euler.y*180/Math.PI+180}deg)`,...d},children:"E"}),S.jsx("div",{className:Es,style:{transform:r.blockRotate||n.control==="normal"?"translate(50%, -50%) rotate(180deg)":`translate(50%, -50%) rotate(-${t.euler.y*180/Math.PI+180}deg)`,...d},children:"W"}),S.jsx("div",{className:js,style:{transform:r.blockRotate||n.control==="normal"?"translate(-50%, 50%) rotate(180deg)":`translate(-50%, 50%) rotate(-${t.euler.y*180/Math.PI+180}deg)`,...d},children:"S"}),S.jsx("div",{className:ks,style:{transform:r.blockRotate||n.control==="normal"?"translate(-50%, -50%) rotate(180deg)":`translate(-50%, -50%) rotate(-${t.euler.y*180/Math.PI+180}deg)`,...d},children:"N"}),Object.values(e.props).map(({center:R,size:k,text:P},_)=>{const D=(R.x-t.position.x)*(r.angle?Math.sin(r.angle):1)*i,V=(R.z-t.position.z)*(r.angle?-Math.cos(r.angle):1)*i;return S.jsxs("div",{children:[S.jsx("div",{className:Ss,style:{width:`${k.x*i}rem`,height:`${k.z*i}rem`,top:"50%",left:"50%",transform:`translate(-50.1%, -50.1%) translate(${-D}rem, ${-V}rem) rotate(${Math.PI*3/2+r.angle||0}rad)`,transformOrigin:"50% 50%",zIndex:1+_,...s}}),_===0&&S.jsx("div",{className:Rs,style:{width:`${k.x*i}rem`,height:`${k.z*i}rem`,top:"50%",left:"50%",transform:`translate(-50.1%, -50.1%) translate(${-D}rem, ${-V}rem) rotate(${Math.PI*3/2+r.angle||0}rad)`,transformOrigin:"50% 50%",zIndex:10+_,...v}}),S.jsx("div",{className:Os,style:{width:`${k.x*i}rem`,height:`${k.z*i}rem`,top:"50.1%",left:"50.1%",transform:`translate(-50.1%, -50.1%) translate(${-D}rem, ${-V}rem)`,transformOrigin:"50.1% 50.1%",zIndex:1001+_},children:P&&S.jsx("div",{className:xs,style:{...l,zIndex:1001+_,transform:r.blockRotate||n.control==="normal"?"rotate(180deg)":`rotate(-${t.euler.y*180/Math.PI+180}deg)`},children:P})})]},_)}),S.jsx("div",{className:ws,style:c})]}),!r.blockScaleControl&&S.jsxs("div",{className:Cs,style:h,children:[S.jsx("div",{className:un,style:m,onClick:()=>{r.blockScale||C()},children:"+"}),"SCALE 1:",Math.round(100/i),S.jsx("div",{className:un,style:m,onClick:()=>{r.blockScale||g()},children:"-"})]})]})}function Ps(r){}function Gn(){const r=w.useContext(B);return{Teleport:t=>{var n,i,a;r&&(r!=null&&r.refs)&&((n=r==null?void 0:r.refs)!=null&&n.rigidBodyRef)&&((a=(i=r==null?void 0:r.refs)==null?void 0:i.rigidBodyRef)!=null&&a.current)&&r.refs.rigidBodyRef.current.setTranslation(t,!0)}}}const Fs=Z([Ln,{margin:"1rem",fontSize:"0.8rem",background:"rgba(0, 0, 0, 0.6)",boxShadow:"0 0 5px 0 rgba(0, 0, 0, 0.6)",transition:"all 0.2s ease-in",borderRadius:"50%"}]);function _s({text:r,position:e,teleportStyle:t}){const{Teleport:n}=Gn();return S.jsx("div",{className:Fs,onClick:()=>{n(e)},style:t,children:r})}function Ts({children:r,...e}){const t=w.useRef(),[n,i]=w.useState(),a=new L.Vector3;return je.useFrame(o=>{const l=o.camera.position.distanceTo(t.current.getWorldPosition(a))<=10;l!==n&&i(l)}),S.jsx("group",{ref:t,children:S.jsx(Pe.Html,{transform:!0,occlude:!0,...e,children:r})})}function zs(r,e){switch(e.type){case"init":return{...r};case"update":return{...r,...e.payload}}}function Ds(r){const[e,t]=w.useReducer(zs,{activeState:{...ue.activeState,position:r.startPosition||ue.activeState.position},cameraOption:Object.assign(ue.cameraOption,r.cameraOption||{}),mode:Object.assign(ue.mode,r.mode||{}),urls:Object.assign(ue.urls,r.urls||{}),refs:null,states:ue.states,rideable:ue.rideable,minimap:ue.minimap,control:ue.control,clicker:ue.clicker,clickerOption:Object.assign(ue.clickerOption,r.clickerOption||{}),animationState:ue.animationState,block:Object.assign(ue.block,r.block||{}),sizes:ue.sizes});return{gaesupProps:w.useMemo(()=>({value:e,dispatch:t}),[e,e.block,t])}}function Is(r){const{gaesupProps:e}=Ds(r);return S.jsx(B.Provider,{value:e.value,children:S.jsx(pe.Provider,{value:e.dispatch,children:r.children})})}function Ns(){const r=w.useContext(B);return{state:r.activeState,mode:r.mode,urls:r.urls,currentAnimation:r.mode.type?r.animationState[r.mode.type].current:"idle"}}function Us(){const{activeState:r,clicker:e}=w.useContext(B),t=w.useContext(pe);return{move:(i,a)=>{const o=r.position,l=E.vec3(i),s=Math.atan2(l.z-o.z,l.x-o.x);t({type:"update",payload:{clicker:{point:K(i.x,0,i.z),angle:s,isOn:!0,isRun:a}}})}}}const Ls={objectkey:null,objectType:null,isRiderOn:!1,url:null,wheelUrl:null,position:E.vec3(),rotation:E.euler(),offset:E.vec3(),visible:!0};function Ws(){const r=w.useContext(B),{urls:e,states:t,rideable:n,mode:i}=r,a=w.useContext(pe),{getSizesByUrls:o}=bn(),l=p=>{n[p.objectkey]={...Ls,...p}},s=p=>{n[p.objectkey]=p},c=p=>n[p],h=p=>{const{activeState:y,refs:g}=r;t.enableRiding=!1,t.isRiderOn=!1,t.rideableId=null;const C=n[p].objectType,{vehicleUrl:R,airplaneUrl:k,characterUrl:P}=o(e),_=C==="vehicle"?R:k,D=P;n[p].visible=!0,n[p].position.copy(y.position.clone()),g&&g.rigidBodyRef&&g.rigidBodyRef.current.setTranslation(y.position.clone().add(_.clone().add(D.clone()).addScalar(1)),!1),a({type:"update",payload:{rideable:{...n},states:{...t},activeState:{...y}}})},d=async p=>{e.ridingUrl=p.ridingUrl||e.characterUrl||null,p.objectType==="vehicle"?(e.vehicleUrl=p.url,e.wheelUrl=p.wheelUrl||null):p.objectType==="airplane"&&(e.airplaneUrl=p.url),a({type:"update",payload:{urls:{...e}}})},m=async p=>{i.type=p.objectType,t.enableRiding=p.enableRiding,t.isRiderOn=!0,t.rideableId=p.objectkey,n[p.objectkey].visible=!1,a({type:"update",payload:{mode:{...i},states:{...t}}})};return{initRideable:l,setRideable:s,getRideable:c,ride:async(p,y)=>{p.other.rigidBodyObject.name==="character"&&(await d(y),await m(y))},landing:h}}function Gs(){const{cameraOption:r}=w.useContext(B),e=w.useContext(pe);return{zoom:n=>{r.zoom=n,e({type:"update",payload:{cameraOption:r}})}}}exports.Clicker=ka;exports.Elr=Ri;exports.GaeSupProps=ja;exports.GaesupComponent=Sn;exports.GaesupController=Aa;exports.GaesupWorld=Is;exports.GaesupWorldContext=B;exports.GamePad=ps;exports.InnerHtml=Ts;exports.MiniMap=Ms;exports.PassiveAirplane=wa;exports.PassiveCharacter=Ca;exports.PassiveVehicle=xa;exports.Qt=Si;exports.Rideable=Ps;exports.V3=K;exports.V30=Ci;exports.V31=xi;exports.teleport=_s;exports.useClicker=Rn;exports.useGaesupAnimation=ft;exports.useGaesupController=Ns;exports.useMovePoint=Us;exports.usePushKey=On;exports.useRideable=Ws;exports.useTeleport=Gn;exports.useZoom=Gs;
@@ -6223,6 +6223,7 @@ export {
6223
6223
  Ia as GaesupComponent,
6224
6224
  sl as GaesupController,
6225
6225
  vl as GaesupWorld,
6226
+ q as GaesupWorldContext,
6226
6227
  hl as GamePad,
6227
6228
  gl as InnerHtml,
6228
6229
  dl as MiniMap,
@@ -2,6 +2,7 @@ export { GaesupComponent } from './gaesup/component';
2
2
  export { PassiveAirplane } from './gaesup/component/passive/airplane';
3
3
  export { PassiveCharacter } from './gaesup/component/passive/character';
4
4
  export { PassiveVehicle } from './gaesup/component/passive/vehicle';
5
+ export { GaesupWorldContext } from './gaesup/world/context';
5
6
  export { GaesupController } from './gaesup/controller';
6
7
  export { GaeSupProps } from './gaesup/gaesupProps';
7
8
  export { Clicker } from './gaesup/tools/clicker';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gaesup-world",
3
- "version": "0.9.786",
3
+ "version": "0.9.787",
4
4
  "main": "dist/gaesup-world.cjs.js",
5
5
  "module": "dist/gaesup-world.es.js",
6
6
  "types": "dist/types/index.d.ts",