From c599af20ce7d406a6b1a58dfb19902ccec82f671 Mon Sep 17 00:00:00 2001 From: tmarti Date: Thu, 6 Jun 2024 08:16:43 +0000 Subject: [PATCH] deploy: 159779daaa44a93a84ac870ff0befe3c1f835e31 --- assets/index-BtMyw9PQ.css | 1 - assets/index-CEiZlQj8.css | 1 + .../{index-Dfw0nlt8.js => index-CxsBVa9u.js} | 22 +++++++++---------- index.html | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) delete mode 100644 assets/index-BtMyw9PQ.css create mode 100644 assets/index-CEiZlQj8.css rename assets/{index-Dfw0nlt8.js => index-CxsBVa9u.js} (96%) diff --git a/assets/index-BtMyw9PQ.css b/assets/index-BtMyw9PQ.css deleted file mode 100644 index 55bc21f..0000000 --- a/assets/index-BtMyw9PQ.css +++ /dev/null @@ -1 +0,0 @@ -#root{max-width:1280px;margin:0 auto;padding:2rem;text-align:center}.logo{height:6em;padding:1.5em;will-change:filter;transition:filter .3s}.logo:hover{filter:drop-shadow(0 0 2em #646cffaa)}.logo.react:hover{filter:drop-shadow(0 0 2em #61dafbaa)}@keyframes logo-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (prefers-reduced-motion: no-preference){a:nth-of-type(2) .logo{animation:logo-spin infinite 20s linear}}.card{padding:2em}.read-the-docs{color:#888}#main-div{display:flex;width:100%;height:100%}#left-pane{width:25%;margin:5px}#right-pane{flex-grow:1;margin:5px}:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:flex;place-items:center;min-width:320px;min-height:100vh}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}} diff --git a/assets/index-CEiZlQj8.css b/assets/index-CEiZlQj8.css new file mode 100644 index 0000000..4aaec75 --- /dev/null +++ b/assets/index-CEiZlQj8.css @@ -0,0 +1 @@ +#root{margin:0 auto;text-align:center}.logo{height:6em;padding:1.5em;will-change:filter;transition:filter .3s}.logo:hover{filter:drop-shadow(0 0 2em #646cffaa)}.logo.react:hover{filter:drop-shadow(0 0 2em #61dafbaa)}@keyframes logo-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@media (prefers-reduced-motion: no-preference){a:nth-of-type(2) .logo{animation:logo-spin infinite 20s linear}}.card{padding:2em}.read-the-docs{color:#888}#main-div{display:flex;height:100vh;width:100vw}#left-pane{display:flex;flex-direction:column;height:100%;width:20%;border:1px solid lightgray;padding:0 2rem}#right-pane{height:100%;width:80%}.PanelConceptCategories{height:70%;overflow-y:scroll}.PanelMyConcept{height:30%}.Panel3D{height:100%;width:100%;border:1px solid lightgray}.ItemOpenAiKey{position:fixed;bottom:1rem;right:1rem;width:auto;z-index:1000;background:#ffffe0;padding:1rem;border:1px solid lightgray;border-radius:10px}.CardHoveredConcept{position:fixed;bottom:1rem;left:calc(20% + 4rem);width:auto;z-index:1000;background:#ffffe0;padding:1rem;border:1px solid lightgray;border-radius:10px;margin-left:1rem}.HiddenOnMobile{display:block}.SelectConcept{max-width:100%;margin:1rem 0}@media (max-width: 600px){#main-div{flex-direction:column}#left-pane,#right-pane{width:100%}#right-pane{height:50%}#left-pane{height:50%;padding:0}.PanelConceptCategories{width:calc(100% - 2rem);padding:0;margin:1rem;height:170px;margin-bottom:0}.PanelMyConcept{width:100%;padding-bottom:1rem;padding:0;margin:1rem}.Panel3D{height:50%;width:100%;height:unset}.HiddenOnMobile{display:none}.SelectConcept{max-width:85%}}:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:flex;place-items:center;min-width:320px;min-height:100vh}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}} diff --git a/assets/index-Dfw0nlt8.js b/assets/index-CxsBVa9u.js similarity index 96% rename from assets/index-Dfw0nlt8.js rename to assets/index-CxsBVa9u.js index 270418c..50303fa 100644 --- a/assets/index-Dfw0nlt8.js +++ b/assets/index-CxsBVa9u.js @@ -14,7 +14,7 @@ var ek=Object.defineProperty;var tk=(n,e,t)=>e in n?ek(n,e,{enumerable:!0,config * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var yk=Y,_k=Symbol.for("react.element"),xk=Symbol.for("react.fragment"),wk=Object.prototype.hasOwnProperty,Sk=yk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Mk={key:!0,ref:!0,__self:!0,__source:!0};function SP(n,e,t){var i,r={},s=null,o=null;t!==void 0&&(s=""+t),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(i in e)wk.call(e,i)&&!Mk.hasOwnProperty(i)&&(r[i]=e[i]);if(n&&n.defaultProps)for(i in e=n.defaultProps,e)r[i]===void 0&&(r[i]=e[i]);return{$$typeof:_k,type:n,key:s,ref:o,props:r,_owner:Sk.current}}Zv.Fragment=xk;Zv.jsx=SP;Zv.jsxs=SP;hP.exports=Zv;var Ge=hP.exports,Kx={},MP={exports:{}},Ar={},EP={exports:{}},bP={};/** + */var yk=Y,_k=Symbol.for("react.element"),xk=Symbol.for("react.fragment"),wk=Object.prototype.hasOwnProperty,Sk=yk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Mk={key:!0,ref:!0,__self:!0,__source:!0};function SP(n,e,t){var i,r={},s=null,o=null;t!==void 0&&(s=""+t),e.key!==void 0&&(s=""+e.key),e.ref!==void 0&&(o=e.ref);for(i in e)wk.call(e,i)&&!Mk.hasOwnProperty(i)&&(r[i]=e[i]);if(n&&n.defaultProps)for(i in e=n.defaultProps,e)r[i]===void 0&&(r[i]=e[i]);return{$$typeof:_k,type:n,key:s,ref:o,props:r,_owner:Sk.current}}Zv.Fragment=xk;Zv.jsx=SP;Zv.jsxs=SP;hP.exports=Zv;var We=hP.exports,Kx={},MP={exports:{}},Ar={},EP={exports:{}},bP={};/** * @license React * scheduler.production.min.js * @@ -3889,13 +3889,13 @@ void main() { `+gt+c}var ln=!1;function Dn(c,h){if(!c||ln)return"";ln=!0;var y=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(h)if(h=function(){throw Error()},Object.defineProperty(h.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(h,[])}catch(Ae){var M=Ae}Reflect.construct(c,[],h)}else{try{h.call()}catch(Ae){M=Ae}c.call(h.prototype)}else{try{throw Error()}catch(Ae){M=Ae}c()}}catch(Ae){if(Ae&&M&&typeof Ae.stack=="string"){for(var T=Ae.stack.split(` `),P=M.stack.split(` `),B=T.length-1,$=P.length-1;1<=B&&0<=$&&T[B]!==P[$];)$--;for(;1<=B&&0<=$;B--,$--)if(T[B]!==P[$]){if(B!==1||$!==1)do if(B--,$--,0>$||T[B]!==P[$]){var fe=` -`+T[B].replace(" at new "," at ");return c.displayName&&fe.includes("")&&(fe=fe.replace("",c.displayName)),fe}while(1<=B&&0<=$);break}}}finally{ln=!1,Error.prepareStackTrace=y}return(c=c?c.displayName||c.name:"")?vt(c):""}var Ii=Object.prototype.hasOwnProperty,sr=[],Pt=-1;function ot(c){return{current:c}}function jt(c){0>Pt||(c.current=sr[Pt],sr[Pt]=null,Pt--)}function at(c,h){Pt++,sr[Pt]=c.current,c.current=h}var fi={},Wn=ot(fi),On=ot(!1),Kr=fi;function fn(c,h){var y=c.type.contextTypes;if(!y)return fi;var M=c.stateNode;if(M&&M.__reactInternalMemoizedUnmaskedChildContext===h)return M.__reactInternalMemoizedMaskedChildContext;var T={},P;for(P in y)T[P]=h[P];return M&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=h,c.__reactInternalMemoizedMaskedChildContext=T),T}function dn(c){return c=c.childContextTypes,c!=null}function Uo(){jt(On),jt(Wn)}function Li(c,h,y){if(Wn.current!==fi)throw Error(o(168));at(Wn,h),at(On,y)}function Hl(c,h,y){var M=c.stateNode;if(h=h.childContextTypes,typeof M.getChildContext!="function")return y;M=M.getChildContext();for(var T in M)if(!(T in h))throw Error(o(108,L(c)||"Unknown",T));return s({},y,M)}function Gl(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||fi,Kr=Wn.current,at(Wn,c),at(On,On.current),!0}function Hc(c,h,y){var M=c.stateNode;if(!M)throw Error(o(169));y?(c=Hl(c,h,Kr),M.__reactInternalMemoizedMergedChildContext=c,jt(On),jt(Wn),at(Wn,c)):jt(On),at(On,y)}var Jr=Math.clz32?Math.clz32:hO,uO=Math.log,cO=Math.LN2;function hO(c){return c>>>=0,c===0?32:31-(uO(c)/cO|0)|0}var Rd=64,Pd=4194304;function Gc(c){switch(c&-c){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return c&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return c}}function Id(c,h){var y=c.pendingLanes;if(y===0)return 0;var M=0,T=c.suspendedLanes,P=c.pingedLanes,B=y&268435455;if(B!==0){var $=B&~T;$!==0?M=Gc($):(P&=B,P!==0&&(M=Gc(P)))}else B=y&~T,B!==0?M=Gc(B):P!==0&&(M=Gc(P));if(M===0)return 0;if(h!==0&&h!==M&&!(h&T)&&(T=M&-M,P=h&-h,T>=P||T===16&&(P&4194240)!==0))return h;if(M&4&&(M|=y&16),h=c.entangledLanes,h!==0)for(c=c.entanglements,h&=M;0y;y++)h.push(c);return h}function Wc(c,h,y){c.pendingLanes|=h,h!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,h=31-Jr(h),c[h]=y}function pO(c,h){var y=c.pendingLanes&~h;c.pendingLanes=h,c.suspendedLanes=0,c.pingedLanes=0,c.expiredLanes&=h,c.mutableReadLanes&=h,c.entangledLanes&=h,h=c.entanglements;var M=c.eventTimes;for(c=c.expirationTimes;0>=B,T-=B,Qs=1<<32-Jr(h)+T|y<Vt?(Jn=_t,_t=null):Jn=_t.sibling;var Ht=rt(ie,_t,le[Vt],Ue);if(Ht===null){_t===null&&(_t=Jn);break}c&&_t&&Ht.alternate===null&&h(ie,_t),Z=P(Ht,Z,Vt),At===null?Ze=Ht:At.sibling=Ht,At=Ht,_t=Jn}if(Vt===le.length)return y(ie,_t),un&&La(ie,Vt),Ze;if(_t===null){for(;VtVt?(Jn=_t,_t=null):Jn=_t.sibling;var Xo=rt(ie,_t,Ht.value,Ue);if(Xo===null){_t===null&&(_t=Jn);break}c&&_t&&Xo.alternate===null&&h(ie,_t),Z=P(Xo,Z,Vt),At===null?Ze=Xo:At.sibling=Xo,At=Xo,_t=Jn}if(Ht.done)return y(ie,_t),un&&La(ie,Vt),Ze;if(_t===null){for(;!Ht.done;Vt++,Ht=le.next())Ht=yt(ie,Ht.value,Ue),Ht!==null&&(Z=P(Ht,Z,Vt),At===null?Ze=Ht:At.sibling=Ht,At=Ht);return un&&La(ie,Vt),Ze}for(_t=M(ie,_t);!Ht.done;Vt++,Ht=le.next())Ht=en(_t,ie,Vt,Ht.value,Ue),Ht!==null&&(c&&Ht.alternate!==null&&_t.delete(Ht.key===null?Vt:Ht.key),Z=P(Ht,Z,Vt),At===null?Ze=Ht:At.sibling=Ht,At=Ht);return c&&_t.forEach(function(QO){return h(ie,QO)}),un&&La(ie,Vt),Ze}function Fr(ie,Z,le,Ue){if(typeof le=="object"&&le!==null&&le.type===f&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case l:e:{for(var Ze=le.key,At=Z;At!==null;){if(At.key===Ze){if(Ze=le.type,Ze===f){if(At.tag===7){y(ie,At.sibling),Z=T(At,le.props.children),Z.return=ie,ie=Z;break e}}else if(At.elementType===Ze||typeof Ze=="object"&&Ze!==null&&Ze.$$typeof===S&&zE(Ze)===At.type){y(ie,At.sibling),Z=T(At,le.props),Z.ref=$c(ie,At,le),Z.return=ie,ie=Z;break e}y(ie,At);break}else h(ie,At);At=At.sibling}le.type===f?(Z=za(le.props.children,ie.mode,Ue,le.key),Z.return=ie,ie=Z):(Ue=_p(le.type,le.key,le.props,null,ie.mode,Ue),Ue.ref=$c(ie,Z,le),Ue.return=ie,ie=Ue)}return B(ie);case u:e:{for(At=le.key;Z!==null;){if(Z.key===At)if(Z.tag===4&&Z.stateNode.containerInfo===le.containerInfo&&Z.stateNode.implementation===le.implementation){y(ie,Z.sibling),Z=T(Z,le.children||[]),Z.return=ie,ie=Z;break e}else{y(ie,Z);break}else h(ie,Z);Z=Z.sibling}Z=d_(le,ie.mode,Ue),Z.return=ie,ie=Z}return B(ie);case S:return At=le._init,Fr(ie,Z,At(le._payload),Ue)}if(j(le))return Je(ie,Z,le,Ue);if(A(le))return gi(ie,Z,le,Ue);Hd(ie,le)}return typeof le=="string"&&le!==""||typeof le=="number"?(le=""+le,Z!==null&&Z.tag===6?(y(ie,Z.sibling),Z=T(Z,le),Z.return=ie,ie=Z):(y(ie,Z),Z=f_(le,ie.mode,Ue),Z.return=ie,ie=Z),B(ie)):y(ie,Z)}return Fr}var Yl=BE(!0),VE=BE(!1),qc={},Nr=ot(qc),Yc=ot(qc),Zl=ot(qc);function Ts(c){if(c===qc)throw Error(o(174));return c}function Py(c,h){at(Zl,h),at(Yc,c),at(Nr,qc),c=oe(h),jt(Nr),at(Nr,c)}function Kl(){jt(Nr),jt(Yc),jt(Zl)}function HE(c){var h=Ts(Zl.current),y=Ts(Nr.current);h=k(y,c.type,h),y!==h&&(at(Yc,c),at(Nr,h))}function Iy(c){Yc.current===c&&(jt(Nr),jt(Yc))}var pn=ot(0);function Gd(c){for(var h=c;h!==null;){if(h.tag===13){var y=h.memoizedState;if(y!==null&&(y=y.dehydrated,y===null||Pa(y)||Bl(y)))return h}else if(h.tag===19&&h.memoizedProps.revealOrder!==void 0){if(h.flags&128)return h}else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===c)break;for(;h.sibling===null;){if(h.return===null||h.return===c)return null;h=h.return}h.sibling.return=h.return,h=h.sibling}return null}var Ly=[];function Ny(){for(var c=0;cy?y:4,c(!0);var M=Dr.transition;Dr.transition={};try{c(!1),h()}finally{Bt=y,Dr.transition=M}}function nb(){return As().memoizedState}function TO(c,h,y){var M=Go(c);y={lane:M,action:y,hasEagerState:!1,eagerState:null,next:null},ib(c)?rb(h,y):(sb(c,h,y),y=Di(),c=Or(c,M,y),c!==null&&ob(c,h,M))}function AO(c,h,y){var M=Go(c),T={lane:M,action:y,hasEagerState:!1,eagerState:null,next:null};if(ib(c))rb(h,T);else{sb(c,h,T);var P=c.alternate;if(c.lanes===0&&(P===null||P.lanes===0)&&(P=h.lastRenderedReducer,P!==null))try{var B=h.lastRenderedState,$=P(B,y);if(T.hasEagerState=!0,T.eagerState=$,Ms($,B))return}catch{}finally{}y=Di(),c=Or(c,M,y),c!==null&&ob(c,h,M)}}function ib(c){var h=c.alternate;return c===wn||h!==null&&h===wn}function rb(c,h){Zc=jd=!0;var y=c.pending;y===null?h.next=h:(h.next=y.next,y.next=h),c.pending=h}function sb(c,h,y){kn!==null&&c.mode&1&&!(Ct&2)?(c=h.interleaved,c===null?(y.next=y,bs===null?bs=[h]:bs.push(h)):(y.next=c.next,c.next=y),h.interleaved=y):(c=h.pending,c===null?y.next=y:(y.next=c.next,c.next=y),h.pending=y)}function ob(c,h,y){if(y&4194240){var M=h.lanes;M&=c.pendingLanes,y|=M,h.lanes=y,dy(c,y)}}var Zd={readContext:Pr,useCallback:pi,useContext:pi,useEffect:pi,useImperativeHandle:pi,useInsertionEffect:pi,useLayoutEffect:pi,useMemo:pi,useReducer:pi,useRef:pi,useState:pi,useDebugValue:pi,useDeferredValue:pi,useTransition:pi,useMutableSource:pi,useSyncExternalStore:pi,useId:pi,unstable_isNewReconciler:!1},CO={readContext:Pr,useCallback:function(c,h){return to().memoizedState=[c,h===void 0?null:h],c},useContext:Pr,useEffect:Uy,useImperativeHandle:function(c,h,y){return y=y!=null?y.concat([c]):null,qd(4194308,4,JE.bind(null,h,c),y)},useLayoutEffect:function(c,h){return qd(4194308,4,c,h)},useInsertionEffect:function(c,h){return qd(4,2,c,h)},useMemo:function(c,h){var y=to();return h=h===void 0?null:h,c=c(),y.memoizedState=[c,h],c},useReducer:function(c,h,y){var M=to();return h=y!==void 0?y(h):h,M.memoizedState=M.baseState=h,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:h},M.queue=c,c=c.dispatch=TO.bind(null,wn,c),[M.memoizedState,c]},useRef:function(c){var h=to();return c={current:c},h.memoizedState=c},useState:Fy,useDebugValue:zy,useDeferredValue:function(c){var h=Fy(c),y=h[0],M=h[1];return Uy(function(){var T=Dr.transition;Dr.transition={};try{M(c)}finally{Dr.transition=T}},[c]),y},useTransition:function(){var c=Fy(!1),h=c[0];return c=bO.bind(null,c[1]),to().memoizedState=c,[h,c]},useMutableSource:function(){},useSyncExternalStore:function(c,h,y){var M=wn,T=to();if(un){if(y===void 0)throw Error(o(407));y=y()}else{if(y=h(),kn===null)throw Error(o(349));Jl&30||jE(M,h,y)}T.memoizedState=y;var P={value:y,getSnapshot:h};return T.queue=P,Uy($E.bind(null,M,P,c),[c]),M.flags|=2048,Jc(9,XE.bind(null,M,P,y,h),void 0,null),y},useId:function(){var c=to(),h=kn.identifierPrefix;if(un){var y=eo,M=Qs;y=(M&~(1<<32-Jr(M)-1)).toString(32)+y,h=":"+h+"R"+y,y=Kc++,0")&&(fe=fe.replace("",c.displayName)),fe}while(1<=B&&0<=$);break}}}finally{ln=!1,Error.prepareStackTrace=y}return(c=c?c.displayName||c.name:"")?vt(c):""}var Ii=Object.prototype.hasOwnProperty,sr=[],Pt=-1;function ot(c){return{current:c}}function jt(c){0>Pt||(c.current=sr[Pt],sr[Pt]=null,Pt--)}function at(c,h){Pt++,sr[Pt]=c.current,c.current=h}var fi={},Wn=ot(fi),On=ot(!1),Kr=fi;function fn(c,h){var y=c.type.contextTypes;if(!y)return fi;var M=c.stateNode;if(M&&M.__reactInternalMemoizedUnmaskedChildContext===h)return M.__reactInternalMemoizedMaskedChildContext;var T={},P;for(P in y)T[P]=h[P];return M&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=h,c.__reactInternalMemoizedMaskedChildContext=T),T}function dn(c){return c=c.childContextTypes,c!=null}function Uo(){jt(On),jt(Wn)}function Li(c,h,y){if(Wn.current!==fi)throw Error(o(168));at(Wn,h),at(On,y)}function Hl(c,h,y){var M=c.stateNode;if(h=h.childContextTypes,typeof M.getChildContext!="function")return y;M=M.getChildContext();for(var T in M)if(!(T in h))throw Error(o(108,L(c)||"Unknown",T));return s({},y,M)}function Gl(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||fi,Kr=Wn.current,at(Wn,c),at(On,On.current),!0}function Hc(c,h,y){var M=c.stateNode;if(!M)throw Error(o(169));y?(c=Hl(c,h,Kr),M.__reactInternalMemoizedMergedChildContext=c,jt(On),jt(Wn),at(Wn,c)):jt(On),at(On,y)}var Jr=Math.clz32?Math.clz32:hO,uO=Math.log,cO=Math.LN2;function hO(c){return c>>>=0,c===0?32:31-(uO(c)/cO|0)|0}var Rd=64,Pd=4194304;function Gc(c){switch(c&-c){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return c&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return c}}function Id(c,h){var y=c.pendingLanes;if(y===0)return 0;var M=0,T=c.suspendedLanes,P=c.pingedLanes,B=y&268435455;if(B!==0){var $=B&~T;$!==0?M=Gc($):(P&=B,P!==0&&(M=Gc(P)))}else B=y&~T,B!==0?M=Gc(B):P!==0&&(M=Gc(P));if(M===0)return 0;if(h!==0&&h!==M&&!(h&T)&&(T=M&-M,P=h&-h,T>=P||T===16&&(P&4194240)!==0))return h;if(M&4&&(M|=y&16),h=c.entangledLanes,h!==0)for(c=c.entanglements,h&=M;0y;y++)h.push(c);return h}function Wc(c,h,y){c.pendingLanes|=h,h!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,h=31-Jr(h),c[h]=y}function pO(c,h){var y=c.pendingLanes&~h;c.pendingLanes=h,c.suspendedLanes=0,c.pingedLanes=0,c.expiredLanes&=h,c.mutableReadLanes&=h,c.entangledLanes&=h,h=c.entanglements;var M=c.eventTimes;for(c=c.expirationTimes;0>=B,T-=B,Qs=1<<32-Jr(h)+T|y<Vt?(Jn=_t,_t=null):Jn=_t.sibling;var Ht=rt(ie,_t,le[Vt],Ue);if(Ht===null){_t===null&&(_t=Jn);break}c&&_t&&Ht.alternate===null&&h(ie,_t),Z=P(Ht,Z,Vt),At===null?Ze=Ht:At.sibling=Ht,At=Ht,_t=Jn}if(Vt===le.length)return y(ie,_t),un&&La(ie,Vt),Ze;if(_t===null){for(;VtVt?(Jn=_t,_t=null):Jn=_t.sibling;var Xo=rt(ie,_t,Ht.value,Ue);if(Xo===null){_t===null&&(_t=Jn);break}c&&_t&&Xo.alternate===null&&h(ie,_t),Z=P(Xo,Z,Vt),At===null?Ze=Xo:At.sibling=Xo,At=Xo,_t=Jn}if(Ht.done)return y(ie,_t),un&&La(ie,Vt),Ze;if(_t===null){for(;!Ht.done;Vt++,Ht=le.next())Ht=yt(ie,Ht.value,Ue),Ht!==null&&(Z=P(Ht,Z,Vt),At===null?Ze=Ht:At.sibling=Ht,At=Ht);return un&&La(ie,Vt),Ze}for(_t=M(ie,_t);!Ht.done;Vt++,Ht=le.next())Ht=en(_t,ie,Vt,Ht.value,Ue),Ht!==null&&(c&&Ht.alternate!==null&&_t.delete(Ht.key===null?Vt:Ht.key),Z=P(Ht,Z,Vt),At===null?Ze=Ht:At.sibling=Ht,At=Ht);return c&&_t.forEach(function(QO){return h(ie,QO)}),un&&La(ie,Vt),Ze}function Fr(ie,Z,le,Ue){if(typeof le=="object"&&le!==null&&le.type===f&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case l:e:{for(var Ze=le.key,At=Z;At!==null;){if(At.key===Ze){if(Ze=le.type,Ze===f){if(At.tag===7){y(ie,At.sibling),Z=T(At,le.props.children),Z.return=ie,ie=Z;break e}}else if(At.elementType===Ze||typeof Ze=="object"&&Ze!==null&&Ze.$$typeof===S&&zE(Ze)===At.type){y(ie,At.sibling),Z=T(At,le.props),Z.ref=$c(ie,At,le),Z.return=ie,ie=Z;break e}y(ie,At);break}else h(ie,At);At=At.sibling}le.type===f?(Z=za(le.props.children,ie.mode,Ue,le.key),Z.return=ie,ie=Z):(Ue=_p(le.type,le.key,le.props,null,ie.mode,Ue),Ue.ref=$c(ie,Z,le),Ue.return=ie,ie=Ue)}return B(ie);case u:e:{for(At=le.key;Z!==null;){if(Z.key===At)if(Z.tag===4&&Z.stateNode.containerInfo===le.containerInfo&&Z.stateNode.implementation===le.implementation){y(ie,Z.sibling),Z=T(Z,le.children||[]),Z.return=ie,ie=Z;break e}else{y(ie,Z);break}else h(ie,Z);Z=Z.sibling}Z=d_(le,ie.mode,Ue),Z.return=ie,ie=Z}return B(ie);case S:return At=le._init,Fr(ie,Z,At(le._payload),Ue)}if(j(le))return Je(ie,Z,le,Ue);if(A(le))return gi(ie,Z,le,Ue);Hd(ie,le)}return typeof le=="string"&&le!==""||typeof le=="number"?(le=""+le,Z!==null&&Z.tag===6?(y(ie,Z.sibling),Z=T(Z,le),Z.return=ie,ie=Z):(y(ie,Z),Z=f_(le,ie.mode,Ue),Z.return=ie,ie=Z),B(ie)):y(ie,Z)}return Fr}var Yl=BE(!0),VE=BE(!1),qc={},Nr=ot(qc),Yc=ot(qc),Zl=ot(qc);function Ts(c){if(c===qc)throw Error(o(174));return c}function Py(c,h){at(Zl,h),at(Yc,c),at(Nr,qc),c=oe(h),jt(Nr),at(Nr,c)}function Kl(){jt(Nr),jt(Yc),jt(Zl)}function HE(c){var h=Ts(Zl.current),y=Ts(Nr.current);h=k(y,c.type,h),y!==h&&(at(Yc,c),at(Nr,h))}function Iy(c){Yc.current===c&&(jt(Nr),jt(Yc))}var pn=ot(0);function Gd(c){for(var h=c;h!==null;){if(h.tag===13){var y=h.memoizedState;if(y!==null&&(y=y.dehydrated,y===null||Pa(y)||Bl(y)))return h}else if(h.tag===19&&h.memoizedProps.revealOrder!==void 0){if(h.flags&128)return h}else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===c)break;for(;h.sibling===null;){if(h.return===null||h.return===c)return null;h=h.return}h.sibling.return=h.return,h=h.sibling}return null}var Ly=[];function Ny(){for(var c=0;cy?y:4,c(!0);var M=Dr.transition;Dr.transition={};try{c(!1),h()}finally{Bt=y,Dr.transition=M}}function nb(){return As().memoizedState}function TO(c,h,y){var M=Go(c);y={lane:M,action:y,hasEagerState:!1,eagerState:null,next:null},ib(c)?rb(h,y):(sb(c,h,y),y=Di(),c=Or(c,M,y),c!==null&&ob(c,h,M))}function AO(c,h,y){var M=Go(c),T={lane:M,action:y,hasEagerState:!1,eagerState:null,next:null};if(ib(c))rb(h,T);else{sb(c,h,T);var P=c.alternate;if(c.lanes===0&&(P===null||P.lanes===0)&&(P=h.lastRenderedReducer,P!==null))try{var B=h.lastRenderedState,$=P(B,y);if(T.hasEagerState=!0,T.eagerState=$,Ms($,B))return}catch{}finally{}y=Di(),c=Or(c,M,y),c!==null&&ob(c,h,M)}}function ib(c){var h=c.alternate;return c===wn||h!==null&&h===wn}function rb(c,h){Zc=jd=!0;var y=c.pending;y===null?h.next=h:(h.next=y.next,y.next=h),c.pending=h}function sb(c,h,y){kn!==null&&c.mode&1&&!(Ct&2)?(c=h.interleaved,c===null?(y.next=y,bs===null?bs=[h]:bs.push(h)):(y.next=c.next,c.next=y),h.interleaved=y):(c=h.pending,c===null?y.next=y:(y.next=c.next,c.next=y),h.pending=y)}function ob(c,h,y){if(y&4194240){var M=h.lanes;M&=c.pendingLanes,y|=M,h.lanes=y,dy(c,y)}}var Zd={readContext:Pr,useCallback:pi,useContext:pi,useEffect:pi,useImperativeHandle:pi,useInsertionEffect:pi,useLayoutEffect:pi,useMemo:pi,useReducer:pi,useRef:pi,useState:pi,useDebugValue:pi,useDeferredValue:pi,useTransition:pi,useMutableSource:pi,useSyncExternalStore:pi,useId:pi,unstable_isNewReconciler:!1},CO={readContext:Pr,useCallback:function(c,h){return to().memoizedState=[c,h===void 0?null:h],c},useContext:Pr,useEffect:Uy,useImperativeHandle:function(c,h,y){return y=y!=null?y.concat([c]):null,qd(4194308,4,JE.bind(null,h,c),y)},useLayoutEffect:function(c,h){return qd(4194308,4,c,h)},useInsertionEffect:function(c,h){return qd(4,2,c,h)},useMemo:function(c,h){var y=to();return h=h===void 0?null:h,c=c(),y.memoizedState=[c,h],c},useReducer:function(c,h,y){var M=to();return h=y!==void 0?y(h):h,M.memoizedState=M.baseState=h,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:h},M.queue=c,c=c.dispatch=TO.bind(null,wn,c),[M.memoizedState,c]},useRef:function(c){var h=to();return c={current:c},h.memoizedState=c},useState:Fy,useDebugValue:zy,useDeferredValue:function(c){var h=Fy(c),y=h[0],M=h[1];return Uy(function(){var T=Dr.transition;Dr.transition={};try{M(c)}finally{Dr.transition=T}},[c]),y},useTransition:function(){var c=Fy(!1),h=c[0];return c=bO.bind(null,c[1]),to().memoizedState=c,[h,c]},useMutableSource:function(){},useSyncExternalStore:function(c,h,y){var M=wn,T=to();if(un){if(y===void 0)throw Error(o(407));y=y()}else{if(y=h(),kn===null)throw Error(o(349));Jl&30||jE(M,h,y)}T.memoizedState=y;var P={value:y,getSnapshot:h};return T.queue=P,Uy($E.bind(null,M,P,c),[c]),M.flags|=2048,Jc(9,XE.bind(null,M,P,y,h),void 0,null),y},useId:function(){var c=to(),h=kn.identifierPrefix;if(un){var y=eo,M=Qs;y=(M&~(1<<32-Jr(M)-1)).toString(32)+y,h=":"+h+"R"+y,y=Kc++,0r_&&(h.flags|=128,M=!0,nh(T,!1),h.lanes=4194304)}else{if(!M)if(c=Gd(P),c!==null){if(h.flags|=128,M=!0,c=c.updateQueue,c!==null&&(h.updateQueue=c,h.flags|=4),nh(T,!0),T.tail===null&&T.tailMode==="hidden"&&!P.alternate&&!un)return mi(h),null}else 2*Zn()-T.renderingStartTime>r_&&y!==1073741824&&(h.flags|=128,M=!0,nh(T,!1),h.lanes=4194304);T.isBackwards?(P.sibling=h.child,h.child=P):(c=T.last,c!==null?c.sibling=P:h.child=P,T.last=P)}return T.tail!==null?(h=T.tail,T.rendering=h,T.tail=h.sibling,T.renderingStartTime=Zn(),h.sibling=null,c=pn.current,at(pn,M?c&1|2:c&1),h):(mi(h),null);case 22:case 23:return u_(),M=h.memoizedState!==null,c!==null&&c.memoizedState!==null!==M&&(h.flags|=8192),M&&h.mode&1?ur&1073741824&&(mi(h),tt&&h.subtreeFlags&6&&(h.flags|=8192)):mi(h),null;case 24:return null;case 25:return null}throw Error(o(156,h.tag))}var NO=a.ReactCurrentOwner,lr=!1;function Ni(c,h,y,M){h.child=c===null?VE(h,null,y,M):Yl(h,c.child,y,M)}function pb(c,h,y,M,T){y=y.render;var P=h.ref;return jl(h,T),M=Oy(c,h,y,M,P,T),y=ky(),c!==null&&!lr?(h.updateQueue=c.updateQueue,h.flags&=-2053,c.lanes&=~T,no(c,h,T)):(un&&y&&by(h),h.flags|=1,Ni(c,h,M,T),h.child)}function mb(c,h,y,M,T){if(c===null){var P=y.type;return typeof P=="function"&&!h_(P)&&P.defaultProps===void 0&&y.compare===null&&y.defaultProps===void 0?(h.tag=15,h.type=P,gb(c,h,P,M,T)):(c=_p(y.type,null,M,h,h.mode,T),c.ref=h.ref,c.return=h,h.child=c)}if(P=c.child,!(c.lanes&T)){var B=P.memoizedProps;if(y=y.compare,y=y!==null?y:Dd,y(B,M)&&c.ref===h.ref)return no(c,h,T)}return h.flags|=1,c=jo(P,M),c.ref=h.ref,c.return=h,h.child=c}function gb(c,h,y,M,T){if(c!==null&&Dd(c.memoizedProps,M)&&c.ref===h.ref)if(lr=!1,(c.lanes&T)!==0)c.flags&131072&&(lr=!0);else return h.lanes=c.lanes,no(c,h,T);return Hy(c,h,y,M,T)}function vb(c,h,y){var M=h.pendingProps,T=M.children,P=c!==null?c.memoizedState:null;if(M.mode==="hidden")if(!(h.mode&1))h.memoizedState={baseLanes:0,cachePool:null},at(Ql,ur),ur|=y;else if(y&1073741824)h.memoizedState={baseLanes:0,cachePool:null},M=P!==null?P.baseLanes:y,at(Ql,ur),ur|=M;else return c=P!==null?P.baseLanes|y:y,h.lanes=h.childLanes=1073741824,h.memoizedState={baseLanes:c,cachePool:null},h.updateQueue=null,at(Ql,ur),ur|=c,null;else P!==null?(M=P.baseLanes|y,h.memoizedState=null):M=y,at(Ql,ur),ur|=M;return Ni(c,h,T,y),h.child}function yb(c,h){var y=h.ref;(c===null&&y!==null||c!==null&&c.ref!==y)&&(h.flags|=512,h.flags|=2097152)}function Hy(c,h,y,M,T){var P=dn(y)?Kr:Wn.current;return P=fn(h,P),jl(h,T),y=Oy(c,h,y,M,P,T),M=ky(),c!==null&&!lr?(h.updateQueue=c.updateQueue,h.flags&=-2053,c.lanes&=~T,no(c,h,T)):(un&&M&&by(h),h.flags|=1,Ni(c,h,y,T),h.child)}function _b(c,h,y,M,T){if(dn(y)){var P=!0;Gl(h)}else P=!1;if(jl(h,T),h.stateNode===null)c!==null&&(c.alternate=null,h.alternate=null,h.flags|=2),NE(h,y,M),Ey(h,y,M,T),M=!0;else if(c===null){var B=h.stateNode,$=h.memoizedProps;B.props=$;var fe=B.context,Ae=y.contextType;typeof Ae=="object"&&Ae!==null?Ae=Pr(Ae):(Ae=dn(y)?Kr:Wn.current,Ae=fn(h,Ae));var We=y.getDerivedStateFromProps,yt=typeof We=="function"||typeof B.getSnapshotBeforeUpdate=="function";yt||typeof B.UNSAFE_componentWillReceiveProps!="function"&&typeof B.componentWillReceiveProps!="function"||($!==M||fe!==Ae)&&DE(h,B,M,Ae),zo=!1;var rt=h.memoizedState;B.state=rt,Ud(h,M,B,T),fe=h.memoizedState,$!==M||rt!==fe||On.current||zo?(typeof We=="function"&&(My(h,y,We,M),fe=h.memoizedState),($=zo||LE(h,y,$,M,rt,fe,Ae))?(yt||typeof B.UNSAFE_componentWillMount!="function"&&typeof B.componentWillMount!="function"||(typeof B.componentWillMount=="function"&&B.componentWillMount(),typeof B.UNSAFE_componentWillMount=="function"&&B.UNSAFE_componentWillMount()),typeof B.componentDidMount=="function"&&(h.flags|=4194308)):(typeof B.componentDidMount=="function"&&(h.flags|=4194308),h.memoizedProps=M,h.memoizedState=fe),B.props=M,B.state=fe,B.context=Ae,M=$):(typeof B.componentDidMount=="function"&&(h.flags|=4194308),M=!1)}else{B=h.stateNode,CE(c,h),$=h.memoizedProps,Ae=h.type===h.elementType?$:Qr(h.type,$),B.props=Ae,yt=h.pendingProps,rt=B.context,fe=y.contextType,typeof fe=="object"&&fe!==null?fe=Pr(fe):(fe=dn(y)?Kr:Wn.current,fe=fn(h,fe));var en=y.getDerivedStateFromProps;(We=typeof en=="function"||typeof B.getSnapshotBeforeUpdate=="function")||typeof B.UNSAFE_componentWillReceiveProps!="function"&&typeof B.componentWillReceiveProps!="function"||($!==yt||rt!==fe)&&DE(h,B,M,fe),zo=!1,rt=h.memoizedState,B.state=rt,Ud(h,M,B,T);var Je=h.memoizedState;$!==yt||rt!==Je||On.current||zo?(typeof en=="function"&&(My(h,y,en,M),Je=h.memoizedState),(Ae=zo||LE(h,y,Ae,M,rt,Je,fe)||!1)?(We||typeof B.UNSAFE_componentWillUpdate!="function"&&typeof B.componentWillUpdate!="function"||(typeof B.componentWillUpdate=="function"&&B.componentWillUpdate(M,Je,fe),typeof B.UNSAFE_componentWillUpdate=="function"&&B.UNSAFE_componentWillUpdate(M,Je,fe)),typeof B.componentDidUpdate=="function"&&(h.flags|=4),typeof B.getSnapshotBeforeUpdate=="function"&&(h.flags|=1024)):(typeof B.componentDidUpdate!="function"||$===c.memoizedProps&&rt===c.memoizedState||(h.flags|=4),typeof B.getSnapshotBeforeUpdate!="function"||$===c.memoizedProps&&rt===c.memoizedState||(h.flags|=1024),h.memoizedProps=M,h.memoizedState=Je),B.props=M,B.state=Je,B.context=fe,M=Ae):(typeof B.componentDidUpdate!="function"||$===c.memoizedProps&&rt===c.memoizedState||(h.flags|=4),typeof B.getSnapshotBeforeUpdate!="function"||$===c.memoizedProps&&rt===c.memoizedState||(h.flags|=1024),M=!1)}return Gy(c,h,y,M,P,T)}function Gy(c,h,y,M,T,P){yb(c,h);var B=(h.flags&128)!==0;if(!M&&!B)return T&&Hc(h,y,!1),no(c,h,P);M=h.stateNode,NO.current=h;var $=B&&typeof y.getDerivedStateFromError!="function"?null:M.render();return h.flags|=1,c!==null&&B?(h.child=Yl(h,c.child,null,P),h.child=Yl(h,null,$,P)):Ni(c,h,$,P),h.memoizedState=M.state,T&&Hc(h,y,!0),h.child}function xb(c){var h=c.stateNode;h.pendingContext?Li(c,h.pendingContext,h.pendingContext!==h.context):h.context&&Li(c,h.context,!1),Py(c,h.containerInfo)}function wb(c,h,y,M,T){return ql(),Ry(T),h.flags|=256,Ni(c,h,y,M),h.child}var Qd={dehydrated:null,treeContext:null,retryLane:0};function ep(c){return{baseLanes:c,cachePool:null}}function Sb(c,h,y){var M=h.pendingProps,T=pn.current,P=!1,B=(h.flags&128)!==0,$;if(($=B)||($=c!==null&&c.memoizedState===null?!1:(T&2)!==0),$?(P=!0,h.flags&=-129):(c===null||c.memoizedState!==null)&&(T|=1),at(pn,T&1),c===null)return Cy(h),c=h.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?(h.mode&1?Bl(c)?h.lanes=8:h.lanes=1073741824:h.lanes=1,null):(T=M.children,c=M.fallback,P?(M=h.mode,P=h.child,T={mode:"hidden",children:T},!(M&1)&&P!==null?(P.childLanes=0,P.pendingProps=T):P=xp(T,M,0,null),c=za(c,M,y,null),P.return=h,c.return=h,P.sibling=c,h.child=P,h.child.memoizedState=ep(y),h.memoizedState=Qd,c):Wy(h,T));if(T=c.memoizedState,T!==null){if($=T.dehydrated,$!==null){if(B)return h.flags&256?(h.flags&=-257,tp(c,h,y,Error(o(422)))):h.memoizedState!==null?(h.child=c.child,h.flags|=128,null):(P=M.fallback,T=h.mode,M=xp({mode:"visible",children:M.children},T,0,null),P=za(P,T,y,null),P.flags|=2,M.return=h,P.return=h,M.sibling=P,h.child=M,h.mode&1&&Yl(h,c.child,null,y),h.child.memoizedState=ep(y),h.memoizedState=Qd,P);if(!(h.mode&1))h=tp(c,h,y,null);else if(Bl($))h=tp(c,h,y,Error(o(419)));else if(M=(y&c.childLanes)!==0,lr||M){if(M=kn,M!==null){switch(y&-y){case 4:P=2;break;case 16:P=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:P=32;break;case 536870912:P=268435456;break;default:P=0}M=P&(M.suspendedLanes|y)?0:P,M!==0&&M!==T.retryLane&&(T.retryLane=M,Or(c,M,-1))}c_(),h=tp(c,h,y,Error(o(421)))}else Pa($)?(h.flags|=128,h.child=c.child,h=XO.bind(null,c),Vl($,h),h=null):(y=T.treeContext,we&&(ar=uy($),or=h,un=!0,es=null,jc=!1,y!==null&&(Ir[Lr++]=Qs,Ir[Lr++]=eo,Ir[Lr++]=Ia,Qs=y.id,eo=y.overflow,Ia=h)),h=Wy(h,h.pendingProps.children),h.flags|=4096);return h}return P?(M=Eb(c,h,M.children,M.fallback,y),P=h.child,T=c.child.memoizedState,P.memoizedState=T===null?ep(y):{baseLanes:T.baseLanes|y,cachePool:null},P.childLanes=c.childLanes&~y,h.memoizedState=Qd,M):(y=Mb(c,h,M.children,y),h.memoizedState=null,y)}return P?(M=Eb(c,h,M.children,M.fallback,y),P=h.child,T=c.child.memoizedState,P.memoizedState=T===null?ep(y):{baseLanes:T.baseLanes|y,cachePool:null},P.childLanes=c.childLanes&~y,h.memoizedState=Qd,M):(y=Mb(c,h,M.children,y),h.memoizedState=null,y)}function Wy(c,h){return h=xp({mode:"visible",children:h},c.mode,0,null),h.return=c,c.child=h}function Mb(c,h,y,M){var T=c.child;return c=T.sibling,y=jo(T,{mode:"visible",children:y}),!(h.mode&1)&&(y.lanes=M),y.return=h,y.sibling=null,c!==null&&(M=h.deletions,M===null?(h.deletions=[c],h.flags|=16):M.push(c)),h.child=y}function Eb(c,h,y,M,T){var P=h.mode;c=c.child;var B=c.sibling,$={mode:"hidden",children:y};return!(P&1)&&h.child!==c?(y=h.child,y.childLanes=0,y.pendingProps=$,h.deletions=null):(y=jo(c,$),y.subtreeFlags=c.subtreeFlags&14680064),B!==null?M=jo(B,M):(M=za(M,P,T,null),M.flags|=2),M.return=h,y.return=h,y.sibling=M,h.child=y,M}function tp(c,h,y,M){return M!==null&&Ry(M),Yl(h,c.child,null,y),c=Wy(h,h.pendingProps.children),c.flags|=2,h.memoizedState=null,c}function bb(c,h,y){c.lanes|=h;var M=c.alternate;M!==null&&(M.lanes|=h),wy(c.return,h,y)}function jy(c,h,y,M,T){var P=c.memoizedState;P===null?c.memoizedState={isBackwards:h,rendering:null,renderingStartTime:0,last:M,tail:y,tailMode:T}:(P.isBackwards=h,P.rendering=null,P.renderingStartTime=0,P.last=M,P.tail=y,P.tailMode=T)}function Tb(c,h,y){var M=h.pendingProps,T=M.revealOrder,P=M.tail;if(Ni(c,h,M.children,y),M=pn.current,M&2)M=M&1|2,h.flags|=128;else{if(c!==null&&c.flags&128)e:for(c=h.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&bb(c,y,h);else if(c.tag===19)bb(c,y,h);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===h)break e;for(;c.sibling===null;){if(c.return===null||c.return===h)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}M&=1}if(at(pn,M),!(h.mode&1))h.memoizedState=null;else switch(T){case"forwards":for(y=h.child,T=null;y!==null;)c=y.alternate,c!==null&&Gd(c)===null&&(T=y),y=y.sibling;y=T,y===null?(T=h.child,h.child=null):(T=y.sibling,y.sibling=null),jy(h,!1,T,y,P);break;case"backwards":for(y=null,T=h.child,h.child=null;T!==null;){if(c=T.alternate,c!==null&&Gd(c)===null){h.child=T;break}c=T.sibling,T.sibling=y,y=T,T=c}jy(h,!0,y,null,P);break;case"together":jy(h,!1,null,null,void 0);break;default:h.memoizedState=null}return h.child}function no(c,h,y){if(c!==null&&(h.dependencies=c.dependencies),eu|=h.lanes,!(y&h.childLanes))return null;if(c!==null&&h.child!==c.child)throw Error(o(153));if(h.child!==null){for(c=h.child,y=jo(c,c.pendingProps),h.child=y,y.return=h;c.sibling!==null;)c=c.sibling,y=y.sibling=jo(c,c.pendingProps),y.return=h;y.sibling=null}return h.child}function DO(c,h,y){switch(h.tag){case 3:xb(h),ql();break;case 5:HE(h);break;case 1:dn(h.type)&&Gl(h);break;case 4:Py(h,h.stateNode.containerInfo);break;case 10:AE(h,h.type._context,h.memoizedProps.value);break;case 13:var M=h.memoizedState;if(M!==null)return M.dehydrated!==null?(at(pn,pn.current&1),h.flags|=128,null):y&h.child.childLanes?Sb(c,h,y):(at(pn,pn.current&1),c=no(c,h,y),c!==null?c.sibling:null);at(pn,pn.current&1);break;case 19:if(M=(y&h.childLanes)!==0,c.flags&128){if(M)return Tb(c,h,y);h.flags|=128}var T=h.memoizedState;if(T!==null&&(T.rendering=null,T.tail=null,T.lastEffect=null),at(pn,pn.current),M)break;return null;case 22:case 23:return h.lanes=0,vb(c,h,y)}return no(c,h,y)}function OO(c,h){switch(Ty(h),h.tag){case 1:return dn(h.type)&&Uo(),c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 3:return Kl(),jt(On),jt(Wn),Ny(),c=h.flags,c&65536&&!(c&128)?(h.flags=c&-65537|128,h):null;case 5:return Iy(h),null;case 13:if(jt(pn),c=h.memoizedState,c!==null&&c.dehydrated!==null){if(h.alternate===null)throw Error(o(340));ql()}return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 19:return jt(pn),null;case 4:return Kl(),null;case 10:return xy(h.type._context),null;case 22:case 23:return u_(),null;case 24:return null;default:return null}}var np=!1,Da=!1,kO=typeof WeakSet=="function"?WeakSet:Set,Fe=null;function ip(c,h){var y=c.ref;if(y!==null)if(typeof y=="function")try{y(null)}catch(M){$i(c,h,M)}else y.current=null}function Xy(c,h,y){try{y()}catch(M){$i(c,h,M)}}var Ab=!1;function FO(c,h){for(W(c.containerInfo),Fe=h;Fe!==null;)if(c=Fe,h=c.child,(c.subtreeFlags&1028)!==0&&h!==null)h.return=c,Fe=h;else for(;Fe!==null;){c=Fe;try{var y=c.alternate;if(c.flags&1024)switch(c.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var M=y.memoizedProps,T=y.memoizedState,P=c.stateNode,B=P.getSnapshotBeforeUpdate(c.elementType===c.type?M:Qr(c.type,M),T);P.__reactInternalSnapshotBeforeUpdate=B}break;case 3:tt&&Ne(c.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch($){$i(c,c.return,$)}if(h=c.sibling,h!==null){h.return=c.return,Fe=h;break}Fe=c.return}return y=Ab,Ab=!1,y}function Oa(c,h,y){var M=h.updateQueue;if(M=M!==null?M.lastEffect:null,M!==null){var T=M=M.next;do{if((T.tag&c)===c){var P=T.destroy;T.destroy=void 0,P!==void 0&&Xy(h,y,P)}T=T.next}while(T!==M)}}function ih(c,h){if(h=h.updateQueue,h=h!==null?h.lastEffect:null,h!==null){var y=h=h.next;do{if((y.tag&c)===c){var M=y.create;y.destroy=M()}y=y.next}while(y!==h)}}function $y(c){var h=c.ref;if(h!==null){var y=c.stateNode;switch(c.tag){case 5:c=Q(y);break;default:c=y}typeof h=="function"?h(c):h.current=c}}function Cb(c,h,y){if(Ss&&typeof Ss.onCommitFiberUnmount=="function")try{Ss.onCommitFiberUnmount(Ld,h)}catch{}switch(h.tag){case 0:case 11:case 14:case 15:if(c=h.updateQueue,c!==null&&(c=c.lastEffect,c!==null)){var M=c=c.next;do{var T=M,P=T.destroy;T=T.tag,P!==void 0&&(T&2||T&4)&&Xy(h,y,P),M=M.next}while(M!==c)}break;case 1:if(ip(h,y),c=h.stateNode,typeof c.componentWillUnmount=="function")try{c.props=h.memoizedProps,c.state=h.memoizedState,c.componentWillUnmount()}catch(B){$i(h,y,B)}break;case 5:ip(h,y);break;case 4:tt?Db(c,h,y):he&&he&&(h=h.stateNode.containerInfo,y=Wt(h),Rt(h,y))}}function Rb(c,h,y){for(var M=h;;)if(Cb(c,M,y),M.child===null||tt&&M.tag===4){if(M===h)break;for(;M.sibling===null;){if(M.return===null||M.return===h)return;M=M.return}M.sibling.return=M.return,M=M.sibling}else M.child.return=M,M=M.child}function Pb(c){var h=c.alternate;h!==null&&(c.alternate=null,Pb(h)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(h=c.stateNode,h!==null&&Be(h)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function Ib(c){return c.tag===5||c.tag===3||c.tag===4}function Lb(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||Ib(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function Nb(c){if(tt){e:{for(var h=c.return;h!==null;){if(Ib(h))break e;h=h.return}throw Error(o(160))}var y=h;switch(y.tag){case 5:h=y.stateNode,y.flags&32&&(ge(h),y.flags&=-33),y=Lb(c),Yy(c,y,h);break;case 3:case 4:h=y.stateNode.containerInfo,y=Lb(c),qy(c,y,h);break;default:throw Error(o(161))}}}function qy(c,h,y){var M=c.tag;if(M===5||M===6)c=c.stateNode,h?pt(y,c,h):Re(y,c);else if(M!==4&&(c=c.child,c!==null))for(qy(c,h,y),c=c.sibling;c!==null;)qy(c,h,y),c=c.sibling}function Yy(c,h,y){var M=c.tag;if(M===5||M===6)c=c.stateNode,h?Ve(y,c,h):ft(y,c);else if(M!==4&&(c=c.child,c!==null))for(Yy(c,h,y),c=c.sibling;c!==null;)Yy(c,h,y),c=c.sibling}function Db(c,h,y){for(var M=h,T=!1,P,B;;){if(!T){T=M.return;e:for(;;){if(T===null)throw Error(o(160));switch(P=T.stateNode,T.tag){case 5:B=!1;break e;case 3:P=P.containerInfo,B=!0;break e;case 4:P=P.containerInfo,B=!0;break e}T=T.return}T=!0}if(M.tag===5||M.tag===6)Rb(c,M,y),B?X(P,M.stateNode):Et(P,M.stateNode);else if(M.tag===18)B?Xe(P,M.stateNode):ke(P,M.stateNode);else if(M.tag===4){if(M.child!==null){P=M.stateNode.containerInfo,B=!0,M.child.return=M,M=M.child;continue}}else if(Cb(c,M,y),M.child!==null){M.child.return=M,M=M.child;continue}if(M===h)break;for(;M.sibling===null;){if(M.return===null||M.return===h)return;M=M.return,M.tag===4&&(T=!1)}M.sibling.return=M.return,M=M.sibling}}function Zy(c,h){if(tt){switch(h.tag){case 0:case 11:case 14:case 15:Oa(3,h,h.return),ih(3,h),Oa(5,h,h.return);return;case 1:return;case 5:var y=h.stateNode;if(y!=null){var M=h.memoizedProps;c=c!==null?c.memoizedProps:M;var T=h.type,P=h.updateQueue;h.updateQueue=null,P!==null&&it(y,P,T,c,M,h)}return;case 6:if(h.stateNode===null)throw Error(o(162));y=h.memoizedProps,$e(h.stateNode,c!==null?c.memoizedProps:y,y);return;case 3:we&&c!==null&&c.memoizedState.isDehydrated&&re(h.stateNode.containerInfo);return;case 12:return;case 13:rp(h);return;case 19:rp(h);return;case 17:return}throw Error(o(163))}switch(h.tag){case 0:case 11:case 14:case 15:Oa(3,h,h.return),ih(3,h),Oa(5,h,h.return);return;case 12:return;case 13:rp(h);return;case 19:rp(h);return;case 3:we&&c!==null&&c.memoizedState.isDehydrated&&re(h.stateNode.containerInfo);break;case 22:case 23:return}e:if(he){switch(h.tag){case 1:case 5:case 6:break e;case 3:case 4:h=h.stateNode,Rt(h.containerInfo,h.pendingChildren);break e}throw Error(o(163))}}function rp(c){var h=c.updateQueue;if(h!==null){c.updateQueue=null;var y=c.stateNode;y===null&&(y=c.stateNode=new kO),h.forEach(function(M){var T=$O.bind(null,c,M);y.has(M)||(y.add(M),M.then(T,T))})}}function UO(c,h){for(Fe=h;Fe!==null;){h=Fe;var y=h.deletions;if(y!==null)for(var M=0;M";case op:return":has("+(Qy(c)||"")+")";case ap:return'[role="'+c.value+'"]';case up:return'"'+c.value+'"';case lp:return'[data-testname="'+c.value+'"]';default:throw Error(o(365))}}function zb(c,h){var y=[];c=[c,0];for(var M=0;MT&&(T=B),M&=~P}if(M=T,M=Zn()-M,M=(120>M?120:480>M?480:1080>M?1080:1920>M?1920:3e3>M?3e3:4320>M?4320:1960*BO(M/1960))-M,10c?16:c,Ho===null)var M=!1;else{if(c=Ho,Ho=null,pp=0,Ct&6)throw Error(o(331));var T=Ct;for(Ct|=4,Fe=c.current;Fe!==null;){var P=Fe,B=P.child;if(Fe.flags&16){var $=P.deletions;if($!==null){for(var fe=0;fe<$.length;fe++){var Ae=$[fe];for(Fe=Ae;Fe!==null;){var We=Fe;switch(We.tag){case 0:case 11:case 15:Oa(8,We,P)}var yt=We.child;if(yt!==null)yt.return=We,Fe=yt;else for(;Fe!==null;){We=Fe;var rt=We.sibling,en=We.return;if(Pb(We),We===Ae){Fe=null;break}if(rt!==null){rt.return=en,Fe=rt;break}Fe=en}}}var Je=P.alternate;if(Je!==null){var gi=Je.child;if(gi!==null){Je.child=null;do{var Fr=gi.sibling;gi.sibling=null,gi=Fr}while(gi!==null)}}Fe=P}}if(P.subtreeFlags&2064&&B!==null)B.return=P,Fe=B;else e:for(;Fe!==null;){if(P=Fe,P.flags&2048)switch(P.tag){case 0:case 11:case 15:Oa(9,P,P.return)}var ie=P.sibling;if(ie!==null){ie.return=P.return,Fe=ie;break e}Fe=P.return}}var Z=c.current;for(Fe=Z;Fe!==null;){B=Fe;var le=B.child;if(B.subtreeFlags&2064&&le!==null)le.return=B,Fe=le;else e:for(B=Z;Fe!==null;){if($=Fe,$.flags&2048)try{switch($.tag){case 0:case 11:case 15:ih(9,$)}}catch(Ze){$i($,$.return,Ze)}if($===B){Fe=null;break e}var Ue=$.sibling;if(Ue!==null){Ue.return=$.return,Fe=Ue;break e}Fe=$.return}}if(Ct=T,Es(),Ss&&typeof Ss.onPostCommitFiberRoot=="function")try{Ss.onPostCommitFiberRoot(Ld,c)}catch{}M=!0}return M}finally{Bt=y,Rn.transition=h}}return!1}function $b(c,h,y){h=By(y,h),h=ab(c,h,1),Bo(c,h),h=Di(),c=vp(c,1),c!==null&&(Wc(c,1,h),Xi(c,h))}function $i(c,h,y){if(c.tag===3)$b(c,c,y);else for(;h!==null;){if(h.tag===3){$b(h,c,y);break}else if(h.tag===1){var M=h.stateNode;if(typeof h.type.getDerivedStateFromError=="function"||typeof M.componentDidCatch=="function"&&(Vo===null||!Vo.has(M))){c=By(y,c),c=lb(h,c,1),Bo(h,c),c=Di(),h=vp(h,1),h!==null&&(Wc(h,1,c),Xi(h,c));break}}h=h.return}}function jO(c,h,y){var M=c.pingCache;M!==null&&M.delete(h),h=Di(),c.pingedLanes|=c.suspendedLanes&y,kn===c&&(ri&y)===y&&(jn===4||jn===3&&(ri&130023424)===ri&&500>Zn()-i_?ka(c,0):n_|=y),Xi(c,h)}function qb(c,h){h===0&&(c.mode&1?(h=Pd,Pd<<=1,!(Pd&130023424)&&(Pd=4194304)):h=1);var y=Di();c=vp(c,h),c!==null&&(Wc(c,h,y),Xi(c,y))}function XO(c){var h=c.memoizedState,y=0;h!==null&&(y=h.retryLane),qb(c,y)}function $O(c,h){var y=0;switch(c.tag){case 13:var M=c.stateNode,T=c.memoizedState;T!==null&&(y=T.retryLane);break;case 19:M=c.stateNode;break;default:throw Error(o(314))}M!==null&&M.delete(h),qb(c,y)}var Yb;Yb=function(c,h,y){if(c!==null)if(c.memoizedProps!==h.pendingProps||On.current)lr=!0;else{if(!(c.lanes&y)&&!(h.flags&128))return lr=!1,DO(c,h,y);lr=!!(c.flags&131072)}else lr=!1,un&&h.flags&1048576&&OE(h,Vd,h.index);switch(h.lanes=0,h.tag){case 2:var M=h.type;c!==null&&(c.alternate=null,h.alternate=null,h.flags|=2),c=h.pendingProps;var T=fn(h,Wn.current);jl(h,y),T=Oy(null,h,M,c,T,y);var P=ky();return h.flags|=1,typeof T=="object"&&T!==null&&typeof T.render=="function"&&T.$$typeof===void 0?(h.tag=1,h.memoizedState=null,h.updateQueue=null,dn(M)?(P=!0,Gl(h)):P=!1,h.memoizedState=T.state!==null&&T.state!==void 0?T.state:null,Sy(h),T.updater=zd,h.stateNode=T,T._reactInternals=h,Ey(h,M,c,y),h=Gy(null,h,M,!0,P,y)):(h.tag=0,un&&P&&by(h),Ni(null,h,T,y),h=h.child),h;case 16:M=h.elementType;e:{switch(c!==null&&(c.alternate=null,h.alternate=null,h.flags|=2),c=h.pendingProps,T=M._init,M=T(M._payload),h.type=M,T=h.tag=YO(M),c=Qr(M,c),T){case 0:h=Hy(null,h,M,c,y);break e;case 1:h=_b(null,h,M,c,y);break e;case 11:h=pb(null,h,M,c,y);break e;case 14:h=mb(null,h,M,Qr(M.type,c),y);break e}throw Error(o(306,M,""))}return h;case 0:return M=h.type,T=h.pendingProps,T=h.elementType===M?T:Qr(M,T),Hy(c,h,M,T,y);case 1:return M=h.type,T=h.pendingProps,T=h.elementType===M?T:Qr(M,T),_b(c,h,M,T,y);case 3:e:{if(xb(h),c===null)throw Error(o(387));M=h.pendingProps,P=h.memoizedState,T=P.element,CE(c,h),Ud(h,M,null,y);var B=h.memoizedState;if(M=B.element,we&&P.isDehydrated)if(P={element:M,isDehydrated:!1,cache:B.cache,transitions:B.transitions},h.updateQueue.baseState=P,h.memoizedState=P,h.flags&256){T=Error(o(423)),h=wb(c,h,M,y,T);break e}else if(M!==T){T=Error(o(424)),h=wb(c,h,M,y,T);break e}else for(we&&(ar=ly(h.stateNode.containerInfo),or=h,un=!0,es=null,jc=!1),y=VE(h,null,M,y),h.child=y;y;)y.flags=y.flags&-3|4096,y=y.sibling;else{if(ql(),M===T){h=no(c,h,y);break e}Ni(c,h,M,y)}h=h.child}return h;case 5:return HE(h),c===null&&Cy(h),M=h.type,T=h.pendingProps,P=c!==null?c.memoizedProps:null,B=T.children,pe(M,T)?B=null:P!==null&&pe(M,P)&&(h.flags|=32),yb(c,h),Ni(c,h,B,y),h.child;case 6:return c===null&&Cy(h),null;case 13:return Sb(c,h,y);case 4:return Py(h,h.stateNode.containerInfo),M=h.pendingProps,c===null?h.child=Yl(h,null,M,y):Ni(c,h,M,y),h.child;case 11:return M=h.type,T=h.pendingProps,T=h.elementType===M?T:Qr(M,T),pb(c,h,M,T,y);case 7:return Ni(c,h,h.pendingProps,y),h.child;case 8:return Ni(c,h,h.pendingProps.children,y),h.child;case 12:return Ni(c,h,h.pendingProps.children,y),h.child;case 10:e:{if(M=h.type._context,T=h.pendingProps,P=h.memoizedProps,B=T.value,AE(h,M,B),P!==null)if(Ms(P.value,B)){if(P.children===T.children&&!On.current){h=no(c,h,y);break e}}else for(P=h.child,P!==null&&(P.return=h);P!==null;){var $=P.dependencies;if($!==null){B=P.child;for(var fe=$.firstContext;fe!==null;){if(fe.context===M){if(P.tag===1){fe=Js(-1,y&-y),fe.tag=2;var Ae=P.updateQueue;if(Ae!==null){Ae=Ae.shared;var We=Ae.pending;We===null?fe.next=fe:(fe.next=We.next,We.next=fe),Ae.pending=fe}}P.lanes|=y,fe=P.alternate,fe!==null&&(fe.lanes|=y),wy(P.return,y,h),$.lanes|=y;break}fe=fe.next}}else if(P.tag===10)B=P.type===h.type?null:P.child;else if(P.tag===18){if(B=P.return,B===null)throw Error(o(341));B.lanes|=y,$=B.alternate,$!==null&&($.lanes|=y),wy(B,y,h),B=P.sibling}else B=P.child;if(B!==null)B.return=P;else for(B=P;B!==null;){if(B===h){B=null;break}if(P=B.sibling,P!==null){P.return=B.return,B=P;break}B=B.return}P=B}Ni(c,h,T.children,y),h=h.child}return h;case 9:return T=h.type,M=h.pendingProps.children,jl(h,y),T=Pr(T),M=M(T),h.flags|=1,Ni(c,h,M,y),h.child;case 14:return M=h.type,T=Qr(M,h.pendingProps),T=Qr(M.type,T),mb(c,h,M,T,y);case 15:return gb(c,h,h.type,h.pendingProps,y);case 17:return M=h.type,T=h.pendingProps,T=h.elementType===M?T:Qr(M,T),c!==null&&(c.alternate=null,h.alternate=null,h.flags|=2),h.tag=1,dn(M)?(c=!0,Gl(h)):c=!1,jl(h,y),NE(h,M,T),Ey(h,M,T,y),Gy(null,h,M,!0,c,y);case 19:return Tb(c,h,y);case 22:return vb(c,h,y)}throw Error(o(156,h.tag))};function Zb(c,h){return py(c,h)}function qO(c,h,y,M){this.tag=c,this.key=y,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=h,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=M,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function kr(c,h,y,M){return new qO(c,h,y,M)}function h_(c){return c=c.prototype,!(!c||!c.isReactComponent)}function YO(c){if(typeof c=="function")return h_(c)?1:0;if(c!=null){if(c=c.$$typeof,c===x)return 11;if(c===w)return 14}return 2}function jo(c,h){var y=c.alternate;return y===null?(y=kr(c.tag,h,c.key,c.mode),y.elementType=c.elementType,y.type=c.type,y.stateNode=c.stateNode,y.alternate=c,c.alternate=y):(y.pendingProps=h,y.type=c.type,y.flags=0,y.subtreeFlags=0,y.deletions=null),y.flags=c.flags&14680064,y.childLanes=c.childLanes,y.lanes=c.lanes,y.child=c.child,y.memoizedProps=c.memoizedProps,y.memoizedState=c.memoizedState,y.updateQueue=c.updateQueue,h=c.dependencies,y.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},y.sibling=c.sibling,y.index=c.index,y.ref=c.ref,y}function _p(c,h,y,M,T,P){var B=2;if(M=c,typeof c=="function")h_(c)&&(B=1);else if(typeof c=="string")B=5;else e:switch(c){case f:return za(y.children,T,P,h);case d:B=8,T|=8;break;case p:return c=kr(12,y,h,T|2),c.elementType=p,c.lanes=P,c;case _:return c=kr(13,y,h,T),c.elementType=_,c.lanes=P,c;case m:return c=kr(19,y,h,T),c.elementType=m,c.lanes=P,c;case b:return xp(y,T,P,h);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case g:B=10;break e;case v:B=9;break e;case x:B=11;break e;case w:B=14;break e;case S:B=16,M=null;break e}throw Error(o(130,c==null?c:typeof c,""))}return h=kr(B,y,h,T),h.elementType=c,h.type=M,h.lanes=P,h}function za(c,h,y,M){return c=kr(7,c,M,h),c.lanes=y,c}function xp(c,h,y,M){return c=kr(22,c,M,h),c.elementType=b,c.lanes=y,c.stateNode={},c}function f_(c,h,y){return c=kr(6,c,null,h),c.lanes=y,c}function d_(c,h,y){return h=kr(4,c.children!==null?c.children:[],c.key,h),h.lanes=y,h.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},h}function ZO(c,h,y,M,T){this.tag=h,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=lt,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=fy(0),this.expirationTimes=fy(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fy(0),this.identifierPrefix=M,this.onRecoverableError=T,we&&(this.mutableSourceEagerHydrationData=null)}function Kb(c,h,y,M,T,P,B,$,fe){return c=new ZO(c,h,y,$,fe),h===1?(h=1,P===!0&&(h|=8)):h=0,P=kr(3,null,null,h),c.current=P,P.stateNode=c,P.memoizedState={element:M,isDehydrated:y,cache:null,transitions:null},Sy(P),c}function Jb(c){if(!c)return fi;c=c._reactInternals;e:{if(I(c)!==c||c.tag!==1)throw Error(o(170));var h=c;do{switch(h.tag){case 3:h=h.stateNode.context;break e;case 1:if(dn(h.type)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break e}}h=h.return}while(h!==null);throw Error(o(171))}if(c.tag===1){var y=c.type;if(dn(y))return Hl(c,y,h)}return h}function Qb(c){var h=c._reactInternals;if(h===void 0)throw typeof c.render=="function"?Error(o(188)):(c=Object.keys(c).join(","),Error(o(268,c)));return c=z(h),c===null?null:c.stateNode}function eT(c,h){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var y=c.retryLane;c.retryLane=y!==0&&y=Ae&&P>=yt&&T<=We&&B<=rt){c.splice(h,1);break}else if(M!==Ae||y.width!==fe.width||rtB){if(!(P!==yt||y.height!==fe.height||WeT)){Ae>M&&(fe.width+=Ae-M,fe.x=M),WeP&&(fe.height+=yt-P,fe.y=P),rty&&(y=B)),Br_&&(h.flags|=128,M=!0,nh(T,!1),h.lanes=4194304)}else{if(!M)if(c=Gd(P),c!==null){if(h.flags|=128,M=!0,c=c.updateQueue,c!==null&&(h.updateQueue=c,h.flags|=4),nh(T,!0),T.tail===null&&T.tailMode==="hidden"&&!P.alternate&&!un)return mi(h),null}else 2*Zn()-T.renderingStartTime>r_&&y!==1073741824&&(h.flags|=128,M=!0,nh(T,!1),h.lanes=4194304);T.isBackwards?(P.sibling=h.child,h.child=P):(c=T.last,c!==null?c.sibling=P:h.child=P,T.last=P)}return T.tail!==null?(h=T.tail,T.rendering=h,T.tail=h.sibling,T.renderingStartTime=Zn(),h.sibling=null,c=pn.current,at(pn,M?c&1|2:c&1),h):(mi(h),null);case 22:case 23:return u_(),M=h.memoizedState!==null,c!==null&&c.memoizedState!==null!==M&&(h.flags|=8192),M&&h.mode&1?ur&1073741824&&(mi(h),tt&&h.subtreeFlags&6&&(h.flags|=8192)):mi(h),null;case 24:return null;case 25:return null}throw Error(o(156,h.tag))}var NO=a.ReactCurrentOwner,lr=!1;function Ni(c,h,y,M){h.child=c===null?VE(h,null,y,M):Yl(h,c.child,y,M)}function pb(c,h,y,M,T){y=y.render;var P=h.ref;return jl(h,T),M=Oy(c,h,y,M,P,T),y=ky(),c!==null&&!lr?(h.updateQueue=c.updateQueue,h.flags&=-2053,c.lanes&=~T,no(c,h,T)):(un&&y&&by(h),h.flags|=1,Ni(c,h,M,T),h.child)}function mb(c,h,y,M,T){if(c===null){var P=y.type;return typeof P=="function"&&!h_(P)&&P.defaultProps===void 0&&y.compare===null&&y.defaultProps===void 0?(h.tag=15,h.type=P,gb(c,h,P,M,T)):(c=_p(y.type,null,M,h,h.mode,T),c.ref=h.ref,c.return=h,h.child=c)}if(P=c.child,!(c.lanes&T)){var B=P.memoizedProps;if(y=y.compare,y=y!==null?y:Dd,y(B,M)&&c.ref===h.ref)return no(c,h,T)}return h.flags|=1,c=jo(P,M),c.ref=h.ref,c.return=h,h.child=c}function gb(c,h,y,M,T){if(c!==null&&Dd(c.memoizedProps,M)&&c.ref===h.ref)if(lr=!1,(c.lanes&T)!==0)c.flags&131072&&(lr=!0);else return h.lanes=c.lanes,no(c,h,T);return Hy(c,h,y,M,T)}function vb(c,h,y){var M=h.pendingProps,T=M.children,P=c!==null?c.memoizedState:null;if(M.mode==="hidden")if(!(h.mode&1))h.memoizedState={baseLanes:0,cachePool:null},at(Ql,ur),ur|=y;else if(y&1073741824)h.memoizedState={baseLanes:0,cachePool:null},M=P!==null?P.baseLanes:y,at(Ql,ur),ur|=M;else return c=P!==null?P.baseLanes|y:y,h.lanes=h.childLanes=1073741824,h.memoizedState={baseLanes:c,cachePool:null},h.updateQueue=null,at(Ql,ur),ur|=c,null;else P!==null?(M=P.baseLanes|y,h.memoizedState=null):M=y,at(Ql,ur),ur|=M;return Ni(c,h,T,y),h.child}function yb(c,h){var y=h.ref;(c===null&&y!==null||c!==null&&c.ref!==y)&&(h.flags|=512,h.flags|=2097152)}function Hy(c,h,y,M,T){var P=dn(y)?Kr:Wn.current;return P=fn(h,P),jl(h,T),y=Oy(c,h,y,M,P,T),M=ky(),c!==null&&!lr?(h.updateQueue=c.updateQueue,h.flags&=-2053,c.lanes&=~T,no(c,h,T)):(un&&M&&by(h),h.flags|=1,Ni(c,h,y,T),h.child)}function _b(c,h,y,M,T){if(dn(y)){var P=!0;Gl(h)}else P=!1;if(jl(h,T),h.stateNode===null)c!==null&&(c.alternate=null,h.alternate=null,h.flags|=2),NE(h,y,M),Ey(h,y,M,T),M=!0;else if(c===null){var B=h.stateNode,$=h.memoizedProps;B.props=$;var fe=B.context,Ae=y.contextType;typeof Ae=="object"&&Ae!==null?Ae=Pr(Ae):(Ae=dn(y)?Kr:Wn.current,Ae=fn(h,Ae));var Ge=y.getDerivedStateFromProps,yt=typeof Ge=="function"||typeof B.getSnapshotBeforeUpdate=="function";yt||typeof B.UNSAFE_componentWillReceiveProps!="function"&&typeof B.componentWillReceiveProps!="function"||($!==M||fe!==Ae)&&DE(h,B,M,Ae),zo=!1;var rt=h.memoizedState;B.state=rt,Ud(h,M,B,T),fe=h.memoizedState,$!==M||rt!==fe||On.current||zo?(typeof Ge=="function"&&(My(h,y,Ge,M),fe=h.memoizedState),($=zo||LE(h,y,$,M,rt,fe,Ae))?(yt||typeof B.UNSAFE_componentWillMount!="function"&&typeof B.componentWillMount!="function"||(typeof B.componentWillMount=="function"&&B.componentWillMount(),typeof B.UNSAFE_componentWillMount=="function"&&B.UNSAFE_componentWillMount()),typeof B.componentDidMount=="function"&&(h.flags|=4194308)):(typeof B.componentDidMount=="function"&&(h.flags|=4194308),h.memoizedProps=M,h.memoizedState=fe),B.props=M,B.state=fe,B.context=Ae,M=$):(typeof B.componentDidMount=="function"&&(h.flags|=4194308),M=!1)}else{B=h.stateNode,CE(c,h),$=h.memoizedProps,Ae=h.type===h.elementType?$:Qr(h.type,$),B.props=Ae,yt=h.pendingProps,rt=B.context,fe=y.contextType,typeof fe=="object"&&fe!==null?fe=Pr(fe):(fe=dn(y)?Kr:Wn.current,fe=fn(h,fe));var en=y.getDerivedStateFromProps;(Ge=typeof en=="function"||typeof B.getSnapshotBeforeUpdate=="function")||typeof B.UNSAFE_componentWillReceiveProps!="function"&&typeof B.componentWillReceiveProps!="function"||($!==yt||rt!==fe)&&DE(h,B,M,fe),zo=!1,rt=h.memoizedState,B.state=rt,Ud(h,M,B,T);var Je=h.memoizedState;$!==yt||rt!==Je||On.current||zo?(typeof en=="function"&&(My(h,y,en,M),Je=h.memoizedState),(Ae=zo||LE(h,y,Ae,M,rt,Je,fe)||!1)?(Ge||typeof B.UNSAFE_componentWillUpdate!="function"&&typeof B.componentWillUpdate!="function"||(typeof B.componentWillUpdate=="function"&&B.componentWillUpdate(M,Je,fe),typeof B.UNSAFE_componentWillUpdate=="function"&&B.UNSAFE_componentWillUpdate(M,Je,fe)),typeof B.componentDidUpdate=="function"&&(h.flags|=4),typeof B.getSnapshotBeforeUpdate=="function"&&(h.flags|=1024)):(typeof B.componentDidUpdate!="function"||$===c.memoizedProps&&rt===c.memoizedState||(h.flags|=4),typeof B.getSnapshotBeforeUpdate!="function"||$===c.memoizedProps&&rt===c.memoizedState||(h.flags|=1024),h.memoizedProps=M,h.memoizedState=Je),B.props=M,B.state=Je,B.context=fe,M=Ae):(typeof B.componentDidUpdate!="function"||$===c.memoizedProps&&rt===c.memoizedState||(h.flags|=4),typeof B.getSnapshotBeforeUpdate!="function"||$===c.memoizedProps&&rt===c.memoizedState||(h.flags|=1024),M=!1)}return Gy(c,h,y,M,P,T)}function Gy(c,h,y,M,T,P){yb(c,h);var B=(h.flags&128)!==0;if(!M&&!B)return T&&Hc(h,y,!1),no(c,h,P);M=h.stateNode,NO.current=h;var $=B&&typeof y.getDerivedStateFromError!="function"?null:M.render();return h.flags|=1,c!==null&&B?(h.child=Yl(h,c.child,null,P),h.child=Yl(h,null,$,P)):Ni(c,h,$,P),h.memoizedState=M.state,T&&Hc(h,y,!0),h.child}function xb(c){var h=c.stateNode;h.pendingContext?Li(c,h.pendingContext,h.pendingContext!==h.context):h.context&&Li(c,h.context,!1),Py(c,h.containerInfo)}function wb(c,h,y,M,T){return ql(),Ry(T),h.flags|=256,Ni(c,h,y,M),h.child}var Qd={dehydrated:null,treeContext:null,retryLane:0};function ep(c){return{baseLanes:c,cachePool:null}}function Sb(c,h,y){var M=h.pendingProps,T=pn.current,P=!1,B=(h.flags&128)!==0,$;if(($=B)||($=c!==null&&c.memoizedState===null?!1:(T&2)!==0),$?(P=!0,h.flags&=-129):(c===null||c.memoizedState!==null)&&(T|=1),at(pn,T&1),c===null)return Cy(h),c=h.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?(h.mode&1?Bl(c)?h.lanes=8:h.lanes=1073741824:h.lanes=1,null):(T=M.children,c=M.fallback,P?(M=h.mode,P=h.child,T={mode:"hidden",children:T},!(M&1)&&P!==null?(P.childLanes=0,P.pendingProps=T):P=xp(T,M,0,null),c=za(c,M,y,null),P.return=h,c.return=h,P.sibling=c,h.child=P,h.child.memoizedState=ep(y),h.memoizedState=Qd,c):Wy(h,T));if(T=c.memoizedState,T!==null){if($=T.dehydrated,$!==null){if(B)return h.flags&256?(h.flags&=-257,tp(c,h,y,Error(o(422)))):h.memoizedState!==null?(h.child=c.child,h.flags|=128,null):(P=M.fallback,T=h.mode,M=xp({mode:"visible",children:M.children},T,0,null),P=za(P,T,y,null),P.flags|=2,M.return=h,P.return=h,M.sibling=P,h.child=M,h.mode&1&&Yl(h,c.child,null,y),h.child.memoizedState=ep(y),h.memoizedState=Qd,P);if(!(h.mode&1))h=tp(c,h,y,null);else if(Bl($))h=tp(c,h,y,Error(o(419)));else if(M=(y&c.childLanes)!==0,lr||M){if(M=kn,M!==null){switch(y&-y){case 4:P=2;break;case 16:P=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:P=32;break;case 536870912:P=268435456;break;default:P=0}M=P&(M.suspendedLanes|y)?0:P,M!==0&&M!==T.retryLane&&(T.retryLane=M,Or(c,M,-1))}c_(),h=tp(c,h,y,Error(o(421)))}else Pa($)?(h.flags|=128,h.child=c.child,h=XO.bind(null,c),Vl($,h),h=null):(y=T.treeContext,we&&(ar=uy($),or=h,un=!0,es=null,jc=!1,y!==null&&(Ir[Lr++]=Qs,Ir[Lr++]=eo,Ir[Lr++]=Ia,Qs=y.id,eo=y.overflow,Ia=h)),h=Wy(h,h.pendingProps.children),h.flags|=4096);return h}return P?(M=Eb(c,h,M.children,M.fallback,y),P=h.child,T=c.child.memoizedState,P.memoizedState=T===null?ep(y):{baseLanes:T.baseLanes|y,cachePool:null},P.childLanes=c.childLanes&~y,h.memoizedState=Qd,M):(y=Mb(c,h,M.children,y),h.memoizedState=null,y)}return P?(M=Eb(c,h,M.children,M.fallback,y),P=h.child,T=c.child.memoizedState,P.memoizedState=T===null?ep(y):{baseLanes:T.baseLanes|y,cachePool:null},P.childLanes=c.childLanes&~y,h.memoizedState=Qd,M):(y=Mb(c,h,M.children,y),h.memoizedState=null,y)}function Wy(c,h){return h=xp({mode:"visible",children:h},c.mode,0,null),h.return=c,c.child=h}function Mb(c,h,y,M){var T=c.child;return c=T.sibling,y=jo(T,{mode:"visible",children:y}),!(h.mode&1)&&(y.lanes=M),y.return=h,y.sibling=null,c!==null&&(M=h.deletions,M===null?(h.deletions=[c],h.flags|=16):M.push(c)),h.child=y}function Eb(c,h,y,M,T){var P=h.mode;c=c.child;var B=c.sibling,$={mode:"hidden",children:y};return!(P&1)&&h.child!==c?(y=h.child,y.childLanes=0,y.pendingProps=$,h.deletions=null):(y=jo(c,$),y.subtreeFlags=c.subtreeFlags&14680064),B!==null?M=jo(B,M):(M=za(M,P,T,null),M.flags|=2),M.return=h,y.return=h,y.sibling=M,h.child=y,M}function tp(c,h,y,M){return M!==null&&Ry(M),Yl(h,c.child,null,y),c=Wy(h,h.pendingProps.children),c.flags|=2,h.memoizedState=null,c}function bb(c,h,y){c.lanes|=h;var M=c.alternate;M!==null&&(M.lanes|=h),wy(c.return,h,y)}function jy(c,h,y,M,T){var P=c.memoizedState;P===null?c.memoizedState={isBackwards:h,rendering:null,renderingStartTime:0,last:M,tail:y,tailMode:T}:(P.isBackwards=h,P.rendering=null,P.renderingStartTime=0,P.last=M,P.tail=y,P.tailMode=T)}function Tb(c,h,y){var M=h.pendingProps,T=M.revealOrder,P=M.tail;if(Ni(c,h,M.children,y),M=pn.current,M&2)M=M&1|2,h.flags|=128;else{if(c!==null&&c.flags&128)e:for(c=h.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&bb(c,y,h);else if(c.tag===19)bb(c,y,h);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===h)break e;for(;c.sibling===null;){if(c.return===null||c.return===h)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}M&=1}if(at(pn,M),!(h.mode&1))h.memoizedState=null;else switch(T){case"forwards":for(y=h.child,T=null;y!==null;)c=y.alternate,c!==null&&Gd(c)===null&&(T=y),y=y.sibling;y=T,y===null?(T=h.child,h.child=null):(T=y.sibling,y.sibling=null),jy(h,!1,T,y,P);break;case"backwards":for(y=null,T=h.child,h.child=null;T!==null;){if(c=T.alternate,c!==null&&Gd(c)===null){h.child=T;break}c=T.sibling,T.sibling=y,y=T,T=c}jy(h,!0,y,null,P);break;case"together":jy(h,!1,null,null,void 0);break;default:h.memoizedState=null}return h.child}function no(c,h,y){if(c!==null&&(h.dependencies=c.dependencies),eu|=h.lanes,!(y&h.childLanes))return null;if(c!==null&&h.child!==c.child)throw Error(o(153));if(h.child!==null){for(c=h.child,y=jo(c,c.pendingProps),h.child=y,y.return=h;c.sibling!==null;)c=c.sibling,y=y.sibling=jo(c,c.pendingProps),y.return=h;y.sibling=null}return h.child}function DO(c,h,y){switch(h.tag){case 3:xb(h),ql();break;case 5:HE(h);break;case 1:dn(h.type)&&Gl(h);break;case 4:Py(h,h.stateNode.containerInfo);break;case 10:AE(h,h.type._context,h.memoizedProps.value);break;case 13:var M=h.memoizedState;if(M!==null)return M.dehydrated!==null?(at(pn,pn.current&1),h.flags|=128,null):y&h.child.childLanes?Sb(c,h,y):(at(pn,pn.current&1),c=no(c,h,y),c!==null?c.sibling:null);at(pn,pn.current&1);break;case 19:if(M=(y&h.childLanes)!==0,c.flags&128){if(M)return Tb(c,h,y);h.flags|=128}var T=h.memoizedState;if(T!==null&&(T.rendering=null,T.tail=null,T.lastEffect=null),at(pn,pn.current),M)break;return null;case 22:case 23:return h.lanes=0,vb(c,h,y)}return no(c,h,y)}function OO(c,h){switch(Ty(h),h.tag){case 1:return dn(h.type)&&Uo(),c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 3:return Kl(),jt(On),jt(Wn),Ny(),c=h.flags,c&65536&&!(c&128)?(h.flags=c&-65537|128,h):null;case 5:return Iy(h),null;case 13:if(jt(pn),c=h.memoizedState,c!==null&&c.dehydrated!==null){if(h.alternate===null)throw Error(o(340));ql()}return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 19:return jt(pn),null;case 4:return Kl(),null;case 10:return xy(h.type._context),null;case 22:case 23:return u_(),null;case 24:return null;default:return null}}var np=!1,Da=!1,kO=typeof WeakSet=="function"?WeakSet:Set,Fe=null;function ip(c,h){var y=c.ref;if(y!==null)if(typeof y=="function")try{y(null)}catch(M){$i(c,h,M)}else y.current=null}function Xy(c,h,y){try{y()}catch(M){$i(c,h,M)}}var Ab=!1;function FO(c,h){for(W(c.containerInfo),Fe=h;Fe!==null;)if(c=Fe,h=c.child,(c.subtreeFlags&1028)!==0&&h!==null)h.return=c,Fe=h;else for(;Fe!==null;){c=Fe;try{var y=c.alternate;if(c.flags&1024)switch(c.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var M=y.memoizedProps,T=y.memoizedState,P=c.stateNode,B=P.getSnapshotBeforeUpdate(c.elementType===c.type?M:Qr(c.type,M),T);P.__reactInternalSnapshotBeforeUpdate=B}break;case 3:tt&&Ne(c.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch($){$i(c,c.return,$)}if(h=c.sibling,h!==null){h.return=c.return,Fe=h;break}Fe=c.return}return y=Ab,Ab=!1,y}function Oa(c,h,y){var M=h.updateQueue;if(M=M!==null?M.lastEffect:null,M!==null){var T=M=M.next;do{if((T.tag&c)===c){var P=T.destroy;T.destroy=void 0,P!==void 0&&Xy(h,y,P)}T=T.next}while(T!==M)}}function ih(c,h){if(h=h.updateQueue,h=h!==null?h.lastEffect:null,h!==null){var y=h=h.next;do{if((y.tag&c)===c){var M=y.create;y.destroy=M()}y=y.next}while(y!==h)}}function $y(c){var h=c.ref;if(h!==null){var y=c.stateNode;switch(c.tag){case 5:c=Q(y);break;default:c=y}typeof h=="function"?h(c):h.current=c}}function Cb(c,h,y){if(Ss&&typeof Ss.onCommitFiberUnmount=="function")try{Ss.onCommitFiberUnmount(Ld,h)}catch{}switch(h.tag){case 0:case 11:case 14:case 15:if(c=h.updateQueue,c!==null&&(c=c.lastEffect,c!==null)){var M=c=c.next;do{var T=M,P=T.destroy;T=T.tag,P!==void 0&&(T&2||T&4)&&Xy(h,y,P),M=M.next}while(M!==c)}break;case 1:if(ip(h,y),c=h.stateNode,typeof c.componentWillUnmount=="function")try{c.props=h.memoizedProps,c.state=h.memoizedState,c.componentWillUnmount()}catch(B){$i(h,y,B)}break;case 5:ip(h,y);break;case 4:tt?Db(c,h,y):he&&he&&(h=h.stateNode.containerInfo,y=Wt(h),Rt(h,y))}}function Rb(c,h,y){for(var M=h;;)if(Cb(c,M,y),M.child===null||tt&&M.tag===4){if(M===h)break;for(;M.sibling===null;){if(M.return===null||M.return===h)return;M=M.return}M.sibling.return=M.return,M=M.sibling}else M.child.return=M,M=M.child}function Pb(c){var h=c.alternate;h!==null&&(c.alternate=null,Pb(h)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(h=c.stateNode,h!==null&&Be(h)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function Ib(c){return c.tag===5||c.tag===3||c.tag===4}function Lb(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||Ib(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function Nb(c){if(tt){e:{for(var h=c.return;h!==null;){if(Ib(h))break e;h=h.return}throw Error(o(160))}var y=h;switch(y.tag){case 5:h=y.stateNode,y.flags&32&&(ge(h),y.flags&=-33),y=Lb(c),Yy(c,y,h);break;case 3:case 4:h=y.stateNode.containerInfo,y=Lb(c),qy(c,y,h);break;default:throw Error(o(161))}}}function qy(c,h,y){var M=c.tag;if(M===5||M===6)c=c.stateNode,h?pt(y,c,h):Re(y,c);else if(M!==4&&(c=c.child,c!==null))for(qy(c,h,y),c=c.sibling;c!==null;)qy(c,h,y),c=c.sibling}function Yy(c,h,y){var M=c.tag;if(M===5||M===6)c=c.stateNode,h?Ve(y,c,h):ft(y,c);else if(M!==4&&(c=c.child,c!==null))for(Yy(c,h,y),c=c.sibling;c!==null;)Yy(c,h,y),c=c.sibling}function Db(c,h,y){for(var M=h,T=!1,P,B;;){if(!T){T=M.return;e:for(;;){if(T===null)throw Error(o(160));switch(P=T.stateNode,T.tag){case 5:B=!1;break e;case 3:P=P.containerInfo,B=!0;break e;case 4:P=P.containerInfo,B=!0;break e}T=T.return}T=!0}if(M.tag===5||M.tag===6)Rb(c,M,y),B?X(P,M.stateNode):Et(P,M.stateNode);else if(M.tag===18)B?Xe(P,M.stateNode):ke(P,M.stateNode);else if(M.tag===4){if(M.child!==null){P=M.stateNode.containerInfo,B=!0,M.child.return=M,M=M.child;continue}}else if(Cb(c,M,y),M.child!==null){M.child.return=M,M=M.child;continue}if(M===h)break;for(;M.sibling===null;){if(M.return===null||M.return===h)return;M=M.return,M.tag===4&&(T=!1)}M.sibling.return=M.return,M=M.sibling}}function Zy(c,h){if(tt){switch(h.tag){case 0:case 11:case 14:case 15:Oa(3,h,h.return),ih(3,h),Oa(5,h,h.return);return;case 1:return;case 5:var y=h.stateNode;if(y!=null){var M=h.memoizedProps;c=c!==null?c.memoizedProps:M;var T=h.type,P=h.updateQueue;h.updateQueue=null,P!==null&&it(y,P,T,c,M,h)}return;case 6:if(h.stateNode===null)throw Error(o(162));y=h.memoizedProps,$e(h.stateNode,c!==null?c.memoizedProps:y,y);return;case 3:we&&c!==null&&c.memoizedState.isDehydrated&&re(h.stateNode.containerInfo);return;case 12:return;case 13:rp(h);return;case 19:rp(h);return;case 17:return}throw Error(o(163))}switch(h.tag){case 0:case 11:case 14:case 15:Oa(3,h,h.return),ih(3,h),Oa(5,h,h.return);return;case 12:return;case 13:rp(h);return;case 19:rp(h);return;case 3:we&&c!==null&&c.memoizedState.isDehydrated&&re(h.stateNode.containerInfo);break;case 22:case 23:return}e:if(he){switch(h.tag){case 1:case 5:case 6:break e;case 3:case 4:h=h.stateNode,Rt(h.containerInfo,h.pendingChildren);break e}throw Error(o(163))}}function rp(c){var h=c.updateQueue;if(h!==null){c.updateQueue=null;var y=c.stateNode;y===null&&(y=c.stateNode=new kO),h.forEach(function(M){var T=$O.bind(null,c,M);y.has(M)||(y.add(M),M.then(T,T))})}}function UO(c,h){for(Fe=h;Fe!==null;){h=Fe;var y=h.deletions;if(y!==null)for(var M=0;M";case op:return":has("+(Qy(c)||"")+")";case ap:return'[role="'+c.value+'"]';case up:return'"'+c.value+'"';case lp:return'[data-testname="'+c.value+'"]';default:throw Error(o(365))}}function zb(c,h){var y=[];c=[c,0];for(var M=0;MT&&(T=B),M&=~P}if(M=T,M=Zn()-M,M=(120>M?120:480>M?480:1080>M?1080:1920>M?1920:3e3>M?3e3:4320>M?4320:1960*BO(M/1960))-M,10c?16:c,Ho===null)var M=!1;else{if(c=Ho,Ho=null,pp=0,Ct&6)throw Error(o(331));var T=Ct;for(Ct|=4,Fe=c.current;Fe!==null;){var P=Fe,B=P.child;if(Fe.flags&16){var $=P.deletions;if($!==null){for(var fe=0;fe<$.length;fe++){var Ae=$[fe];for(Fe=Ae;Fe!==null;){var Ge=Fe;switch(Ge.tag){case 0:case 11:case 15:Oa(8,Ge,P)}var yt=Ge.child;if(yt!==null)yt.return=Ge,Fe=yt;else for(;Fe!==null;){Ge=Fe;var rt=Ge.sibling,en=Ge.return;if(Pb(Ge),Ge===Ae){Fe=null;break}if(rt!==null){rt.return=en,Fe=rt;break}Fe=en}}}var Je=P.alternate;if(Je!==null){var gi=Je.child;if(gi!==null){Je.child=null;do{var Fr=gi.sibling;gi.sibling=null,gi=Fr}while(gi!==null)}}Fe=P}}if(P.subtreeFlags&2064&&B!==null)B.return=P,Fe=B;else e:for(;Fe!==null;){if(P=Fe,P.flags&2048)switch(P.tag){case 0:case 11:case 15:Oa(9,P,P.return)}var ie=P.sibling;if(ie!==null){ie.return=P.return,Fe=ie;break e}Fe=P.return}}var Z=c.current;for(Fe=Z;Fe!==null;){B=Fe;var le=B.child;if(B.subtreeFlags&2064&&le!==null)le.return=B,Fe=le;else e:for(B=Z;Fe!==null;){if($=Fe,$.flags&2048)try{switch($.tag){case 0:case 11:case 15:ih(9,$)}}catch(Ze){$i($,$.return,Ze)}if($===B){Fe=null;break e}var Ue=$.sibling;if(Ue!==null){Ue.return=$.return,Fe=Ue;break e}Fe=$.return}}if(Ct=T,Es(),Ss&&typeof Ss.onPostCommitFiberRoot=="function")try{Ss.onPostCommitFiberRoot(Ld,c)}catch{}M=!0}return M}finally{Bt=y,Rn.transition=h}}return!1}function $b(c,h,y){h=By(y,h),h=ab(c,h,1),Bo(c,h),h=Di(),c=vp(c,1),c!==null&&(Wc(c,1,h),Xi(c,h))}function $i(c,h,y){if(c.tag===3)$b(c,c,y);else for(;h!==null;){if(h.tag===3){$b(h,c,y);break}else if(h.tag===1){var M=h.stateNode;if(typeof h.type.getDerivedStateFromError=="function"||typeof M.componentDidCatch=="function"&&(Vo===null||!Vo.has(M))){c=By(y,c),c=lb(h,c,1),Bo(h,c),c=Di(),h=vp(h,1),h!==null&&(Wc(h,1,c),Xi(h,c));break}}h=h.return}}function jO(c,h,y){var M=c.pingCache;M!==null&&M.delete(h),h=Di(),c.pingedLanes|=c.suspendedLanes&y,kn===c&&(ri&y)===y&&(jn===4||jn===3&&(ri&130023424)===ri&&500>Zn()-i_?ka(c,0):n_|=y),Xi(c,h)}function qb(c,h){h===0&&(c.mode&1?(h=Pd,Pd<<=1,!(Pd&130023424)&&(Pd=4194304)):h=1);var y=Di();c=vp(c,h),c!==null&&(Wc(c,h,y),Xi(c,y))}function XO(c){var h=c.memoizedState,y=0;h!==null&&(y=h.retryLane),qb(c,y)}function $O(c,h){var y=0;switch(c.tag){case 13:var M=c.stateNode,T=c.memoizedState;T!==null&&(y=T.retryLane);break;case 19:M=c.stateNode;break;default:throw Error(o(314))}M!==null&&M.delete(h),qb(c,y)}var Yb;Yb=function(c,h,y){if(c!==null)if(c.memoizedProps!==h.pendingProps||On.current)lr=!0;else{if(!(c.lanes&y)&&!(h.flags&128))return lr=!1,DO(c,h,y);lr=!!(c.flags&131072)}else lr=!1,un&&h.flags&1048576&&OE(h,Vd,h.index);switch(h.lanes=0,h.tag){case 2:var M=h.type;c!==null&&(c.alternate=null,h.alternate=null,h.flags|=2),c=h.pendingProps;var T=fn(h,Wn.current);jl(h,y),T=Oy(null,h,M,c,T,y);var P=ky();return h.flags|=1,typeof T=="object"&&T!==null&&typeof T.render=="function"&&T.$$typeof===void 0?(h.tag=1,h.memoizedState=null,h.updateQueue=null,dn(M)?(P=!0,Gl(h)):P=!1,h.memoizedState=T.state!==null&&T.state!==void 0?T.state:null,Sy(h),T.updater=zd,h.stateNode=T,T._reactInternals=h,Ey(h,M,c,y),h=Gy(null,h,M,!0,P,y)):(h.tag=0,un&&P&&by(h),Ni(null,h,T,y),h=h.child),h;case 16:M=h.elementType;e:{switch(c!==null&&(c.alternate=null,h.alternate=null,h.flags|=2),c=h.pendingProps,T=M._init,M=T(M._payload),h.type=M,T=h.tag=YO(M),c=Qr(M,c),T){case 0:h=Hy(null,h,M,c,y);break e;case 1:h=_b(null,h,M,c,y);break e;case 11:h=pb(null,h,M,c,y);break e;case 14:h=mb(null,h,M,Qr(M.type,c),y);break e}throw Error(o(306,M,""))}return h;case 0:return M=h.type,T=h.pendingProps,T=h.elementType===M?T:Qr(M,T),Hy(c,h,M,T,y);case 1:return M=h.type,T=h.pendingProps,T=h.elementType===M?T:Qr(M,T),_b(c,h,M,T,y);case 3:e:{if(xb(h),c===null)throw Error(o(387));M=h.pendingProps,P=h.memoizedState,T=P.element,CE(c,h),Ud(h,M,null,y);var B=h.memoizedState;if(M=B.element,we&&P.isDehydrated)if(P={element:M,isDehydrated:!1,cache:B.cache,transitions:B.transitions},h.updateQueue.baseState=P,h.memoizedState=P,h.flags&256){T=Error(o(423)),h=wb(c,h,M,y,T);break e}else if(M!==T){T=Error(o(424)),h=wb(c,h,M,y,T);break e}else for(we&&(ar=ly(h.stateNode.containerInfo),or=h,un=!0,es=null,jc=!1),y=VE(h,null,M,y),h.child=y;y;)y.flags=y.flags&-3|4096,y=y.sibling;else{if(ql(),M===T){h=no(c,h,y);break e}Ni(c,h,M,y)}h=h.child}return h;case 5:return HE(h),c===null&&Cy(h),M=h.type,T=h.pendingProps,P=c!==null?c.memoizedProps:null,B=T.children,pe(M,T)?B=null:P!==null&&pe(M,P)&&(h.flags|=32),yb(c,h),Ni(c,h,B,y),h.child;case 6:return c===null&&Cy(h),null;case 13:return Sb(c,h,y);case 4:return Py(h,h.stateNode.containerInfo),M=h.pendingProps,c===null?h.child=Yl(h,null,M,y):Ni(c,h,M,y),h.child;case 11:return M=h.type,T=h.pendingProps,T=h.elementType===M?T:Qr(M,T),pb(c,h,M,T,y);case 7:return Ni(c,h,h.pendingProps,y),h.child;case 8:return Ni(c,h,h.pendingProps.children,y),h.child;case 12:return Ni(c,h,h.pendingProps.children,y),h.child;case 10:e:{if(M=h.type._context,T=h.pendingProps,P=h.memoizedProps,B=T.value,AE(h,M,B),P!==null)if(Ms(P.value,B)){if(P.children===T.children&&!On.current){h=no(c,h,y);break e}}else for(P=h.child,P!==null&&(P.return=h);P!==null;){var $=P.dependencies;if($!==null){B=P.child;for(var fe=$.firstContext;fe!==null;){if(fe.context===M){if(P.tag===1){fe=Js(-1,y&-y),fe.tag=2;var Ae=P.updateQueue;if(Ae!==null){Ae=Ae.shared;var Ge=Ae.pending;Ge===null?fe.next=fe:(fe.next=Ge.next,Ge.next=fe),Ae.pending=fe}}P.lanes|=y,fe=P.alternate,fe!==null&&(fe.lanes|=y),wy(P.return,y,h),$.lanes|=y;break}fe=fe.next}}else if(P.tag===10)B=P.type===h.type?null:P.child;else if(P.tag===18){if(B=P.return,B===null)throw Error(o(341));B.lanes|=y,$=B.alternate,$!==null&&($.lanes|=y),wy(B,y,h),B=P.sibling}else B=P.child;if(B!==null)B.return=P;else for(B=P;B!==null;){if(B===h){B=null;break}if(P=B.sibling,P!==null){P.return=B.return,B=P;break}B=B.return}P=B}Ni(c,h,T.children,y),h=h.child}return h;case 9:return T=h.type,M=h.pendingProps.children,jl(h,y),T=Pr(T),M=M(T),h.flags|=1,Ni(c,h,M,y),h.child;case 14:return M=h.type,T=Qr(M,h.pendingProps),T=Qr(M.type,T),mb(c,h,M,T,y);case 15:return gb(c,h,h.type,h.pendingProps,y);case 17:return M=h.type,T=h.pendingProps,T=h.elementType===M?T:Qr(M,T),c!==null&&(c.alternate=null,h.alternate=null,h.flags|=2),h.tag=1,dn(M)?(c=!0,Gl(h)):c=!1,jl(h,y),NE(h,M,T),Ey(h,M,T,y),Gy(null,h,M,!0,c,y);case 19:return Tb(c,h,y);case 22:return vb(c,h,y)}throw Error(o(156,h.tag))};function Zb(c,h){return py(c,h)}function qO(c,h,y,M){this.tag=c,this.key=y,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=h,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=M,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function kr(c,h,y,M){return new qO(c,h,y,M)}function h_(c){return c=c.prototype,!(!c||!c.isReactComponent)}function YO(c){if(typeof c=="function")return h_(c)?1:0;if(c!=null){if(c=c.$$typeof,c===x)return 11;if(c===w)return 14}return 2}function jo(c,h){var y=c.alternate;return y===null?(y=kr(c.tag,h,c.key,c.mode),y.elementType=c.elementType,y.type=c.type,y.stateNode=c.stateNode,y.alternate=c,c.alternate=y):(y.pendingProps=h,y.type=c.type,y.flags=0,y.subtreeFlags=0,y.deletions=null),y.flags=c.flags&14680064,y.childLanes=c.childLanes,y.lanes=c.lanes,y.child=c.child,y.memoizedProps=c.memoizedProps,y.memoizedState=c.memoizedState,y.updateQueue=c.updateQueue,h=c.dependencies,y.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},y.sibling=c.sibling,y.index=c.index,y.ref=c.ref,y}function _p(c,h,y,M,T,P){var B=2;if(M=c,typeof c=="function")h_(c)&&(B=1);else if(typeof c=="string")B=5;else e:switch(c){case f:return za(y.children,T,P,h);case d:B=8,T|=8;break;case p:return c=kr(12,y,h,T|2),c.elementType=p,c.lanes=P,c;case _:return c=kr(13,y,h,T),c.elementType=_,c.lanes=P,c;case m:return c=kr(19,y,h,T),c.elementType=m,c.lanes=P,c;case b:return xp(y,T,P,h);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case g:B=10;break e;case v:B=9;break e;case x:B=11;break e;case w:B=14;break e;case S:B=16,M=null;break e}throw Error(o(130,c==null?c:typeof c,""))}return h=kr(B,y,h,T),h.elementType=c,h.type=M,h.lanes=P,h}function za(c,h,y,M){return c=kr(7,c,M,h),c.lanes=y,c}function xp(c,h,y,M){return c=kr(22,c,M,h),c.elementType=b,c.lanes=y,c.stateNode={},c}function f_(c,h,y){return c=kr(6,c,null,h),c.lanes=y,c}function d_(c,h,y){return h=kr(4,c.children!==null?c.children:[],c.key,h),h.lanes=y,h.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},h}function ZO(c,h,y,M,T){this.tag=h,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=lt,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=fy(0),this.expirationTimes=fy(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fy(0),this.identifierPrefix=M,this.onRecoverableError=T,we&&(this.mutableSourceEagerHydrationData=null)}function Kb(c,h,y,M,T,P,B,$,fe){return c=new ZO(c,h,y,$,fe),h===1?(h=1,P===!0&&(h|=8)):h=0,P=kr(3,null,null,h),c.current=P,P.stateNode=c,P.memoizedState={element:M,isDehydrated:y,cache:null,transitions:null},Sy(P),c}function Jb(c){if(!c)return fi;c=c._reactInternals;e:{if(I(c)!==c||c.tag!==1)throw Error(o(170));var h=c;do{switch(h.tag){case 3:h=h.stateNode.context;break e;case 1:if(dn(h.type)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break e}}h=h.return}while(h!==null);throw Error(o(171))}if(c.tag===1){var y=c.type;if(dn(y))return Hl(c,y,h)}return h}function Qb(c){var h=c._reactInternals;if(h===void 0)throw typeof c.render=="function"?Error(o(188)):(c=Object.keys(c).join(","),Error(o(268,c)));return c=z(h),c===null?null:c.stateNode}function eT(c,h){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var y=c.retryLane;c.retryLane=y!==0&&y=Ae&&P>=yt&&T<=Ge&&B<=rt){c.splice(h,1);break}else if(M!==Ae||y.width!==fe.width||rtB){if(!(P!==yt||y.height!==fe.height||GeT)){Ae>M&&(fe.width+=Ae-M,fe.x=M),GeP&&(fe.height+=yt-P,fe.y=P),rty&&(y=B)),B ")+` No matching component was found for: - `)+c.join(" > ")}return null},t.getPublicRootInstance=function(c){if(c=c.current,!c.child)return null;switch(c.child.tag){case 5:return Q(c.child.stateNode);default:return c.child.stateNode}},t.injectIntoDevTools=function(c){if(c={bundleType:c.bundleType,version:c.version,rendererPackageName:c.rendererPackageName,rendererConfig:c.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:KO,findFiberByHostInstance:c.findFiberByHostInstance||JO,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")c=!1;else{var h=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(h.isDisabled||!h.supportsFiber)c=!0;else{try{Ld=h.inject(c),Ss=h}catch{}c=!!h.checkDCE}}return c},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(c,h,y,M){if(!D)throw Error(o(363));c=e_(c,h);var T=Ie(c,y,M).disconnect;return{disconnect:function(){T()}}},t.registerMutableSourceForHydration=function(c,h){var y=h._getVersion;y=y(h._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[h,y]:c.mutableSourceEagerHydrationData.push(h,y)},t.runWithPriority=function(c,h){var y=Bt;try{return Bt=c,h()}finally{Bt=y}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(c,h,y,M){var T=h.current,P=Di(),B=Go(T);return y=Jb(y),h.context===null?h.context=y:h.pendingContext=y,h=Js(P,B),h.payload={element:c},M=M===void 0?null:M,M!==null&&(h.callback=M),Bo(T,h),c=Or(T,B,P),c!==null&&Fd(c,T,B),B},t};W3.exports=MG;var EG=W3.exports;const bG=l1(EG),WM={},$3=n=>void Object.assign(WM,n);function TG(n,e){function t(f,{args:d=[],attach:p,...g},v){let x=`${f[0].toUpperCase()}${f.slice(1)}`,_;if(f==="primitive"){if(g.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const m=g.object;_=Ru(m,{type:f,root:v,attach:p,primitive:!0})}else{const m=WM[x];if(!m)throw new Error(`R3F: ${x} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(d))throw new Error("R3F: The args prop must be an array!");_=Ru(new m(...d),{type:f,root:v,attach:p,memoizedProps:{args:d}})}return _.__r3f.attach===void 0&&(_ instanceof Tt?_.__r3f.attach="geometry":_ instanceof hi&&(_.__r3f.attach="material")),x!=="inject"&&Ix(_,g),_}function i(f,d){let p=!1;if(d){var g,v;(g=d.__r3f)!=null&&g.attach?Px(f,d,d.__r3f.attach):d.isObject3D&&f.isObject3D&&(f.add(d),p=!0),p||(v=f.__r3f)==null||v.objects.push(d),d.__r3f||Ru(d,{}),d.__r3f.parent=f,DS(d),Pu(d)}}function r(f,d,p){let g=!1;if(d){var v,x;if((v=d.__r3f)!=null&&v.attach)Px(f,d,d.__r3f.attach);else if(d.isObject3D&&f.isObject3D){d.parent=f,d.dispatchEvent({type:"added"}),f.dispatchEvent({type:"childadded",child:d});const _=f.children.filter(w=>w!==d),m=_.indexOf(p);f.children=[..._.slice(0,m),d,..._.slice(m)],g=!0}g||(x=f.__r3f)==null||x.objects.push(d),d.__r3f||Ru(d,{}),d.__r3f.parent=f,DS(d),Pu(d)}}function s(f,d,p=!1){f&&[...f].forEach(g=>o(d,g,p))}function o(f,d,p){if(d){var g,v,x;if(d.__r3f&&(d.__r3f.parent=null),(g=f.__r3f)!=null&&g.objects&&(f.__r3f.objects=f.__r3f.objects.filter(b=>b!==d)),(v=d.__r3f)!=null&&v.attach)qC(f,d,d.__r3f.attach);else if(d.isObject3D&&f.isObject3D){var _;f.remove(d),(_=d.__r3f)!=null&&_.root&&DG(pg(d),d)}const w=(x=d.__r3f)==null?void 0:x.primitive,S=!w&&(p===void 0?d.dispose!==null:p);if(!w){var m;s((m=d.__r3f)==null?void 0:m.objects,d,S),s(d.children,d,S)}if(delete d.__r3f,S&&d.dispose&&d.type!=="Scene"){const b=()=>{try{d.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?LS.unstable_scheduleCallback(LS.unstable_IdlePriority,b):b()}Pu(f)}}function a(f,d,p,g){var v;const x=(v=f.__r3f)==null?void 0:v.parent;if(!x)return;const _=t(d,p,f.__r3f.root);if(f.children){for(const m of f.children)m.__r3f&&i(_,m);f.children=f.children.filter(m=>!m.__r3f)}f.__r3f.objects.forEach(m=>i(_,m)),f.__r3f.objects=[],f.__r3f.autoRemovedBeforeAppend||o(x,f),_.parent&&(_.__r3f.autoRemovedBeforeAppend=!0),i(x,_),_.raycast&&_.__r3f.eventCount&&pg(_).getState().internal.interaction.push(_),[g,g.alternate].forEach(m=>{m!==null&&(m.stateNode=_,m.ref&&(typeof m.ref=="function"?m.ref(_):m.ref.current=_))})}const l=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:bG({createInstance:t,removeChild:o,appendChild:i,appendInitialChild:i,insertBefore:r,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(f,d)=>{if(!d)return;const p=f.getState().scene;p.__r3f&&(p.__r3f.root=f,i(p,d))},removeChildFromContainer:(f,d)=>{d&&o(f.getState().scene,d)},insertInContainerBefore:(f,d,p)=>{if(!d||!p)return;const g=f.getState().scene;g.__r3f&&r(g,d,p)},getRootHostContext:()=>null,getChildHostContext:f=>f,finalizeInitialChildren(f){var d;return!!((d=f==null?void 0:f.__r3f)!=null?d:{}).handlers},prepareUpdate(f,d,p,g){var v;if(((v=f==null?void 0:f.__r3f)!=null?v:{}).primitive&&g.object&&g.object!==f)return[!0];{const{args:_=[],children:m,...w}=g,{args:S=[],children:b,...R}=p;if(!Array.isArray(_))throw new Error("R3F: the args prop must be an array!");if(_.some((C,L)=>C!==S[L]))return[!0];const A=eN(f,w,R,!0);return A.changes.length?[!1,A]:null}},commitUpdate(f,[d,p],g,v,x,_){d?a(f,g,x,_):Ix(f,p)},commitMount(f,d,p,g){var v;const x=(v=f.__r3f)!=null?v:{};f.raycast&&x.handlers&&x.eventCount&&pg(f).getState().internal.interaction.push(f)},getPublicInstance:f=>f,prepareForCommit:()=>null,preparePortalMount:f=>Ru(f.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(f){var d;const{attach:p,parent:g}=(d=f.__r3f)!=null?d:{};p&&g&&qC(g,f,p),f.isObject3D&&(f.visible=!1),Pu(f)},unhideInstance(f,d){var p;const{attach:g,parent:v}=(p=f.__r3f)!=null?p:{};g&&v&&Px(v,f,g),(f.isObject3D&&d.visible==null||d.visible)&&(f.visible=!0),Pu(f)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():Qu.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&cn.fun(performance.now)?performance.now:cn.fun(Date.now)?Date.now:()=>0,scheduleTimeout:cn.fun(setTimeout)?setTimeout:void 0,cancelTimeout:cn.fun(clearTimeout)?clearTimeout:void 0}),applyProps:Ix}}var WC,jC;const Rx=n=>"colorSpace"in n||"outputColorSpace"in n,q3=()=>{var n;return(n=WM.ColorManagement)!=null?n:null},Y3=n=>n&&n.isOrthographicCamera,AG=n=>n&&n.hasOwnProperty("current"),Sd=typeof window<"u"&&((WC=window.document)!=null&&WC.createElement||((jC=window.navigator)==null?void 0:jC.product)==="ReactNative")?Y.useLayoutEffect:Y.useEffect;function Z3(n){const e=Y.useRef(n);return Sd(()=>void(e.current=n),[n]),e}function CG({set:n}){return Sd(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class K3 extends Y.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}K3.getDerivedStateFromError=()=>({error:!0});const J3="__default",XC=new Map,RG=n=>n&&!!n.memoized&&!!n.changes;function Q3(n){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(n)?Math.min(Math.max(n[0],t),n[1]):n}const Ch=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()};function pg(n){let e=n.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const cn={obj:n=>n===Object(n)&&!cn.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,arr:n=>Array.isArray(n),equ(n,e,{arrays:t="shallow",objects:i="reference",strict:r=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if(cn.str(n)||cn.num(n))return n===e;const s=cn.obj(n);if(s&&i==="reference")return n===e;const o=cn.arr(n);if(o&&t==="reference")return n===e;if((o||s)&&n===e)return!0;let a;for(a in n)if(!(a in e))return!1;if(s&&t==="shallow"&&i==="shallow"){for(a in r?e:n)if(!cn.equ(n[a],e[a],{strict:r,objects:"reference"}))return!1}else for(a in r?e:n)if(n[a]!==e[a])return!1;if(cn.und(a)){if(o&&n.length===0&&e.length===0||s&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function PG(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function Ru(n,e){const t=n;return t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},n}function NS(n,e){let t=n;if(e.includes("-")){const i=e.split("-"),r=i.pop();return t=i.reduce((s,o)=>s[o],n),{target:t,key:r}}else return{target:t,key:e}}const $C=/-\d+$/;function Px(n,e,t){if(cn.str(t)){if($C.test(t)){const s=t.replace($C,""),{target:o,key:a}=NS(n,s);Array.isArray(o[a])||(o[a]=[])}const{target:i,key:r}=NS(n,t);e.__r3f.previousAttach=i[r],i[r]=e}else e.__r3f.previousAttach=t(n,e)}function qC(n,e,t){var i,r;if(cn.str(t)){const{target:s,key:o}=NS(n,t),a=e.__r3f.previousAttach;a===void 0?delete s[o]:s[o]=a}else(i=e.__r3f)==null||i.previousAttach==null||i.previousAttach(n,e);(r=e.__r3f)==null||delete r.previousAttach}function eN(n,{children:e,key:t,ref:i,...r},{children:s,key:o,ref:a,...l}={},u=!1){const f=n.__r3f,d=Object.entries(r),p=[];if(u){const v=Object.keys(l);for(let x=0;x{var _;if((_=n.__r3f)!=null&&_.primitive&&v==="object"||cn.equ(x,l[v]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(v))return p.push([v,x,!0,[]]);let m=[];v.includes("-")&&(m=v.split("-")),p.push([v,x,!1,m]);for(const w in r){const S=r[w];w.startsWith(`${v}-`)&&p.push([w,S,!1,w.split("-")])}});const g={...r};return f!=null&&f.memoizedProps&&f!=null&&f.memoizedProps.args&&(g.args=f.memoizedProps.args),f!=null&&f.memoizedProps&&f!=null&&f.memoizedProps.attach&&(g.attach=f.memoizedProps.attach),{memoized:g,changes:p}}const IG=typeof process<"u"&&!1;function Ix(n,e){var t;const i=n.__r3f,r=i==null?void 0:i.root,s=r==null||r.getState==null?void 0:r.getState(),{memoized:o,changes:a}=RG(e)?e:eN(n,e),l=i==null?void 0:i.eventCount;n.__r3f&&(n.__r3f.memoizedProps=o);for(let f=0;fm[w],n),!(_&&_.set))){const[m,...w]=v.reverse();x=w.reverse().reduce((S,b)=>S[b],n),d=m}if(p===J3+"remove")if(x.constructor){let m=XC.get(x.constructor);m||(m=new x.constructor,XC.set(x.constructor,m)),p=m[d]}else p=0;if(g&&i)p?i.handlers[d]=p:delete i.handlers[d],i.eventCount=Object.keys(i.handlers).length;else if(_&&_.set&&(_.copy||_ instanceof _l)){if(Array.isArray(p))_.fromArray?_.fromArray(p):_.set(...p);else if(_.copy&&p&&p.constructor&&(IG?_.constructor.name===p.constructor.name:_.constructor===p.constructor))_.copy(p);else if(p!==void 0){const m=_ instanceof ze;!m&&_.setScalar?_.setScalar(p):_ instanceof _l&&p instanceof _l?_.mask=p.mask:_.set(p),!q3()&&s&&!s.linear&&m&&_.convertSRGBToLinear()}}else if(x[d]=p,x[d]instanceof _n&&x[d].format===Ji&&x[d].type===Xs&&s){const m=x[d];Rx(m)&&Rx(s.gl)?m.colorSpace=s.gl.outputColorSpace:m.encoding=s.gl.outputEncoding}Pu(n)}if(i&&i.parent&&n.raycast&&l!==i.eventCount){const f=pg(n).getState().internal,d=f.interaction.indexOf(n);d>-1&&f.interaction.splice(d,1),i.eventCount&&f.interaction.push(n)}return!(a.length===1&&a[0][0]==="onUpdate")&&a.length&&(t=n.__r3f)!=null&&t.parent&&DS(n),n}function Pu(n){var e,t;const i=(e=n.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();i&&i.internal.frames===0&&i.invalidate()}function DS(n){n.onUpdate==null||n.onUpdate(n)}function LG(n,e){n.manual||(Y3(n)?(n.left=e.width/-2,n.right=e.width/2,n.top=e.height/2,n.bottom=e.height/-2):n.aspect=e.width/e.height,n.updateProjectionMatrix(),n.updateMatrixWorld())}function Lm(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function NG(){var n;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return Qu.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Qu.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Qu.ContinuousEventPriority;default:return Qu.DefaultEventPriority}}function tN(n,e,t,i){const r=t.get(e);r&&(t.delete(e),t.size===0&&(n.delete(i),r.target.releasePointerCapture(i)))}function DG(n,e){const{internal:t}=n.getState();t.interaction=t.interaction.filter(i=>i!==e),t.initialHits=t.initialHits.filter(i=>i!==e),t.hovered.forEach((i,r)=>{(i.eventObject===e||i.object===e)&&t.hovered.delete(r)}),t.capturedMap.forEach((i,r)=>{tN(t.capturedMap,e,i,r)})}function OG(n){function e(l){const{internal:u}=n.getState(),f=l.offsetX-u.initialClick[0],d=l.offsetY-u.initialClick[1];return Math.round(Math.sqrt(f*f+d*d))}function t(l){return l.filter(u=>["Move","Over","Enter","Out","Leave"].some(f=>{var d;return(d=u.__r3f)==null?void 0:d.handlers["onPointer"+f]}))}function i(l,u){const f=n.getState(),d=new Set,p=[],g=u?u(f.internal.interaction):f.internal.interaction;for(let m=0;m{const S=Ch(m.object),b=Ch(w.object);return!S||!b?m.distance-w.distance:b.events.priority-S.events.priority||m.distance-w.distance}).filter(m=>{const w=Lm(m);return d.has(w)?!1:(d.add(w),!0)});f.events.filter&&(x=f.events.filter(x,f));for(const m of x){let w=m.object;for(;w;){var _;(_=w.__r3f)!=null&&_.eventCount&&p.push({...m,eventObject:w}),w=w.parent}}if("pointerId"in l&&f.internal.capturedMap.has(l.pointerId))for(let m of f.internal.capturedMap.get(l.pointerId).values())d.has(Lm(m.intersection))||p.push(m.intersection);return p}function r(l,u,f,d){const p=n.getState();if(l.length){const g={stopped:!1};for(const v of l){const x=Ch(v.object)||p,{raycaster:_,pointer:m,camera:w,internal:S}=x,b=new U(m.x,m.y,0).unproject(w),R=E=>{var N,z;return(N=(z=S.capturedMap.get(E))==null?void 0:z.has(v.eventObject))!=null?N:!1},A=E=>{const N={intersection:v,target:u.target};S.capturedMap.has(E)?S.capturedMap.get(E).set(v.eventObject,N):S.capturedMap.set(E,new Map([[v.eventObject,N]])),u.target.setPointerCapture(E)},C=E=>{const N=S.capturedMap.get(E);N&&tN(S.capturedMap,v.eventObject,N,E)};let L={};for(let E in u){let N=u[E];typeof N!="function"&&(L[E]=N)}let I={...v,...L,pointer:m,intersections:l,stopped:g.stopped,delta:f,unprojectedPoint:b,ray:_.ray,camera:w,stopPropagation(){const E="pointerId"in u&&S.capturedMap.get(u.pointerId);if((!E||E.has(v.eventObject))&&(I.stopped=g.stopped=!0,S.hovered.size&&Array.from(S.hovered.values()).find(N=>N.eventObject===v.eventObject))){const N=l.slice(0,l.indexOf(v));s([...N,v])}},target:{hasPointerCapture:R,setPointerCapture:A,releasePointerCapture:C},currentTarget:{hasPointerCapture:R,setPointerCapture:A,releasePointerCapture:C},nativeEvent:u};if(d(I),g.stopped===!0)break}}return l}function s(l){const{internal:u}=n.getState();for(const f of u.hovered.values())if(!l.length||!l.find(d=>d.object===f.object&&d.index===f.index&&d.instanceId===f.instanceId)){const p=f.eventObject.__r3f,g=p==null?void 0:p.handlers;if(u.hovered.delete(Lm(f)),p!=null&&p.eventCount){const v={...f,intersections:l};g.onPointerOut==null||g.onPointerOut(v),g.onPointerLeave==null||g.onPointerLeave(v)}}}function o(l,u){for(let f=0;fs([]);case"onLostPointerCapture":return u=>{const{internal:f}=n.getState();"pointerId"in u&&f.capturedMap.has(u.pointerId)&&requestAnimationFrame(()=>{f.capturedMap.has(u.pointerId)&&(f.capturedMap.delete(u.pointerId),s([]))})}}return function(f){const{onPointerMissed:d,internal:p}=n.getState();p.lastEvent.current=f;const g=l==="onPointerMove",v=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",_=i(f,g?t:void 0),m=v?e(f):0;l==="onPointerDown"&&(p.initialClick=[f.offsetX,f.offsetY],p.initialHits=_.map(S=>S.eventObject)),v&&!_.length&&m<=2&&(o(f,p.interaction),d&&d(f)),g&&s(_);function w(S){const b=S.eventObject,R=b.__r3f,A=R==null?void 0:R.handlers;if(R!=null&&R.eventCount)if(g){if(A.onPointerOver||A.onPointerEnter||A.onPointerOut||A.onPointerLeave){const C=Lm(S),L=p.hovered.get(C);L?L.stopped&&S.stopPropagation():(p.hovered.set(C,S),A.onPointerOver==null||A.onPointerOver(S),A.onPointerEnter==null||A.onPointerEnter(S))}A.onPointerMove==null||A.onPointerMove(S)}else{const C=A[l];C?(!v||p.initialHits.includes(b))&&(o(f,p.interaction.filter(L=>!p.initialHits.includes(L))),C(S)):v&&p.initialHits.includes(b)&&o(f,p.interaction.filter(L=>!p.initialHits.includes(L)))}}r(_,f,m,w)}}return{handlePointer:a}}const nN=n=>!!(n!=null&&n.render),iN=Y.createContext(null),kG=(n,e)=>{const t=SG((a,l)=>{const u=new U,f=new U,d=new U;function p(m=l().camera,w=f,S=l().size){const{width:b,height:R,top:A,left:C}=S,L=b/R;w instanceof U?d.copy(w):d.set(...w);const I=m.getWorldPosition(u).distanceTo(d);if(Y3(m))return{width:b/m.zoom,height:R/m.zoom,top:A,left:C,factor:1,distance:I,aspect:L};{const E=m.fov*Math.PI/180,N=2*Math.tan(E/2)*I,z=N*(b/R);return{width:z,height:N,top:A,left:C,factor:b/z,distance:I,aspect:L}}}let g;const v=m=>a(w=>({performance:{...w.performance,current:m}})),x=new ve;return{set:a,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(m=1)=>n(l(),m),advance:(m,w)=>e(m,w,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new BM,pointer:x,mouse:x,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const m=l();g&&clearTimeout(g),m.performance.current!==m.performance.min&&v(m.performance.min),g=setTimeout(()=>v(l().performance.max),m.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:p},setEvents:m=>a(w=>({...w,events:{...w.events,...m}})),setSize:(m,w,S,b,R)=>{const A=l().camera,C={width:m,height:w,top:b||0,left:R||0,updateStyle:S};a(L=>({size:C,viewport:{...L.viewport,...p(A,f,C)}}))},setDpr:m=>a(w=>{const S=Q3(m);return{viewport:{...w.viewport,dpr:S,initialDpr:w.viewport.initialDpr||S}}}),setFrameloop:(m="always")=>{const w=l().clock;w.stop(),w.elapsedTime=0,m!=="never"&&(w.start(),w.elapsedTime=0),a(()=>({frameloop:m}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:Y.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(m,w,S)=>{const b=l().internal;return b.priority=b.priority+(w>0?1:0),b.subscribers.push({ref:m,priority:w,store:S}),b.subscribers=b.subscribers.sort((R,A)=>R.priority-A.priority),()=>{const R=l().internal;R!=null&&R.subscribers&&(R.priority=R.priority-(w>0?1:0),R.subscribers=R.subscribers.filter(A=>A.ref!==m))}}}}}),i=t.getState();let r=i.size,s=i.viewport.dpr,o=i.camera;return t.subscribe(()=>{const{camera:a,size:l,viewport:u,gl:f,set:d}=t.getState();if(l.width!==r.width||l.height!==r.height||u.dpr!==s){var p;r=l,s=u.dpr,LG(a,l),f.setPixelRatio(u.dpr);const g=(p=l.updateStyle)!=null?p:typeof HTMLCanvasElement<"u"&&f.domElement instanceof HTMLCanvasElement;f.setSize(l.width,l.height,g)}a!==o&&(o=a,d(g=>({viewport:{...g.viewport,...g.viewport.getCurrentViewport(a)}})))}),t.subscribe(a=>n(a)),t};let Nm,FG=new Set,UG=new Set,zG=new Set;function Lx(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function Rh(n,e){switch(n){case"before":return Lx(FG,e);case"after":return Lx(UG,e);case"tail":return Lx(zG,e)}}let Nx,Dx;function Ox(n,e,t){let i=e.clock.getDelta();for(e.frameloop==="never"&&typeof n=="number"&&(i=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),Nx=e.internal.subscribers,Nm=0;Nm0)&&!((f=s.gl.xr)!=null&&f.isPresenting)&&(i+=Ox(u,s))}if(t=!1,Rh("after",u),i===0)return Rh("tail",u),e=!1,cancelAnimationFrame(r)}function a(u,f=1){var d;if(!u)return n.forEach(p=>a(p.store.getState(),f));(d=u.gl.xr)!=null&&d.isPresenting||!u.internal.active||u.frameloop==="never"||(f>1?u.internal.frames=Math.min(60,u.internal.frames+f):t?u.internal.frames=2:u.internal.frames=1,e||(e=!0,requestAnimationFrame(o)))}function l(u,f=!0,d,p){if(f&&Rh("before",u),d)Ox(u,d,p);else for(const g of n.values())Ox(u,g.store.getState());f&&Rh("after",u)}return{loop:o,invalidate:a,advance:l}}function rN(){const n=Y.useContext(iN);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function mr(n=t=>t,e){return rN()(n,e)}function jM(n,e=0){const t=rN(),i=t.getState().internal.subscribe,r=Z3(n);return Sd(()=>i(r,e,t),[e,i,t]),null}const bc=new Map,{invalidate:YC,advance:ZC}=BG(bc),{reconciler:hv,applyProps:bu}=TG(bc,NG),Tu={objects:"shallow",strict:!1},VG=(n,e)=>{const t=typeof n=="function"?n(e):n;return nN(t)?t:new qL({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function HG(n,e){const t=typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement;if(e){const{width:i,height:r,top:s,left:o,updateStyle:a=t}=e;return{width:i,height:r,top:s,left:o,updateStyle:a}}else if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:i,height:r,top:s,left:o}=n.parentElement.getBoundingClientRect();return{width:i,height:r,top:s,left:o,updateStyle:t}}else if(typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height,top:0,left:0,updateStyle:t};return{width:0,height:0,top:0,left:0}}function GG(n){const e=bc.get(n),t=e==null?void 0:e.fiber,i=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const r=typeof reportError=="function"?reportError:console.error,s=i||kG(YC,ZC),o=t||hv.createContainer(s,Qu.ConcurrentRoot,null,!1,null,"",r,null);e||bc.set(n,{fiber:o,store:s});let a,l=!1,u;return{configure(f={}){let{gl:d,size:p,scene:g,events:v,onCreated:x,shadows:_=!1,linear:m=!1,flat:w=!1,legacy:S=!1,orthographic:b=!1,frameloop:R="always",dpr:A=[1,2],performance:C,raycaster:L,camera:I,onPointerMissed:E}=f,N=s.getState(),z=N.gl;N.gl||N.set({gl:z=VG(d,n)});let O=N.raycaster;O||N.set({raycaster:O=new V3});const{params:q,...j}=L||{};if(cn.equ(j,O,Tu)||bu(O,{...j}),cn.equ(q,O.params,Tu)||bu(O,{params:{...O.params,...q}}),!N.camera||N.camera===u&&!cn.equ(u,I,Tu)){u=I;const G=I instanceof md,ne=G?I:b?new _o(0,0,0,0,.1,1e3):new Tn(75,0,.1,1e3);G||(ne.position.z=5,I&&(bu(ne,I),("aspect"in I||"left"in I||"right"in I||"bottom"in I||"top"in I)&&(ne.manual=!0,ne.updateProjectionMatrix())),!N.camera&&!(I!=null&&I.rotation)&&ne.lookAt(0,0,0)),N.set({camera:ne}),O.camera=ne}if(!N.scene){let G;g instanceof av?G=g:(G=new av,g&&bu(G,g)),N.set({scene:Ru(G)})}if(!N.xr){var Q;const G=(_e,J)=>{const pe=s.getState();pe.frameloop!=="never"&&ZC(_e,!0,pe,J)},ne=()=>{const _e=s.getState();_e.gl.xr.enabled=_e.gl.xr.isPresenting,_e.gl.xr.setAnimationLoop(_e.gl.xr.isPresenting?G:null),_e.gl.xr.isPresenting||YC(_e)},me={connect(){const _e=s.getState().gl;_e.xr.addEventListener("sessionstart",ne),_e.xr.addEventListener("sessionend",ne)},disconnect(){const _e=s.getState().gl;_e.xr.removeEventListener("sessionstart",ne),_e.xr.removeEventListener("sessionend",ne)}};typeof((Q=z.xr)==null?void 0:Q.addEventListener)=="function"&&me.connect(),N.set({xr:me})}if(z.shadowMap){const G=z.shadowMap.enabled,ne=z.shadowMap.type;if(z.shadowMap.enabled=!!_,cn.boo(_))z.shadowMap.type=of;else if(cn.str(_)){var oe;const me={basic:AI,percentage:f0,soft:of,variance:cs};z.shadowMap.type=(oe=me[_])!=null?oe:of}else cn.obj(_)&&Object.assign(z.shadowMap,_);(G!==z.shadowMap.enabled||ne!==z.shadowMap.type)&&(z.shadowMap.needsUpdate=!0)}const k=q3();k&&("enabled"in k?k.enabled=!S:"legacyMode"in k&&(k.legacyMode=S)),l||bu(z,{outputEncoding:m?3e3:3001,toneMapping:w?Gs:rM}),N.legacy!==S&&N.set(()=>({legacy:S})),N.linear!==m&&N.set(()=>({linear:m})),N.flat!==w&&N.set(()=>({flat:w})),d&&!cn.fun(d)&&!nN(d)&&!cn.equ(d,z,Tu)&&bu(z,d),v&&!N.events.handlers&&N.set({events:v(s)});const W=HG(n,p);return cn.equ(W,N.size,Tu)||N.setSize(W.width,W.height,W.updateStyle,W.top,W.left),A&&N.viewport.dpr!==Q3(A)&&N.setDpr(A),N.frameloop!==R&&N.setFrameloop(R),N.onPointerMissed||N.set({onPointerMissed:E}),C&&!cn.equ(C,N.performance,Tu)&&N.set(G=>({performance:{...G.performance,...C}})),a=x,l=!0,this},render(f){return l||this.configure(),hv.updateContainer(Ge.jsx(WG,{store:s,children:f,onCreated:a,rootElement:n}),o,null,()=>{}),s},unmount(){sN(n)}}}function WG({store:n,children:e,onCreated:t,rootElement:i}){return Sd(()=>{const r=n.getState();r.set(s=>({internal:{...s.internal,active:!0}})),t&&t(r),n.getState().events.connected||r.events.connect==null||r.events.connect(i)},[]),Ge.jsx(iN.Provider,{value:n,children:e})}function sN(n,e){const t=bc.get(n),i=t==null?void 0:t.fiber;if(i){const r=t==null?void 0:t.store.getState();r&&(r.internal.active=!1),hv.updateContainer(null,i,null,()=>{r&&setTimeout(()=>{try{var s,o,a,l;r.events.disconnect==null||r.events.disconnect(),(s=r.gl)==null||(o=s.renderLists)==null||o.dispose==null||o.dispose(),(a=r.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(l=r.gl)!=null&&l.xr&&r.xr.disconnect(),PG(r),bc.delete(n)}catch{}},500)})}}hv.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:Y.version});function OS(n,e,t){var i,r,s,o,a;e==null&&(e=100);function l(){var f=Date.now()-o;f=0?i=setTimeout(l,e-f):(i=null,t||(a=n.apply(s,r),s=r=null))}var u=function(){s=this,r=arguments,o=Date.now();var f=t&&!i;return i||(i=setTimeout(l,e)),f&&(a=n.apply(s,r),s=r=null),a};return u.clear=function(){i&&(clearTimeout(i),i=null)},u.flush=function(){i&&(a=n.apply(s,r),s=r=null,clearTimeout(i),i=null)},u}OS.debounce=OS;var jG=OS;const KC=l1(jG);function XG(n){let{debounce:e,scroll:t,polyfill:i,offsetSize:r}=n===void 0?{debounce:0,scroll:!1,offsetSize:!1}:n;const s=i||(typeof window>"u"?class{}:window.ResizeObserver);if(!s)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[o,a]=Y.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),l=Y.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o}),u=e?typeof e=="number"?e:e.scroll:null,f=e?typeof e=="number"?e:e.resize:null,d=Y.useRef(!1);Y.useEffect(()=>(d.current=!0,()=>void(d.current=!1)));const[p,g,v]=Y.useMemo(()=>{const w=()=>{if(!l.current.element)return;const{left:S,top:b,width:R,height:A,bottom:C,right:L,x:I,y:E}=l.current.element.getBoundingClientRect(),N={left:S,top:b,width:R,height:A,bottom:C,right:L,x:I,y:E};l.current.element instanceof HTMLElement&&r&&(N.height=l.current.element.offsetHeight,N.width=l.current.element.offsetWidth),Object.freeze(N),d.current&&!ZG(l.current.lastBounds,N)&&a(l.current.lastBounds=N)};return[w,f?KC(w,f):w,u?KC(w,u):w]},[a,r,u,f]);function x(){l.current.scrollContainers&&(l.current.scrollContainers.forEach(w=>w.removeEventListener("scroll",v,!0)),l.current.scrollContainers=null),l.current.resizeObserver&&(l.current.resizeObserver.disconnect(),l.current.resizeObserver=null)}function _(){l.current.element&&(l.current.resizeObserver=new s(v),l.current.resizeObserver.observe(l.current.element),t&&l.current.scrollContainers&&l.current.scrollContainers.forEach(w=>w.addEventListener("scroll",v,{capture:!0,passive:!0})))}const m=w=>{!w||w===l.current.element||(x(),l.current.element=w,l.current.scrollContainers=oN(w),_())};return qG(v,!!t),$G(g),Y.useEffect(()=>{x(),_()},[t,v,g]),Y.useEffect(()=>x,[]),[m,o,p]}function $G(n){Y.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function qG(n,e){Y.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function oN(n){const e=[];if(!n||n===document.body)return e;const{overflow:t,overflowX:i,overflowY:r}=window.getComputedStyle(n);return[t,i,r].some(s=>s==="auto"||s==="scroll")&&e.push(n),[...e,...oN(n.parentElement)]}const YG=["x","y","top","bottom","left","right","width","height"],ZG=(n,e)=>YG.every(t=>n[t]===e[t]);var KG=Object.defineProperty,JG=Object.defineProperties,QG=Object.getOwnPropertyDescriptors,JC=Object.getOwnPropertySymbols,e8=Object.prototype.hasOwnProperty,t8=Object.prototype.propertyIsEnumerable,QC=(n,e,t)=>e in n?KG(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,eR=(n,e)=>{for(var t in e||(e={}))e8.call(e,t)&&QC(n,t,e[t]);if(JC)for(var t of JC(e))t8.call(e,t)&&QC(n,t,e[t]);return n},n8=(n,e)=>JG(n,QG(e)),tR,nR;typeof window<"u"&&((tR=window.document)!=null&&tR.createElement||((nR=window.navigator)==null?void 0:nR.product)==="ReactNative")?Y.useLayoutEffect:Y.useEffect;function aN(n,e,t){if(!n)return;if(t(n)===!0)return n;let i=n.child;for(;i;){const r=aN(i,e,t);if(r)return r;i=i.sibling}}function lN(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const iR=console.error;console.error=function(){const n=[...arguments].join("");if(n!=null&&n.startsWith("Warning:")&&n.includes("useContext")){console.error=iR;return}return iR.apply(this,arguments)};const XM=lN(Y.createContext(null));class uN extends Y.Component{render(){return Y.createElement(XM.Provider,{value:this._reactInternals},this.props.children)}}function i8(){const n=Y.useContext(XM);if(n===null)throw new Error("its-fine: useFiber must be called within a !");const e=Y.useId();return Y.useMemo(()=>{for(const i of[n,n==null?void 0:n.alternate]){if(!i)continue;const r=aN(i,!1,s=>{let o=s.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(r)return r}},[n,e])}function r8(){const n=i8(),[e]=Y.useState(()=>new Map);e.clear();let t=n;for(;t;){if(t.type&&typeof t.type=="object"){const r=t.type._context===void 0&&t.type.Provider===t.type?t.type:t.type._context;r&&r!==XM&&!e.has(r)&&e.set(r,Y.useContext(lN(r)))}t=t.return}return e}function s8(){const n=r8();return Y.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>i=>Y.createElement(e,null,Y.createElement(t.Provider,n8(eR({},i),{value:n.get(t)}))),e=>Y.createElement(uN,eR({},e))),[n])}const kx={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function o8(n){const{handlePointer:e}=OG(n);return{priority:1,enabled:!0,compute(t,i,r){i.pointer.set(t.offsetX/i.size.width*2-1,-(t.offsetY/i.size.height)*2+1),i.raycaster.setFromCamera(i.pointer,i.camera)},connected:void 0,handlers:Object.keys(kx).reduce((t,i)=>({...t,[i]:e(i)}),{}),update:()=>{var t;const{events:i,internal:r}=n.getState();(t=r.lastEvent)!=null&&t.current&&i.handlers&&i.handlers.onPointerMove(r.lastEvent.current)},connect:t=>{var i;const{set:r,events:s}=n.getState();s.disconnect==null||s.disconnect(),r(o=>({events:{...o.events,connected:t}})),Object.entries((i=s.handlers)!=null?i:[]).forEach(([o,a])=>{const[l,u]=kx[o];t.addEventListener(l,a,{passive:u})})},disconnect:()=>{const{set:t,events:i}=n.getState();if(i.connected){var r;Object.entries((r=i.handlers)!=null?r:[]).forEach(([s,o])=>{if(i&&i.connected instanceof HTMLElement){const[a]=kx[s];i.connected.removeEventListener(a,o)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}const a8=Y.forwardRef(function({children:e,fallback:t,resize:i,style:r,gl:s,events:o=o8,eventSource:a,eventPrefix:l,shadows:u,linear:f,flat:d,legacy:p,orthographic:g,frameloop:v,dpr:x,performance:_,raycaster:m,camera:w,scene:S,onPointerMissed:b,onCreated:R,...A},C){Y.useMemo(()=>$3(_G),[]);const L=s8(),[I,E]=XG({scroll:!0,debounce:{scroll:50,resize:0},...i}),N=Y.useRef(null),z=Y.useRef(null);Y.useImperativeHandle(C,()=>N.current);const O=Z3(b),[q,j]=Y.useState(!1),[Q,oe]=Y.useState(!1);if(q)throw q;if(Q)throw Q;const k=Y.useRef(null);Sd(()=>{const G=N.current;E.width>0&&E.height>0&&G&&(k.current||(k.current=GG(G)),k.current.configure({gl:s,events:o,shadows:u,linear:f,flat:d,legacy:p,orthographic:g,frameloop:v,dpr:x,performance:_,raycaster:m,camera:w,scene:S,size:E,onPointerMissed:(...ne)=>O.current==null?void 0:O.current(...ne),onCreated:ne=>{ne.events.connect==null||ne.events.connect(a?AG(a)?a.current:a:z.current),l&&ne.setEvents({compute:(me,_e)=>{const J=me[l+"X"],pe=me[l+"Y"];_e.pointer.set(J/_e.size.width*2-1,-(pe/_e.size.height)*2+1),_e.raycaster.setFromCamera(_e.pointer,_e.camera)}}),R==null||R(ne)}}),k.current.render(Ge.jsx(L,{children:Ge.jsx(K3,{set:oe,children:Ge.jsx(Y.Suspense,{fallback:Ge.jsx(CG,{set:j}),children:e})})})))}),Y.useEffect(()=>{const G=N.current;if(G)return()=>sN(G)},[]);const W=a?"none":"auto";return Ge.jsx("div",{ref:z,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:W,...r},...A,children:Ge.jsx("div",{ref:I,style:{width:"100%",height:"100%"},children:Ge.jsx("canvas",{ref:N,style:{display:"block"},children:t})})})}),l8=Y.forwardRef(function(e,t){return Ge.jsx(uN,{children:Ge.jsx(a8,{...e,ref:t})})});var u8=Object.defineProperty,c8=(n,e,t)=>e in n?u8(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,dt=(n,e,t)=>(c8(n,typeof e!="symbol"?e+"":e,t),t);const Dm=new Dl,rR=new Ns,h8=Math.cos(70*(Math.PI/180)),sR=(n,e)=>(n%e+e)%e;let f8=class extends $s{constructor(e,t){super(),dt(this,"object"),dt(this,"domElement"),dt(this,"enabled",!0),dt(this,"target",new U),dt(this,"minDistance",0),dt(this,"maxDistance",1/0),dt(this,"minZoom",0),dt(this,"maxZoom",1/0),dt(this,"minPolarAngle",0),dt(this,"maxPolarAngle",Math.PI),dt(this,"minAzimuthAngle",-1/0),dt(this,"maxAzimuthAngle",1/0),dt(this,"enableDamping",!1),dt(this,"dampingFactor",.05),dt(this,"enableZoom",!0),dt(this,"zoomSpeed",1),dt(this,"enableRotate",!0),dt(this,"rotateSpeed",1),dt(this,"enablePan",!0),dt(this,"panSpeed",1),dt(this,"screenSpacePanning",!0),dt(this,"keyPanSpeed",7),dt(this,"zoomToCursor",!1),dt(this,"autoRotate",!1),dt(this,"autoRotateSpeed",2),dt(this,"reverseOrbit",!1),dt(this,"reverseHorizontalOrbit",!1),dt(this,"reverseVerticalOrbit",!1),dt(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),dt(this,"mouseButtons",{LEFT:el.ROTATE,MIDDLE:el.DOLLY,RIGHT:el.PAN}),dt(this,"touches",{ONE:tl.ROTATE,TWO:tl.DOLLY_PAN}),dt(this,"target0"),dt(this,"position0"),dt(this,"zoom0"),dt(this,"_domElementKeyEvents",null),dt(this,"getPolarAngle"),dt(this,"getAzimuthalAngle"),dt(this,"setPolarAngle"),dt(this,"setAzimuthalAngle"),dt(this,"getDistance"),dt(this,"listenToKeyEvents"),dt(this,"stopListenToKeyEvents"),dt(this,"saveState"),dt(this,"reset"),dt(this,"update"),dt(this,"connect"),dt(this,"dispose"),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>f.phi,this.getAzimuthalAngle=()=>f.theta,this.setPolarAngle=X=>{let ge=sR(X,2*Math.PI),H=f.phi;H<0&&(H+=2*Math.PI),ge<0&&(ge+=2*Math.PI);let ue=Math.abs(ge-H);2*Math.PI-ue{let ge=sR(X,2*Math.PI),H=f.theta;H<0&&(H+=2*Math.PI),ge<0&&(ge+=2*Math.PI);let ue=Math.abs(ge-H);2*Math.PI-uei.object.position.distanceTo(i.target),this.listenToKeyEvents=X=>{X.addEventListener("keydown",ft),this._domElementKeyEvents=X},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",ft),this._domElementKeyEvents=null},this.saveState=()=>{i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object.zoom},this.reset=()=>{i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.zoom=i.zoom0,i.object.updateProjectionMatrix(),i.dispatchEvent(r),i.update(),l=a.NONE},this.update=(()=>{const X=new U,ge=new U(0,1,0),H=new Ci().setFromUnitVectors(e.up,ge),ue=H.clone().invert(),ce=new U,Pe=new Ci,Ne=2*Math.PI;return function(){const Wt=i.object.position;H.setFromUnitVectors(e.up,ge),ue.copy(H).invert(),X.copy(Wt).sub(i.target),X.applyQuaternion(H),f.setFromVector3(X),i.autoRotate&&l===a.NONE&&q(z()),i.enableDamping?(f.theta+=d.theta*i.dampingFactor,f.phi+=d.phi*i.dampingFactor):(f.theta+=d.theta,f.phi+=d.phi);let Ot=i.minAzimuthAngle,Qt=i.maxAzimuthAngle;isFinite(Ot)&&isFinite(Qt)&&(Ot<-Math.PI?Ot+=Ne:Ot>Math.PI&&(Ot-=Ne),Qt<-Math.PI?Qt+=Ne:Qt>Math.PI&&(Qt-=Ne),Ot<=Qt?f.theta=Math.max(Ot,Math.min(Qt,f.theta)):f.theta=f.theta>(Ot+Qt)/2?Math.max(Ot,f.theta):Math.min(Qt,f.theta)),f.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,f.phi)),f.makeSafe(),i.enableDamping===!0?i.target.addScaledVector(g,i.dampingFactor):i.target.add(g),i.zoomToCursor&&I||i.object.isOrthographicCamera?f.radius=me(f.radius):f.radius=me(f.radius*p),X.setFromSpherical(f),X.applyQuaternion(ue),Wt.copy(i.target).add(X),i.object.matrixAutoUpdate||i.object.updateMatrix(),i.object.lookAt(i.target),i.enableDamping===!0?(d.theta*=1-i.dampingFactor,d.phi*=1-i.dampingFactor,g.multiplyScalar(1-i.dampingFactor)):(d.set(0,0,0),g.set(0,0,0));let Rt=!1;if(i.zoomToCursor&&I){let Gn=null;if(i.object instanceof Tn&&i.object.isPerspectiveCamera){const an=X.length();Gn=me(an*p);const Zs=an-Gn;i.object.position.addScaledVector(C,Zs),i.object.updateMatrixWorld()}else if(i.object.isOrthographicCamera){const an=new U(L.x,L.y,0);an.unproject(i.object),i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/p)),i.object.updateProjectionMatrix(),Rt=!0;const Zs=new U(L.x,L.y,0);Zs.unproject(i.object),i.object.position.sub(Zs).add(an),i.object.updateMatrixWorld(),Gn=X.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),i.zoomToCursor=!1;Gn!==null&&(i.screenSpacePanning?i.target.set(0,0,-1).transformDirection(i.object.matrix).multiplyScalar(Gn).add(i.object.position):(Dm.origin.copy(i.object.position),Dm.direction.set(0,0,-1).transformDirection(i.object.matrix),Math.abs(i.object.up.dot(Dm.direction))u||8*(1-Pe.dot(i.object.quaternion))>u?(i.dispatchEvent(r),ce.copy(i.object.position),Pe.copy(i.object.quaternion),Rt=!1,!0):!1}})(),this.connect=X=>{X===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),i.domElement=X,i.domElement.style.touchAction="none",i.domElement.addEventListener("contextmenu",Mt),i.domElement.addEventListener("pointerdown",te),i.domElement.addEventListener("pointercancel",Se),i.domElement.addEventListener("wheel",Ie)},this.dispose=()=>{var X,ge,H,ue,ce,Pe;i.domElement&&(i.domElement.style.touchAction="auto"),(X=i.domElement)==null||X.removeEventListener("contextmenu",Mt),(ge=i.domElement)==null||ge.removeEventListener("pointerdown",te),(H=i.domElement)==null||H.removeEventListener("pointercancel",Se),(ue=i.domElement)==null||ue.removeEventListener("wheel",Ie),(ce=i.domElement)==null||ce.ownerDocument.removeEventListener("pointermove",xe),(Pe=i.domElement)==null||Pe.ownerDocument.removeEventListener("pointerup",Ee),i._domElementKeyEvents!==null&&i._domElementKeyEvents.removeEventListener("keydown",ft)};const i=this,r={type:"change"},s={type:"start"},o={type:"end"},a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=a.NONE;const u=1e-6,f=new IS,d=new IS;let p=1;const g=new U,v=new ve,x=new ve,_=new ve,m=new ve,w=new ve,S=new ve,b=new ve,R=new ve,A=new ve,C=new U,L=new ve;let I=!1;const E=[],N={};function z(){return 2*Math.PI/60/60*i.autoRotateSpeed}function O(){return Math.pow(.95,i.zoomSpeed)}function q(X){i.reverseOrbit||i.reverseHorizontalOrbit?d.theta+=X:d.theta-=X}function j(X){i.reverseOrbit||i.reverseVerticalOrbit?d.phi+=X:d.phi-=X}const Q=(()=>{const X=new U;return function(H,ue){X.setFromMatrixColumn(ue,0),X.multiplyScalar(-H),g.add(X)}})(),oe=(()=>{const X=new U;return function(H,ue){i.screenSpacePanning===!0?X.setFromMatrixColumn(ue,1):(X.setFromMatrixColumn(ue,0),X.crossVectors(i.object.up,X)),X.multiplyScalar(H),g.add(X)}})(),k=(()=>{const X=new U;return function(H,ue){const ce=i.domElement;if(ce&&i.object instanceof Tn&&i.object.isPerspectiveCamera){const Pe=i.object.position;X.copy(Pe).sub(i.target);let Ne=X.length();Ne*=Math.tan(i.object.fov/2*Math.PI/180),Q(2*H*Ne/ce.clientHeight,i.object.matrix),oe(2*ue*Ne/ce.clientHeight,i.object.matrix)}else ce&&i.object instanceof _o&&i.object.isOrthographicCamera?(Q(H*(i.object.right-i.object.left)/i.object.zoom/ce.clientWidth,i.object.matrix),oe(ue*(i.object.top-i.object.bottom)/i.object.zoom/ce.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}})();function W(X){i.object instanceof Tn&&i.object.isPerspectiveCamera||i.object instanceof _o&&i.object.isOrthographicCamera?p/=X:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function G(X){i.object instanceof Tn&&i.object.isPerspectiveCamera||i.object instanceof _o&&i.object.isOrthographicCamera?p*=X:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function ne(X){if(!i.zoomToCursor||!i.domElement)return;I=!0;const ge=i.domElement.getBoundingClientRect(),H=X.clientX-ge.left,ue=X.clientY-ge.top,ce=ge.width,Pe=ge.height;L.x=H/ce*2-1,L.y=-(ue/Pe)*2+1,C.set(L.x,L.y,1).unproject(i.object).sub(i.object.position).normalize()}function me(X){return Math.max(i.minDistance,Math.min(i.maxDistance,X))}function _e(X){v.set(X.clientX,X.clientY)}function J(X){ne(X),b.set(X.clientX,X.clientY)}function pe(X){m.set(X.clientX,X.clientY)}function Me(X){x.set(X.clientX,X.clientY),_.subVectors(x,v).multiplyScalar(i.rotateSpeed);const ge=i.domElement;ge&&(q(2*Math.PI*_.x/ge.clientHeight),j(2*Math.PI*_.y/ge.clientHeight)),v.copy(x),i.update()}function de(X){R.set(X.clientX,X.clientY),A.subVectors(R,b),A.y>0?W(O()):A.y<0&&G(O()),b.copy(R),i.update()}function Qe(X){w.set(X.clientX,X.clientY),S.subVectors(w,m).multiplyScalar(i.panSpeed),k(S.x,S.y),m.copy(w),i.update()}function lt(X){ne(X),X.deltaY<0?G(O()):X.deltaY>0&&W(O()),i.update()}function K(X){let ge=!1;switch(X.code){case i.keys.UP:k(0,i.keyPanSpeed),ge=!0;break;case i.keys.BOTTOM:k(0,-i.keyPanSpeed),ge=!0;break;case i.keys.LEFT:k(i.keyPanSpeed,0),ge=!0;break;case i.keys.RIGHT:k(-i.keyPanSpeed,0),ge=!0;break}ge&&(X.preventDefault(),i.update())}function tt(){if(E.length==1)v.set(E[0].pageX,E[0].pageY);else{const X=.5*(E[0].pageX+E[1].pageX),ge=.5*(E[0].pageY+E[1].pageY);v.set(X,ge)}}function he(){if(E.length==1)m.set(E[0].pageX,E[0].pageY);else{const X=.5*(E[0].pageX+E[1].pageX),ge=.5*(E[0].pageY+E[1].pageY);m.set(X,ge)}}function we(){const X=E[0].pageX-E[1].pageX,ge=E[0].pageY-E[1].pageY,H=Math.sqrt(X*X+ge*ge);b.set(0,H)}function ye(){i.enableZoom&&we(),i.enablePan&&he()}function Ce(){i.enableZoom&&we(),i.enableRotate&&tt()}function be(X){if(E.length==1)x.set(X.pageX,X.pageY);else{const H=Et(X),ue=.5*(X.pageX+H.x),ce=.5*(X.pageY+H.y);x.set(ue,ce)}_.subVectors(x,v).multiplyScalar(i.rotateSpeed);const ge=i.domElement;ge&&(q(2*Math.PI*_.x/ge.clientHeight),j(2*Math.PI*_.y/ge.clientHeight)),v.copy(x)}function Be(X){if(E.length==1)w.set(X.pageX,X.pageY);else{const ge=Et(X),H=.5*(X.pageX+ge.x),ue=.5*(X.pageY+ge.y);w.set(H,ue)}S.subVectors(w,m).multiplyScalar(i.panSpeed),k(S.x,S.y),m.copy(w)}function Ke(X){const ge=Et(X),H=X.pageX-ge.x,ue=X.pageY-ge.y,ce=Math.sqrt(H*H+ue*ue);R.set(0,ce),A.set(0,Math.pow(R.y/b.y,i.zoomSpeed)),W(A.y),b.copy(R)}function V(X){i.enableZoom&&Ke(X),i.enablePan&&Be(X)}function D(X){i.enableZoom&&Ke(X),i.enableRotate&&be(X)}function te(X){var ge,H;i.enabled!==!1&&(E.length===0&&((ge=i.domElement)==null||ge.ownerDocument.addEventListener("pointermove",xe),(H=i.domElement)==null||H.ownerDocument.addEventListener("pointerup",Ee)),it(X),X.pointerType==="touch"?Re(X):qe(X))}function xe(X){i.enabled!==!1&&(X.pointerType==="touch"?$e(X):Le(X))}function Ee(X){var ge,H,ue;Ve(X),E.length===0&&((ge=i.domElement)==null||ge.releasePointerCapture(X.pointerId),(H=i.domElement)==null||H.ownerDocument.removeEventListener("pointermove",xe),(ue=i.domElement)==null||ue.ownerDocument.removeEventListener("pointerup",Ee)),i.dispatchEvent(o),l=a.NONE}function Se(X){Ve(X)}function qe(X){let ge;switch(X.button){case 0:ge=i.mouseButtons.LEFT;break;case 1:ge=i.mouseButtons.MIDDLE;break;case 2:ge=i.mouseButtons.RIGHT;break;default:ge=-1}switch(ge){case el.DOLLY:if(i.enableZoom===!1)return;J(X),l=a.DOLLY;break;case el.ROTATE:if(X.ctrlKey||X.metaKey||X.shiftKey){if(i.enablePan===!1)return;pe(X),l=a.PAN}else{if(i.enableRotate===!1)return;_e(X),l=a.ROTATE}break;case el.PAN:if(X.ctrlKey||X.metaKey||X.shiftKey){if(i.enableRotate===!1)return;_e(X),l=a.ROTATE}else{if(i.enablePan===!1)return;pe(X),l=a.PAN}break;default:l=a.NONE}l!==a.NONE&&i.dispatchEvent(s)}function Le(X){if(i.enabled!==!1)switch(l){case a.ROTATE:if(i.enableRotate===!1)return;Me(X);break;case a.DOLLY:if(i.enableZoom===!1)return;de(X);break;case a.PAN:if(i.enablePan===!1)return;Qe(X);break}}function Ie(X){i.enabled===!1||i.enableZoom===!1||l!==a.NONE&&l!==a.ROTATE||(X.preventDefault(),i.dispatchEvent(s),lt(X),i.dispatchEvent(o))}function ft(X){i.enabled===!1||i.enablePan===!1||K(X)}function Re(X){switch(pt(X),E.length){case 1:switch(i.touches.ONE){case tl.ROTATE:if(i.enableRotate===!1)return;tt(),l=a.TOUCH_ROTATE;break;case tl.PAN:if(i.enablePan===!1)return;he(),l=a.TOUCH_PAN;break;default:l=a.NONE}break;case 2:switch(i.touches.TWO){case tl.DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;ye(),l=a.TOUCH_DOLLY_PAN;break;case tl.DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;Ce(),l=a.TOUCH_DOLLY_ROTATE;break;default:l=a.NONE}break;default:l=a.NONE}l!==a.NONE&&i.dispatchEvent(s)}function $e(X){switch(pt(X),l){case a.TOUCH_ROTATE:if(i.enableRotate===!1)return;be(X),i.update();break;case a.TOUCH_PAN:if(i.enablePan===!1)return;Be(X),i.update();break;case a.TOUCH_DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;V(X),i.update();break;case a.TOUCH_DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;D(X),i.update();break;default:l=a.NONE}}function Mt(X){i.enabled!==!1&&X.preventDefault()}function it(X){E.push(X)}function Ve(X){delete N[X.pointerId];for(let ge=0;ge{const d=xM.clone({[u]:{value:f}});return{...l,...d}},{}),vertexShader:e,fragmentShader:t}),this.key="",a.forEach(([l])=>Object.defineProperty(this,l,{get:()=>this.uniforms[l].value,set:u=>this.uniforms[l].value=u})),Object.assign(this,o)}};return r.key=PL.generateUUID(),r}const p8=()=>parseInt(fd.replace(/\D+/g,"")),m8=p8();function g8(n,e,t){const i=mr(p=>p.size),r=mr(p=>p.viewport),s=typeof n=="number"?n:i.width*r.dpr,o=i.height*r.dpr,a=(typeof n=="number"?t:n)||{},{samples:l=0,depth:u,...f}=a,d=Y.useMemo(()=>{const p=new Yr(s,o,{minFilter:An,magFilter:An,type:Lc,...f});return u&&(p.depthTexture=new v0(s,o,yr)),p.samples=l,p},[]);return Y.useLayoutEffect(()=>{d.setSize(s,o),l&&(d.samples=l)},[l,d,s,o]),Y.useEffect(()=>()=>d.dispose(),[]),d}const v8=n=>typeof n=="function",y8=Y.forwardRef(({envMap:n,resolution:e=256,frames:t=1/0,makeDefault:i,children:r,...s},o)=>{const a=mr(({set:_})=>_),l=mr(({camera:_})=>_),u=mr(({size:_})=>_),f=Y.useRef(null);Y.useImperativeHandle(o,()=>f.current,[]);const d=Y.useRef(null),p=g8(e);Y.useLayoutEffect(()=>{s.manual||(f.current.aspect=u.width/u.height)},[u,s]),Y.useLayoutEffect(()=>{f.current.updateProjectionMatrix()});let g=0,v=null;const x=v8(r);return jM(_=>{x&&(t===1/0||g{if(i){const _=l;return a(()=>({camera:f.current})),()=>a(()=>({camera:_}))}},[f,i,a]),Y.createElement(Y.Fragment,null,Y.createElement("perspectiveCamera",xc({ref:f},s),!x&&r),Y.createElement("group",{ref:d},x&&r(p.texture)))}),_8=Y.forwardRef(({makeDefault:n,camera:e,regress:t,domElement:i,enableDamping:r=!0,keyEvents:s=!1,onChange:o,onStart:a,onEnd:l,...u},f)=>{const d=mr(A=>A.invalidate),p=mr(A=>A.camera),g=mr(A=>A.gl),v=mr(A=>A.events),x=mr(A=>A.setEvents),_=mr(A=>A.set),m=mr(A=>A.get),w=mr(A=>A.performance),S=e||p,b=i||v.connected||g.domElement,R=Y.useMemo(()=>new f8(S),[S]);return jM(()=>{R.enabled&&R.update()},-1),Y.useEffect(()=>(s&&R.connect(s===!0?b:s),R.connect(b),()=>void R.dispose()),[s,b,t,R,d]),Y.useEffect(()=>{const A=I=>{d(),t&&w.regress(),o&&o(I)},C=I=>{a&&a(I)},L=I=>{l&&l(I)};return R.addEventListener("change",A),R.addEventListener("start",C),R.addEventListener("end",L),()=>{R.removeEventListener("start",C),R.removeEventListener("end",L),R.removeEventListener("change",A)}},[o,a,l,R,d,x]),Y.useEffect(()=>{if(n){const A=m().controls;return _({controls:R}),()=>_({controls:A})}},[n,R]),Y.createElement("primitive",xc({ref:f,object:R,enableDamping:r},u))}),x8=d8({cellSize:.5,sectionSize:1,fadeDistance:100,fadeStrength:1,fadeFrom:1,cellThickness:.5,sectionThickness:1,cellColor:new ze,sectionColor:new ze,infiniteGrid:!1,followCamera:!1,worldCamProjPosition:new U,worldPlanePosition:new U},` + `)+c.join(" > ")}return null},t.getPublicRootInstance=function(c){if(c=c.current,!c.child)return null;switch(c.child.tag){case 5:return Q(c.child.stateNode);default:return c.child.stateNode}},t.injectIntoDevTools=function(c){if(c={bundleType:c.bundleType,version:c.version,rendererPackageName:c.rendererPackageName,rendererConfig:c.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:KO,findFiberByHostInstance:c.findFiberByHostInstance||JO,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")c=!1;else{var h=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(h.isDisabled||!h.supportsFiber)c=!0;else{try{Ld=h.inject(c),Ss=h}catch{}c=!!h.checkDCE}}return c},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(c,h,y,M){if(!D)throw Error(o(363));c=e_(c,h);var T=Ie(c,y,M).disconnect;return{disconnect:function(){T()}}},t.registerMutableSourceForHydration=function(c,h){var y=h._getVersion;y=y(h._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[h,y]:c.mutableSourceEagerHydrationData.push(h,y)},t.runWithPriority=function(c,h){var y=Bt;try{return Bt=c,h()}finally{Bt=y}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(c,h,y,M){var T=h.current,P=Di(),B=Go(T);return y=Jb(y),h.context===null?h.context=y:h.pendingContext=y,h=Js(P,B),h.payload={element:c},M=M===void 0?null:M,M!==null&&(h.callback=M),Bo(T,h),c=Or(T,B,P),c!==null&&Fd(c,T,B),B},t};W3.exports=MG;var EG=W3.exports;const bG=l1(EG),WM={},$3=n=>void Object.assign(WM,n);function TG(n,e){function t(f,{args:d=[],attach:p,...g},v){let x=`${f[0].toUpperCase()}${f.slice(1)}`,_;if(f==="primitive"){if(g.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const m=g.object;_=Ru(m,{type:f,root:v,attach:p,primitive:!0})}else{const m=WM[x];if(!m)throw new Error(`R3F: ${x} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(d))throw new Error("R3F: The args prop must be an array!");_=Ru(new m(...d),{type:f,root:v,attach:p,memoizedProps:{args:d}})}return _.__r3f.attach===void 0&&(_ instanceof Tt?_.__r3f.attach="geometry":_ instanceof hi&&(_.__r3f.attach="material")),x!=="inject"&&Ix(_,g),_}function i(f,d){let p=!1;if(d){var g,v;(g=d.__r3f)!=null&&g.attach?Px(f,d,d.__r3f.attach):d.isObject3D&&f.isObject3D&&(f.add(d),p=!0),p||(v=f.__r3f)==null||v.objects.push(d),d.__r3f||Ru(d,{}),d.__r3f.parent=f,DS(d),Pu(d)}}function r(f,d,p){let g=!1;if(d){var v,x;if((v=d.__r3f)!=null&&v.attach)Px(f,d,d.__r3f.attach);else if(d.isObject3D&&f.isObject3D){d.parent=f,d.dispatchEvent({type:"added"}),f.dispatchEvent({type:"childadded",child:d});const _=f.children.filter(w=>w!==d),m=_.indexOf(p);f.children=[..._.slice(0,m),d,..._.slice(m)],g=!0}g||(x=f.__r3f)==null||x.objects.push(d),d.__r3f||Ru(d,{}),d.__r3f.parent=f,DS(d),Pu(d)}}function s(f,d,p=!1){f&&[...f].forEach(g=>o(d,g,p))}function o(f,d,p){if(d){var g,v,x;if(d.__r3f&&(d.__r3f.parent=null),(g=f.__r3f)!=null&&g.objects&&(f.__r3f.objects=f.__r3f.objects.filter(b=>b!==d)),(v=d.__r3f)!=null&&v.attach)qC(f,d,d.__r3f.attach);else if(d.isObject3D&&f.isObject3D){var _;f.remove(d),(_=d.__r3f)!=null&&_.root&&DG(pg(d),d)}const w=(x=d.__r3f)==null?void 0:x.primitive,S=!w&&(p===void 0?d.dispose!==null:p);if(!w){var m;s((m=d.__r3f)==null?void 0:m.objects,d,S),s(d.children,d,S)}if(delete d.__r3f,S&&d.dispose&&d.type!=="Scene"){const b=()=>{try{d.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT>"u"?LS.unstable_scheduleCallback(LS.unstable_IdlePriority,b):b()}Pu(f)}}function a(f,d,p,g){var v;const x=(v=f.__r3f)==null?void 0:v.parent;if(!x)return;const _=t(d,p,f.__r3f.root);if(f.children){for(const m of f.children)m.__r3f&&i(_,m);f.children=f.children.filter(m=>!m.__r3f)}f.__r3f.objects.forEach(m=>i(_,m)),f.__r3f.objects=[],f.__r3f.autoRemovedBeforeAppend||o(x,f),_.parent&&(_.__r3f.autoRemovedBeforeAppend=!0),i(x,_),_.raycast&&_.__r3f.eventCount&&pg(_).getState().internal.interaction.push(_),[g,g.alternate].forEach(m=>{m!==null&&(m.stateNode=_,m.ref&&(typeof m.ref=="function"?m.ref(_):m.ref.current=_))})}const l=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:bG({createInstance:t,removeChild:o,appendChild:i,appendInitialChild:i,insertBefore:r,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(f,d)=>{if(!d)return;const p=f.getState().scene;p.__r3f&&(p.__r3f.root=f,i(p,d))},removeChildFromContainer:(f,d)=>{d&&o(f.getState().scene,d)},insertInContainerBefore:(f,d,p)=>{if(!d||!p)return;const g=f.getState().scene;g.__r3f&&r(g,d,p)},getRootHostContext:()=>null,getChildHostContext:f=>f,finalizeInitialChildren(f){var d;return!!((d=f==null?void 0:f.__r3f)!=null?d:{}).handlers},prepareUpdate(f,d,p,g){var v;if(((v=f==null?void 0:f.__r3f)!=null?v:{}).primitive&&g.object&&g.object!==f)return[!0];{const{args:_=[],children:m,...w}=g,{args:S=[],children:b,...R}=p;if(!Array.isArray(_))throw new Error("R3F: the args prop must be an array!");if(_.some((C,L)=>C!==S[L]))return[!0];const A=eN(f,w,R,!0);return A.changes.length?[!1,A]:null}},commitUpdate(f,[d,p],g,v,x,_){d?a(f,g,x,_):Ix(f,p)},commitMount(f,d,p,g){var v;const x=(v=f.__r3f)!=null?v:{};f.raycast&&x.handlers&&x.eventCount&&pg(f).getState().internal.interaction.push(f)},getPublicInstance:f=>f,prepareForCommit:()=>null,preparePortalMount:f=>Ru(f.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(f){var d;const{attach:p,parent:g}=(d=f.__r3f)!=null?d:{};p&&g&&qC(g,f,p),f.isObject3D&&(f.visible=!1),Pu(f)},unhideInstance(f,d){var p;const{attach:g,parent:v}=(p=f.__r3f)!=null?p:{};g&&v&&Px(v,f,g),(f.isObject3D&&d.visible==null||d.visible)&&(f.visible=!0),Pu(f)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():Qu.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&cn.fun(performance.now)?performance.now:cn.fun(Date.now)?Date.now:()=>0,scheduleTimeout:cn.fun(setTimeout)?setTimeout:void 0,cancelTimeout:cn.fun(clearTimeout)?clearTimeout:void 0}),applyProps:Ix}}var WC,jC;const Rx=n=>"colorSpace"in n||"outputColorSpace"in n,q3=()=>{var n;return(n=WM.ColorManagement)!=null?n:null},Y3=n=>n&&n.isOrthographicCamera,AG=n=>n&&n.hasOwnProperty("current"),Sd=typeof window<"u"&&((WC=window.document)!=null&&WC.createElement||((jC=window.navigator)==null?void 0:jC.product)==="ReactNative")?Y.useLayoutEffect:Y.useEffect;function Z3(n){const e=Y.useRef(n);return Sd(()=>void(e.current=n),[n]),e}function CG({set:n}){return Sd(()=>(n(new Promise(()=>null)),()=>n(!1)),[n]),null}class K3 extends Y.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}K3.getDerivedStateFromError=()=>({error:!0});const J3="__default",XC=new Map,RG=n=>n&&!!n.memoized&&!!n.changes;function Q3(n){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(n)?Math.min(Math.max(n[0],t),n[1]):n}const Ch=n=>{var e;return(e=n.__r3f)==null?void 0:e.root.getState()};function pg(n){let e=n.__r3f.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const cn={obj:n=>n===Object(n)&&!cn.arr(n)&&typeof n!="function",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",boo:n=>typeof n=="boolean",und:n=>n===void 0,arr:n=>Array.isArray(n),equ(n,e,{arrays:t="shallow",objects:i="reference",strict:r=!0}={}){if(typeof n!=typeof e||!!n!=!!e)return!1;if(cn.str(n)||cn.num(n))return n===e;const s=cn.obj(n);if(s&&i==="reference")return n===e;const o=cn.arr(n);if(o&&t==="reference")return n===e;if((o||s)&&n===e)return!0;let a;for(a in n)if(!(a in e))return!1;if(s&&t==="shallow"&&i==="shallow"){for(a in r?e:n)if(!cn.equ(n[a],e[a],{strict:r,objects:"reference"}))return!1}else for(a in r?e:n)if(n[a]!==e[a])return!1;if(cn.und(a)){if(o&&n.length===0&&e.length===0||s&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}};function PG(n){n.dispose&&n.type!=="Scene"&&n.dispose();for(const e in n)e.dispose==null||e.dispose(),delete n[e]}function Ru(n,e){const t=n;return t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},n}function NS(n,e){let t=n;if(e.includes("-")){const i=e.split("-"),r=i.pop();return t=i.reduce((s,o)=>s[o],n),{target:t,key:r}}else return{target:t,key:e}}const $C=/-\d+$/;function Px(n,e,t){if(cn.str(t)){if($C.test(t)){const s=t.replace($C,""),{target:o,key:a}=NS(n,s);Array.isArray(o[a])||(o[a]=[])}const{target:i,key:r}=NS(n,t);e.__r3f.previousAttach=i[r],i[r]=e}else e.__r3f.previousAttach=t(n,e)}function qC(n,e,t){var i,r;if(cn.str(t)){const{target:s,key:o}=NS(n,t),a=e.__r3f.previousAttach;a===void 0?delete s[o]:s[o]=a}else(i=e.__r3f)==null||i.previousAttach==null||i.previousAttach(n,e);(r=e.__r3f)==null||delete r.previousAttach}function eN(n,{children:e,key:t,ref:i,...r},{children:s,key:o,ref:a,...l}={},u=!1){const f=n.__r3f,d=Object.entries(r),p=[];if(u){const v=Object.keys(l);for(let x=0;x{var _;if((_=n.__r3f)!=null&&_.primitive&&v==="object"||cn.equ(x,l[v]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(v))return p.push([v,x,!0,[]]);let m=[];v.includes("-")&&(m=v.split("-")),p.push([v,x,!1,m]);for(const w in r){const S=r[w];w.startsWith(`${v}-`)&&p.push([w,S,!1,w.split("-")])}});const g={...r};return f!=null&&f.memoizedProps&&f!=null&&f.memoizedProps.args&&(g.args=f.memoizedProps.args),f!=null&&f.memoizedProps&&f!=null&&f.memoizedProps.attach&&(g.attach=f.memoizedProps.attach),{memoized:g,changes:p}}const IG=typeof process<"u"&&!1;function Ix(n,e){var t;const i=n.__r3f,r=i==null?void 0:i.root,s=r==null||r.getState==null?void 0:r.getState(),{memoized:o,changes:a}=RG(e)?e:eN(n,e),l=i==null?void 0:i.eventCount;n.__r3f&&(n.__r3f.memoizedProps=o);for(let f=0;fm[w],n),!(_&&_.set))){const[m,...w]=v.reverse();x=w.reverse().reduce((S,b)=>S[b],n),d=m}if(p===J3+"remove")if(x.constructor){let m=XC.get(x.constructor);m||(m=new x.constructor,XC.set(x.constructor,m)),p=m[d]}else p=0;if(g&&i)p?i.handlers[d]=p:delete i.handlers[d],i.eventCount=Object.keys(i.handlers).length;else if(_&&_.set&&(_.copy||_ instanceof _l)){if(Array.isArray(p))_.fromArray?_.fromArray(p):_.set(...p);else if(_.copy&&p&&p.constructor&&(IG?_.constructor.name===p.constructor.name:_.constructor===p.constructor))_.copy(p);else if(p!==void 0){const m=_ instanceof ze;!m&&_.setScalar?_.setScalar(p):_ instanceof _l&&p instanceof _l?_.mask=p.mask:_.set(p),!q3()&&s&&!s.linear&&m&&_.convertSRGBToLinear()}}else if(x[d]=p,x[d]instanceof _n&&x[d].format===Ji&&x[d].type===Xs&&s){const m=x[d];Rx(m)&&Rx(s.gl)?m.colorSpace=s.gl.outputColorSpace:m.encoding=s.gl.outputEncoding}Pu(n)}if(i&&i.parent&&n.raycast&&l!==i.eventCount){const f=pg(n).getState().internal,d=f.interaction.indexOf(n);d>-1&&f.interaction.splice(d,1),i.eventCount&&f.interaction.push(n)}return!(a.length===1&&a[0][0]==="onUpdate")&&a.length&&(t=n.__r3f)!=null&&t.parent&&DS(n),n}function Pu(n){var e,t;const i=(e=n.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();i&&i.internal.frames===0&&i.invalidate()}function DS(n){n.onUpdate==null||n.onUpdate(n)}function LG(n,e){n.manual||(Y3(n)?(n.left=e.width/-2,n.right=e.width/2,n.top=e.height/2,n.bottom=e.height/-2):n.aspect=e.width/e.height,n.updateProjectionMatrix(),n.updateMatrixWorld())}function Lm(n){return(n.eventObject||n.object).uuid+"/"+n.index+n.instanceId}function NG(){var n;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return Qu.DefaultEventPriority;switch((n=e.event)==null?void 0:n.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Qu.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Qu.ContinuousEventPriority;default:return Qu.DefaultEventPriority}}function tN(n,e,t,i){const r=t.get(e);r&&(t.delete(e),t.size===0&&(n.delete(i),r.target.releasePointerCapture(i)))}function DG(n,e){const{internal:t}=n.getState();t.interaction=t.interaction.filter(i=>i!==e),t.initialHits=t.initialHits.filter(i=>i!==e),t.hovered.forEach((i,r)=>{(i.eventObject===e||i.object===e)&&t.hovered.delete(r)}),t.capturedMap.forEach((i,r)=>{tN(t.capturedMap,e,i,r)})}function OG(n){function e(l){const{internal:u}=n.getState(),f=l.offsetX-u.initialClick[0],d=l.offsetY-u.initialClick[1];return Math.round(Math.sqrt(f*f+d*d))}function t(l){return l.filter(u=>["Move","Over","Enter","Out","Leave"].some(f=>{var d;return(d=u.__r3f)==null?void 0:d.handlers["onPointer"+f]}))}function i(l,u){const f=n.getState(),d=new Set,p=[],g=u?u(f.internal.interaction):f.internal.interaction;for(let m=0;m{const S=Ch(m.object),b=Ch(w.object);return!S||!b?m.distance-w.distance:b.events.priority-S.events.priority||m.distance-w.distance}).filter(m=>{const w=Lm(m);return d.has(w)?!1:(d.add(w),!0)});f.events.filter&&(x=f.events.filter(x,f));for(const m of x){let w=m.object;for(;w;){var _;(_=w.__r3f)!=null&&_.eventCount&&p.push({...m,eventObject:w}),w=w.parent}}if("pointerId"in l&&f.internal.capturedMap.has(l.pointerId))for(let m of f.internal.capturedMap.get(l.pointerId).values())d.has(Lm(m.intersection))||p.push(m.intersection);return p}function r(l,u,f,d){const p=n.getState();if(l.length){const g={stopped:!1};for(const v of l){const x=Ch(v.object)||p,{raycaster:_,pointer:m,camera:w,internal:S}=x,b=new U(m.x,m.y,0).unproject(w),R=E=>{var N,z;return(N=(z=S.capturedMap.get(E))==null?void 0:z.has(v.eventObject))!=null?N:!1},A=E=>{const N={intersection:v,target:u.target};S.capturedMap.has(E)?S.capturedMap.get(E).set(v.eventObject,N):S.capturedMap.set(E,new Map([[v.eventObject,N]])),u.target.setPointerCapture(E)},C=E=>{const N=S.capturedMap.get(E);N&&tN(S.capturedMap,v.eventObject,N,E)};let L={};for(let E in u){let N=u[E];typeof N!="function"&&(L[E]=N)}let I={...v,...L,pointer:m,intersections:l,stopped:g.stopped,delta:f,unprojectedPoint:b,ray:_.ray,camera:w,stopPropagation(){const E="pointerId"in u&&S.capturedMap.get(u.pointerId);if((!E||E.has(v.eventObject))&&(I.stopped=g.stopped=!0,S.hovered.size&&Array.from(S.hovered.values()).find(N=>N.eventObject===v.eventObject))){const N=l.slice(0,l.indexOf(v));s([...N,v])}},target:{hasPointerCapture:R,setPointerCapture:A,releasePointerCapture:C},currentTarget:{hasPointerCapture:R,setPointerCapture:A,releasePointerCapture:C},nativeEvent:u};if(d(I),g.stopped===!0)break}}return l}function s(l){const{internal:u}=n.getState();for(const f of u.hovered.values())if(!l.length||!l.find(d=>d.object===f.object&&d.index===f.index&&d.instanceId===f.instanceId)){const p=f.eventObject.__r3f,g=p==null?void 0:p.handlers;if(u.hovered.delete(Lm(f)),p!=null&&p.eventCount){const v={...f,intersections:l};g.onPointerOut==null||g.onPointerOut(v),g.onPointerLeave==null||g.onPointerLeave(v)}}}function o(l,u){for(let f=0;fs([]);case"onLostPointerCapture":return u=>{const{internal:f}=n.getState();"pointerId"in u&&f.capturedMap.has(u.pointerId)&&requestAnimationFrame(()=>{f.capturedMap.has(u.pointerId)&&(f.capturedMap.delete(u.pointerId),s([]))})}}return function(f){const{onPointerMissed:d,internal:p}=n.getState();p.lastEvent.current=f;const g=l==="onPointerMove",v=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",_=i(f,g?t:void 0),m=v?e(f):0;l==="onPointerDown"&&(p.initialClick=[f.offsetX,f.offsetY],p.initialHits=_.map(S=>S.eventObject)),v&&!_.length&&m<=2&&(o(f,p.interaction),d&&d(f)),g&&s(_);function w(S){const b=S.eventObject,R=b.__r3f,A=R==null?void 0:R.handlers;if(R!=null&&R.eventCount)if(g){if(A.onPointerOver||A.onPointerEnter||A.onPointerOut||A.onPointerLeave){const C=Lm(S),L=p.hovered.get(C);L?L.stopped&&S.stopPropagation():(p.hovered.set(C,S),A.onPointerOver==null||A.onPointerOver(S),A.onPointerEnter==null||A.onPointerEnter(S))}A.onPointerMove==null||A.onPointerMove(S)}else{const C=A[l];C?(!v||p.initialHits.includes(b))&&(o(f,p.interaction.filter(L=>!p.initialHits.includes(L))),C(S)):v&&p.initialHits.includes(b)&&o(f,p.interaction.filter(L=>!p.initialHits.includes(L)))}}r(_,f,m,w)}}return{handlePointer:a}}const nN=n=>!!(n!=null&&n.render),iN=Y.createContext(null),kG=(n,e)=>{const t=SG((a,l)=>{const u=new U,f=new U,d=new U;function p(m=l().camera,w=f,S=l().size){const{width:b,height:R,top:A,left:C}=S,L=b/R;w instanceof U?d.copy(w):d.set(...w);const I=m.getWorldPosition(u).distanceTo(d);if(Y3(m))return{width:b/m.zoom,height:R/m.zoom,top:A,left:C,factor:1,distance:I,aspect:L};{const E=m.fov*Math.PI/180,N=2*Math.tan(E/2)*I,z=N*(b/R);return{width:z,height:N,top:A,left:C,factor:b/z,distance:I,aspect:L}}}let g;const v=m=>a(w=>({performance:{...w.performance,current:m}})),x=new ve;return{set:a,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(m=1)=>n(l(),m),advance:(m,w)=>e(m,w,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new BM,pointer:x,mouse:x,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const m=l();g&&clearTimeout(g),m.performance.current!==m.performance.min&&v(m.performance.min),g=setTimeout(()=>v(l().performance.max),m.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:p},setEvents:m=>a(w=>({...w,events:{...w.events,...m}})),setSize:(m,w,S,b,R)=>{const A=l().camera,C={width:m,height:w,top:b||0,left:R||0,updateStyle:S};a(L=>({size:C,viewport:{...L.viewport,...p(A,f,C)}}))},setDpr:m=>a(w=>{const S=Q3(m);return{viewport:{...w.viewport,dpr:S,initialDpr:w.viewport.initialDpr||S}}}),setFrameloop:(m="always")=>{const w=l().clock;w.stop(),w.elapsedTime=0,m!=="never"&&(w.start(),w.elapsedTime=0),a(()=>({frameloop:m}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:Y.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(m,w,S)=>{const b=l().internal;return b.priority=b.priority+(w>0?1:0),b.subscribers.push({ref:m,priority:w,store:S}),b.subscribers=b.subscribers.sort((R,A)=>R.priority-A.priority),()=>{const R=l().internal;R!=null&&R.subscribers&&(R.priority=R.priority-(w>0?1:0),R.subscribers=R.subscribers.filter(A=>A.ref!==m))}}}}}),i=t.getState();let r=i.size,s=i.viewport.dpr,o=i.camera;return t.subscribe(()=>{const{camera:a,size:l,viewport:u,gl:f,set:d}=t.getState();if(l.width!==r.width||l.height!==r.height||u.dpr!==s){var p;r=l,s=u.dpr,LG(a,l),f.setPixelRatio(u.dpr);const g=(p=l.updateStyle)!=null?p:typeof HTMLCanvasElement<"u"&&f.domElement instanceof HTMLCanvasElement;f.setSize(l.width,l.height,g)}a!==o&&(o=a,d(g=>({viewport:{...g.viewport,...g.viewport.getCurrentViewport(a)}})))}),t.subscribe(a=>n(a)),t};let Nm,FG=new Set,UG=new Set,zG=new Set;function Lx(n,e){if(n.size)for(const{callback:t}of n.values())t(e)}function Rh(n,e){switch(n){case"before":return Lx(FG,e);case"after":return Lx(UG,e);case"tail":return Lx(zG,e)}}let Nx,Dx;function Ox(n,e,t){let i=e.clock.getDelta();for(e.frameloop==="never"&&typeof n=="number"&&(i=n-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=n),Nx=e.internal.subscribers,Nm=0;Nm0)&&!((f=s.gl.xr)!=null&&f.isPresenting)&&(i+=Ox(u,s))}if(t=!1,Rh("after",u),i===0)return Rh("tail",u),e=!1,cancelAnimationFrame(r)}function a(u,f=1){var d;if(!u)return n.forEach(p=>a(p.store.getState(),f));(d=u.gl.xr)!=null&&d.isPresenting||!u.internal.active||u.frameloop==="never"||(f>1?u.internal.frames=Math.min(60,u.internal.frames+f):t?u.internal.frames=2:u.internal.frames=1,e||(e=!0,requestAnimationFrame(o)))}function l(u,f=!0,d,p){if(f&&Rh("before",u),d)Ox(u,d,p);else for(const g of n.values())Ox(u,g.store.getState());f&&Rh("after",u)}return{loop:o,invalidate:a,advance:l}}function rN(){const n=Y.useContext(iN);if(!n)throw new Error("R3F: Hooks can only be used within the Canvas component!");return n}function mr(n=t=>t,e){return rN()(n,e)}function jM(n,e=0){const t=rN(),i=t.getState().internal.subscribe,r=Z3(n);return Sd(()=>i(r,e,t),[e,i,t]),null}const bc=new Map,{invalidate:YC,advance:ZC}=BG(bc),{reconciler:hv,applyProps:bu}=TG(bc,NG),Tu={objects:"shallow",strict:!1},VG=(n,e)=>{const t=typeof n=="function"?n(e):n;return nN(t)?t:new qL({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...n})};function HG(n,e){const t=typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement;if(e){const{width:i,height:r,top:s,left:o,updateStyle:a=t}=e;return{width:i,height:r,top:s,left:o,updateStyle:a}}else if(typeof HTMLCanvasElement<"u"&&n instanceof HTMLCanvasElement&&n.parentElement){const{width:i,height:r,top:s,left:o}=n.parentElement.getBoundingClientRect();return{width:i,height:r,top:s,left:o,updateStyle:t}}else if(typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas)return{width:n.width,height:n.height,top:0,left:0,updateStyle:t};return{width:0,height:0,top:0,left:0}}function GG(n){const e=bc.get(n),t=e==null?void 0:e.fiber,i=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const r=typeof reportError=="function"?reportError:console.error,s=i||kG(YC,ZC),o=t||hv.createContainer(s,Qu.ConcurrentRoot,null,!1,null,"",r,null);e||bc.set(n,{fiber:o,store:s});let a,l=!1,u;return{configure(f={}){let{gl:d,size:p,scene:g,events:v,onCreated:x,shadows:_=!1,linear:m=!1,flat:w=!1,legacy:S=!1,orthographic:b=!1,frameloop:R="always",dpr:A=[1,2],performance:C,raycaster:L,camera:I,onPointerMissed:E}=f,N=s.getState(),z=N.gl;N.gl||N.set({gl:z=VG(d,n)});let O=N.raycaster;O||N.set({raycaster:O=new V3});const{params:q,...j}=L||{};if(cn.equ(j,O,Tu)||bu(O,{...j}),cn.equ(q,O.params,Tu)||bu(O,{params:{...O.params,...q}}),!N.camera||N.camera===u&&!cn.equ(u,I,Tu)){u=I;const G=I instanceof md,ne=G?I:b?new _o(0,0,0,0,.1,1e3):new Tn(75,0,.1,1e3);G||(ne.position.z=5,I&&(bu(ne,I),("aspect"in I||"left"in I||"right"in I||"bottom"in I||"top"in I)&&(ne.manual=!0,ne.updateProjectionMatrix())),!N.camera&&!(I!=null&&I.rotation)&&ne.lookAt(0,0,0)),N.set({camera:ne}),O.camera=ne}if(!N.scene){let G;g instanceof av?G=g:(G=new av,g&&bu(G,g)),N.set({scene:Ru(G)})}if(!N.xr){var Q;const G=(_e,J)=>{const pe=s.getState();pe.frameloop!=="never"&&ZC(_e,!0,pe,J)},ne=()=>{const _e=s.getState();_e.gl.xr.enabled=_e.gl.xr.isPresenting,_e.gl.xr.setAnimationLoop(_e.gl.xr.isPresenting?G:null),_e.gl.xr.isPresenting||YC(_e)},me={connect(){const _e=s.getState().gl;_e.xr.addEventListener("sessionstart",ne),_e.xr.addEventListener("sessionend",ne)},disconnect(){const _e=s.getState().gl;_e.xr.removeEventListener("sessionstart",ne),_e.xr.removeEventListener("sessionend",ne)}};typeof((Q=z.xr)==null?void 0:Q.addEventListener)=="function"&&me.connect(),N.set({xr:me})}if(z.shadowMap){const G=z.shadowMap.enabled,ne=z.shadowMap.type;if(z.shadowMap.enabled=!!_,cn.boo(_))z.shadowMap.type=of;else if(cn.str(_)){var oe;const me={basic:AI,percentage:f0,soft:of,variance:cs};z.shadowMap.type=(oe=me[_])!=null?oe:of}else cn.obj(_)&&Object.assign(z.shadowMap,_);(G!==z.shadowMap.enabled||ne!==z.shadowMap.type)&&(z.shadowMap.needsUpdate=!0)}const k=q3();k&&("enabled"in k?k.enabled=!S:"legacyMode"in k&&(k.legacyMode=S)),l||bu(z,{outputEncoding:m?3e3:3001,toneMapping:w?Gs:rM}),N.legacy!==S&&N.set(()=>({legacy:S})),N.linear!==m&&N.set(()=>({linear:m})),N.flat!==w&&N.set(()=>({flat:w})),d&&!cn.fun(d)&&!nN(d)&&!cn.equ(d,z,Tu)&&bu(z,d),v&&!N.events.handlers&&N.set({events:v(s)});const W=HG(n,p);return cn.equ(W,N.size,Tu)||N.setSize(W.width,W.height,W.updateStyle,W.top,W.left),A&&N.viewport.dpr!==Q3(A)&&N.setDpr(A),N.frameloop!==R&&N.setFrameloop(R),N.onPointerMissed||N.set({onPointerMissed:E}),C&&!cn.equ(C,N.performance,Tu)&&N.set(G=>({performance:{...G.performance,...C}})),a=x,l=!0,this},render(f){return l||this.configure(),hv.updateContainer(We.jsx(WG,{store:s,children:f,onCreated:a,rootElement:n}),o,null,()=>{}),s},unmount(){sN(n)}}}function WG({store:n,children:e,onCreated:t,rootElement:i}){return Sd(()=>{const r=n.getState();r.set(s=>({internal:{...s.internal,active:!0}})),t&&t(r),n.getState().events.connected||r.events.connect==null||r.events.connect(i)},[]),We.jsx(iN.Provider,{value:n,children:e})}function sN(n,e){const t=bc.get(n),i=t==null?void 0:t.fiber;if(i){const r=t==null?void 0:t.store.getState();r&&(r.internal.active=!1),hv.updateContainer(null,i,null,()=>{r&&setTimeout(()=>{try{var s,o,a,l;r.events.disconnect==null||r.events.disconnect(),(s=r.gl)==null||(o=s.renderLists)==null||o.dispose==null||o.dispose(),(a=r.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(l=r.gl)!=null&&l.xr&&r.xr.disconnect(),PG(r),bc.delete(n)}catch{}},500)})}}hv.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:Y.version});function OS(n,e,t){var i,r,s,o,a;e==null&&(e=100);function l(){var f=Date.now()-o;f=0?i=setTimeout(l,e-f):(i=null,t||(a=n.apply(s,r),s=r=null))}var u=function(){s=this,r=arguments,o=Date.now();var f=t&&!i;return i||(i=setTimeout(l,e)),f&&(a=n.apply(s,r),s=r=null),a};return u.clear=function(){i&&(clearTimeout(i),i=null)},u.flush=function(){i&&(a=n.apply(s,r),s=r=null,clearTimeout(i),i=null)},u}OS.debounce=OS;var jG=OS;const KC=l1(jG);function XG(n){let{debounce:e,scroll:t,polyfill:i,offsetSize:r}=n===void 0?{debounce:0,scroll:!1,offsetSize:!1}:n;const s=i||(typeof window>"u"?class{}:window.ResizeObserver);if(!s)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[o,a]=Y.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),l=Y.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:o}),u=e?typeof e=="number"?e:e.scroll:null,f=e?typeof e=="number"?e:e.resize:null,d=Y.useRef(!1);Y.useEffect(()=>(d.current=!0,()=>void(d.current=!1)));const[p,g,v]=Y.useMemo(()=>{const w=()=>{if(!l.current.element)return;const{left:S,top:b,width:R,height:A,bottom:C,right:L,x:I,y:E}=l.current.element.getBoundingClientRect(),N={left:S,top:b,width:R,height:A,bottom:C,right:L,x:I,y:E};l.current.element instanceof HTMLElement&&r&&(N.height=l.current.element.offsetHeight,N.width=l.current.element.offsetWidth),Object.freeze(N),d.current&&!ZG(l.current.lastBounds,N)&&a(l.current.lastBounds=N)};return[w,f?KC(w,f):w,u?KC(w,u):w]},[a,r,u,f]);function x(){l.current.scrollContainers&&(l.current.scrollContainers.forEach(w=>w.removeEventListener("scroll",v,!0)),l.current.scrollContainers=null),l.current.resizeObserver&&(l.current.resizeObserver.disconnect(),l.current.resizeObserver=null)}function _(){l.current.element&&(l.current.resizeObserver=new s(v),l.current.resizeObserver.observe(l.current.element),t&&l.current.scrollContainers&&l.current.scrollContainers.forEach(w=>w.addEventListener("scroll",v,{capture:!0,passive:!0})))}const m=w=>{!w||w===l.current.element||(x(),l.current.element=w,l.current.scrollContainers=oN(w),_())};return qG(v,!!t),$G(g),Y.useEffect(()=>{x(),_()},[t,v,g]),Y.useEffect(()=>x,[]),[m,o,p]}function $G(n){Y.useEffect(()=>{const e=n;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[n])}function qG(n,e){Y.useEffect(()=>{if(e){const t=n;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[n,e])}function oN(n){const e=[];if(!n||n===document.body)return e;const{overflow:t,overflowX:i,overflowY:r}=window.getComputedStyle(n);return[t,i,r].some(s=>s==="auto"||s==="scroll")&&e.push(n),[...e,...oN(n.parentElement)]}const YG=["x","y","top","bottom","left","right","width","height"],ZG=(n,e)=>YG.every(t=>n[t]===e[t]);var KG=Object.defineProperty,JG=Object.defineProperties,QG=Object.getOwnPropertyDescriptors,JC=Object.getOwnPropertySymbols,eW=Object.prototype.hasOwnProperty,tW=Object.prototype.propertyIsEnumerable,QC=(n,e,t)=>e in n?KG(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,eR=(n,e)=>{for(var t in e||(e={}))eW.call(e,t)&&QC(n,t,e[t]);if(JC)for(var t of JC(e))tW.call(e,t)&&QC(n,t,e[t]);return n},nW=(n,e)=>JG(n,QG(e)),tR,nR;typeof window<"u"&&((tR=window.document)!=null&&tR.createElement||((nR=window.navigator)==null?void 0:nR.product)==="ReactNative")?Y.useLayoutEffect:Y.useEffect;function aN(n,e,t){if(!n)return;if(t(n)===!0)return n;let i=n.child;for(;i;){const r=aN(i,e,t);if(r)return r;i=i.sibling}}function lN(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const iR=console.error;console.error=function(){const n=[...arguments].join("");if(n!=null&&n.startsWith("Warning:")&&n.includes("useContext")){console.error=iR;return}return iR.apply(this,arguments)};const XM=lN(Y.createContext(null));class uN extends Y.Component{render(){return Y.createElement(XM.Provider,{value:this._reactInternals},this.props.children)}}function iW(){const n=Y.useContext(XM);if(n===null)throw new Error("its-fine: useFiber must be called within a !");const e=Y.useId();return Y.useMemo(()=>{for(const i of[n,n==null?void 0:n.alternate]){if(!i)continue;const r=aN(i,!1,s=>{let o=s.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(r)return r}},[n,e])}function rW(){const n=iW(),[e]=Y.useState(()=>new Map);e.clear();let t=n;for(;t;){if(t.type&&typeof t.type=="object"){const r=t.type._context===void 0&&t.type.Provider===t.type?t.type:t.type._context;r&&r!==XM&&!e.has(r)&&e.set(r,Y.useContext(lN(r)))}t=t.return}return e}function sW(){const n=rW();return Y.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>i=>Y.createElement(e,null,Y.createElement(t.Provider,nW(eR({},i),{value:n.get(t)}))),e=>Y.createElement(uN,eR({},e))),[n])}const kx={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function oW(n){const{handlePointer:e}=OG(n);return{priority:1,enabled:!0,compute(t,i,r){i.pointer.set(t.offsetX/i.size.width*2-1,-(t.offsetY/i.size.height)*2+1),i.raycaster.setFromCamera(i.pointer,i.camera)},connected:void 0,handlers:Object.keys(kx).reduce((t,i)=>({...t,[i]:e(i)}),{}),update:()=>{var t;const{events:i,internal:r}=n.getState();(t=r.lastEvent)!=null&&t.current&&i.handlers&&i.handlers.onPointerMove(r.lastEvent.current)},connect:t=>{var i;const{set:r,events:s}=n.getState();s.disconnect==null||s.disconnect(),r(o=>({events:{...o.events,connected:t}})),Object.entries((i=s.handlers)!=null?i:[]).forEach(([o,a])=>{const[l,u]=kx[o];t.addEventListener(l,a,{passive:u})})},disconnect:()=>{const{set:t,events:i}=n.getState();if(i.connected){var r;Object.entries((r=i.handlers)!=null?r:[]).forEach(([s,o])=>{if(i&&i.connected instanceof HTMLElement){const[a]=kx[s];i.connected.removeEventListener(a,o)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}const aW=Y.forwardRef(function({children:e,fallback:t,resize:i,style:r,gl:s,events:o=oW,eventSource:a,eventPrefix:l,shadows:u,linear:f,flat:d,legacy:p,orthographic:g,frameloop:v,dpr:x,performance:_,raycaster:m,camera:w,scene:S,onPointerMissed:b,onCreated:R,...A},C){Y.useMemo(()=>$3(_G),[]);const L=sW(),[I,E]=XG({scroll:!0,debounce:{scroll:50,resize:0},...i}),N=Y.useRef(null),z=Y.useRef(null);Y.useImperativeHandle(C,()=>N.current);const O=Z3(b),[q,j]=Y.useState(!1),[Q,oe]=Y.useState(!1);if(q)throw q;if(Q)throw Q;const k=Y.useRef(null);Sd(()=>{const G=N.current;E.width>0&&E.height>0&&G&&(k.current||(k.current=GG(G)),k.current.configure({gl:s,events:o,shadows:u,linear:f,flat:d,legacy:p,orthographic:g,frameloop:v,dpr:x,performance:_,raycaster:m,camera:w,scene:S,size:E,onPointerMissed:(...ne)=>O.current==null?void 0:O.current(...ne),onCreated:ne=>{ne.events.connect==null||ne.events.connect(a?AG(a)?a.current:a:z.current),l&&ne.setEvents({compute:(me,_e)=>{const J=me[l+"X"],pe=me[l+"Y"];_e.pointer.set(J/_e.size.width*2-1,-(pe/_e.size.height)*2+1),_e.raycaster.setFromCamera(_e.pointer,_e.camera)}}),R==null||R(ne)}}),k.current.render(We.jsx(L,{children:We.jsx(K3,{set:oe,children:We.jsx(Y.Suspense,{fallback:We.jsx(CG,{set:j}),children:e})})})))}),Y.useEffect(()=>{const G=N.current;if(G)return()=>sN(G)},[]);const W=a?"none":"auto";return We.jsx("div",{ref:z,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:W,...r},...A,children:We.jsx("div",{ref:I,style:{width:"100%",height:"100%"},children:We.jsx("canvas",{ref:N,style:{display:"block"},children:t})})})}),lW=Y.forwardRef(function(e,t){return We.jsx(uN,{children:We.jsx(aW,{...e,ref:t})})});var uW=Object.defineProperty,cW=(n,e,t)=>e in n?uW(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,dt=(n,e,t)=>(cW(n,typeof e!="symbol"?e+"":e,t),t);const Dm=new Dl,rR=new Ns,hW=Math.cos(70*(Math.PI/180)),sR=(n,e)=>(n%e+e)%e;let fW=class extends $s{constructor(e,t){super(),dt(this,"object"),dt(this,"domElement"),dt(this,"enabled",!0),dt(this,"target",new U),dt(this,"minDistance",0),dt(this,"maxDistance",1/0),dt(this,"minZoom",0),dt(this,"maxZoom",1/0),dt(this,"minPolarAngle",0),dt(this,"maxPolarAngle",Math.PI),dt(this,"minAzimuthAngle",-1/0),dt(this,"maxAzimuthAngle",1/0),dt(this,"enableDamping",!1),dt(this,"dampingFactor",.05),dt(this,"enableZoom",!0),dt(this,"zoomSpeed",1),dt(this,"enableRotate",!0),dt(this,"rotateSpeed",1),dt(this,"enablePan",!0),dt(this,"panSpeed",1),dt(this,"screenSpacePanning",!0),dt(this,"keyPanSpeed",7),dt(this,"zoomToCursor",!1),dt(this,"autoRotate",!1),dt(this,"autoRotateSpeed",2),dt(this,"reverseOrbit",!1),dt(this,"reverseHorizontalOrbit",!1),dt(this,"reverseVerticalOrbit",!1),dt(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),dt(this,"mouseButtons",{LEFT:el.ROTATE,MIDDLE:el.DOLLY,RIGHT:el.PAN}),dt(this,"touches",{ONE:tl.ROTATE,TWO:tl.DOLLY_PAN}),dt(this,"target0"),dt(this,"position0"),dt(this,"zoom0"),dt(this,"_domElementKeyEvents",null),dt(this,"getPolarAngle"),dt(this,"getAzimuthalAngle"),dt(this,"setPolarAngle"),dt(this,"setAzimuthalAngle"),dt(this,"getDistance"),dt(this,"listenToKeyEvents"),dt(this,"stopListenToKeyEvents"),dt(this,"saveState"),dt(this,"reset"),dt(this,"update"),dt(this,"connect"),dt(this,"dispose"),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>f.phi,this.getAzimuthalAngle=()=>f.theta,this.setPolarAngle=X=>{let ge=sR(X,2*Math.PI),H=f.phi;H<0&&(H+=2*Math.PI),ge<0&&(ge+=2*Math.PI);let ue=Math.abs(ge-H);2*Math.PI-ue{let ge=sR(X,2*Math.PI),H=f.theta;H<0&&(H+=2*Math.PI),ge<0&&(ge+=2*Math.PI);let ue=Math.abs(ge-H);2*Math.PI-uei.object.position.distanceTo(i.target),this.listenToKeyEvents=X=>{X.addEventListener("keydown",ft),this._domElementKeyEvents=X},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",ft),this._domElementKeyEvents=null},this.saveState=()=>{i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object.zoom},this.reset=()=>{i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.zoom=i.zoom0,i.object.updateProjectionMatrix(),i.dispatchEvent(r),i.update(),l=a.NONE},this.update=(()=>{const X=new U,ge=new U(0,1,0),H=new Ci().setFromUnitVectors(e.up,ge),ue=H.clone().invert(),ce=new U,Pe=new Ci,Ne=2*Math.PI;return function(){const Wt=i.object.position;H.setFromUnitVectors(e.up,ge),ue.copy(H).invert(),X.copy(Wt).sub(i.target),X.applyQuaternion(H),f.setFromVector3(X),i.autoRotate&&l===a.NONE&&q(z()),i.enableDamping?(f.theta+=d.theta*i.dampingFactor,f.phi+=d.phi*i.dampingFactor):(f.theta+=d.theta,f.phi+=d.phi);let Ot=i.minAzimuthAngle,Qt=i.maxAzimuthAngle;isFinite(Ot)&&isFinite(Qt)&&(Ot<-Math.PI?Ot+=Ne:Ot>Math.PI&&(Ot-=Ne),Qt<-Math.PI?Qt+=Ne:Qt>Math.PI&&(Qt-=Ne),Ot<=Qt?f.theta=Math.max(Ot,Math.min(Qt,f.theta)):f.theta=f.theta>(Ot+Qt)/2?Math.max(Ot,f.theta):Math.min(Qt,f.theta)),f.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,f.phi)),f.makeSafe(),i.enableDamping===!0?i.target.addScaledVector(g,i.dampingFactor):i.target.add(g),i.zoomToCursor&&I||i.object.isOrthographicCamera?f.radius=me(f.radius):f.radius=me(f.radius*p),X.setFromSpherical(f),X.applyQuaternion(ue),Wt.copy(i.target).add(X),i.object.matrixAutoUpdate||i.object.updateMatrix(),i.object.lookAt(i.target),i.enableDamping===!0?(d.theta*=1-i.dampingFactor,d.phi*=1-i.dampingFactor,g.multiplyScalar(1-i.dampingFactor)):(d.set(0,0,0),g.set(0,0,0));let Rt=!1;if(i.zoomToCursor&&I){let Gn=null;if(i.object instanceof Tn&&i.object.isPerspectiveCamera){const an=X.length();Gn=me(an*p);const Zs=an-Gn;i.object.position.addScaledVector(C,Zs),i.object.updateMatrixWorld()}else if(i.object.isOrthographicCamera){const an=new U(L.x,L.y,0);an.unproject(i.object),i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/p)),i.object.updateProjectionMatrix(),Rt=!0;const Zs=new U(L.x,L.y,0);Zs.unproject(i.object),i.object.position.sub(Zs).add(an),i.object.updateMatrixWorld(),Gn=X.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),i.zoomToCursor=!1;Gn!==null&&(i.screenSpacePanning?i.target.set(0,0,-1).transformDirection(i.object.matrix).multiplyScalar(Gn).add(i.object.position):(Dm.origin.copy(i.object.position),Dm.direction.set(0,0,-1).transformDirection(i.object.matrix),Math.abs(i.object.up.dot(Dm.direction))u||8*(1-Pe.dot(i.object.quaternion))>u?(i.dispatchEvent(r),ce.copy(i.object.position),Pe.copy(i.object.quaternion),Rt=!1,!0):!1}})(),this.connect=X=>{X===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),i.domElement=X,i.domElement.style.touchAction="none",i.domElement.addEventListener("contextmenu",Mt),i.domElement.addEventListener("pointerdown",te),i.domElement.addEventListener("pointercancel",Se),i.domElement.addEventListener("wheel",Ie)},this.dispose=()=>{var X,ge,H,ue,ce,Pe;i.domElement&&(i.domElement.style.touchAction="auto"),(X=i.domElement)==null||X.removeEventListener("contextmenu",Mt),(ge=i.domElement)==null||ge.removeEventListener("pointerdown",te),(H=i.domElement)==null||H.removeEventListener("pointercancel",Se),(ue=i.domElement)==null||ue.removeEventListener("wheel",Ie),(ce=i.domElement)==null||ce.ownerDocument.removeEventListener("pointermove",xe),(Pe=i.domElement)==null||Pe.ownerDocument.removeEventListener("pointerup",Ee),i._domElementKeyEvents!==null&&i._domElementKeyEvents.removeEventListener("keydown",ft)};const i=this,r={type:"change"},s={type:"start"},o={type:"end"},a={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=a.NONE;const u=1e-6,f=new IS,d=new IS;let p=1;const g=new U,v=new ve,x=new ve,_=new ve,m=new ve,w=new ve,S=new ve,b=new ve,R=new ve,A=new ve,C=new U,L=new ve;let I=!1;const E=[],N={};function z(){return 2*Math.PI/60/60*i.autoRotateSpeed}function O(){return Math.pow(.95,i.zoomSpeed)}function q(X){i.reverseOrbit||i.reverseHorizontalOrbit?d.theta+=X:d.theta-=X}function j(X){i.reverseOrbit||i.reverseVerticalOrbit?d.phi+=X:d.phi-=X}const Q=(()=>{const X=new U;return function(H,ue){X.setFromMatrixColumn(ue,0),X.multiplyScalar(-H),g.add(X)}})(),oe=(()=>{const X=new U;return function(H,ue){i.screenSpacePanning===!0?X.setFromMatrixColumn(ue,1):(X.setFromMatrixColumn(ue,0),X.crossVectors(i.object.up,X)),X.multiplyScalar(H),g.add(X)}})(),k=(()=>{const X=new U;return function(H,ue){const ce=i.domElement;if(ce&&i.object instanceof Tn&&i.object.isPerspectiveCamera){const Pe=i.object.position;X.copy(Pe).sub(i.target);let Ne=X.length();Ne*=Math.tan(i.object.fov/2*Math.PI/180),Q(2*H*Ne/ce.clientHeight,i.object.matrix),oe(2*ue*Ne/ce.clientHeight,i.object.matrix)}else ce&&i.object instanceof _o&&i.object.isOrthographicCamera?(Q(H*(i.object.right-i.object.left)/i.object.zoom/ce.clientWidth,i.object.matrix),oe(ue*(i.object.top-i.object.bottom)/i.object.zoom/ce.clientHeight,i.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),i.enablePan=!1)}})();function W(X){i.object instanceof Tn&&i.object.isPerspectiveCamera||i.object instanceof _o&&i.object.isOrthographicCamera?p/=X:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function G(X){i.object instanceof Tn&&i.object.isPerspectiveCamera||i.object instanceof _o&&i.object.isOrthographicCamera?p*=X:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),i.enableZoom=!1)}function ne(X){if(!i.zoomToCursor||!i.domElement)return;I=!0;const ge=i.domElement.getBoundingClientRect(),H=X.clientX-ge.left,ue=X.clientY-ge.top,ce=ge.width,Pe=ge.height;L.x=H/ce*2-1,L.y=-(ue/Pe)*2+1,C.set(L.x,L.y,1).unproject(i.object).sub(i.object.position).normalize()}function me(X){return Math.max(i.minDistance,Math.min(i.maxDistance,X))}function _e(X){v.set(X.clientX,X.clientY)}function J(X){ne(X),b.set(X.clientX,X.clientY)}function pe(X){m.set(X.clientX,X.clientY)}function Me(X){x.set(X.clientX,X.clientY),_.subVectors(x,v).multiplyScalar(i.rotateSpeed);const ge=i.domElement;ge&&(q(2*Math.PI*_.x/ge.clientHeight),j(2*Math.PI*_.y/ge.clientHeight)),v.copy(x),i.update()}function de(X){R.set(X.clientX,X.clientY),A.subVectors(R,b),A.y>0?W(O()):A.y<0&&G(O()),b.copy(R),i.update()}function Qe(X){w.set(X.clientX,X.clientY),S.subVectors(w,m).multiplyScalar(i.panSpeed),k(S.x,S.y),m.copy(w),i.update()}function lt(X){ne(X),X.deltaY<0?G(O()):X.deltaY>0&&W(O()),i.update()}function K(X){let ge=!1;switch(X.code){case i.keys.UP:k(0,i.keyPanSpeed),ge=!0;break;case i.keys.BOTTOM:k(0,-i.keyPanSpeed),ge=!0;break;case i.keys.LEFT:k(i.keyPanSpeed,0),ge=!0;break;case i.keys.RIGHT:k(-i.keyPanSpeed,0),ge=!0;break}ge&&(X.preventDefault(),i.update())}function tt(){if(E.length==1)v.set(E[0].pageX,E[0].pageY);else{const X=.5*(E[0].pageX+E[1].pageX),ge=.5*(E[0].pageY+E[1].pageY);v.set(X,ge)}}function he(){if(E.length==1)m.set(E[0].pageX,E[0].pageY);else{const X=.5*(E[0].pageX+E[1].pageX),ge=.5*(E[0].pageY+E[1].pageY);m.set(X,ge)}}function we(){const X=E[0].pageX-E[1].pageX,ge=E[0].pageY-E[1].pageY,H=Math.sqrt(X*X+ge*ge);b.set(0,H)}function ye(){i.enableZoom&&we(),i.enablePan&&he()}function Ce(){i.enableZoom&&we(),i.enableRotate&&tt()}function be(X){if(E.length==1)x.set(X.pageX,X.pageY);else{const H=Et(X),ue=.5*(X.pageX+H.x),ce=.5*(X.pageY+H.y);x.set(ue,ce)}_.subVectors(x,v).multiplyScalar(i.rotateSpeed);const ge=i.domElement;ge&&(q(2*Math.PI*_.x/ge.clientHeight),j(2*Math.PI*_.y/ge.clientHeight)),v.copy(x)}function Be(X){if(E.length==1)w.set(X.pageX,X.pageY);else{const ge=Et(X),H=.5*(X.pageX+ge.x),ue=.5*(X.pageY+ge.y);w.set(H,ue)}S.subVectors(w,m).multiplyScalar(i.panSpeed),k(S.x,S.y),m.copy(w)}function Ke(X){const ge=Et(X),H=X.pageX-ge.x,ue=X.pageY-ge.y,ce=Math.sqrt(H*H+ue*ue);R.set(0,ce),A.set(0,Math.pow(R.y/b.y,i.zoomSpeed)),W(A.y),b.copy(R)}function V(X){i.enableZoom&&Ke(X),i.enablePan&&Be(X)}function D(X){i.enableZoom&&Ke(X),i.enableRotate&&be(X)}function te(X){var ge,H;i.enabled!==!1&&(E.length===0&&((ge=i.domElement)==null||ge.ownerDocument.addEventListener("pointermove",xe),(H=i.domElement)==null||H.ownerDocument.addEventListener("pointerup",Ee)),it(X),X.pointerType==="touch"?Re(X):qe(X))}function xe(X){i.enabled!==!1&&(X.pointerType==="touch"?$e(X):Le(X))}function Ee(X){var ge,H,ue;Ve(X),E.length===0&&((ge=i.domElement)==null||ge.releasePointerCapture(X.pointerId),(H=i.domElement)==null||H.ownerDocument.removeEventListener("pointermove",xe),(ue=i.domElement)==null||ue.ownerDocument.removeEventListener("pointerup",Ee)),i.dispatchEvent(o),l=a.NONE}function Se(X){Ve(X)}function qe(X){let ge;switch(X.button){case 0:ge=i.mouseButtons.LEFT;break;case 1:ge=i.mouseButtons.MIDDLE;break;case 2:ge=i.mouseButtons.RIGHT;break;default:ge=-1}switch(ge){case el.DOLLY:if(i.enableZoom===!1)return;J(X),l=a.DOLLY;break;case el.ROTATE:if(X.ctrlKey||X.metaKey||X.shiftKey){if(i.enablePan===!1)return;pe(X),l=a.PAN}else{if(i.enableRotate===!1)return;_e(X),l=a.ROTATE}break;case el.PAN:if(X.ctrlKey||X.metaKey||X.shiftKey){if(i.enableRotate===!1)return;_e(X),l=a.ROTATE}else{if(i.enablePan===!1)return;pe(X),l=a.PAN}break;default:l=a.NONE}l!==a.NONE&&i.dispatchEvent(s)}function Le(X){if(i.enabled!==!1)switch(l){case a.ROTATE:if(i.enableRotate===!1)return;Me(X);break;case a.DOLLY:if(i.enableZoom===!1)return;de(X);break;case a.PAN:if(i.enablePan===!1)return;Qe(X);break}}function Ie(X){i.enabled===!1||i.enableZoom===!1||l!==a.NONE&&l!==a.ROTATE||(X.preventDefault(),i.dispatchEvent(s),lt(X),i.dispatchEvent(o))}function ft(X){i.enabled===!1||i.enablePan===!1||K(X)}function Re(X){switch(pt(X),E.length){case 1:switch(i.touches.ONE){case tl.ROTATE:if(i.enableRotate===!1)return;tt(),l=a.TOUCH_ROTATE;break;case tl.PAN:if(i.enablePan===!1)return;he(),l=a.TOUCH_PAN;break;default:l=a.NONE}break;case 2:switch(i.touches.TWO){case tl.DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;ye(),l=a.TOUCH_DOLLY_PAN;break;case tl.DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;Ce(),l=a.TOUCH_DOLLY_ROTATE;break;default:l=a.NONE}break;default:l=a.NONE}l!==a.NONE&&i.dispatchEvent(s)}function $e(X){switch(pt(X),l){case a.TOUCH_ROTATE:if(i.enableRotate===!1)return;be(X),i.update();break;case a.TOUCH_PAN:if(i.enablePan===!1)return;Be(X),i.update();break;case a.TOUCH_DOLLY_PAN:if(i.enableZoom===!1&&i.enablePan===!1)return;V(X),i.update();break;case a.TOUCH_DOLLY_ROTATE:if(i.enableZoom===!1&&i.enableRotate===!1)return;D(X),i.update();break;default:l=a.NONE}}function Mt(X){i.enabled!==!1&&X.preventDefault()}function it(X){E.push(X)}function Ve(X){delete N[X.pointerId];for(let ge=0;ge{const d=xM.clone({[u]:{value:f}});return{...l,...d}},{}),vertexShader:e,fragmentShader:t}),this.key="",a.forEach(([l])=>Object.defineProperty(this,l,{get:()=>this.uniforms[l].value,set:u=>this.uniforms[l].value=u})),Object.assign(this,o)}};return r.key=PL.generateUUID(),r}const pW=()=>parseInt(fd.replace(/\D+/g,"")),mW=pW();function gW(n,e,t){const i=mr(p=>p.size),r=mr(p=>p.viewport),s=typeof n=="number"?n:i.width*r.dpr,o=i.height*r.dpr,a=(typeof n=="number"?t:n)||{},{samples:l=0,depth:u,...f}=a,d=Y.useMemo(()=>{const p=new Yr(s,o,{minFilter:An,magFilter:An,type:Lc,...f});return u&&(p.depthTexture=new v0(s,o,yr)),p.samples=l,p},[]);return Y.useLayoutEffect(()=>{d.setSize(s,o),l&&(d.samples=l)},[l,d,s,o]),Y.useEffect(()=>()=>d.dispose(),[]),d}const vW=n=>typeof n=="function",yW=Y.forwardRef(({envMap:n,resolution:e=256,frames:t=1/0,makeDefault:i,children:r,...s},o)=>{const a=mr(({set:_})=>_),l=mr(({camera:_})=>_),u=mr(({size:_})=>_),f=Y.useRef(null);Y.useImperativeHandle(o,()=>f.current,[]);const d=Y.useRef(null),p=gW(e);Y.useLayoutEffect(()=>{s.manual||(f.current.aspect=u.width/u.height)},[u,s]),Y.useLayoutEffect(()=>{f.current.updateProjectionMatrix()});let g=0,v=null;const x=vW(r);return jM(_=>{x&&(t===1/0||g{if(i){const _=l;return a(()=>({camera:f.current})),()=>a(()=>({camera:_}))}},[f,i,a]),Y.createElement(Y.Fragment,null,Y.createElement("perspectiveCamera",xc({ref:f},s),!x&&r),Y.createElement("group",{ref:d},x&&r(p.texture)))}),_W=Y.forwardRef(({makeDefault:n,camera:e,regress:t,domElement:i,enableDamping:r=!0,keyEvents:s=!1,onChange:o,onStart:a,onEnd:l,...u},f)=>{const d=mr(A=>A.invalidate),p=mr(A=>A.camera),g=mr(A=>A.gl),v=mr(A=>A.events),x=mr(A=>A.setEvents),_=mr(A=>A.set),m=mr(A=>A.get),w=mr(A=>A.performance),S=e||p,b=i||v.connected||g.domElement,R=Y.useMemo(()=>new fW(S),[S]);return jM(()=>{R.enabled&&R.update()},-1),Y.useEffect(()=>(s&&R.connect(s===!0?b:s),R.connect(b),()=>void R.dispose()),[s,b,t,R,d]),Y.useEffect(()=>{const A=I=>{d(),t&&w.regress(),o&&o(I)},C=I=>{a&&a(I)},L=I=>{l&&l(I)};return R.addEventListener("change",A),R.addEventListener("start",C),R.addEventListener("end",L),()=>{R.removeEventListener("start",C),R.removeEventListener("end",L),R.removeEventListener("change",A)}},[o,a,l,R,d,x]),Y.useEffect(()=>{if(n){const A=m().controls;return _({controls:R}),()=>_({controls:A})}},[n,R]),Y.createElement("primitive",xc({ref:f,object:R,enableDamping:r},u))}),xW=dW({cellSize:.5,sectionSize:1,fadeDistance:100,fadeStrength:1,fadeFrom:1,cellThickness:.5,sectionThickness:1,cellColor:new ze,sectionColor:new ze,infiniteGrid:!1,followCamera:!1,worldCamProjPosition:new U,worldPlanePosition:new U},` varying vec3 localPosition; varying vec4 worldPosition; @@ -3953,21 +3953,21 @@ No matching component was found for: if (gl_FragColor.a <= 0.0) discard; #include - #include <${m8>=154?"colorspace_fragment":"encodings_fragment"}> + #include <${mW>=154?"colorspace_fragment":"encodings_fragment"}> } - `),w8=Y.forwardRef(({args:n,cellColor:e="#000000",sectionColor:t="#2080ff",cellSize:i=.5,sectionSize:r=1,followCamera:s=!1,infiniteGrid:o=!1,fadeDistance:a=100,fadeStrength:l=1,fadeFrom:u=1,cellThickness:f=.5,sectionThickness:d=1,side:p=Ai,...g},v)=>{$3({GridMaterial:x8});const x=Y.useRef(null);Y.useImperativeHandle(v,()=>x.current,[]);const _=new Ns,m=new U(0,1,0),w=new U(0,0,0);jM(R=>{_.setFromNormalAndCoplanarPoint(m,w).applyMatrix4(x.current.matrixWorld);const A=x.current.material,C=A.uniforms.worldCamProjPosition,L=A.uniforms.worldPlanePosition;_.projectPoint(R.camera.position,C.value),L.value.set(0,0,0).applyMatrix4(x.current.matrixWorld)});const S={cellSize:i,sectionSize:r,cellColor:e,sectionColor:t,cellThickness:f,sectionThickness:d},b={fadeDistance:a,fadeStrength:l,fadeFrom:u,infiniteGrid:o,followCamera:s};return Y.createElement("mesh",xc({ref:x,frustumCulled:!1},g),Y.createElement("gridMaterial",xc({transparent:!0,"extensions-derivatives":!0,side:p},S,b)),Y.createElement("planeGeometry",{args:n}))});function Fx(n){return Ge.jsxs("mesh",{...n,scale:[1,10,1],children:[Ge.jsx("cylinderGeometry",{args:[.05,.05,5,32]}),Ge.jsx("meshBasicMaterial",{color:n.color})]})}function S8(n){const e=Y.useRef(null);return Ge.jsxs("mesh",{...n,ref:e,children:[Ge.jsx("sphereGeometry",{args:[1,16,16]}),Ge.jsx("meshStandardMaterial",{color:n.color})]})}const M8=({concepts:n,onHoverConcept:e,spherePos:t})=>{function i(r){const s=Y.useRef(null),[o,a]=Y.useState(!1),[l,u]=Y.useState(!1);return Ge.jsxs("mesh",{...r,ref:s,scale:l?1.5:1,onClick:()=>u(!l),onPointerOver:()=>{a(!0),e(r.index)},onPointerOut:()=>{a(!1),e(-1)},children:[Ge.jsx("boxGeometry",{args:[1,1,1]}),Ge.jsx("meshStandardMaterial",{color:o?"hotpink":r.color||"orange"})]})}return Ge.jsxs(l8,{id:"three-canvas",children:[Ge.jsx(y8,{makeDefault:!0,position:[20,20,20],fov:75,near:.1,far:1e3}),Ge.jsx("ambientLight",{intensity:Math.PI/2}),Ge.jsx("spotLight",{position:[10,10,10],angle:.15,penumbra:1,decay:0,intensity:Math.PI}),Ge.jsx("pointLight",{position:[-10,-10,-10],decay:0,intensity:Math.PI}),Ge.jsx(w8,{args:[60,60,30,30],rotation:[0,0,0],position:[0,0,0],cellColor:"green"}),n.map(r=>Ge.jsx(i,{position:r.position,color:r.color,index:r.index},"box"+r.index)),";",Ge.jsx(S8,{position:t,color:"black"}),Ge.jsx(Fx,{position:[0,0,0],rotation:[0,0,-Math.PI/2],color:"red"}),Ge.jsx(Fx,{position:[0,0,0],rotation:[Math.PI/2,0,0],color:"green"}),Ge.jsx(Fx,{position:[0,0,0],rotation:[0,0,0],color:"blue"}),Ge.jsx(_8,{})]})},cN=({color:n,title:e,inputId:t,inputValue:i})=>Ge.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"3px"},children:[Ge.jsx("span",{style:{height:"20px",width:"20px",backgroundColor:n,borderRadius:"10px",marginLeft:"5px"},title:e||""})," ",Ge.jsx("input",{style:{width:"180px"},id:t,value:i,name:"test",readOnly:!!i})]}),oR=["red","blue","green","yellow","gray","orange","pink","lightblue"];function E8(n){return oR[n%oR.length]}function Pl(n){"@babel/helpers - typeof";return Pl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pl(n)}function b8(n,e){if(Pl(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(Pl(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function hN(n){var e=b8(n,"string");return Pl(e)=="symbol"?e:e+""}function zh(n,e,t){return(e=hN(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function aR(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function st(n){for(var e=1;en.length)&&(e=n.length);for(var t=0,i=Array(e);t=0)continue;t[i]=n[i]}return t}function Do(n,e){if(n==null)return{};var t,i,r=R8(n,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(i=0;i=0||{}.propertyIsEnumerable.call(n,t)&&(r[t]=n[t])}return r}var P8=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function I8(n){var e=n.defaultInputValue,t=e===void 0?"":e,i=n.defaultMenuIsOpen,r=i===void 0?!1:i,s=n.defaultValue,o=s===void 0?null:s,a=n.inputValue,l=n.menuIsOpen,u=n.onChange,f=n.onInputChange,d=n.onMenuClose,p=n.onMenuOpen,g=n.value,v=Do(n,P8),x=Y.useState(a!==void 0?a:t),_=Mo(x,2),m=_[0],w=_[1],S=Y.useState(l!==void 0?l:r),b=Mo(S,2),R=b[0],A=b[1],C=Y.useState(g!==void 0?g:o),L=Mo(C,2),I=L[0],E=L[1],N=Y.useCallback(function(k,W){typeof u=="function"&&u(k,W),E(k)},[u]),z=Y.useCallback(function(k,W){var G;typeof f=="function"&&(G=f(k,W)),w(G!==void 0?G:k)},[f]),O=Y.useCallback(function(){typeof p=="function"&&p(),A(!0)},[p]),q=Y.useCallback(function(){typeof d=="function"&&d(),A(!1)},[d]),j=a!==void 0?a:m,Q=l!==void 0?l:R,oe=g!==void 0?g:I;return st(st({},v),{},{inputValue:j,menuIsOpen:Q,onChange:N,onInputChange:z,onMenuClose:q,onMenuOpen:O,value:oe})}function ct(){return ct=Object.assign?Object.assign.bind():function(n){for(var e=1;e0?ai(Uc,--nr):0,Tc--,zn===10&&(Tc=1,B0--),zn}function Sr(){return zn=nr2||Qf(zn)>3?"":" "}function eW(n,e){for(;--e&&Sr()&&!(zn<48||zn>102||zn>57&&zn<65||zn>70&&zn<97););return Md(n,mg()+(e<6&&js()==32&&Sr()==32))}function zS(n){for(;Sr();)switch(zn){case n:return nr;case 34:case 39:n!==34&&n!==39&&zS(zn);break;case 40:n===41&&zS(n);break;case 92:Sr();break}return nr}function tW(n,e){for(;Sr()&&n+zn!==57;)if(n+zn===84&&js()===47)break;return"/*"+Md(e,nr-1)+"*"+z0(n===47?n:Sr())}function nW(n){for(;!Qf(js());)Sr();return Md(n,nr)}function iW(n){return _N(vg("",null,null,null,[""],n=yN(n),0,[0],n))}function vg(n,e,t,i,r,s,o,a,l){for(var u=0,f=0,d=o,p=0,g=0,v=0,x=1,_=1,m=1,w=0,S="",b=r,R=s,A=i,C=S;_;)switch(v=w,w=Sr()){case 40:if(v!=108&&ai(C,d-1)==58){US(C+=$t(gg(w),"&","&\f"),"&\f")!=-1&&(m=-1);break}case 34:case 39:case 91:C+=gg(w);break;case 9:case 10:case 13:case 32:C+=Q8(v);break;case 92:C+=eW(mg()-1,7);continue;case 47:switch(js()){case 42:case 47:Om(rW(tW(Sr(),mg()),e,t),l);break;default:C+="/"}break;case 123*x:a[u++]=Ds(C)*m;case 125*x:case 59:case 0:switch(w){case 0:case 125:_=0;case 59+f:m==-1&&(C=$t(C,/\f/g,"")),g>0&&Ds(C)-d&&Om(g>32?cR(C+";",i,t,d-1):cR($t(C," ","")+";",i,t,d-2),l);break;case 59:C+=";";default:if(Om(A=uR(C,e,t,u,f,r,a,S,b=[],R=[],d),s),w===123)if(f===0)vg(C,e,A,A,b,s,d,a,R);else switch(p===99&&ai(C,3)===110?100:p){case 100:case 108:case 109:case 115:vg(n,A,A,i&&Om(uR(n,A,A,0,0,r,a,S,r,b=[],d),R),r,R,d,a,i?b:R);break;default:vg(C,A,A,A,[""],R,0,a,R)}}u=f=g=0,x=m=1,S=C="",d=o;break;case 58:d=1+Ds(C),g=v;default:if(x<1){if(w==123)--x;else if(w==125&&x++==0&&J8()==125)continue}switch(C+=z0(w),w*x){case 38:m=f>0?1:(C+="\f",-1);break;case 44:a[u++]=(Ds(C)-1)*m,m=1;break;case 64:js()===45&&(C+=gg(Sr())),p=js(),f=d=Ds(S=C+=nW(mg())),w++;break;case 45:v===45&&Ds(C)==2&&(x=0)}}return s}function uR(n,e,t,i,r,s,o,a,l,u,f){for(var d=r-1,p=r===0?s:[""],g=ZM(p),v=0,x=0,_=0;v0?p[m]+" "+w:$t(w,/&\f/g,p[m])))&&(l[_++]=S);return V0(n,e,t,r===0?qM:a,l,u,f)}function rW(n,e,t){return V0(n,e,t,pN,z0(K8()),Jf(n,2,-2),0)}function cR(n,e,t,i){return V0(n,e,t,YM,Jf(n,0,i),Jf(n,i+1,-1),i)}function lc(n,e){for(var t="",i=ZM(n),r=0;r6)switch(ai(n,e+1)){case 109:if(ai(n,e+4)!==45)break;case 102:return $t(n,/(.+:)(.+)-([^]+)/,"$1"+Xt+"$2-$3$1"+dv+(ai(n,e+3)==108?"$3":"$2-$3"))+n;case 115:return~US(n,"stretch")?xN($t(n,"stretch","fill-available"),e)+n:n}break;case 4949:if(ai(n,e+1)!==115)break;case 6444:switch(ai(n,Ds(n)-3-(~US(n,"!important")&&10))){case 107:return $t(n,":",":"+Xt)+n;case 101:return $t(n,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Xt+(ai(n,14)===45?"inline-":"")+"box$3$1"+Xt+"$2$3$1"+Si+"$2box$3")+n}break;case 5936:switch(ai(n,e+11)){case 114:return Xt+n+Si+$t(n,/[svh]\w+-[tblr]{2}/,"tb")+n;case 108:return Xt+n+Si+$t(n,/[svh]\w+-[tblr]{2}/,"tb-rl")+n;case 45:return Xt+n+Si+$t(n,/[svh]\w+-[tblr]{2}/,"lr")+n}return Xt+n+Si+n+n}return n}var pW=function(e,t,i,r){if(e.length>-1&&!e.return)switch(e.type){case YM:e.return=xN(e.value,e.length);break;case mN:return lc([Ph(e,{value:$t(e.value,"@","@"+Xt)})],r);case qM:if(e.length)return Z8(e.props,function(s){switch(Y8(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return lc([Ph(e,{props:[$t(s,/:(read-\w+)/,":"+dv+"$1")]})],r);case"::placeholder":return lc([Ph(e,{props:[$t(s,/:(plac\w+)/,":"+Xt+"input-$1")]}),Ph(e,{props:[$t(s,/:(plac\w+)/,":"+dv+"$1")]}),Ph(e,{props:[$t(s,/:(plac\w+)/,Si+"input-$1")]})],r)}return""})}},mW=[pW],gW=function(e){var t=e.key;if(t==="css"){var i=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(i,function(x){var _=x.getAttribute("data-emotion");_.indexOf(" ")!==-1&&(document.head.appendChild(x),x.setAttribute("data-s",""))})}var r=e.stylisPlugins||mW,s={},o,a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(x){for(var _=x.getAttribute("data-emotion").split(" "),m=1;m<_.length;m++)s[_[m]]=!0;a.push(x)});var l,u=[fW,dW];{var f,d=[sW,aW(function(x){f.insert(x)})],p=oW(u.concat(r,d)),g=function(_){return lc(iW(_),p)};l=function(_,m,w,S){f=w,g(_?_+"{"+m.styles+"}":m.styles),S&&(v.inserted[m.name]=!0)}}var v={key:t,sheet:new G8({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:l};return v.sheet.hydrate(a),v},wN={exports:{}},Jt={};/** @license React v16.13.1 + `),wW=Y.forwardRef(({args:n,cellColor:e="#000000",sectionColor:t="#2080ff",cellSize:i=.5,sectionSize:r=1,followCamera:s=!1,infiniteGrid:o=!1,fadeDistance:a=100,fadeStrength:l=1,fadeFrom:u=1,cellThickness:f=.5,sectionThickness:d=1,side:p=Ai,...g},v)=>{$3({GridMaterial:xW});const x=Y.useRef(null);Y.useImperativeHandle(v,()=>x.current,[]);const _=new Ns,m=new U(0,1,0),w=new U(0,0,0);jM(R=>{_.setFromNormalAndCoplanarPoint(m,w).applyMatrix4(x.current.matrixWorld);const A=x.current.material,C=A.uniforms.worldCamProjPosition,L=A.uniforms.worldPlanePosition;_.projectPoint(R.camera.position,C.value),L.value.set(0,0,0).applyMatrix4(x.current.matrixWorld)});const S={cellSize:i,sectionSize:r,cellColor:e,sectionColor:t,cellThickness:f,sectionThickness:d},b={fadeDistance:a,fadeStrength:l,fadeFrom:u,infiniteGrid:o,followCamera:s};return Y.createElement("mesh",xc({ref:x,frustumCulled:!1},g),Y.createElement("gridMaterial",xc({transparent:!0,"extensions-derivatives":!0,side:p},S,b)),Y.createElement("planeGeometry",{args:n}))});function Fx(n){return We.jsxs("mesh",{...n,scale:[1,10,1],children:[We.jsx("cylinderGeometry",{args:[.05,.05,5,32]}),We.jsx("meshBasicMaterial",{color:n.color})]})}function SW(n){const e=Y.useRef(null);return We.jsxs("mesh",{...n,ref:e,children:[We.jsx("sphereGeometry",{args:[1,16,16]}),We.jsx("meshStandardMaterial",{color:n.color})]})}const MW=({concepts:n,onHoverConcept:e,spherePos:t})=>{function i(r){const s=Y.useRef(null),[o,a]=Y.useState(!1),[l,u]=Y.useState(!1);return We.jsxs("mesh",{...r,ref:s,scale:l?1.5:1,onClick:()=>u(!l),onPointerOver:()=>{a(!0),e(r.index)},onPointerOut:()=>{a(!1),e(-1)},children:[We.jsx("boxGeometry",{args:[1,1,1]}),We.jsx("meshStandardMaterial",{color:o?"hotpink":r.color||"orange"})]})}return We.jsxs(lW,{id:"three-canvas",className:"Panel3D",children:[We.jsx(yW,{makeDefault:!0,position:[20,20,20],fov:75,near:.1,far:1e3}),We.jsx("ambientLight",{intensity:Math.PI/2}),We.jsx("spotLight",{position:[10,10,10],angle:.15,penumbra:1,decay:0,intensity:Math.PI}),We.jsx("pointLight",{position:[-10,-10,-10],decay:0,intensity:Math.PI}),We.jsx(wW,{args:[60,60,30,30],rotation:[0,0,0],position:[0,0,0],cellColor:"green"}),n.map(r=>We.jsx(i,{position:r.position,color:r.color,index:r.index},"box"+r.index)),";",We.jsx(SW,{position:t,color:"black"}),We.jsx(Fx,{position:[0,0,0],rotation:[0,0,-Math.PI/2],color:"red"}),We.jsx(Fx,{position:[0,0,0],rotation:[Math.PI/2,0,0],color:"green"}),We.jsx(Fx,{position:[0,0,0],rotation:[0,0,0],color:"blue"}),We.jsx(_W,{})]})},cN=({color:n,title:e,inputId:t,inputValue:i})=>We.jsxs("div",{style:{display:"flex",alignItems:"center",padding:"3px"},children:[We.jsx("span",{className:"HiddenOnMobile",style:{height:"20px",width:"20px",backgroundColor:n,borderRadius:"10px",marginLeft:"5px"},title:e||""})," ",We.jsx("input",{style:{width:"180px"},id:t,value:i,name:"test",readOnly:!!i})]}),oR=["red","blue","green","yellow","gray","orange","pink","lightblue"];function EW(n){return oR[n%oR.length]}function Pl(n){"@babel/helpers - typeof";return Pl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pl(n)}function bW(n,e){if(Pl(n)!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e||"default");if(Pl(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function hN(n){var e=bW(n,"string");return Pl(e)=="symbol"?e:e+""}function zh(n,e,t){return(e=hN(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function aR(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,i)}return t}function st(n){for(var e=1;en.length)&&(e=n.length);for(var t=0,i=Array(e);t=0)continue;t[i]=n[i]}return t}function Do(n,e){if(n==null)return{};var t,i,r=RW(n,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(n);for(i=0;i=0||{}.propertyIsEnumerable.call(n,t)&&(r[t]=n[t])}return r}var PW=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function IW(n){var e=n.defaultInputValue,t=e===void 0?"":e,i=n.defaultMenuIsOpen,r=i===void 0?!1:i,s=n.defaultValue,o=s===void 0?null:s,a=n.inputValue,l=n.menuIsOpen,u=n.onChange,f=n.onInputChange,d=n.onMenuClose,p=n.onMenuOpen,g=n.value,v=Do(n,PW),x=Y.useState(a!==void 0?a:t),_=Mo(x,2),m=_[0],w=_[1],S=Y.useState(l!==void 0?l:r),b=Mo(S,2),R=b[0],A=b[1],C=Y.useState(g!==void 0?g:o),L=Mo(C,2),I=L[0],E=L[1],N=Y.useCallback(function(k,W){typeof u=="function"&&u(k,W),E(k)},[u]),z=Y.useCallback(function(k,W){var G;typeof f=="function"&&(G=f(k,W)),w(G!==void 0?G:k)},[f]),O=Y.useCallback(function(){typeof p=="function"&&p(),A(!0)},[p]),q=Y.useCallback(function(){typeof d=="function"&&d(),A(!1)},[d]),j=a!==void 0?a:m,Q=l!==void 0?l:R,oe=g!==void 0?g:I;return st(st({},v),{},{inputValue:j,menuIsOpen:Q,onChange:N,onInputChange:z,onMenuClose:q,onMenuOpen:O,value:oe})}function ct(){return ct=Object.assign?Object.assign.bind():function(n){for(var e=1;e0?ai(Uc,--nr):0,Tc--,zn===10&&(Tc=1,B0--),zn}function Sr(){return zn=nr2||Qf(zn)>3?"":" "}function e8(n,e){for(;--e&&Sr()&&!(zn<48||zn>102||zn>57&&zn<65||zn>70&&zn<97););return Md(n,mg()+(e<6&&js()==32&&Sr()==32))}function zS(n){for(;Sr();)switch(zn){case n:return nr;case 34:case 39:n!==34&&n!==39&&zS(zn);break;case 40:n===41&&zS(n);break;case 92:Sr();break}return nr}function t8(n,e){for(;Sr()&&n+zn!==57;)if(n+zn===84&&js()===47)break;return"/*"+Md(e,nr-1)+"*"+z0(n===47?n:Sr())}function n8(n){for(;!Qf(js());)Sr();return Md(n,nr)}function i8(n){return _N(vg("",null,null,null,[""],n=yN(n),0,[0],n))}function vg(n,e,t,i,r,s,o,a,l){for(var u=0,f=0,d=o,p=0,g=0,v=0,x=1,_=1,m=1,w=0,S="",b=r,R=s,A=i,C=S;_;)switch(v=w,w=Sr()){case 40:if(v!=108&&ai(C,d-1)==58){US(C+=$t(gg(w),"&","&\f"),"&\f")!=-1&&(m=-1);break}case 34:case 39:case 91:C+=gg(w);break;case 9:case 10:case 13:case 32:C+=QW(v);break;case 92:C+=e8(mg()-1,7);continue;case 47:switch(js()){case 42:case 47:Om(r8(t8(Sr(),mg()),e,t),l);break;default:C+="/"}break;case 123*x:a[u++]=Ds(C)*m;case 125*x:case 59:case 0:switch(w){case 0:case 125:_=0;case 59+f:m==-1&&(C=$t(C,/\f/g,"")),g>0&&Ds(C)-d&&Om(g>32?cR(C+";",i,t,d-1):cR($t(C," ","")+";",i,t,d-2),l);break;case 59:C+=";";default:if(Om(A=uR(C,e,t,u,f,r,a,S,b=[],R=[],d),s),w===123)if(f===0)vg(C,e,A,A,b,s,d,a,R);else switch(p===99&&ai(C,3)===110?100:p){case 100:case 108:case 109:case 115:vg(n,A,A,i&&Om(uR(n,A,A,0,0,r,a,S,r,b=[],d),R),r,R,d,a,i?b:R);break;default:vg(C,A,A,A,[""],R,0,a,R)}}u=f=g=0,x=m=1,S=C="",d=o;break;case 58:d=1+Ds(C),g=v;default:if(x<1){if(w==123)--x;else if(w==125&&x++==0&&JW()==125)continue}switch(C+=z0(w),w*x){case 38:m=f>0?1:(C+="\f",-1);break;case 44:a[u++]=(Ds(C)-1)*m,m=1;break;case 64:js()===45&&(C+=gg(Sr())),p=js(),f=d=Ds(S=C+=n8(mg())),w++;break;case 45:v===45&&Ds(C)==2&&(x=0)}}return s}function uR(n,e,t,i,r,s,o,a,l,u,f){for(var d=r-1,p=r===0?s:[""],g=ZM(p),v=0,x=0,_=0;v0?p[m]+" "+w:$t(w,/&\f/g,p[m])))&&(l[_++]=S);return V0(n,e,t,r===0?qM:a,l,u,f)}function r8(n,e,t){return V0(n,e,t,pN,z0(KW()),Jf(n,2,-2),0)}function cR(n,e,t,i){return V0(n,e,t,YM,Jf(n,0,i),Jf(n,i+1,-1),i)}function lc(n,e){for(var t="",i=ZM(n),r=0;r6)switch(ai(n,e+1)){case 109:if(ai(n,e+4)!==45)break;case 102:return $t(n,/(.+:)(.+)-([^]+)/,"$1"+Xt+"$2-$3$1"+dv+(ai(n,e+3)==108?"$3":"$2-$3"))+n;case 115:return~US(n,"stretch")?xN($t(n,"stretch","fill-available"),e)+n:n}break;case 4949:if(ai(n,e+1)!==115)break;case 6444:switch(ai(n,Ds(n)-3-(~US(n,"!important")&&10))){case 107:return $t(n,":",":"+Xt)+n;case 101:return $t(n,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Xt+(ai(n,14)===45?"inline-":"")+"box$3$1"+Xt+"$2$3$1"+Si+"$2box$3")+n}break;case 5936:switch(ai(n,e+11)){case 114:return Xt+n+Si+$t(n,/[svh]\w+-[tblr]{2}/,"tb")+n;case 108:return Xt+n+Si+$t(n,/[svh]\w+-[tblr]{2}/,"tb-rl")+n;case 45:return Xt+n+Si+$t(n,/[svh]\w+-[tblr]{2}/,"lr")+n}return Xt+n+Si+n+n}return n}var p8=function(e,t,i,r){if(e.length>-1&&!e.return)switch(e.type){case YM:e.return=xN(e.value,e.length);break;case mN:return lc([Ph(e,{value:$t(e.value,"@","@"+Xt)})],r);case qM:if(e.length)return ZW(e.props,function(s){switch(YW(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return lc([Ph(e,{props:[$t(s,/:(read-\w+)/,":"+dv+"$1")]})],r);case"::placeholder":return lc([Ph(e,{props:[$t(s,/:(plac\w+)/,":"+Xt+"input-$1")]}),Ph(e,{props:[$t(s,/:(plac\w+)/,":"+dv+"$1")]}),Ph(e,{props:[$t(s,/:(plac\w+)/,Si+"input-$1")]})],r)}return""})}},m8=[p8],g8=function(e){var t=e.key;if(t==="css"){var i=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(i,function(x){var _=x.getAttribute("data-emotion");_.indexOf(" ")!==-1&&(document.head.appendChild(x),x.setAttribute("data-s",""))})}var r=e.stylisPlugins||m8,s={},o,a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(x){for(var _=x.getAttribute("data-emotion").split(" "),m=1;m<_.length;m++)s[_[m]]=!0;a.push(x)});var l,u=[f8,d8];{var f,d=[s8,a8(function(x){f.insert(x)})],p=o8(u.concat(r,d)),g=function(_){return lc(i8(_),p)};l=function(_,m,w,S){f=w,g(_?_+"{"+m.styles+"}":m.styles),S&&(v.inserted[m.name]=!0)}}var v={key:t,sheet:new GW({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:l};return v.sheet.hydrate(a),v},wN={exports:{}},Jt={};/** @license React v16.13.1 * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var ii=typeof Symbol=="function"&&Symbol.for,KM=ii?Symbol.for("react.element"):60103,JM=ii?Symbol.for("react.portal"):60106,H0=ii?Symbol.for("react.fragment"):60107,G0=ii?Symbol.for("react.strict_mode"):60108,W0=ii?Symbol.for("react.profiler"):60114,j0=ii?Symbol.for("react.provider"):60109,X0=ii?Symbol.for("react.context"):60110,QM=ii?Symbol.for("react.async_mode"):60111,$0=ii?Symbol.for("react.concurrent_mode"):60111,q0=ii?Symbol.for("react.forward_ref"):60112,Y0=ii?Symbol.for("react.suspense"):60113,vW=ii?Symbol.for("react.suspense_list"):60120,Z0=ii?Symbol.for("react.memo"):60115,K0=ii?Symbol.for("react.lazy"):60116,yW=ii?Symbol.for("react.block"):60121,_W=ii?Symbol.for("react.fundamental"):60117,xW=ii?Symbol.for("react.responder"):60118,wW=ii?Symbol.for("react.scope"):60119;function Rr(n){if(typeof n=="object"&&n!==null){var e=n.$$typeof;switch(e){case KM:switch(n=n.type,n){case QM:case $0:case H0:case W0:case G0:case Y0:return n;default:switch(n=n&&n.$$typeof,n){case X0:case q0:case K0:case Z0:case j0:return n;default:return e}}case JM:return e}}}function SN(n){return Rr(n)===$0}Jt.AsyncMode=QM;Jt.ConcurrentMode=$0;Jt.ContextConsumer=X0;Jt.ContextProvider=j0;Jt.Element=KM;Jt.ForwardRef=q0;Jt.Fragment=H0;Jt.Lazy=K0;Jt.Memo=Z0;Jt.Portal=JM;Jt.Profiler=W0;Jt.StrictMode=G0;Jt.Suspense=Y0;Jt.isAsyncMode=function(n){return SN(n)||Rr(n)===QM};Jt.isConcurrentMode=SN;Jt.isContextConsumer=function(n){return Rr(n)===X0};Jt.isContextProvider=function(n){return Rr(n)===j0};Jt.isElement=function(n){return typeof n=="object"&&n!==null&&n.$$typeof===KM};Jt.isForwardRef=function(n){return Rr(n)===q0};Jt.isFragment=function(n){return Rr(n)===H0};Jt.isLazy=function(n){return Rr(n)===K0};Jt.isMemo=function(n){return Rr(n)===Z0};Jt.isPortal=function(n){return Rr(n)===JM};Jt.isProfiler=function(n){return Rr(n)===W0};Jt.isStrictMode=function(n){return Rr(n)===G0};Jt.isSuspense=function(n){return Rr(n)===Y0};Jt.isValidElementType=function(n){return typeof n=="string"||typeof n=="function"||n===H0||n===$0||n===W0||n===G0||n===Y0||n===vW||typeof n=="object"&&n!==null&&(n.$$typeof===K0||n.$$typeof===Z0||n.$$typeof===j0||n.$$typeof===X0||n.$$typeof===q0||n.$$typeof===_W||n.$$typeof===xW||n.$$typeof===wW||n.$$typeof===yW)};Jt.typeOf=Rr;wN.exports=Jt;var SW=wN.exports,MN=SW,MW={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},EW={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},EN={};EN[MN.ForwardRef]=MW;EN[MN.Memo]=EW;var bW=!0;function TW(n,e,t){var i="";return t.split(" ").forEach(function(r){n[r]!==void 0?e.push(n[r]+";"):i+=r+" "}),i}var bN=function(e,t,i){var r=e.key+"-"+t.name;(i===!1||bW===!1)&&e.registered[r]===void 0&&(e.registered[r]=t.styles)},AW=function(e,t,i){bN(e,t,i);var r=e.key+"-"+t.name;if(e.inserted[t.name]===void 0){var s=t;do e.insert(t===s?"."+r:"",s,e.sheet,!0),s=s.next;while(s!==void 0)}};function CW(n){for(var e=0,t,i=0,r=n.length;r>=4;++i,r-=4)t=n.charCodeAt(i)&255|(n.charCodeAt(++i)&255)<<8|(n.charCodeAt(++i)&255)<<16|(n.charCodeAt(++i)&255)<<24,t=(t&65535)*1540483477+((t>>>16)*59797<<16),t^=t>>>24,e=(t&65535)*1540483477+((t>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(r){case 3:e^=(n.charCodeAt(i+2)&255)<<16;case 2:e^=(n.charCodeAt(i+1)&255)<<8;case 1:e^=n.charCodeAt(i)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var RW={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},PW=/[A-Z]|^ms/g,IW=/_EMO_([^_]+?)_([^]*?)_EMO_/g,TN=function(e){return e.charCodeAt(1)===45},fR=function(e){return e!=null&&typeof e!="boolean"},Ux=lW(function(n){return TN(n)?n:n.replace(PW,"-$&").toLowerCase()}),dR=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(IW,function(i,r,s){return Os={name:r,styles:s,next:Os},r})}return RW[e]!==1&&!TN(e)&&typeof t=="number"&&t!==0?t+"px":t};function ed(n,e,t){if(t==null)return"";if(t.__emotion_styles!==void 0)return t;switch(typeof t){case"boolean":return"";case"object":{if(t.anim===1)return Os={name:t.name,styles:t.styles,next:Os},t.name;if(t.styles!==void 0){var i=t.next;if(i!==void 0)for(;i!==void 0;)Os={name:i.name,styles:i.styles,next:Os},i=i.next;var r=t.styles+";";return r}return LW(n,e,t)}case"function":{if(n!==void 0){var s=Os,o=t(n);return Os=s,ed(n,e,o)}break}}return t}function LW(n,e,t){var i="";if(Array.isArray(t))for(var r=0;r({x:n,y:n});function XW(n){const{x:e,y:t,width:i,height:r}=n;return{width:i,height:r,top:t,left:e,right:e+i,bottom:t+r,x:e,y:t}}function RN(n){return IN(n)?(n.nodeName||"").toLowerCase():"#document"}function Io(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function PN(n){var e;return(e=(IN(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function IN(n){return n instanceof Node||n instanceof Io(n).Node}function $W(n){return n instanceof Element||n instanceof Io(n).Element}function nE(n){return n instanceof HTMLElement||n instanceof Io(n).HTMLElement}function mR(n){return typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof Io(n).ShadowRoot}function LN(n){const{overflow:e,overflowX:t,overflowY:i,display:r}=iE(n);return/auto|scroll|overlay|hidden|clip/.test(e+i+t)&&!["inline","contents"].includes(r)}function qW(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function YW(n){return["html","body","#document"].includes(RN(n))}function iE(n){return Io(n).getComputedStyle(n)}function ZW(n){if(RN(n)==="html")return n;const e=n.assignedSlot||n.parentNode||mR(n)&&n.host||PN(n);return mR(e)?e.host:e}function NN(n){const e=ZW(n);return YW(e)?n.ownerDocument?n.ownerDocument.body:n.body:nE(e)&&LN(e)?e:NN(e)}function gv(n,e,t){var i;e===void 0&&(e=[]),t===void 0&&(t=!0);const r=NN(n),s=r===((i=n.ownerDocument)==null?void 0:i.body),o=Io(r);return s?e.concat(o,o.visualViewport||[],LN(r)?r:[],o.frameElement&&t?gv(o.frameElement):[]):e.concat(r,gv(r,[],t))}function KW(n){const e=iE(n);let t=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=nE(n),s=r?n.offsetWidth:t,o=r?n.offsetHeight:i,a=pv(t)!==s||pv(i)!==o;return a&&(t=s,i=o),{width:t,height:i,$:a}}function rE(n){return $W(n)?n:n.contextElement}function gR(n){const e=rE(n);if(!nE(e))return mv(1);const t=e.getBoundingClientRect(),{width:i,height:r,$:s}=KW(e);let o=(s?pv(t.width):t.width)/i,a=(s?pv(t.height):t.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const JW=mv(0);function QW(n){const e=Io(n);return!qW()||!e.visualViewport?JW:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function e9(n,e,t){return!1}function vR(n,e,t,i){e===void 0&&(e=!1);const r=n.getBoundingClientRect(),s=rE(n);let o=mv(1);e&&(o=gR(n));const a=e9()?QW(s):mv(0);let l=(r.left+a.x)/o.x,u=(r.top+a.y)/o.y,f=r.width/o.x,d=r.height/o.y;if(s){const p=Io(s),g=i;let v=p,x=v.frameElement;for(;x&&i&&g!==v;){const _=gR(x),m=x.getBoundingClientRect(),w=iE(x),S=m.left+(x.clientLeft+parseFloat(w.paddingLeft))*_.x,b=m.top+(x.clientTop+parseFloat(w.paddingTop))*_.y;l*=_.x,u*=_.y,f*=_.x,d*=_.y,l+=S,u+=b,v=Io(x),x=v.frameElement}}return XW({width:f,height:d,x:l,y:u})}function t9(n,e){let t=null,i;const r=PN(n);function s(){var a;clearTimeout(i),(a=t)==null||a.disconnect(),t=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:u,top:f,width:d,height:p}=n.getBoundingClientRect();if(a||e(),!d||!p)return;const g=km(f),v=km(r.clientWidth-(u+d)),x=km(r.clientHeight-(f+p)),_=km(u),w={rootMargin:-g+"px "+-v+"px "+-x+"px "+-_+"px",threshold:jW(0,WW(1,l))||1};let S=!0;function b(R){const A=R[0].intersectionRatio;if(A!==l){if(!S)return o();A?o(!1,A):i=setTimeout(()=>{o(!1,1e-7)},1e3)}S=!1}try{t=new IntersectionObserver(b,{...w,root:r.ownerDocument})}catch{t=new IntersectionObserver(b,w)}t.observe(n)}return o(!0),s}function n9(n,e,t,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,u=rE(n),f=r||s?[...u?gv(u):[],...gv(e)]:[];f.forEach(m=>{r&&m.addEventListener("scroll",t,{passive:!0}),s&&m.addEventListener("resize",t)});const d=u&&a?t9(u,t):null;let p=-1,g=null;o&&(g=new ResizeObserver(m=>{let[w]=m;w&&w.target===u&&g&&(g.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var S;(S=g)==null||S.observe(e)})),t()}),u&&!l&&g.observe(u),g.observe(e));let v,x=l?vR(n):null;l&&_();function _(){const m=vR(n);x&&(m.x!==x.x||m.y!==x.y||m.width!==x.width||m.height!==x.height)&&t(),x=m,v=requestAnimationFrame(_)}return t(),()=>{var m;f.forEach(w=>{r&&w.removeEventListener("scroll",t),s&&w.removeEventListener("resize",t)}),d==null||d(),(m=g)==null||m.disconnect(),g=null,l&&cancelAnimationFrame(v)}}var VS=Y.useLayoutEffect,i9=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],vv=function(){};function r9(n,e){return e?e[0]==="-"?n+e:n+"__"+e:n}function s9(n,e){for(var t=arguments.length,i=new Array(t>2?t-2:0),r=2;r-1}function o9(n){return J0(n)?window.innerHeight:n.clientHeight}function ON(n){return J0(n)?window.pageYOffset:n.scrollTop}function yv(n,e){if(J0(n)){window.scrollTo(0,e);return}n.scrollTop=e}function a9(n){var e=getComputedStyle(n),t=e.position==="absolute",i=/(auto|scroll)/;if(e.position==="fixed")return document.documentElement;for(var r=n;r=r.parentElement;)if(e=getComputedStyle(r),!(t&&e.position==="static")&&i.test(e.overflow+e.overflowY+e.overflowX))return r;return document.documentElement}function l9(n,e,t,i){return t*((n=n/i-1)*n*n+1)+e}function Fm(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:vv,r=ON(n),s=e-r,o=10,a=0;function l(){a+=o;var u=l9(a,r,s,t);yv(n,u),at.bottom?yv(n,Math.min(e.offsetTop+e.clientHeight-n.offsetHeight+r,n.scrollHeight)):i.top-r1?t-1:0),r=1;r=v)return{placement:"bottom",maxHeight:e};if(I>=v&&!o)return s&&Fm(l,E,z),{placement:"bottom",maxHeight:e};if(!o&&I>=i||o&&C>=i){s&&Fm(l,E,z);var O=o?C-b:I-b;return{placement:"bottom",maxHeight:O}}if(r==="auto"||o){var q=e,j=o?A:L;return j>=i&&(q=Math.min(j-b-a,e)),{placement:"top",maxHeight:q}}if(r==="bottom")return s&&yv(l,E),{placement:"bottom",maxHeight:e};break;case"top":if(A>=v)return{placement:"top",maxHeight:e};if(L>=v&&!o)return s&&Fm(l,N,z),{placement:"top",maxHeight:e};if(!o&&L>=i||o&&A>=i){var Q=e;return(!o&&L>=i||o&&A>=i)&&(Q=o?A-R:L-R),s&&Fm(l,N,z),{placement:"top",maxHeight:Q}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return u}function _9(n){var e={bottom:"top",top:"bottom"};return n?e[n]:"bottom"}var FN=function(e){return e==="auto"?"bottom":e},x9=function(e,t){var i,r=e.placement,s=e.theme,o=s.borderRadius,a=s.spacing,l=s.colors;return st((i={label:"menu"},zh(i,_9(r),"100%"),zh(i,"position","absolute"),zh(i,"width","100%"),zh(i,"zIndex",1),i),t?{}:{backgroundColor:l.neutral0,borderRadius:o,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:a.menuGutter,marginTop:a.menuGutter})},UN=Y.createContext(null),w9=function(e){var t=e.children,i=e.minMenuHeight,r=e.maxMenuHeight,s=e.menuPlacement,o=e.menuPosition,a=e.menuShouldScrollIntoView,l=e.theme,u=Y.useContext(UN)||{},f=u.setPortalPlacement,d=Y.useRef(null),p=Y.useState(r),g=Mo(p,2),v=g[0],x=g[1],_=Y.useState(null),m=Mo(_,2),w=m[0],S=m[1],b=l.spacing.controlHeight;return VS(function(){var R=d.current;if(R){var A=o==="fixed",C=a&&!A,L=y9({maxHeight:r,menuEl:R,minHeight:i,placement:s,shouldScroll:C,isFixedPosition:A,controlHeight:b});x(L.maxHeight),S(L.placement),f==null||f(L.placement)}},[r,s,o,a,i,f,b]),t({ref:d,placerProps:st(st({},e),{},{placement:w||FN(s),maxHeight:v})})},S9=function(e){var t=e.children,i=e.innerRef,r=e.innerProps;return nt("div",ct({},Cn(e,"menu",{menu:!0}),{ref:i},r),t)},M9=S9,E9=function(e,t){var i=e.maxHeight,r=e.theme.spacing.baseUnit;return st({maxHeight:i,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:r,paddingTop:r})},b9=function(e){var t=e.children,i=e.innerProps,r=e.innerRef,s=e.isMulti;return nt("div",ct({},Cn(e,"menuList",{"menu-list":!0,"menu-list--is-multi":s}),{ref:r},i),t)},zN=function(e,t){var i=e.theme,r=i.spacing.baseUnit,s=i.colors;return st({textAlign:"center"},t?{}:{color:s.neutral40,padding:"".concat(r*2,"px ").concat(r*3,"px")})},T9=zN,A9=zN,C9=function(e){var t=e.children,i=t===void 0?"No options":t,r=e.innerProps,s=Do(e,g9);return nt("div",ct({},Cn(st(st({},s),{},{children:i,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),i)},R9=function(e){var t=e.children,i=t===void 0?"Loading...":t,r=e.innerProps,s=Do(e,v9);return nt("div",ct({},Cn(st(st({},s),{},{children:i,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),i)},P9=function(e){var t=e.rect,i=e.offset,r=e.position;return{left:t.left,position:r,top:i,width:t.width,zIndex:1}},I9=function(e){var t=e.appendTo,i=e.children,r=e.controlElement,s=e.innerProps,o=e.menuPlacement,a=e.menuPosition,l=Y.useRef(null),u=Y.useRef(null),f=Y.useState(FN(o)),d=Mo(f,2),p=d[0],g=d[1],v=Y.useMemo(function(){return{setPortalPlacement:g}},[]),x=Y.useState(null),_=Mo(x,2),m=_[0],w=_[1],S=Y.useCallback(function(){if(r){var C=u9(r),L=a==="fixed"?0:window.pageYOffset,I=C[p]+L;(I!==(m==null?void 0:m.offset)||C.left!==(m==null?void 0:m.rect.left)||C.width!==(m==null?void 0:m.rect.width))&&w({offset:I,rect:C})}},[r,a,p,m==null?void 0:m.offset,m==null?void 0:m.rect.left,m==null?void 0:m.rect.width]);VS(function(){S()},[S]);var b=Y.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),r&&l.current&&(u.current=n9(r,l.current,S,{elementResize:"ResizeObserver"in window}))},[r,S]);VS(function(){b()},[b]);var R=Y.useCallback(function(C){l.current=C,b()},[b]);if(!t&&a!=="fixed"||!m)return null;var A=nt("div",ct({ref:R},Cn(st(st({},e),{},{offset:m.offset,position:a,rect:m.rect}),"menuPortal",{"menu-portal":!0}),s),i);return nt(UN.Provider,{value:v},t?EI.createPortal(A,t):A)},L9=function(e){var t=e.isDisabled,i=e.isRtl;return{label:"container",direction:i?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},N9=function(e){var t=e.children,i=e.innerProps,r=e.isDisabled,s=e.isRtl;return nt("div",ct({},Cn(e,"container",{"--is-disabled":r,"--is-rtl":s}),i),t)},D9=function(e,t){var i=e.theme.spacing,r=e.isMulti,s=e.hasValue,o=e.selectProps.controlShouldRenderValue;return st({alignItems:"center",display:r&&s&&o?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(i.baseUnit/2,"px ").concat(i.baseUnit*2,"px")})},O9=function(e){var t=e.children,i=e.innerProps,r=e.isMulti,s=e.hasValue;return nt("div",ct({},Cn(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":s}),i),t)},k9=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},F9=function(e){var t=e.children,i=e.innerProps;return nt("div",ct({},Cn(e,"indicatorsContainer",{indicators:!0}),i),t)},wR,U9=["size"],z9=["innerProps","isRtl","size"],B9={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},BN=function(e){var t=e.size,i=Do(e,U9);return nt("svg",ct({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:B9},i))},sE=function(e){return nt(BN,ct({size:20},e),nt("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},VN=function(e){return nt(BN,ct({size:20},e),nt("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},HN=function(e,t){var i=e.isFocused,r=e.theme,s=r.spacing.baseUnit,o=r.colors;return st({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:i?o.neutral60:o.neutral20,padding:s*2,":hover":{color:i?o.neutral80:o.neutral40}})},V9=HN,H9=function(e){var t=e.children,i=e.innerProps;return nt("div",ct({},Cn(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),i),t||nt(VN,null))},G9=HN,W9=function(e){var t=e.children,i=e.innerProps;return nt("div",ct({},Cn(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),i),t||nt(sE,null))},j9=function(e,t){var i=e.isDisabled,r=e.theme,s=r.spacing.baseUnit,o=r.colors;return st({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:i?o.neutral10:o.neutral20,marginBottom:s*2,marginTop:s*2})},X9=function(e){var t=e.innerProps;return nt("span",ct({},t,Cn(e,"indicatorSeparator",{"indicator-separator":!0})))},$9=HW(wR||(wR=GW([` + */var ii=typeof Symbol=="function"&&Symbol.for,KM=ii?Symbol.for("react.element"):60103,JM=ii?Symbol.for("react.portal"):60106,H0=ii?Symbol.for("react.fragment"):60107,G0=ii?Symbol.for("react.strict_mode"):60108,W0=ii?Symbol.for("react.profiler"):60114,j0=ii?Symbol.for("react.provider"):60109,X0=ii?Symbol.for("react.context"):60110,QM=ii?Symbol.for("react.async_mode"):60111,$0=ii?Symbol.for("react.concurrent_mode"):60111,q0=ii?Symbol.for("react.forward_ref"):60112,Y0=ii?Symbol.for("react.suspense"):60113,v8=ii?Symbol.for("react.suspense_list"):60120,Z0=ii?Symbol.for("react.memo"):60115,K0=ii?Symbol.for("react.lazy"):60116,y8=ii?Symbol.for("react.block"):60121,_8=ii?Symbol.for("react.fundamental"):60117,x8=ii?Symbol.for("react.responder"):60118,w8=ii?Symbol.for("react.scope"):60119;function Rr(n){if(typeof n=="object"&&n!==null){var e=n.$$typeof;switch(e){case KM:switch(n=n.type,n){case QM:case $0:case H0:case W0:case G0:case Y0:return n;default:switch(n=n&&n.$$typeof,n){case X0:case q0:case K0:case Z0:case j0:return n;default:return e}}case JM:return e}}}function SN(n){return Rr(n)===$0}Jt.AsyncMode=QM;Jt.ConcurrentMode=$0;Jt.ContextConsumer=X0;Jt.ContextProvider=j0;Jt.Element=KM;Jt.ForwardRef=q0;Jt.Fragment=H0;Jt.Lazy=K0;Jt.Memo=Z0;Jt.Portal=JM;Jt.Profiler=W0;Jt.StrictMode=G0;Jt.Suspense=Y0;Jt.isAsyncMode=function(n){return SN(n)||Rr(n)===QM};Jt.isConcurrentMode=SN;Jt.isContextConsumer=function(n){return Rr(n)===X0};Jt.isContextProvider=function(n){return Rr(n)===j0};Jt.isElement=function(n){return typeof n=="object"&&n!==null&&n.$$typeof===KM};Jt.isForwardRef=function(n){return Rr(n)===q0};Jt.isFragment=function(n){return Rr(n)===H0};Jt.isLazy=function(n){return Rr(n)===K0};Jt.isMemo=function(n){return Rr(n)===Z0};Jt.isPortal=function(n){return Rr(n)===JM};Jt.isProfiler=function(n){return Rr(n)===W0};Jt.isStrictMode=function(n){return Rr(n)===G0};Jt.isSuspense=function(n){return Rr(n)===Y0};Jt.isValidElementType=function(n){return typeof n=="string"||typeof n=="function"||n===H0||n===$0||n===W0||n===G0||n===Y0||n===v8||typeof n=="object"&&n!==null&&(n.$$typeof===K0||n.$$typeof===Z0||n.$$typeof===j0||n.$$typeof===X0||n.$$typeof===q0||n.$$typeof===_8||n.$$typeof===x8||n.$$typeof===w8||n.$$typeof===y8)};Jt.typeOf=Rr;wN.exports=Jt;var S8=wN.exports,MN=S8,M8={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},E8={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},EN={};EN[MN.ForwardRef]=M8;EN[MN.Memo]=E8;var b8=!0;function T8(n,e,t){var i="";return t.split(" ").forEach(function(r){n[r]!==void 0?e.push(n[r]+";"):i+=r+" "}),i}var bN=function(e,t,i){var r=e.key+"-"+t.name;(i===!1||b8===!1)&&e.registered[r]===void 0&&(e.registered[r]=t.styles)},A8=function(e,t,i){bN(e,t,i);var r=e.key+"-"+t.name;if(e.inserted[t.name]===void 0){var s=t;do e.insert(t===s?"."+r:"",s,e.sheet,!0),s=s.next;while(s!==void 0)}};function C8(n){for(var e=0,t,i=0,r=n.length;r>=4;++i,r-=4)t=n.charCodeAt(i)&255|(n.charCodeAt(++i)&255)<<8|(n.charCodeAt(++i)&255)<<16|(n.charCodeAt(++i)&255)<<24,t=(t&65535)*1540483477+((t>>>16)*59797<<16),t^=t>>>24,e=(t&65535)*1540483477+((t>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(r){case 3:e^=(n.charCodeAt(i+2)&255)<<16;case 2:e^=(n.charCodeAt(i+1)&255)<<8;case 1:e^=n.charCodeAt(i)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var R8={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},P8=/[A-Z]|^ms/g,I8=/_EMO_([^_]+?)_([^]*?)_EMO_/g,TN=function(e){return e.charCodeAt(1)===45},fR=function(e){return e!=null&&typeof e!="boolean"},Ux=l8(function(n){return TN(n)?n:n.replace(P8,"-$&").toLowerCase()}),dR=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(I8,function(i,r,s){return Os={name:r,styles:s,next:Os},r})}return R8[e]!==1&&!TN(e)&&typeof t=="number"&&t!==0?t+"px":t};function ed(n,e,t){if(t==null)return"";if(t.__emotion_styles!==void 0)return t;switch(typeof t){case"boolean":return"";case"object":{if(t.anim===1)return Os={name:t.name,styles:t.styles,next:Os},t.name;if(t.styles!==void 0){var i=t.next;if(i!==void 0)for(;i!==void 0;)Os={name:i.name,styles:i.styles,next:Os},i=i.next;var r=t.styles+";";return r}return L8(n,e,t)}case"function":{if(n!==void 0){var s=Os,o=t(n);return Os=s,ed(n,e,o)}break}}return t}function L8(n,e,t){var i="";if(Array.isArray(t))for(var r=0;r({x:n,y:n});function X8(n){const{x:e,y:t,width:i,height:r}=n;return{width:i,height:r,top:t,left:e,right:e+i,bottom:t+r,x:e,y:t}}function RN(n){return IN(n)?(n.nodeName||"").toLowerCase():"#document"}function Io(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function PN(n){var e;return(e=(IN(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function IN(n){return n instanceof Node||n instanceof Io(n).Node}function $8(n){return n instanceof Element||n instanceof Io(n).Element}function nE(n){return n instanceof HTMLElement||n instanceof Io(n).HTMLElement}function mR(n){return typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof Io(n).ShadowRoot}function LN(n){const{overflow:e,overflowX:t,overflowY:i,display:r}=iE(n);return/auto|scroll|overlay|hidden|clip/.test(e+i+t)&&!["inline","contents"].includes(r)}function q8(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Y8(n){return["html","body","#document"].includes(RN(n))}function iE(n){return Io(n).getComputedStyle(n)}function Z8(n){if(RN(n)==="html")return n;const e=n.assignedSlot||n.parentNode||mR(n)&&n.host||PN(n);return mR(e)?e.host:e}function NN(n){const e=Z8(n);return Y8(e)?n.ownerDocument?n.ownerDocument.body:n.body:nE(e)&&LN(e)?e:NN(e)}function gv(n,e,t){var i;e===void 0&&(e=[]),t===void 0&&(t=!0);const r=NN(n),s=r===((i=n.ownerDocument)==null?void 0:i.body),o=Io(r);return s?e.concat(o,o.visualViewport||[],LN(r)?r:[],o.frameElement&&t?gv(o.frameElement):[]):e.concat(r,gv(r,[],t))}function K8(n){const e=iE(n);let t=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=nE(n),s=r?n.offsetWidth:t,o=r?n.offsetHeight:i,a=pv(t)!==s||pv(i)!==o;return a&&(t=s,i=o),{width:t,height:i,$:a}}function rE(n){return $8(n)?n:n.contextElement}function gR(n){const e=rE(n);if(!nE(e))return mv(1);const t=e.getBoundingClientRect(),{width:i,height:r,$:s}=K8(e);let o=(s?pv(t.width):t.width)/i,a=(s?pv(t.height):t.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const J8=mv(0);function Q8(n){const e=Io(n);return!q8()||!e.visualViewport?J8:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function e9(n,e,t){return!1}function vR(n,e,t,i){e===void 0&&(e=!1);const r=n.getBoundingClientRect(),s=rE(n);let o=mv(1);e&&(o=gR(n));const a=e9()?Q8(s):mv(0);let l=(r.left+a.x)/o.x,u=(r.top+a.y)/o.y,f=r.width/o.x,d=r.height/o.y;if(s){const p=Io(s),g=i;let v=p,x=v.frameElement;for(;x&&i&&g!==v;){const _=gR(x),m=x.getBoundingClientRect(),w=iE(x),S=m.left+(x.clientLeft+parseFloat(w.paddingLeft))*_.x,b=m.top+(x.clientTop+parseFloat(w.paddingTop))*_.y;l*=_.x,u*=_.y,f*=_.x,d*=_.y,l+=S,u+=b,v=Io(x),x=v.frameElement}}return X8({width:f,height:d,x:l,y:u})}function t9(n,e){let t=null,i;const r=PN(n);function s(){var a;clearTimeout(i),(a=t)==null||a.disconnect(),t=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const{left:u,top:f,width:d,height:p}=n.getBoundingClientRect();if(a||e(),!d||!p)return;const g=km(f),v=km(r.clientWidth-(u+d)),x=km(r.clientHeight-(f+p)),_=km(u),w={rootMargin:-g+"px "+-v+"px "+-x+"px "+-_+"px",threshold:j8(0,W8(1,l))||1};let S=!0;function b(R){const A=R[0].intersectionRatio;if(A!==l){if(!S)return o();A?o(!1,A):i=setTimeout(()=>{o(!1,1e-7)},1e3)}S=!1}try{t=new IntersectionObserver(b,{...w,root:r.ownerDocument})}catch{t=new IntersectionObserver(b,w)}t.observe(n)}return o(!0),s}function n9(n,e,t,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,u=rE(n),f=r||s?[...u?gv(u):[],...gv(e)]:[];f.forEach(m=>{r&&m.addEventListener("scroll",t,{passive:!0}),s&&m.addEventListener("resize",t)});const d=u&&a?t9(u,t):null;let p=-1,g=null;o&&(g=new ResizeObserver(m=>{let[w]=m;w&&w.target===u&&g&&(g.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var S;(S=g)==null||S.observe(e)})),t()}),u&&!l&&g.observe(u),g.observe(e));let v,x=l?vR(n):null;l&&_();function _(){const m=vR(n);x&&(m.x!==x.x||m.y!==x.y||m.width!==x.width||m.height!==x.height)&&t(),x=m,v=requestAnimationFrame(_)}return t(),()=>{var m;f.forEach(w=>{r&&w.removeEventListener("scroll",t),s&&w.removeEventListener("resize",t)}),d==null||d(),(m=g)==null||m.disconnect(),g=null,l&&cancelAnimationFrame(v)}}var VS=Y.useLayoutEffect,i9=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],vv=function(){};function r9(n,e){return e?e[0]==="-"?n+e:n+"__"+e:n}function s9(n,e){for(var t=arguments.length,i=new Array(t>2?t-2:0),r=2;r-1}function o9(n){return J0(n)?window.innerHeight:n.clientHeight}function ON(n){return J0(n)?window.pageYOffset:n.scrollTop}function yv(n,e){if(J0(n)){window.scrollTo(0,e);return}n.scrollTop=e}function a9(n){var e=getComputedStyle(n),t=e.position==="absolute",i=/(auto|scroll)/;if(e.position==="fixed")return document.documentElement;for(var r=n;r=r.parentElement;)if(e=getComputedStyle(r),!(t&&e.position==="static")&&i.test(e.overflow+e.overflowY+e.overflowX))return r;return document.documentElement}function l9(n,e,t,i){return t*((n=n/i-1)*n*n+1)+e}function Fm(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:vv,r=ON(n),s=e-r,o=10,a=0;function l(){a+=o;var u=l9(a,r,s,t);yv(n,u),at.bottom?yv(n,Math.min(e.offsetTop+e.clientHeight-n.offsetHeight+r,n.scrollHeight)):i.top-r1?t-1:0),r=1;r=v)return{placement:"bottom",maxHeight:e};if(I>=v&&!o)return s&&Fm(l,E,z),{placement:"bottom",maxHeight:e};if(!o&&I>=i||o&&C>=i){s&&Fm(l,E,z);var O=o?C-b:I-b;return{placement:"bottom",maxHeight:O}}if(r==="auto"||o){var q=e,j=o?A:L;return j>=i&&(q=Math.min(j-b-a,e)),{placement:"top",maxHeight:q}}if(r==="bottom")return s&&yv(l,E),{placement:"bottom",maxHeight:e};break;case"top":if(A>=v)return{placement:"top",maxHeight:e};if(L>=v&&!o)return s&&Fm(l,N,z),{placement:"top",maxHeight:e};if(!o&&L>=i||o&&A>=i){var Q=e;return(!o&&L>=i||o&&A>=i)&&(Q=o?A-R:L-R),s&&Fm(l,N,z),{placement:"top",maxHeight:Q}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return u}function _9(n){var e={bottom:"top",top:"bottom"};return n?e[n]:"bottom"}var FN=function(e){return e==="auto"?"bottom":e},x9=function(e,t){var i,r=e.placement,s=e.theme,o=s.borderRadius,a=s.spacing,l=s.colors;return st((i={label:"menu"},zh(i,_9(r),"100%"),zh(i,"position","absolute"),zh(i,"width","100%"),zh(i,"zIndex",1),i),t?{}:{backgroundColor:l.neutral0,borderRadius:o,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:a.menuGutter,marginTop:a.menuGutter})},UN=Y.createContext(null),w9=function(e){var t=e.children,i=e.minMenuHeight,r=e.maxMenuHeight,s=e.menuPlacement,o=e.menuPosition,a=e.menuShouldScrollIntoView,l=e.theme,u=Y.useContext(UN)||{},f=u.setPortalPlacement,d=Y.useRef(null),p=Y.useState(r),g=Mo(p,2),v=g[0],x=g[1],_=Y.useState(null),m=Mo(_,2),w=m[0],S=m[1],b=l.spacing.controlHeight;return VS(function(){var R=d.current;if(R){var A=o==="fixed",C=a&&!A,L=y9({maxHeight:r,menuEl:R,minHeight:i,placement:s,shouldScroll:C,isFixedPosition:A,controlHeight:b});x(L.maxHeight),S(L.placement),f==null||f(L.placement)}},[r,s,o,a,i,f,b]),t({ref:d,placerProps:st(st({},e),{},{placement:w||FN(s),maxHeight:v})})},S9=function(e){var t=e.children,i=e.innerRef,r=e.innerProps;return nt("div",ct({},Cn(e,"menu",{menu:!0}),{ref:i},r),t)},M9=S9,E9=function(e,t){var i=e.maxHeight,r=e.theme.spacing.baseUnit;return st({maxHeight:i,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:r,paddingTop:r})},b9=function(e){var t=e.children,i=e.innerProps,r=e.innerRef,s=e.isMulti;return nt("div",ct({},Cn(e,"menuList",{"menu-list":!0,"menu-list--is-multi":s}),{ref:r},i),t)},zN=function(e,t){var i=e.theme,r=i.spacing.baseUnit,s=i.colors;return st({textAlign:"center"},t?{}:{color:s.neutral40,padding:"".concat(r*2,"px ").concat(r*3,"px")})},T9=zN,A9=zN,C9=function(e){var t=e.children,i=t===void 0?"No options":t,r=e.innerProps,s=Do(e,g9);return nt("div",ct({},Cn(st(st({},s),{},{children:i,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),i)},R9=function(e){var t=e.children,i=t===void 0?"Loading...":t,r=e.innerProps,s=Do(e,v9);return nt("div",ct({},Cn(st(st({},s),{},{children:i,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),i)},P9=function(e){var t=e.rect,i=e.offset,r=e.position;return{left:t.left,position:r,top:i,width:t.width,zIndex:1}},I9=function(e){var t=e.appendTo,i=e.children,r=e.controlElement,s=e.innerProps,o=e.menuPlacement,a=e.menuPosition,l=Y.useRef(null),u=Y.useRef(null),f=Y.useState(FN(o)),d=Mo(f,2),p=d[0],g=d[1],v=Y.useMemo(function(){return{setPortalPlacement:g}},[]),x=Y.useState(null),_=Mo(x,2),m=_[0],w=_[1],S=Y.useCallback(function(){if(r){var C=u9(r),L=a==="fixed"?0:window.pageYOffset,I=C[p]+L;(I!==(m==null?void 0:m.offset)||C.left!==(m==null?void 0:m.rect.left)||C.width!==(m==null?void 0:m.rect.width))&&w({offset:I,rect:C})}},[r,a,p,m==null?void 0:m.offset,m==null?void 0:m.rect.left,m==null?void 0:m.rect.width]);VS(function(){S()},[S]);var b=Y.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),r&&l.current&&(u.current=n9(r,l.current,S,{elementResize:"ResizeObserver"in window}))},[r,S]);VS(function(){b()},[b]);var R=Y.useCallback(function(C){l.current=C,b()},[b]);if(!t&&a!=="fixed"||!m)return null;var A=nt("div",ct({ref:R},Cn(st(st({},e),{},{offset:m.offset,position:a,rect:m.rect}),"menuPortal",{"menu-portal":!0}),s),i);return nt(UN.Provider,{value:v},t?EI.createPortal(A,t):A)},L9=function(e){var t=e.isDisabled,i=e.isRtl;return{label:"container",direction:i?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},N9=function(e){var t=e.children,i=e.innerProps,r=e.isDisabled,s=e.isRtl;return nt("div",ct({},Cn(e,"container",{"--is-disabled":r,"--is-rtl":s}),i),t)},D9=function(e,t){var i=e.theme.spacing,r=e.isMulti,s=e.hasValue,o=e.selectProps.controlShouldRenderValue;return st({alignItems:"center",display:r&&s&&o?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(i.baseUnit/2,"px ").concat(i.baseUnit*2,"px")})},O9=function(e){var t=e.children,i=e.innerProps,r=e.isMulti,s=e.hasValue;return nt("div",ct({},Cn(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":s}),i),t)},k9=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},F9=function(e){var t=e.children,i=e.innerProps;return nt("div",ct({},Cn(e,"indicatorsContainer",{indicators:!0}),i),t)},wR,U9=["size"],z9=["innerProps","isRtl","size"],B9={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},BN=function(e){var t=e.size,i=Do(e,U9);return nt("svg",ct({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:B9},i))},sE=function(e){return nt(BN,ct({size:20},e),nt("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},VN=function(e){return nt(BN,ct({size:20},e),nt("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},HN=function(e,t){var i=e.isFocused,r=e.theme,s=r.spacing.baseUnit,o=r.colors;return st({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:i?o.neutral60:o.neutral20,padding:s*2,":hover":{color:i?o.neutral80:o.neutral40}})},V9=HN,H9=function(e){var t=e.children,i=e.innerProps;return nt("div",ct({},Cn(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),i),t||nt(VN,null))},G9=HN,W9=function(e){var t=e.children,i=e.innerProps;return nt("div",ct({},Cn(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),i),t||nt(sE,null))},j9=function(e,t){var i=e.isDisabled,r=e.theme,s=r.spacing.baseUnit,o=r.colors;return st({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:i?o.neutral10:o.neutral20,marginBottom:s*2,marginTop:s*2})},X9=function(e){var t=e.innerProps;return nt("span",ct({},t,Cn(e,"indicatorSeparator",{"indicator-separator":!0})))},$9=H8(wR||(wR=G8([` 0%, 80%, 100% { opacity: 0; } 40% { opacity: 1; } -`]))),q9=function(e,t){var i=e.isFocused,r=e.size,s=e.theme,o=s.colors,a=s.spacing.baseUnit;return st({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},t?{}:{color:i?o.neutral60:o.neutral20,padding:a*2})},zx=function(e){var t=e.delay,i=e.offset;return nt("span",{css:tE({animation:"".concat($9," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:i?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},Y9=function(e){var t=e.innerProps,i=e.isRtl,r=e.size,s=r===void 0?4:r,o=Do(e,z9);return nt("div",ct({},Cn(st(st({},o),{},{innerProps:t,isRtl:i,size:s}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),nt(zx,{delay:0,offset:i}),nt(zx,{delay:160,offset:!0}),nt(zx,{delay:320,offset:!i}))},Z9=function(e,t){var i=e.isDisabled,r=e.isFocused,s=e.theme,o=s.colors,a=s.borderRadius,l=s.spacing;return st({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:i?o.neutral5:o.neutral0,borderColor:i?o.neutral10:r?o.primary:o.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:r?o.primary:o.neutral30}})},K9=function(e){var t=e.children,i=e.isDisabled,r=e.isFocused,s=e.innerRef,o=e.innerProps,a=e.menuIsOpen;return nt("div",ct({ref:s},Cn(e,"control",{control:!0,"control--is-disabled":i,"control--is-focused":r,"control--menu-is-open":a}),o,{"aria-disabled":i||void 0}),t)},J9=K9,Q9=["data"],ej=function(e,t){var i=e.theme.spacing;return t?{}:{paddingBottom:i.baseUnit*2,paddingTop:i.baseUnit*2}},tj=function(e){var t=e.children,i=e.cx,r=e.getStyles,s=e.getClassNames,o=e.Heading,a=e.headingProps,l=e.innerProps,u=e.label,f=e.theme,d=e.selectProps;return nt("div",ct({},Cn(e,"group",{group:!0}),l),nt(o,ct({},a,{selectProps:d,theme:f,getStyles:r,getClassNames:s,cx:i}),u),nt("div",null,t))},nj=function(e,t){var i=e.theme,r=i.colors,s=i.spacing;return st({label:"group",cursor:"default",display:"block"},t?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:s.baseUnit*3,paddingRight:s.baseUnit*3,textTransform:"uppercase"})},ij=function(e){var t=DN(e);t.data;var i=Do(t,Q9);return nt("div",ct({},Cn(e,"groupHeading",{"group-heading":!0}),i))},rj=tj,sj=["innerRef","isDisabled","isHidden","inputClassName"],oj=function(e,t){var i=e.isDisabled,r=e.value,s=e.theme,o=s.spacing,a=s.colors;return st(st({visibility:i?"hidden":"visible",transform:r?"translateZ(0)":""},aj),t?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:a.neutral80})},GN={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},aj={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":st({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},GN)},lj=function(e){return st({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},GN)},uj=function(e){var t=e.cx,i=e.value,r=DN(e),s=r.innerRef,o=r.isDisabled,a=r.isHidden,l=r.inputClassName,u=Do(r,sj);return nt("div",ct({},Cn(e,"input",{"input-container":!0}),{"data-value":i||""}),nt("input",ct({className:t({input:!0},l),ref:s,style:lj(a),disabled:o},u)))},cj=uj,hj=function(e,t){var i=e.theme,r=i.spacing,s=i.borderRadius,o=i.colors;return st({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:o.neutral10,borderRadius:s/2,margin:r.baseUnit/2})},fj=function(e,t){var i=e.theme,r=i.borderRadius,s=i.colors,o=e.cropWithEllipsis;return st({overflow:"hidden",textOverflow:o||o===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:r/2,color:s.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},dj=function(e,t){var i=e.theme,r=i.spacing,s=i.borderRadius,o=i.colors,a=e.isFocused;return st({alignItems:"center",display:"flex"},t?{}:{borderRadius:s/2,backgroundColor:a?o.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}})},WN=function(e){var t=e.children,i=e.innerProps;return nt("div",i,t)},pj=WN,mj=WN;function gj(n){var e=n.children,t=n.innerProps;return nt("div",ct({role:"button"},t),e||nt(sE,{size:14}))}var vj=function(e){var t=e.children,i=e.components,r=e.data,s=e.innerProps,o=e.isDisabled,a=e.removeProps,l=e.selectProps,u=i.Container,f=i.Label,d=i.Remove;return nt(u,{data:r,innerProps:st(st({},Cn(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":o})),s),selectProps:l},nt(f,{data:r,innerProps:st({},Cn(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},t),nt(d,{data:r,innerProps:st(st({},Cn(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},a),selectProps:l}))},yj=vj,_j=function(e,t){var i=e.isDisabled,r=e.isFocused,s=e.isSelected,o=e.theme,a=o.spacing,l=o.colors;return st({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:s?l.primary:r?l.primary25:"transparent",color:i?l.neutral20:s?l.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:i?void 0:s?l.primary:l.primary50}})},xj=function(e){var t=e.children,i=e.isDisabled,r=e.isFocused,s=e.isSelected,o=e.innerRef,a=e.innerProps;return nt("div",ct({},Cn(e,"option",{option:!0,"option--is-disabled":i,"option--is-focused":r,"option--is-selected":s}),{ref:o,"aria-disabled":i},a),t)},wj=xj,Sj=function(e,t){var i=e.theme,r=i.spacing,s=i.colors;return st({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:s.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},Mj=function(e){var t=e.children,i=e.innerProps;return nt("div",ct({},Cn(e,"placeholder",{placeholder:!0}),i),t)},Ej=Mj,bj=function(e,t){var i=e.isDisabled,r=e.theme,s=r.spacing,o=r.colors;return st({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:i?o.neutral40:o.neutral80,marginLeft:s.baseUnit/2,marginRight:s.baseUnit/2})},Tj=function(e){var t=e.children,i=e.isDisabled,r=e.innerProps;return nt("div",ct({},Cn(e,"singleValue",{"single-value":!0,"single-value--is-disabled":i}),r),t)},Aj=Tj,Cj={ClearIndicator:W9,Control:J9,DropdownIndicator:H9,DownChevron:VN,CrossIcon:sE,Group:rj,GroupHeading:ij,IndicatorsContainer:F9,IndicatorSeparator:X9,Input:cj,LoadingIndicator:Y9,Menu:M9,MenuList:b9,MenuPortal:I9,LoadingMessage:R9,NoOptionsMessage:C9,MultiValue:yj,MultiValueContainer:pj,MultiValueLabel:mj,MultiValueRemove:gj,Option:wj,Placeholder:Ej,SelectContainer:N9,SingleValue:Aj,ValueContainer:O9},Rj=function(e){return st(st({},Cj),e.components)},SR=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function Pj(n,e){return!!(n===e||SR(n)&&SR(e))}function Ij(n,e){if(n.length!==e.length)return!1;for(var t=0;t1?"s":""," ").concat(s.join(","),", selected.");case"select-option":return o?"option ".concat(r," is disabled. Select another option."):"option ".concat(r,", selected.");default:return""}},onFocus:function(e){var t=e.context,i=e.focused,r=e.options,s=e.label,o=s===void 0?"":s,a=e.selectValue,l=e.isDisabled,u=e.isSelected,f=e.isAppleDevice,d=function(x,_){return x&&x.length?"".concat(x.indexOf(_)+1," of ").concat(x.length):""};if(t==="value"&&a)return"value ".concat(o," focused, ").concat(d(a,i),".");if(t==="menu"&&f){var p=l?" disabled":"",g="".concat(u?" selected":"").concat(p);return"".concat(o).concat(g,", ").concat(d(r,i),".")}return""},onFilter:function(e){var t=e.inputValue,i=e.resultsMessage;return"".concat(i).concat(t?" for search term "+t:"",".")}},kj=function(e){var t=e.ariaSelection,i=e.focusedOption,r=e.focusedValue,s=e.focusableOptions,o=e.isFocused,a=e.selectValue,l=e.selectProps,u=e.id,f=e.isAppleDevice,d=l.ariaLiveMessages,p=l.getOptionLabel,g=l.inputValue,v=l.isMulti,x=l.isOptionDisabled,_=l.isSearchable,m=l.menuIsOpen,w=l.options,S=l.screenReaderStatus,b=l.tabSelectsValue,R=l.isLoading,A=l["aria-label"],C=l["aria-live"],L=Y.useMemo(function(){return st(st({},Oj),d||{})},[d]),I=Y.useMemo(function(){var j="";if(t&&L.onChange){var Q=t.option,oe=t.options,k=t.removedValue,W=t.removedValues,G=t.value,ne=function(Qe){return Array.isArray(Qe)?null:Qe},me=k||Q||ne(G),_e=me?p(me):"",J=oe||W||void 0,pe=J?J.map(p):[],Me=st({isDisabled:me&&x(me,a),label:_e,labels:pe},t);j=L.onChange(Me)}return j},[t,L,x,a,p]),E=Y.useMemo(function(){var j="",Q=i||r,oe=!!(i&&a&&a.includes(i));if(Q&&L.onFocus){var k={focused:Q,label:p(Q),isDisabled:x(Q,a),isSelected:oe,options:s,context:Q===i?"menu":"value",selectValue:a,isAppleDevice:f};j=L.onFocus(k)}return j},[i,r,p,x,L,s,a,f]),N=Y.useMemo(function(){var j="";if(m&&w.length&&!R&&L.onFilter){var Q=S({count:s.length});j=L.onFilter({inputValue:g,resultsMessage:Q})}return j},[s,g,m,L,w,S,R]),z=(t==null?void 0:t.action)==="initial-input-focus",O=Y.useMemo(function(){var j="";if(L.guidance){var Q=r?"value":m?"menu":"input";j=L.guidance({"aria-label":A,context:Q,isDisabled:i&&x(i,a),isMulti:v,isSearchable:_,tabSelectsValue:b,isInitialFocus:z})}return j},[A,i,r,v,x,_,m,L,a,b,z]),q=nt(Y.Fragment,null,nt("span",{id:"aria-selection"},I),nt("span",{id:"aria-focused"},E),nt("span",{id:"aria-results"},N),nt("span",{id:"aria-guidance"},O));return nt(Y.Fragment,null,nt(MR,{id:u},z&&q),nt(MR,{"aria-live":C,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},o&&!z&&q))},Fj=kj,HS=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],Uj=new RegExp("["+HS.map(function(n){return n.letters}).join("")+"]","g"),jN={};for(var Bx=0;Bx-1}},Hj=["innerRef"];function Gj(n){var e=n.innerRef,t=Do(n,Hj),i=m9(t,"onExited","in","enter","exit","appear");return nt("input",ct({ref:e},i,{css:tE({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var Wj=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function jj(n){var e=n.isEnabled,t=n.onBottomArrive,i=n.onBottomLeave,r=n.onTopArrive,s=n.onTopLeave,o=Y.useRef(!1),a=Y.useRef(!1),l=Y.useRef(0),u=Y.useRef(null),f=Y.useCallback(function(_,m){if(u.current!==null){var w=u.current,S=w.scrollTop,b=w.scrollHeight,R=w.clientHeight,A=u.current,C=m>0,L=b-R-S,I=!1;L>m&&o.current&&(i&&i(_),o.current=!1),C&&a.current&&(s&&s(_),a.current=!1),C&&m>L?(t&&!o.current&&t(_),A.scrollTop=b,I=!0,o.current=!0):!C&&-m>S&&(r&&!a.current&&r(_),A.scrollTop=0,I=!0,a.current=!0),I&&Wj(_)}},[t,i,r,s]),d=Y.useCallback(function(_){f(_,_.deltaY)},[f]),p=Y.useCallback(function(_){l.current=_.changedTouches[0].clientY},[]),g=Y.useCallback(function(_){var m=l.current-_.changedTouches[0].clientY;f(_,m)},[f]),v=Y.useCallback(function(_){if(_){var m=f9?{passive:!1}:!1;_.addEventListener("wheel",d,m),_.addEventListener("touchstart",p,m),_.addEventListener("touchmove",g,m)}},[g,p,d]),x=Y.useCallback(function(_){_&&(_.removeEventListener("wheel",d,!1),_.removeEventListener("touchstart",p,!1),_.removeEventListener("touchmove",g,!1))},[g,p,d]);return Y.useEffect(function(){if(e){var _=u.current;return v(_),function(){x(_)}}},[e,v,x]),function(_){u.current=_}}var bR=["boxSizing","height","overflow","paddingRight","position"],TR={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function AR(n){n.preventDefault()}function CR(n){n.stopPropagation()}function RR(){var n=this.scrollTop,e=this.scrollHeight,t=n+this.offsetHeight;n===0?this.scrollTop=1:t===e&&(this.scrollTop=n-1)}function PR(){return"ontouchstart"in window||navigator.maxTouchPoints}var IR=!!(typeof window<"u"&&window.document&&window.document.createElement),Ih=0,Au={capture:!1,passive:!1};function Xj(n){var e=n.isEnabled,t=n.accountForScrollbars,i=t===void 0?!0:t,r=Y.useRef({}),s=Y.useRef(null),o=Y.useCallback(function(l){if(IR){var u=document.body,f=u&&u.style;if(i&&bR.forEach(function(v){var x=f&&f[v];r.current[v]=x}),i&&Ih<1){var d=parseInt(r.current.paddingRight,10)||0,p=document.body?document.body.clientWidth:0,g=window.innerWidth-p+d||0;Object.keys(TR).forEach(function(v){var x=TR[v];f&&(f[v]=x)}),f&&(f.paddingRight="".concat(g,"px"))}u&&PR()&&(u.addEventListener("touchmove",AR,Au),l&&(l.addEventListener("touchstart",RR,Au),l.addEventListener("touchmove",CR,Au))),Ih+=1}},[i]),a=Y.useCallback(function(l){if(IR){var u=document.body,f=u&&u.style;Ih=Math.max(Ih-1,0),i&&Ih<1&&bR.forEach(function(d){var p=r.current[d];f&&(f[d]=p)}),u&&PR()&&(u.removeEventListener("touchmove",AR,Au),l&&(l.removeEventListener("touchstart",RR,Au),l.removeEventListener("touchmove",CR,Au)))}},[i]);return Y.useEffect(function(){if(e){var l=s.current;return o(l),function(){a(l)}}},[e,o,a]),function(l){s.current=l}}var $j=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},qj={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function Yj(n){var e=n.children,t=n.lockEnabled,i=n.captureEnabled,r=i===void 0?!0:i,s=n.onBottomArrive,o=n.onBottomLeave,a=n.onTopArrive,l=n.onTopLeave,u=jj({isEnabled:r,onBottomArrive:s,onBottomLeave:o,onTopArrive:a,onTopLeave:l}),f=Xj({isEnabled:t}),d=function(g){u(g),f(g)};return nt(Y.Fragment,null,t&&nt("div",{onClick:$j,css:qj}),e(d))}var Zj={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Kj=function(e){var t=e.name,i=e.onFocus;return nt("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:i,css:Zj,value:"",onChange:function(){}})},Jj=Kj;function oE(n){var e;return typeof window<"u"&&window.navigator!=null?n.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function Qj(){return oE(/^iPhone/i)}function $N(){return oE(/^Mac/i)}function e7(){return oE(/^iPad/i)||$N()&&navigator.maxTouchPoints>1}function t7(){return Qj()||e7()}function n7(){return $N()||t7()}var i7=function(e){return e.label},r7=function(e){return e.label},s7=function(e){return e.value},o7=function(e){return!!e.isDisabled},a7={clearIndicator:G9,container:L9,control:Z9,dropdownIndicator:V9,group:ej,groupHeading:nj,indicatorsContainer:k9,indicatorSeparator:j9,input:oj,loadingIndicator:q9,loadingMessage:A9,menu:x9,menuList:E9,menuPortal:P9,multiValue:hj,multiValueLabel:fj,multiValueRemove:dj,noOptionsMessage:T9,option:_j,placeholder:Sj,singleValue:bj,valueContainer:D9},l7={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},u7=4,qN=4,c7=38,h7=qN*2,f7={baseUnit:qN,controlHeight:c7,menuGutter:h7},Gx={borderRadius:u7,colors:l7,spacing:f7},d7={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:xR(),captureMenuScroll:!xR(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Vj(),formatGroupLabel:i7,getOptionLabel:r7,getOptionValue:s7,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:o7,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!c9(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(t!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function LR(n,e,t,i){var r=KN(n,e,t),s=JN(n,e,t),o=ZN(n,e),a=_v(n,e);return{type:"option",data:e,isDisabled:r,isSelected:s,label:o,value:a,index:i}}function yg(n,e){return n.options.map(function(t,i){if("options"in t){var r=t.options.map(function(o,a){return LR(n,o,e,a)}).filter(function(o){return DR(n,o)});return r.length>0?{type:"group",data:t,options:r,index:i}:void 0}var s=LR(n,t,e,i);return DR(n,s)?s:void 0}).filter(d9)}function YN(n){return n.reduce(function(e,t){return t.type==="group"?e.push.apply(e,$M(t.options.map(function(i){return i.data}))):e.push(t.data),e},[])}function NR(n,e){return n.reduce(function(t,i){return i.type==="group"?t.push.apply(t,$M(i.options.map(function(r){return{data:r.data,id:"".concat(e,"-").concat(i.index,"-").concat(r.index)}}))):t.push({data:i.data,id:"".concat(e,"-").concat(i.index)}),t},[])}function p7(n,e){return YN(yg(n,e))}function DR(n,e){var t=n.inputValue,i=t===void 0?"":t,r=e.data,s=e.isSelected,o=e.label,a=e.value;return(!eD(n)||!s)&&QN(n,{label:o,value:a,data:r},i)}function m7(n,e){var t=n.focusedValue,i=n.selectValue,r=i.indexOf(t);if(r>-1){var s=e.indexOf(t);if(s>-1)return t;if(r-1?t:e[0]}var Wx=function(e,t){var i,r=(i=e.find(function(s){return s.data===t}))===null||i===void 0?void 0:i.id;return r||null},ZN=function(e,t){return e.getOptionLabel(t)},_v=function(e,t){return e.getOptionValue(t)};function KN(n,e,t){return typeof n.isOptionDisabled=="function"?n.isOptionDisabled(e,t):!1}function JN(n,e,t){if(t.indexOf(e)>-1)return!0;if(typeof n.isOptionSelected=="function")return n.isOptionSelected(e,t);var i=_v(n,e);return t.some(function(r){return _v(n,r)===i})}function QN(n,e,t){return n.filterOption?n.filterOption(e,t):!0}var eD=function(e){var t=e.hideSelectedOptions,i=e.isMulti;return t===void 0?i:t},v7=1,tD=function(n){D8(t,n);var e=F8(t);function t(i){var r;if(L8(this,t),r=e.call(this,i),r.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.isAppleDevice=n7(),r.controlRef=null,r.getControlRef=function(l){r.controlRef=l},r.focusedOptionRef=null,r.getFocusedOptionRef=function(l){r.focusedOptionRef=l},r.menuListRef=null,r.getMenuListRef=function(l){r.menuListRef=l},r.inputRef=null,r.getInputRef=function(l){r.inputRef=l},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(l,u){var f=r.props,d=f.onChange,p=f.name;u.name=p,r.ariaOnChange(l,u),d(l,u)},r.setValue=function(l,u,f){var d=r.props,p=d.closeMenuOnSelect,g=d.isMulti,v=d.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:v}),p&&(r.setState({inputIsHiddenAfterUpdate:!g}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(l,{action:u,option:f})},r.selectOption=function(l){var u=r.props,f=u.blurInputOnSelect,d=u.isMulti,p=u.name,g=r.state.selectValue,v=d&&r.isOptionSelected(l,g),x=r.isOptionDisabled(l,g);if(v){var _=r.getOptionValue(l);r.setValue(g.filter(function(m){return r.getOptionValue(m)!==_}),"deselect-option",l)}else if(!x)d?r.setValue([].concat($M(g),[l]),"select-option",l):r.setValue(l,"select-option");else{r.ariaOnChange(l,{action:"select-option",option:l,name:p});return}f&&r.blurInput()},r.removeValue=function(l){var u=r.props.isMulti,f=r.state.selectValue,d=r.getOptionValue(l),p=f.filter(function(v){return r.getOptionValue(v)!==d}),g=zm(u,p,p[0]||null);r.onChange(g,{action:"remove-value",removedValue:l}),r.focusInput()},r.clearValue=function(){var l=r.state.selectValue;r.onChange(zm(r.props.isMulti,[],null),{action:"clear",removedValues:l})},r.popValue=function(){var l=r.props.isMulti,u=r.state.selectValue,f=u[u.length-1],d=u.slice(0,u.length-1),p=zm(l,d,d[0]||null);r.onChange(p,{action:"pop-value",removedValue:f})},r.getFocusedOptionId=function(l){return Wx(r.state.focusableOptionsWithIds,l)},r.getFocusableOptionsWithIds=function(){return NR(yg(r.props,r.state.selectValue),r.getElementId("option"))},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var l=arguments.length,u=new Array(l),f=0;fg||p>g}},r.onTouchEnd=function(l){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(l.target)&&r.menuListRef&&!r.menuListRef.contains(l.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(l){r.userIsDragging||r.onControlMouseDown(l)},r.onClearIndicatorTouchEnd=function(l){r.userIsDragging||r.onClearIndicatorMouseDown(l)},r.onDropdownIndicatorTouchEnd=function(l){r.userIsDragging||r.onDropdownIndicatorMouseDown(l)},r.handleInputChange=function(l){var u=r.props.inputValue,f=l.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(f,{action:"input-change",prevInputValue:u}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(l){r.props.onFocus&&r.props.onFocus(l),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(l){var u=r.props.inputValue;if(r.menuListRef&&r.menuListRef.contains(document.activeElement)){r.inputRef.focus();return}r.props.onBlur&&r.props.onBlur(l),r.onInputChange("",{action:"input-blur",prevInputValue:u}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1})},r.onOptionHover=function(l){if(!(r.blockOptionHover||r.state.focusedOption===l)){var u=r.getFocusableOptions(),f=u.indexOf(l);r.setState({focusedOption:l,focusedOptionId:f>-1?r.getFocusedOptionId(l):null})}},r.shouldHideSelectedOptions=function(){return eD(r.props)},r.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),r.focus()},r.onKeyDown=function(l){var u=r.props,f=u.isMulti,d=u.backspaceRemovesValue,p=u.escapeClearsValue,g=u.inputValue,v=u.isClearable,x=u.isDisabled,_=u.menuIsOpen,m=u.onKeyDown,w=u.tabSelectsValue,S=u.openMenuOnFocus,b=r.state,R=b.focusedOption,A=b.focusedValue,C=b.selectValue;if(!x&&!(typeof m=="function"&&(m(l),l.defaultPrevented))){switch(r.blockOptionHover=!0,l.key){case"ArrowLeft":if(!f||g)return;r.focusValue("previous");break;case"ArrowRight":if(!f||g)return;r.focusValue("next");break;case"Delete":case"Backspace":if(g)return;if(A)r.removeValue(A);else{if(!d)return;f?r.popValue():v&&r.clearValue()}break;case"Tab":if(r.isComposing||l.shiftKey||!_||!w||!R||S&&r.isOptionSelected(R,C))return;r.selectOption(R);break;case"Enter":if(l.keyCode===229)break;if(_){if(!R||r.isComposing)return;r.selectOption(R);break}return;case"Escape":_?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:g}),r.onMenuClose()):v&&p&&r.clearValue();break;case" ":if(g)return;if(!_){r.openMenu("first");break}if(!R)return;r.selectOption(R);break;case"ArrowUp":_?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":_?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!_)return;r.focusOption("pageup");break;case"PageDown":if(!_)return;r.focusOption("pagedown");break;case"Home":if(!_)return;r.focusOption("first");break;case"End":if(!_)return;r.focusOption("last");break;default:return}l.preventDefault()}},r.state.instancePrefix="react-select-"+(r.props.instanceId||++v7),r.state.selectValue=yR(i.value),i.menuIsOpen&&r.state.selectValue.length){var s=r.getFocusableOptionsWithIds(),o=r.buildFocusableOptions(),a=o.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=s,r.state.focusedOption=o[a],r.state.focusedOptionId=Wx(s,o[a])}return r}return N8(t,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&_R(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(r){var s=this.props,o=s.isDisabled,a=s.menuIsOpen,l=this.state.isFocused;(l&&!o&&r.isDisabled||l&&a&&!r.menuIsOpen)&&this.focusInput(),l&&o&&!r.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!o&&r.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(_R(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(r,s){this.props.onInputChange(r,s)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(r){var s=this,o=this.state,a=o.selectValue,l=o.isFocused,u=this.buildFocusableOptions(),f=r==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(a[0]);d>-1&&(f=d)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[f],focusedOptionId:this.getFocusedOptionId(u[f])},function(){return s.onMenuOpen()})}},{key:"focusValue",value:function(r){var s=this.state,o=s.selectValue,a=s.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=o.indexOf(a);a||(l=-1);var u=o.length-1,f=-1;if(o.length){switch(r){case"previous":l===0?f=0:l===-1?f=u:f=l-1;break;case"next":l>-1&&l0&&arguments[0]!==void 0?arguments[0]:"first",s=this.props.pageSize,o=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var l=0,u=a.indexOf(o);o||(u=-1),r==="up"?l=u>0?u-1:a.length-1:r==="down"?l=(u+1)%a.length:r==="pageup"?(l=u-s,l<0&&(l=0)):r==="pagedown"?(l=u+s,l>a.length-1&&(l=a.length-1)):r==="last"&&(l=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[l])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Gx):st(st({},Gx),this.props.theme):Gx}},{key:"getCommonProps",value:function(){var r=this.clearValue,s=this.cx,o=this.getStyles,a=this.getClassNames,l=this.getValue,u=this.selectOption,f=this.setValue,d=this.props,p=d.isMulti,g=d.isRtl,v=d.options,x=this.hasValue();return{clearValue:r,cx:s,getStyles:o,getClassNames:a,getValue:l,hasValue:x,isMulti:p,isRtl:g,options:v,selectOption:u,selectProps:d,setValue:f,theme:this.getTheme()}}},{key:"hasValue",value:function(){var r=this.state.selectValue;return r.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var r=this.props,s=r.isClearable,o=r.isMulti;return s===void 0?o:s}},{key:"isOptionDisabled",value:function(r,s){return KN(this.props,r,s)}},{key:"isOptionSelected",value:function(r,s){return JN(this.props,r,s)}},{key:"filterOption",value:function(r,s){return QN(this.props,r,s)}},{key:"formatOptionLabel",value:function(r,s){if(typeof this.props.formatOptionLabel=="function"){var o=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(r,{context:s,inputValue:o,selectValue:a})}else return this.getOptionLabel(r)}},{key:"formatGroupLabel",value:function(r){return this.props.formatGroupLabel(r)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var r=this.props,s=r.isDisabled,o=r.isSearchable,a=r.inputId,l=r.inputValue,u=r.tabIndex,f=r.form,d=r.menuIsOpen,p=r.required,g=this.getComponents(),v=g.Input,x=this.state,_=x.inputIsHidden,m=x.ariaSelection,w=this.commonProps,S=a||this.getElementId("input"),b=st(st(st({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":p,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!o&&{"aria-readonly":!0}),this.hasValue()?(m==null?void 0:m.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return o?Y.createElement(v,ct({},w,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:S,innerRef:this.getInputRef,isDisabled:s,isHidden:_,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:f,type:"text",value:l},b)):Y.createElement(Gj,ct({id:S,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:vv,onFocus:this.onInputFocus,disabled:s,tabIndex:u,inputMode:"none",form:f,value:""},b))}},{key:"renderPlaceholderOrValue",value:function(){var r=this,s=this.getComponents(),o=s.MultiValue,a=s.MultiValueContainer,l=s.MultiValueLabel,u=s.MultiValueRemove,f=s.SingleValue,d=s.Placeholder,p=this.commonProps,g=this.props,v=g.controlShouldRenderValue,x=g.isDisabled,_=g.isMulti,m=g.inputValue,w=g.placeholder,S=this.state,b=S.selectValue,R=S.focusedValue,A=S.isFocused;if(!this.hasValue()||!v)return m?null:Y.createElement(d,ct({},p,{key:"placeholder",isDisabled:x,isFocused:A,innerProps:{id:this.getElementId("placeholder")}}),w);if(_)return b.map(function(L,I){var E=L===R,N="".concat(r.getOptionLabel(L),"-").concat(r.getOptionValue(L));return Y.createElement(o,ct({},p,{components:{Container:a,Label:l,Remove:u},isFocused:E,isDisabled:x,key:N,index:I,removeProps:{onClick:function(){return r.removeValue(L)},onTouchEnd:function(){return r.removeValue(L)},onMouseDown:function(O){O.preventDefault()}},data:L}),r.formatOptionLabel(L,"value"))});if(m)return null;var C=b[0];return Y.createElement(f,ct({},p,{data:C,isDisabled:x}),this.formatOptionLabel(C,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),s=r.ClearIndicator,o=this.commonProps,a=this.props,l=a.isDisabled,u=a.isLoading,f=this.state.isFocused;if(!this.isClearable()||!s||l||!this.hasValue()||u)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return Y.createElement(s,ct({},o,{innerProps:d,isFocused:f}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),s=r.LoadingIndicator,o=this.commonProps,a=this.props,l=a.isDisabled,u=a.isLoading,f=this.state.isFocused;if(!s||!u)return null;var d={"aria-hidden":"true"};return Y.createElement(s,ct({},o,{innerProps:d,isDisabled:l,isFocused:f}))}},{key:"renderIndicatorSeparator",value:function(){var r=this.getComponents(),s=r.DropdownIndicator,o=r.IndicatorSeparator;if(!s||!o)return null;var a=this.commonProps,l=this.props.isDisabled,u=this.state.isFocused;return Y.createElement(o,ct({},a,{isDisabled:l,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var r=this.getComponents(),s=r.DropdownIndicator;if(!s)return null;var o=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return Y.createElement(s,ct({},o,{innerProps:u,isDisabled:a,isFocused:l}))}},{key:"renderMenu",value:function(){var r=this,s=this.getComponents(),o=s.Group,a=s.GroupHeading,l=s.Menu,u=s.MenuList,f=s.MenuPortal,d=s.LoadingMessage,p=s.NoOptionsMessage,g=s.Option,v=this.commonProps,x=this.state.focusedOption,_=this.props,m=_.captureMenuScroll,w=_.inputValue,S=_.isLoading,b=_.loadingMessage,R=_.minMenuHeight,A=_.maxMenuHeight,C=_.menuIsOpen,L=_.menuPlacement,I=_.menuPosition,E=_.menuPortalTarget,N=_.menuShouldBlockScroll,z=_.menuShouldScrollIntoView,O=_.noOptionsMessage,q=_.onMenuScrollToTop,j=_.onMenuScrollToBottom;if(!C)return null;var Q=function(_e,J){var pe=_e.type,Me=_e.data,de=_e.isDisabled,Qe=_e.isSelected,lt=_e.label,K=_e.value,tt=x===Me,he=de?void 0:function(){return r.onOptionHover(Me)},we=de?void 0:function(){return r.selectOption(Me)},ye="".concat(r.getElementId("option"),"-").concat(J),Ce={id:ye,onClick:we,onMouseMove:he,onMouseOver:he,tabIndex:-1,role:"option","aria-selected":r.isAppleDevice?void 0:Qe};return Y.createElement(g,ct({},v,{innerProps:Ce,data:Me,isDisabled:de,isSelected:Qe,key:ye,label:lt,type:pe,value:K,isFocused:tt,innerRef:tt?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(_e.data,"menu"))},oe;if(this.hasOptions())oe=this.getCategorizedOptions().map(function(me){if(me.type==="group"){var _e=me.data,J=me.options,pe=me.index,Me="".concat(r.getElementId("group"),"-").concat(pe),de="".concat(Me,"-heading");return Y.createElement(o,ct({},v,{key:Me,data:_e,options:J,Heading:a,headingProps:{id:de,data:me.data},label:r.formatGroupLabel(me.data)}),me.options.map(function(Qe){return Q(Qe,"".concat(pe,"-").concat(Qe.index))}))}else if(me.type==="option")return Q(me,"".concat(me.index))});else if(S){var k=b({inputValue:w});if(k===null)return null;oe=Y.createElement(d,v,k)}else{var W=O({inputValue:w});if(W===null)return null;oe=Y.createElement(p,v,W)}var G={minMenuHeight:R,maxMenuHeight:A,menuPlacement:L,menuPosition:I,menuShouldScrollIntoView:z},ne=Y.createElement(w9,ct({},v,G),function(me){var _e=me.ref,J=me.placerProps,pe=J.placement,Me=J.maxHeight;return Y.createElement(l,ct({},v,G,{innerRef:_e,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove},isLoading:S,placement:pe}),Y.createElement(Yj,{captureEnabled:m,onTopArrive:q,onBottomArrive:j,lockEnabled:N},function(de){return Y.createElement(u,ct({},v,{innerRef:function(lt){r.getMenuListRef(lt),de(lt)},innerProps:{role:"listbox","aria-multiselectable":v.isMulti,id:r.getElementId("listbox")},isLoading:S,maxHeight:Me,focusedOption:x}),oe)}))});return E||I==="fixed"?Y.createElement(f,ct({},v,{appendTo:E,controlElement:this.controlRef,menuPlacement:L,menuPosition:I}),ne):ne}},{key:"renderFormField",value:function(){var r=this,s=this.props,o=s.delimiter,a=s.isDisabled,l=s.isMulti,u=s.name,f=s.required,d=this.state.selectValue;if(f&&!this.hasValue()&&!a)return Y.createElement(Jj,{name:u,onFocus:this.onValueInputFocus});if(!(!u||a))if(l)if(o){var p=d.map(function(x){return r.getOptionValue(x)}).join(o);return Y.createElement("input",{name:u,type:"hidden",value:p})}else{var g=d.length>0?d.map(function(x,_){return Y.createElement("input",{key:"i-".concat(_),name:u,type:"hidden",value:r.getOptionValue(x)})}):Y.createElement("input",{name:u,type:"hidden",value:""});return Y.createElement("div",null,g)}else{var v=d[0]?this.getOptionValue(d[0]):"";return Y.createElement("input",{name:u,type:"hidden",value:v})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,s=this.state,o=s.ariaSelection,a=s.focusedOption,l=s.focusedValue,u=s.isFocused,f=s.selectValue,d=this.getFocusableOptions();return Y.createElement(Fj,ct({},r,{id:this.getElementId("live-region"),ariaSelection:o,focusedOption:a,focusedValue:l,isFocused:u,selectValue:f,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var r=this.getComponents(),s=r.Control,o=r.IndicatorsContainer,a=r.SelectContainer,l=r.ValueContainer,u=this.props,f=u.className,d=u.id,p=u.isDisabled,g=u.menuIsOpen,v=this.state.isFocused,x=this.commonProps=this.getCommonProps();return Y.createElement(a,ct({},x,{className:f,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:p,isFocused:v}),this.renderLiveRegion(),Y.createElement(s,ct({},x,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:p,isFocused:v,menuIsOpen:g}),Y.createElement(l,ct({},x,{isDisabled:p}),this.renderPlaceholderOrValue(),this.renderInput()),Y.createElement(o,ct({},x,{isDisabled:p}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(r,s){var o=s.prevProps,a=s.clearFocusValueOnUpdate,l=s.inputIsHiddenAfterUpdate,u=s.ariaSelection,f=s.isFocused,d=s.prevWasFocused,p=s.instancePrefix,g=r.options,v=r.value,x=r.menuIsOpen,_=r.inputValue,m=r.isMulti,w=yR(v),S={};if(o&&(v!==o.value||g!==o.options||x!==o.menuIsOpen||_!==o.inputValue)){var b=x?p7(r,w):[],R=x?NR(yg(r,w),"".concat(p,"-option")):[],A=a?m7(s,w):null,C=g7(s,b),L=Wx(R,C);S={selectValue:w,focusedOption:C,focusedOptionId:L,focusableOptionsWithIds:R,focusedValue:A,clearFocusValueOnUpdate:!1}}var I=l!=null&&r!==o?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},E=u,N=f&&d;return f&&!N&&(E={value:zm(m,w,w[0]||null),options:w,action:"initial-input-focus"},N=!d),(u==null?void 0:u.action)==="initial-input-focus"&&(E=null),st(st(st({},S),I),{},{prevProps:r,ariaSelection:E,prevWasFocused:N})}}]),t}(Y.Component);tD.defaultProps=d7;var y7=Y.forwardRef(function(n,e){var t=I8(n);return Y.createElement(tD,ct({ref:e},t))}),_7=y7;const x7=({conceptCategories:n,concepts:e,setConcepts:t,onCalculateEmbeddings:i})=>{const r=s=>{s in n&&t(n[s].map((o,a)=>({label:o.label,description:o.description,color:E8(a),embeddings:[],position:[0,0,0],index:a})))};return Ge.jsxs(Ge.Fragment,{children:[Ge.jsx("h3",{style:{textAlign:"left"},children:"# Categories"}),Ge.jsx(_7,{placeholder:"pick a concept...",isSearchable:!1,options:Object.keys(n).map(s=>({value:s,label:s})),onChange:s=>r((s==null?void 0:s.value)||"")}),Ge.jsx("h2",{style:{height:"300px",overflow:"scroll"},children:e.map(s=>Ge.jsx(cN,{color:s.color,inputValue:s.label,inputId:`prompt-${s.index}`,title:s.description},`prompt-${s.index}`))}),Ge.jsx("div",{style:{textAlign:"center"},children:Ge.jsx("button",{onClick:i,children:"Represent Category"})})]})},w7=({onChangeMyConcept:n})=>Ge.jsxs(Ge.Fragment,{children:[Ge.jsx("h3",{style:{textAlign:"left"},children:"# Your Concept"}),Ge.jsx("h2",{children:Ge.jsx(cN,{color:"black",inputId:"prompt-test"})}),Ge.jsx("div",{style:{textAlign:"center"},children:Ge.jsx("button",{onClick:()=>{n(document.getElementById("prompt-test").value)},children:"Represent Concept"})})]}),S7=({text:n})=>Ge.jsx("h4",{style:{border:"1px black solid",borderRadius:"8px",width:"fit-content",padding:"8px"},children:Ge.jsx("em",{children:n})}),nD=[{label:"Pure happiness",description:'Joy - "Pure happiness." Joy is a powerful, often euphoric state of happiness that is usually caused by something exceptionally good or satisfying. It often includes feelings of contentment, satisfaction, and well-being.'},{label:"Sorrowful distress",description:'Sadness - "Sorrowful distress." This emotion is typically associated with feelings of disadvantage, loss, and helplessness. When someone is sad, they often feel down and might have a low mood that affects their day-to-day activities.'},{label:"Anxiety anticipation",description:'Fear - "Anxiety anticipation." Fear is a response to an impending threat or danger, characterized by increased alertness and preparation for physical action. It often serves a protective purpose, triggering the "fight-or-flight" response.'},{label:"Fierce irritation",description:'Anger - "Fierce irritation." Anger is an emotional response to perceived wrongs and injustice, often resulting in a desire to assert authority or independence, or a tendency to retaliate against the source of offense.'},{label:"Unexpected astonishment",description:`Surprise - "Unexpected astonishment." This emotion is a response to an unexpected event. It can be either positive or negative, depending on the nature of the surprise. It's characterized by a high level of stimulation and a need to re-evaluate one's understanding of the situation.`},{label:"Revulsion reaction",description:'Disgust - "Revulsion reaction." Disgust is a powerful aversion to something perceived as unpleasant or offensive. This emotion can be triggered by various stimuli including unpleasant tastes, sights, or moral situations.'},{label:"Scornful disdain",description:'Contempt - "Scornful disdain." Contempt is an emotion that puts someone or something considered worthless or beneath consideration. This emotion often involves moral superiority and a lack of respect.'},{label:"Confident reliance",description:'Trust - "Confident reliance." Trust is an emotion reflecting a level of comfort and firm belief in the reliability or truth of someone or something. It involves a complex mix of affective experiences with a significant history of interactions.'}],iD=[{label:"Visionary guidance",description:'Authoritative Leadership - "Visionary guidance." This style is characterized by a leader who sets clear objectives and directions but allows individuals some flexibility in how they achieve these goals. They motivate by appealing to people’s shared goals.'},{label:"Collective input",description:'Democratic Leadership - "Collective input." Leaders using this style solicit input from team members in decision-making processes, fostering collaboration and participation. This approach can boost morale and creativity by making members feel valued and involved.'},{label:"Hands-off management",description:'Laissez-faire Leadership - "Hands-off management." In this style, the leader provides little guidance to team members, who are then allowed to make decisions and solve problems on their own. This can be effective in highly skilled teams but risky in teams needing direction.'},{label:"Performance reward",description:'Transactional Leadership - "Performance reward." Leaders focusing on this style are centered on clear structures wherein specific tasks are rewarded. Performance is closely monitored and feedback is given directly related to achievements. This approach works well in environments where tasks are routine and outcomes are predictable.'},{label:"Inspiring change",description:'Transformational Leadership - "Inspiring change." These leaders focus on initiating change in organizations, staff, and themselves. They are characterized by their ability to inspire and motivate employees to exceed expectations by aligning team goals with a higher vision.'},{label:"Personal development",description:'Coaching Leadership - "Personal development." Coaching leaders focus heavily on the professional and personal development of their team members. They provide one-on-one guidance to help team members meet their individual goals, which in turn enhances their performance at work.'},{label:"Directive control",description:'Autocratic Leadership - "Directive control." This style is defined by individual control over all decisions with little input from group members. It can be effective in crises but might stifle creativity and autonomy in a standard setting.'},{label:"Supportive facilitator",description:'Servant Leadership - "Supportive facilitator." Servant leaders put the needs of their team members first and help people develop and perform as highly as possible. They lead by example and gain authority by earning trust and fostering a service-oriented environment.'}],rD=[{label:"Continuous focus",description:'Sustained Attention - "Continuous focus." This type of attention is required for activities that demand prolonged concentration, such as studying for an exam or driving a long distance. It involves maintaining focus on a task over an extended period without becoming distracted.'},{label:"Targeted filtering",description:'Selective Attention - "Targeted filtering." Selective attention involves focusing on one specific aspect of the environment while ignoring other stimuli. For example, listening to a friend talk in a noisy room requires the ability to filter out the background noise.'},{label:"Switching focus",description:'Alternating Attention - "Switching focus." This type of attention allows an individual to shift focus between tasks that require different cognitive demands. For instance, alternating between writing a report and responding to emails.'},{label:"Multitasking efficiency",description:'Divided Attention - "Multitasking efficiency." Divided attention refers to the ability to process two or more responses or react to multiple tasks at the same time, such as cooking while watching TV.'},{label:"Complex management",description:'Executive Attention - "Complex management." This involves high-level thought, decision-making, and the management of attention resources among several tasks or priorities, such as planning a project while considering multiple variables.'},{label:"Involuntary awareness",description:'Passive Attention - "Involuntary awareness." Passive attention is drawn to stimuli without any conscious effort, often triggered by something surprising or significant, such as the sudden sound of a loud crash.'},{label:"Minimal engagement",description:'Bored Attention - "Minimal engagement." This is a form of attention where the focus is maintained nominally, often under unstimulating conditions. It’s the kind of attention you might use during a dull lecture or a repetitive task.'},{label:"Intense concentration",description:'Hyperfocus - "Intense concentration." This is an extreme form of mental concentration or visualization that focuses consciousness on a subject, topic, or task. In hyperfocus, one can become so absorbed in the task that they become oblivious to everything else around them, often found in highly engaging activities like playing video games or during a creative burst.'}],sD=[{label:"Persistent sadness",description:'Major Depression - "Persistent sadness." This mood disorder is characterized by a persistent feeling of sadness and a lack of interest in external stimuli. Symptoms can also include changes in sleep, appetite, energy level, concentration, daily behavior, or self-esteem.'},{label:"Constant worry",description:'Generalized Anxiety Disorder (GAD) - "Constant worry." GAD involves excessive, uncontrollable worry about everyday issues, such as health, money, or career. This worry is disproportionate to the actual source of concern and can affect physical health.'},{label:"Mood extremes",description:`Bipolar Disorder - "Mood extremes." This condition is marked by dramatic shifts in a person's mood, energy and ability to think clearly. These mood swings can range from highs (mania) to lows (depression), sometimes with periods of normal mood in between.`},{label:"Altered perceptions",description:'Schizophrenia - "Altered perceptions." Schizophrenia is a complex, long-term medical illness, characterized by symptoms like hallucinations, delusions, and extremely disordered thinking and behavior that impairs daily functioning.'},{label:"Compulsive behavior",description:'Obsessive-Compulsive Disorder (OCD) - "Compulsive behavior." OCD is characterized by unreasonable thoughts and fears (obsessions) that lead to compulsive behaviors. This disorder often centers on themes such as fear of germs or the need to arrange objects in a specific manner.'},{label:"Trauma aftermath",description:'Post-Traumatic Stress Disorder (PTSD) - "Trauma aftermath." PTSD can occur after a person has experienced or witnessed a traumatic event such as a natural disaster, a serious accident, a terrorist act, war/combat, rape, or other violent personal assault.'},{label:"Emotional instability",description:'Borderline Personality Disorder (BPD) - "Emotional instability." BPD is characterized by difficulties in regulating emotion. This can lead to severe, unstable mood swings, impulsivity and instability, poor self-image, and tumultuous personal relationships.'},{label:"Focus deficiency",description:'Attention Deficit Hyperactivity Disorder (ADHD) - "Focus deficiency." ADHD is characterized by a continuous pattern of inattention and/or hyperactivity-impulsivity that interferes with functioning or development. It often presents problems with organizing tasks, staying focused on one task, and social interaction.'}],oD=[{label:"Equitable entitlements",description:'Social Rights - "Equitable entitlements." This involves advocating and ensuring that all individuals have equal access to basic rights and liberties, such as education, healthcare, and fair treatment under the law.'},{label:"Eco-conscious actions",description:`Environmental Care - "Eco-conscious actions." Environmental responsibility emphasizes the protection and improvement of the planet's ecosystems. This includes efforts to reduce pollution, conserve resources, and uphold biodiversity.`},{label:"Wealth distribution",description:'Economic Equality - "Wealth distribution." This type of social responsibility focuses on reducing the disparities in economic opportunity and wealth among different groups within society, aiming to achieve a more equitable economic landscape.'},{label:"Ethical management",description:'Corporate Governance - "Ethical management." This pertains to the way in which companies are directed and controlled, ensuring they operate with fairness, transparency, and accountability to their stakeholders.'},{label:"Local engagement",description:'Community Involvement - "Local engagement." This emphasizes the importance of businesses and individuals participating in community development and support, such as local volunteering, support for community projects, and enhancement of local facilities.'},{label:"Diversity acceptance",description:'Cultural Awareness - "Diversity acceptance." Cultural responsibility involves recognizing, respecting, and preserving the various cultures within a community or society, promoting diversity and inclusion.'},{label:"Promoting well-being",description:'Health and Wellness - "Promoting well-being." This focuses on improving health outcomes for all members of society by advocating for better health services, education, and preventive measures to ensure public health and safety.'},{label:"Responsible purchasing",description:'Ethical Consumption - "Responsible purchasing." This involves making purchasing decisions that are conscious of the environmental and social impacts of products and services, supporting fair trade and ethically produced goods.'}],aD=[{label:"Bodily harm",description:'Physical Abuse - "Bodily harm." This form involves any intentional act causing injury or trauma to another person through physical contact. It includes hitting, punching, slapping, and other forms of physical assault.'},{label:"Psychological harm",description:'Emotional Abuse - "Psychological harm." Emotional or psychological abuse involves exposing someone to behavior that may result in psychological trauma, including anxiety, chronic depression, or post-traumatic stress disorder. It typically involves verbal assault, humiliation, intimidation, or infantilization.'},{label:"Violated consent",description:'Sexual Abuse - "Violated consent." This type of abuse involves forcing undesired sexual behavior by one person upon another. It ranges from non-consensual touching and coercive sexual acts to any sexual contact with someone unable to give consent.'},{label:"Economic control",description:`Financial Abuse - "Economic control." Financial or economic abuse involves controlling a person's ability to acquire, use, and maintain financial resources. Victims are often restricted from accessing funds or are stolen from directly, which diminishes their capacity to support themselves and forces dependency.`},{label:"Care deprivation",description:'Neglect - "Care deprivation." Neglect is a form of abuse where the caregiver fails to provide adequate care in terms of food, shelter, health care, and clothing to someone who cannot care for themselves, often resulting in deteriorating health or wellbeing.'},{label:"Destructive words",description:`Verbal Abuse - "Destructive words." This encompasses any use of language that is demeaning, derogatory, or insulting, intended to undermine the self-esteem of the person it's directed towards. It can be loud or subtle, including threats, insults, or excessively critical comments.`},{label:"Faith manipulation",description:'Spiritual Abuse - "Faith manipulation." This involves using a person’s spiritual beliefs to manipulate, control, or dominate them. It can include misusing doctrine, applying undue pressure to conform to specific beliefs, or exploiting spiritual authority for personal gain.'},{label:"Digital harassment",description:'Cyber Abuse - "Digital harassment." Cyber abuse takes place online and includes cyberbullying, stalking, and harassment. It uses digital technology to intimidate, threaten, or upset someone, often anonymously and repetitively.'}],lD=[{label:"Governance systems",description:'Politics - "Governance systems." This area involves the activities associated with the governance of a country or other area, especially the debate among individuals or parties having or hoping to achieve power. It shapes laws, policies, and the distribution of resources.'},{label:"Financial infrastructure",description:'Economy - "Financial infrastructure." The economy encompasses all activities related to production, consumption, and trade of goods and services in an area. It affects employment, income levels, and overall economic growth and stability.'},{label:"Knowledge dissemination",description:'Education - "Knowledge dissemination." This sector involves the systems and processes through which education is delivered, including schools, colleges, and educational content. It plays a crucial role in skill development, critical thinking, and social mobility.'},{label:"Spiritual practices",description:'Religion - "Spiritual practices." Religion pertains to the organized collection of beliefs, cultural systems, and world views that relate humanity to an order of existence. It often influences personal values, cultural norms, and community traditions.'},{label:"Medical services",description:'Healthcare - "Medical services." Healthcare represents the organized provision of medical care to individuals or a community through services offered by medical professionals. It impacts public health, life expectancy, and quality of life.'},{label:"Social expressions",description:'Culture - "Social expressions." Culture includes the arts, customs, practices, languages, values, and items that are passed along and valued by a group of people. It enriches societal interactions and reflects the historical and social context of the community.'},{label:"Ecological context",description:'Environment - "Ecological context." This area deals with the interaction between society and the natural surroundings, including issues of conservation, pollution control, and sustainable management of natural resources.'},{label:"Judicial frameworks",description:'Legal System - "Judicial frameworks." The legal system comprises the laws and regulations, as well as the processes and infrastructure for enforcing them, governing the behavior of the populace. It ensures order, resolves disputes, and maintains social justice.'}],M7={Emotions:nD,"Leadership styles":iD,"Attention types":rD,"Mental illness":sD,"Social rights":oD,"Abuse forms":aD,"Social areas":lD},uD=[];Object.values(M7).forEach(n=>n.forEach(e=>uD.push(e)));const E7={Emotions:nD,"Leadership styles":iD,"Attention types":rD,"Mental illness":sD,"Social rights":oD,"Abuse forms":aD,"Social areas":lD,All:uD},Iu="4.47.1";let OR=!1,hf,cD,hD,GS,fD,dD,pD,mD,gD;function b7(n,e={auto:!1}){if(OR)throw new Error(`you must \`import 'openai/shims/${n.kind}'\` before importing anything else from openai`);if(hf)throw new Error(`can't \`import 'openai/shims/${n.kind}'\` after \`import 'openai/shims/${hf}'\``);OR=e.auto,hf=n.kind,cD=n.fetch,hD=n.FormData,GS=n.File,fD=n.ReadableStream,dD=n.getMultipartRequestOptions,pD=n.getDefaultAgent,mD=n.fileFromPath,gD=n.isFsReadStream}class T7{constructor(e){this.body=e}get[Symbol.toStringTag](){return"MultipartBody"}}function A7({manuallyImported:n}={}){const e=n?"You may need to use polyfills":"Add one of these imports before your first `import … from 'openai'`:\n- `import 'openai/shims/node'` (if you're running on Node)\n- `import 'openai/shims/web'` (otherwise)\n";let t,i,r,s;try{t=fetch,i=Request,r=Response,s=Headers}catch(o){throw new Error(`this environment is missing the following Web Fetch API type: ${o.message}. ${e}`)}return{kind:"web",fetch:t,Request:i,Response:r,Headers:s,FormData:typeof FormData<"u"?FormData:class{constructor(){throw new Error(`file uploads aren't supported in this environment yet as 'FormData' is undefined. ${e}`)}},Blob:typeof Blob<"u"?Blob:class{constructor(){throw new Error(`file uploads aren't supported in this environment yet as 'Blob' is undefined. ${e}`)}},File:typeof File<"u"?File:class{constructor(){throw new Error(`file uploads aren't supported in this environment yet as 'File' is undefined. ${e}`)}},ReadableStream:typeof ReadableStream<"u"?ReadableStream:class{constructor(){throw new Error(`streaming isn't supported in this environment yet as 'ReadableStream' is undefined. ${e}`)}},getMultipartRequestOptions:async(o,a)=>({...a,body:new T7(o)}),getDefaultAgent:o=>{},fileFromPath:()=>{throw new Error("The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/openai/openai-node#file-uploads")},isFsReadStream:o=>!1}}hf||b7(A7(),{auto:!0});class kt extends Error{}class ci extends kt{constructor(e,t,i,r){super(`${ci.makeMessage(e,t,i)}`),this.status=e,this.headers=r,this.request_id=r==null?void 0:r["x-request-id"];const s=t;this.error=s,this.code=s==null?void 0:s.code,this.param=s==null?void 0:s.param,this.type=s==null?void 0:s.type}static makeMessage(e,t,i){const r=t!=null&&t.message?typeof t.message=="string"?t.message:JSON.stringify(t.message):t?JSON.stringify(t):i;return e&&r?`${e} ${r}`:e?`${e} status code (no body)`:r||"(no status code or body)"}static generate(e,t,i,r){if(!e)return new Q0({cause:jS(t)});const s=t==null?void 0:t.error;return e===400?new vD(e,s,i,r):e===401?new yD(e,s,i,r):e===403?new _D(e,s,i,r):e===404?new xD(e,s,i,r):e===409?new wD(e,s,i,r):e===422?new SD(e,s,i,r):e===429?new MD(e,s,i,r):e>=500?new ED(e,s,i,r):new ci(e,s,i,r)}}class _r extends ci{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0),this.status=void 0}}class Q0 extends ci{constructor({message:e,cause:t}){super(void 0,void 0,e||"Connection error.",void 0),this.status=void 0,t&&(this.cause=t)}}class aE extends Q0{constructor({message:e}={}){super({message:e??"Request timed out."})}}class vD extends ci{constructor(){super(...arguments),this.status=400}}class yD extends ci{constructor(){super(...arguments),this.status=401}}class _D extends ci{constructor(){super(...arguments),this.status=403}}class xD extends ci{constructor(){super(...arguments),this.status=404}}class wD extends ci{constructor(){super(...arguments),this.status=409}}class SD extends ci{constructor(){super(...arguments),this.status=422}}class MD extends ci{constructor(){super(...arguments),this.status=429}}class ED extends ci{}class Bs{constructor(e,t){this.iterator=e,this.controller=t}static fromSSEResponse(e,t){let i=!1;async function*r(){if(i)throw new Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let s=!1;try{for await(const o of C7(e,t))if(!s){if(o.data.startsWith("[DONE]")){s=!0;continue}if(o.event===null){let a;try{a=JSON.parse(o.data)}catch(l){throw console.error("Could not parse message into JSON:",o.data),console.error("From chunk:",o.raw),l}if(a&&a.error)throw new ci(void 0,a.error,void 0,void 0);yield a}else{let a;try{a=JSON.parse(o.data)}catch(l){throw console.error("Could not parse message into JSON:",o.data),console.error("From chunk:",o.raw),l}if(o.event=="error")throw new ci(void 0,a.error,a.message,void 0);yield{event:o.event,data:a}}}s=!0}catch(o){if(o instanceof Error&&o.name==="AbortError")return;throw o}finally{s||t.abort()}}return new Bs(r,t)}static fromReadableStream(e,t){let i=!1;async function*r(){const o=new Il,a=bD(e);for await(const l of a)for(const u of o.decode(l))yield u;for(const l of o.flush())yield l}async function*s(){if(i)throw new Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let o=!1;try{for await(const a of r())o||a&&(yield JSON.parse(a));o=!0}catch(a){if(a instanceof Error&&a.name==="AbortError")return;throw a}finally{o||t.abort()}}return new Bs(s,t)}[Symbol.asyncIterator](){return this.iterator()}tee(){const e=[],t=[],i=this.iterator(),r=s=>({next:()=>{if(s.length===0){const o=i.next();e.push(o),t.push(o)}return s.shift()}});return[new Bs(()=>r(e),this.controller),new Bs(()=>r(t),this.controller)]}toReadableStream(){const e=this;let t;const i=new TextEncoder;return new fD({async start(){t=e[Symbol.asyncIterator]()},async pull(r){try{const{value:s,done:o}=await t.next();if(o)return r.close();const a=i.encode(JSON.stringify(s)+` +`]))),q9=function(e,t){var i=e.isFocused,r=e.size,s=e.theme,o=s.colors,a=s.spacing.baseUnit;return st({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},t?{}:{color:i?o.neutral60:o.neutral20,padding:a*2})},zx=function(e){var t=e.delay,i=e.offset;return nt("span",{css:tE({animation:"".concat($9," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:i?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},Y9=function(e){var t=e.innerProps,i=e.isRtl,r=e.size,s=r===void 0?4:r,o=Do(e,z9);return nt("div",ct({},Cn(st(st({},o),{},{innerProps:t,isRtl:i,size:s}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),nt(zx,{delay:0,offset:i}),nt(zx,{delay:160,offset:!0}),nt(zx,{delay:320,offset:!i}))},Z9=function(e,t){var i=e.isDisabled,r=e.isFocused,s=e.theme,o=s.colors,a=s.borderRadius,l=s.spacing;return st({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:i?o.neutral5:o.neutral0,borderColor:i?o.neutral10:r?o.primary:o.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:r?o.primary:o.neutral30}})},K9=function(e){var t=e.children,i=e.isDisabled,r=e.isFocused,s=e.innerRef,o=e.innerProps,a=e.menuIsOpen;return nt("div",ct({ref:s},Cn(e,"control",{control:!0,"control--is-disabled":i,"control--is-focused":r,"control--menu-is-open":a}),o,{"aria-disabled":i||void 0}),t)},J9=K9,Q9=["data"],ej=function(e,t){var i=e.theme.spacing;return t?{}:{paddingBottom:i.baseUnit*2,paddingTop:i.baseUnit*2}},tj=function(e){var t=e.children,i=e.cx,r=e.getStyles,s=e.getClassNames,o=e.Heading,a=e.headingProps,l=e.innerProps,u=e.label,f=e.theme,d=e.selectProps;return nt("div",ct({},Cn(e,"group",{group:!0}),l),nt(o,ct({},a,{selectProps:d,theme:f,getStyles:r,getClassNames:s,cx:i}),u),nt("div",null,t))},nj=function(e,t){var i=e.theme,r=i.colors,s=i.spacing;return st({label:"group",cursor:"default",display:"block"},t?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:s.baseUnit*3,paddingRight:s.baseUnit*3,textTransform:"uppercase"})},ij=function(e){var t=DN(e);t.data;var i=Do(t,Q9);return nt("div",ct({},Cn(e,"groupHeading",{"group-heading":!0}),i))},rj=tj,sj=["innerRef","isDisabled","isHidden","inputClassName"],oj=function(e,t){var i=e.isDisabled,r=e.value,s=e.theme,o=s.spacing,a=s.colors;return st(st({visibility:i?"hidden":"visible",transform:r?"translateZ(0)":""},aj),t?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:a.neutral80})},GN={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},aj={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":st({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},GN)},lj=function(e){return st({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},GN)},uj=function(e){var t=e.cx,i=e.value,r=DN(e),s=r.innerRef,o=r.isDisabled,a=r.isHidden,l=r.inputClassName,u=Do(r,sj);return nt("div",ct({},Cn(e,"input",{"input-container":!0}),{"data-value":i||""}),nt("input",ct({className:t({input:!0},l),ref:s,style:lj(a),disabled:o},u)))},cj=uj,hj=function(e,t){var i=e.theme,r=i.spacing,s=i.borderRadius,o=i.colors;return st({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:o.neutral10,borderRadius:s/2,margin:r.baseUnit/2})},fj=function(e,t){var i=e.theme,r=i.borderRadius,s=i.colors,o=e.cropWithEllipsis;return st({overflow:"hidden",textOverflow:o||o===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:r/2,color:s.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},dj=function(e,t){var i=e.theme,r=i.spacing,s=i.borderRadius,o=i.colors,a=e.isFocused;return st({alignItems:"center",display:"flex"},t?{}:{borderRadius:s/2,backgroundColor:a?o.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}})},WN=function(e){var t=e.children,i=e.innerProps;return nt("div",i,t)},pj=WN,mj=WN;function gj(n){var e=n.children,t=n.innerProps;return nt("div",ct({role:"button"},t),e||nt(sE,{size:14}))}var vj=function(e){var t=e.children,i=e.components,r=e.data,s=e.innerProps,o=e.isDisabled,a=e.removeProps,l=e.selectProps,u=i.Container,f=i.Label,d=i.Remove;return nt(u,{data:r,innerProps:st(st({},Cn(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":o})),s),selectProps:l},nt(f,{data:r,innerProps:st({},Cn(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},t),nt(d,{data:r,innerProps:st(st({},Cn(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},a),selectProps:l}))},yj=vj,_j=function(e,t){var i=e.isDisabled,r=e.isFocused,s=e.isSelected,o=e.theme,a=o.spacing,l=o.colors;return st({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:s?l.primary:r?l.primary25:"transparent",color:i?l.neutral20:s?l.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:i?void 0:s?l.primary:l.primary50}})},xj=function(e){var t=e.children,i=e.isDisabled,r=e.isFocused,s=e.isSelected,o=e.innerRef,a=e.innerProps;return nt("div",ct({},Cn(e,"option",{option:!0,"option--is-disabled":i,"option--is-focused":r,"option--is-selected":s}),{ref:o,"aria-disabled":i},a),t)},wj=xj,Sj=function(e,t){var i=e.theme,r=i.spacing,s=i.colors;return st({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:s.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},Mj=function(e){var t=e.children,i=e.innerProps;return nt("div",ct({},Cn(e,"placeholder",{placeholder:!0}),i),t)},Ej=Mj,bj=function(e,t){var i=e.isDisabled,r=e.theme,s=r.spacing,o=r.colors;return st({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:i?o.neutral40:o.neutral80,marginLeft:s.baseUnit/2,marginRight:s.baseUnit/2})},Tj=function(e){var t=e.children,i=e.isDisabled,r=e.innerProps;return nt("div",ct({},Cn(e,"singleValue",{"single-value":!0,"single-value--is-disabled":i}),r),t)},Aj=Tj,Cj={ClearIndicator:W9,Control:J9,DropdownIndicator:H9,DownChevron:VN,CrossIcon:sE,Group:rj,GroupHeading:ij,IndicatorsContainer:F9,IndicatorSeparator:X9,Input:cj,LoadingIndicator:Y9,Menu:M9,MenuList:b9,MenuPortal:I9,LoadingMessage:R9,NoOptionsMessage:C9,MultiValue:yj,MultiValueContainer:pj,MultiValueLabel:mj,MultiValueRemove:gj,Option:wj,Placeholder:Ej,SelectContainer:N9,SingleValue:Aj,ValueContainer:O9},Rj=function(e){return st(st({},Cj),e.components)},SR=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function Pj(n,e){return!!(n===e||SR(n)&&SR(e))}function Ij(n,e){if(n.length!==e.length)return!1;for(var t=0;t1?"s":""," ").concat(s.join(","),", selected.");case"select-option":return o?"option ".concat(r," is disabled. Select another option."):"option ".concat(r,", selected.");default:return""}},onFocus:function(e){var t=e.context,i=e.focused,r=e.options,s=e.label,o=s===void 0?"":s,a=e.selectValue,l=e.isDisabled,u=e.isSelected,f=e.isAppleDevice,d=function(x,_){return x&&x.length?"".concat(x.indexOf(_)+1," of ").concat(x.length):""};if(t==="value"&&a)return"value ".concat(o," focused, ").concat(d(a,i),".");if(t==="menu"&&f){var p=l?" disabled":"",g="".concat(u?" selected":"").concat(p);return"".concat(o).concat(g,", ").concat(d(r,i),".")}return""},onFilter:function(e){var t=e.inputValue,i=e.resultsMessage;return"".concat(i).concat(t?" for search term "+t:"",".")}},kj=function(e){var t=e.ariaSelection,i=e.focusedOption,r=e.focusedValue,s=e.focusableOptions,o=e.isFocused,a=e.selectValue,l=e.selectProps,u=e.id,f=e.isAppleDevice,d=l.ariaLiveMessages,p=l.getOptionLabel,g=l.inputValue,v=l.isMulti,x=l.isOptionDisabled,_=l.isSearchable,m=l.menuIsOpen,w=l.options,S=l.screenReaderStatus,b=l.tabSelectsValue,R=l.isLoading,A=l["aria-label"],C=l["aria-live"],L=Y.useMemo(function(){return st(st({},Oj),d||{})},[d]),I=Y.useMemo(function(){var j="";if(t&&L.onChange){var Q=t.option,oe=t.options,k=t.removedValue,W=t.removedValues,G=t.value,ne=function(Qe){return Array.isArray(Qe)?null:Qe},me=k||Q||ne(G),_e=me?p(me):"",J=oe||W||void 0,pe=J?J.map(p):[],Me=st({isDisabled:me&&x(me,a),label:_e,labels:pe},t);j=L.onChange(Me)}return j},[t,L,x,a,p]),E=Y.useMemo(function(){var j="",Q=i||r,oe=!!(i&&a&&a.includes(i));if(Q&&L.onFocus){var k={focused:Q,label:p(Q),isDisabled:x(Q,a),isSelected:oe,options:s,context:Q===i?"menu":"value",selectValue:a,isAppleDevice:f};j=L.onFocus(k)}return j},[i,r,p,x,L,s,a,f]),N=Y.useMemo(function(){var j="";if(m&&w.length&&!R&&L.onFilter){var Q=S({count:s.length});j=L.onFilter({inputValue:g,resultsMessage:Q})}return j},[s,g,m,L,w,S,R]),z=(t==null?void 0:t.action)==="initial-input-focus",O=Y.useMemo(function(){var j="";if(L.guidance){var Q=r?"value":m?"menu":"input";j=L.guidance({"aria-label":A,context:Q,isDisabled:i&&x(i,a),isMulti:v,isSearchable:_,tabSelectsValue:b,isInitialFocus:z})}return j},[A,i,r,v,x,_,m,L,a,b,z]),q=nt(Y.Fragment,null,nt("span",{id:"aria-selection"},I),nt("span",{id:"aria-focused"},E),nt("span",{id:"aria-results"},N),nt("span",{id:"aria-guidance"},O));return nt(Y.Fragment,null,nt(MR,{id:u},z&&q),nt(MR,{"aria-live":C,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},o&&!z&&q))},Fj=kj,HS=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],Uj=new RegExp("["+HS.map(function(n){return n.letters}).join("")+"]","g"),jN={};for(var Bx=0;Bx-1}},Hj=["innerRef"];function Gj(n){var e=n.innerRef,t=Do(n,Hj),i=m9(t,"onExited","in","enter","exit","appear");return nt("input",ct({ref:e},i,{css:tE({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var Wj=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function jj(n){var e=n.isEnabled,t=n.onBottomArrive,i=n.onBottomLeave,r=n.onTopArrive,s=n.onTopLeave,o=Y.useRef(!1),a=Y.useRef(!1),l=Y.useRef(0),u=Y.useRef(null),f=Y.useCallback(function(_,m){if(u.current!==null){var w=u.current,S=w.scrollTop,b=w.scrollHeight,R=w.clientHeight,A=u.current,C=m>0,L=b-R-S,I=!1;L>m&&o.current&&(i&&i(_),o.current=!1),C&&a.current&&(s&&s(_),a.current=!1),C&&m>L?(t&&!o.current&&t(_),A.scrollTop=b,I=!0,o.current=!0):!C&&-m>S&&(r&&!a.current&&r(_),A.scrollTop=0,I=!0,a.current=!0),I&&Wj(_)}},[t,i,r,s]),d=Y.useCallback(function(_){f(_,_.deltaY)},[f]),p=Y.useCallback(function(_){l.current=_.changedTouches[0].clientY},[]),g=Y.useCallback(function(_){var m=l.current-_.changedTouches[0].clientY;f(_,m)},[f]),v=Y.useCallback(function(_){if(_){var m=f9?{passive:!1}:!1;_.addEventListener("wheel",d,m),_.addEventListener("touchstart",p,m),_.addEventListener("touchmove",g,m)}},[g,p,d]),x=Y.useCallback(function(_){_&&(_.removeEventListener("wheel",d,!1),_.removeEventListener("touchstart",p,!1),_.removeEventListener("touchmove",g,!1))},[g,p,d]);return Y.useEffect(function(){if(e){var _=u.current;return v(_),function(){x(_)}}},[e,v,x]),function(_){u.current=_}}var bR=["boxSizing","height","overflow","paddingRight","position"],TR={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function AR(n){n.preventDefault()}function CR(n){n.stopPropagation()}function RR(){var n=this.scrollTop,e=this.scrollHeight,t=n+this.offsetHeight;n===0?this.scrollTop=1:t===e&&(this.scrollTop=n-1)}function PR(){return"ontouchstart"in window||navigator.maxTouchPoints}var IR=!!(typeof window<"u"&&window.document&&window.document.createElement),Ih=0,Au={capture:!1,passive:!1};function Xj(n){var e=n.isEnabled,t=n.accountForScrollbars,i=t===void 0?!0:t,r=Y.useRef({}),s=Y.useRef(null),o=Y.useCallback(function(l){if(IR){var u=document.body,f=u&&u.style;if(i&&bR.forEach(function(v){var x=f&&f[v];r.current[v]=x}),i&&Ih<1){var d=parseInt(r.current.paddingRight,10)||0,p=document.body?document.body.clientWidth:0,g=window.innerWidth-p+d||0;Object.keys(TR).forEach(function(v){var x=TR[v];f&&(f[v]=x)}),f&&(f.paddingRight="".concat(g,"px"))}u&&PR()&&(u.addEventListener("touchmove",AR,Au),l&&(l.addEventListener("touchstart",RR,Au),l.addEventListener("touchmove",CR,Au))),Ih+=1}},[i]),a=Y.useCallback(function(l){if(IR){var u=document.body,f=u&&u.style;Ih=Math.max(Ih-1,0),i&&Ih<1&&bR.forEach(function(d){var p=r.current[d];f&&(f[d]=p)}),u&&PR()&&(u.removeEventListener("touchmove",AR,Au),l&&(l.removeEventListener("touchstart",RR,Au),l.removeEventListener("touchmove",CR,Au)))}},[i]);return Y.useEffect(function(){if(e){var l=s.current;return o(l),function(){a(l)}}},[e,o,a]),function(l){s.current=l}}var $j=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},qj={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function Yj(n){var e=n.children,t=n.lockEnabled,i=n.captureEnabled,r=i===void 0?!0:i,s=n.onBottomArrive,o=n.onBottomLeave,a=n.onTopArrive,l=n.onTopLeave,u=jj({isEnabled:r,onBottomArrive:s,onBottomLeave:o,onTopArrive:a,onTopLeave:l}),f=Xj({isEnabled:t}),d=function(g){u(g),f(g)};return nt(Y.Fragment,null,t&&nt("div",{onClick:$j,css:qj}),e(d))}var Zj={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Kj=function(e){var t=e.name,i=e.onFocus;return nt("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:i,css:Zj,value:"",onChange:function(){}})},Jj=Kj;function oE(n){var e;return typeof window<"u"&&window.navigator!=null?n.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function Qj(){return oE(/^iPhone/i)}function $N(){return oE(/^Mac/i)}function e7(){return oE(/^iPad/i)||$N()&&navigator.maxTouchPoints>1}function t7(){return Qj()||e7()}function n7(){return $N()||t7()}var i7=function(e){return e.label},r7=function(e){return e.label},s7=function(e){return e.value},o7=function(e){return!!e.isDisabled},a7={clearIndicator:G9,container:L9,control:Z9,dropdownIndicator:V9,group:ej,groupHeading:nj,indicatorsContainer:k9,indicatorSeparator:j9,input:oj,loadingIndicator:q9,loadingMessage:A9,menu:x9,menuList:E9,menuPortal:P9,multiValue:hj,multiValueLabel:fj,multiValueRemove:dj,noOptionsMessage:T9,option:_j,placeholder:Sj,singleValue:bj,valueContainer:D9},l7={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},u7=4,qN=4,c7=38,h7=qN*2,f7={baseUnit:qN,controlHeight:c7,menuGutter:h7},Gx={borderRadius:u7,colors:l7,spacing:f7},d7={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:xR(),captureMenuScroll:!xR(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Vj(),formatGroupLabel:i7,getOptionLabel:r7,getOptionValue:s7,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:o7,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!c9(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(t!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function LR(n,e,t,i){var r=KN(n,e,t),s=JN(n,e,t),o=ZN(n,e),a=_v(n,e);return{type:"option",data:e,isDisabled:r,isSelected:s,label:o,value:a,index:i}}function yg(n,e){return n.options.map(function(t,i){if("options"in t){var r=t.options.map(function(o,a){return LR(n,o,e,a)}).filter(function(o){return DR(n,o)});return r.length>0?{type:"group",data:t,options:r,index:i}:void 0}var s=LR(n,t,e,i);return DR(n,s)?s:void 0}).filter(d9)}function YN(n){return n.reduce(function(e,t){return t.type==="group"?e.push.apply(e,$M(t.options.map(function(i){return i.data}))):e.push(t.data),e},[])}function NR(n,e){return n.reduce(function(t,i){return i.type==="group"?t.push.apply(t,$M(i.options.map(function(r){return{data:r.data,id:"".concat(e,"-").concat(i.index,"-").concat(r.index)}}))):t.push({data:i.data,id:"".concat(e,"-").concat(i.index)}),t},[])}function p7(n,e){return YN(yg(n,e))}function DR(n,e){var t=n.inputValue,i=t===void 0?"":t,r=e.data,s=e.isSelected,o=e.label,a=e.value;return(!eD(n)||!s)&&QN(n,{label:o,value:a,data:r},i)}function m7(n,e){var t=n.focusedValue,i=n.selectValue,r=i.indexOf(t);if(r>-1){var s=e.indexOf(t);if(s>-1)return t;if(r-1?t:e[0]}var Wx=function(e,t){var i,r=(i=e.find(function(s){return s.data===t}))===null||i===void 0?void 0:i.id;return r||null},ZN=function(e,t){return e.getOptionLabel(t)},_v=function(e,t){return e.getOptionValue(t)};function KN(n,e,t){return typeof n.isOptionDisabled=="function"?n.isOptionDisabled(e,t):!1}function JN(n,e,t){if(t.indexOf(e)>-1)return!0;if(typeof n.isOptionSelected=="function")return n.isOptionSelected(e,t);var i=_v(n,e);return t.some(function(r){return _v(n,r)===i})}function QN(n,e,t){return n.filterOption?n.filterOption(e,t):!0}var eD=function(e){var t=e.hideSelectedOptions,i=e.isMulti;return t===void 0?i:t},v7=1,tD=function(n){DW(t,n);var e=FW(t);function t(i){var r;if(LW(this,t),r=e.call(this,i),r.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.isAppleDevice=n7(),r.controlRef=null,r.getControlRef=function(l){r.controlRef=l},r.focusedOptionRef=null,r.getFocusedOptionRef=function(l){r.focusedOptionRef=l},r.menuListRef=null,r.getMenuListRef=function(l){r.menuListRef=l},r.inputRef=null,r.getInputRef=function(l){r.inputRef=l},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(l,u){var f=r.props,d=f.onChange,p=f.name;u.name=p,r.ariaOnChange(l,u),d(l,u)},r.setValue=function(l,u,f){var d=r.props,p=d.closeMenuOnSelect,g=d.isMulti,v=d.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:v}),p&&(r.setState({inputIsHiddenAfterUpdate:!g}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(l,{action:u,option:f})},r.selectOption=function(l){var u=r.props,f=u.blurInputOnSelect,d=u.isMulti,p=u.name,g=r.state.selectValue,v=d&&r.isOptionSelected(l,g),x=r.isOptionDisabled(l,g);if(v){var _=r.getOptionValue(l);r.setValue(g.filter(function(m){return r.getOptionValue(m)!==_}),"deselect-option",l)}else if(!x)d?r.setValue([].concat($M(g),[l]),"select-option",l):r.setValue(l,"select-option");else{r.ariaOnChange(l,{action:"select-option",option:l,name:p});return}f&&r.blurInput()},r.removeValue=function(l){var u=r.props.isMulti,f=r.state.selectValue,d=r.getOptionValue(l),p=f.filter(function(v){return r.getOptionValue(v)!==d}),g=zm(u,p,p[0]||null);r.onChange(g,{action:"remove-value",removedValue:l}),r.focusInput()},r.clearValue=function(){var l=r.state.selectValue;r.onChange(zm(r.props.isMulti,[],null),{action:"clear",removedValues:l})},r.popValue=function(){var l=r.props.isMulti,u=r.state.selectValue,f=u[u.length-1],d=u.slice(0,u.length-1),p=zm(l,d,d[0]||null);r.onChange(p,{action:"pop-value",removedValue:f})},r.getFocusedOptionId=function(l){return Wx(r.state.focusableOptionsWithIds,l)},r.getFocusableOptionsWithIds=function(){return NR(yg(r.props,r.state.selectValue),r.getElementId("option"))},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var l=arguments.length,u=new Array(l),f=0;fg||p>g}},r.onTouchEnd=function(l){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(l.target)&&r.menuListRef&&!r.menuListRef.contains(l.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(l){r.userIsDragging||r.onControlMouseDown(l)},r.onClearIndicatorTouchEnd=function(l){r.userIsDragging||r.onClearIndicatorMouseDown(l)},r.onDropdownIndicatorTouchEnd=function(l){r.userIsDragging||r.onDropdownIndicatorMouseDown(l)},r.handleInputChange=function(l){var u=r.props.inputValue,f=l.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(f,{action:"input-change",prevInputValue:u}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(l){r.props.onFocus&&r.props.onFocus(l),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(l){var u=r.props.inputValue;if(r.menuListRef&&r.menuListRef.contains(document.activeElement)){r.inputRef.focus();return}r.props.onBlur&&r.props.onBlur(l),r.onInputChange("",{action:"input-blur",prevInputValue:u}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1})},r.onOptionHover=function(l){if(!(r.blockOptionHover||r.state.focusedOption===l)){var u=r.getFocusableOptions(),f=u.indexOf(l);r.setState({focusedOption:l,focusedOptionId:f>-1?r.getFocusedOptionId(l):null})}},r.shouldHideSelectedOptions=function(){return eD(r.props)},r.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),r.focus()},r.onKeyDown=function(l){var u=r.props,f=u.isMulti,d=u.backspaceRemovesValue,p=u.escapeClearsValue,g=u.inputValue,v=u.isClearable,x=u.isDisabled,_=u.menuIsOpen,m=u.onKeyDown,w=u.tabSelectsValue,S=u.openMenuOnFocus,b=r.state,R=b.focusedOption,A=b.focusedValue,C=b.selectValue;if(!x&&!(typeof m=="function"&&(m(l),l.defaultPrevented))){switch(r.blockOptionHover=!0,l.key){case"ArrowLeft":if(!f||g)return;r.focusValue("previous");break;case"ArrowRight":if(!f||g)return;r.focusValue("next");break;case"Delete":case"Backspace":if(g)return;if(A)r.removeValue(A);else{if(!d)return;f?r.popValue():v&&r.clearValue()}break;case"Tab":if(r.isComposing||l.shiftKey||!_||!w||!R||S&&r.isOptionSelected(R,C))return;r.selectOption(R);break;case"Enter":if(l.keyCode===229)break;if(_){if(!R||r.isComposing)return;r.selectOption(R);break}return;case"Escape":_?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:g}),r.onMenuClose()):v&&p&&r.clearValue();break;case" ":if(g)return;if(!_){r.openMenu("first");break}if(!R)return;r.selectOption(R);break;case"ArrowUp":_?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":_?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!_)return;r.focusOption("pageup");break;case"PageDown":if(!_)return;r.focusOption("pagedown");break;case"Home":if(!_)return;r.focusOption("first");break;case"End":if(!_)return;r.focusOption("last");break;default:return}l.preventDefault()}},r.state.instancePrefix="react-select-"+(r.props.instanceId||++v7),r.state.selectValue=yR(i.value),i.menuIsOpen&&r.state.selectValue.length){var s=r.getFocusableOptionsWithIds(),o=r.buildFocusableOptions(),a=o.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=s,r.state.focusedOption=o[a],r.state.focusedOptionId=Wx(s,o[a])}return r}return NW(t,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&_R(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(r){var s=this.props,o=s.isDisabled,a=s.menuIsOpen,l=this.state.isFocused;(l&&!o&&r.isDisabled||l&&a&&!r.menuIsOpen)&&this.focusInput(),l&&o&&!r.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!o&&r.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(_R(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(r,s){this.props.onInputChange(r,s)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(r){var s=this,o=this.state,a=o.selectValue,l=o.isFocused,u=this.buildFocusableOptions(),f=r==="first"?0:u.length-1;if(!this.props.isMulti){var d=u.indexOf(a[0]);d>-1&&(f=d)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[f],focusedOptionId:this.getFocusedOptionId(u[f])},function(){return s.onMenuOpen()})}},{key:"focusValue",value:function(r){var s=this.state,o=s.selectValue,a=s.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=o.indexOf(a);a||(l=-1);var u=o.length-1,f=-1;if(o.length){switch(r){case"previous":l===0?f=0:l===-1?f=u:f=l-1;break;case"next":l>-1&&l0&&arguments[0]!==void 0?arguments[0]:"first",s=this.props.pageSize,o=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var l=0,u=a.indexOf(o);o||(u=-1),r==="up"?l=u>0?u-1:a.length-1:r==="down"?l=(u+1)%a.length:r==="pageup"?(l=u-s,l<0&&(l=0)):r==="pagedown"?(l=u+s,l>a.length-1&&(l=a.length-1)):r==="last"&&(l=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[l])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Gx):st(st({},Gx),this.props.theme):Gx}},{key:"getCommonProps",value:function(){var r=this.clearValue,s=this.cx,o=this.getStyles,a=this.getClassNames,l=this.getValue,u=this.selectOption,f=this.setValue,d=this.props,p=d.isMulti,g=d.isRtl,v=d.options,x=this.hasValue();return{clearValue:r,cx:s,getStyles:o,getClassNames:a,getValue:l,hasValue:x,isMulti:p,isRtl:g,options:v,selectOption:u,selectProps:d,setValue:f,theme:this.getTheme()}}},{key:"hasValue",value:function(){var r=this.state.selectValue;return r.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var r=this.props,s=r.isClearable,o=r.isMulti;return s===void 0?o:s}},{key:"isOptionDisabled",value:function(r,s){return KN(this.props,r,s)}},{key:"isOptionSelected",value:function(r,s){return JN(this.props,r,s)}},{key:"filterOption",value:function(r,s){return QN(this.props,r,s)}},{key:"formatOptionLabel",value:function(r,s){if(typeof this.props.formatOptionLabel=="function"){var o=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(r,{context:s,inputValue:o,selectValue:a})}else return this.getOptionLabel(r)}},{key:"formatGroupLabel",value:function(r){return this.props.formatGroupLabel(r)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var r=this.props,s=r.isDisabled,o=r.isSearchable,a=r.inputId,l=r.inputValue,u=r.tabIndex,f=r.form,d=r.menuIsOpen,p=r.required,g=this.getComponents(),v=g.Input,x=this.state,_=x.inputIsHidden,m=x.ariaSelection,w=this.commonProps,S=a||this.getElementId("input"),b=st(st(st({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":p,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!o&&{"aria-readonly":!0}),this.hasValue()?(m==null?void 0:m.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return o?Y.createElement(v,ct({},w,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:S,innerRef:this.getInputRef,isDisabled:s,isHidden:_,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:f,type:"text",value:l},b)):Y.createElement(Gj,ct({id:S,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:vv,onFocus:this.onInputFocus,disabled:s,tabIndex:u,inputMode:"none",form:f,value:""},b))}},{key:"renderPlaceholderOrValue",value:function(){var r=this,s=this.getComponents(),o=s.MultiValue,a=s.MultiValueContainer,l=s.MultiValueLabel,u=s.MultiValueRemove,f=s.SingleValue,d=s.Placeholder,p=this.commonProps,g=this.props,v=g.controlShouldRenderValue,x=g.isDisabled,_=g.isMulti,m=g.inputValue,w=g.placeholder,S=this.state,b=S.selectValue,R=S.focusedValue,A=S.isFocused;if(!this.hasValue()||!v)return m?null:Y.createElement(d,ct({},p,{key:"placeholder",isDisabled:x,isFocused:A,innerProps:{id:this.getElementId("placeholder")}}),w);if(_)return b.map(function(L,I){var E=L===R,N="".concat(r.getOptionLabel(L),"-").concat(r.getOptionValue(L));return Y.createElement(o,ct({},p,{components:{Container:a,Label:l,Remove:u},isFocused:E,isDisabled:x,key:N,index:I,removeProps:{onClick:function(){return r.removeValue(L)},onTouchEnd:function(){return r.removeValue(L)},onMouseDown:function(O){O.preventDefault()}},data:L}),r.formatOptionLabel(L,"value"))});if(m)return null;var C=b[0];return Y.createElement(f,ct({},p,{data:C,isDisabled:x}),this.formatOptionLabel(C,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),s=r.ClearIndicator,o=this.commonProps,a=this.props,l=a.isDisabled,u=a.isLoading,f=this.state.isFocused;if(!this.isClearable()||!s||l||!this.hasValue()||u)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return Y.createElement(s,ct({},o,{innerProps:d,isFocused:f}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),s=r.LoadingIndicator,o=this.commonProps,a=this.props,l=a.isDisabled,u=a.isLoading,f=this.state.isFocused;if(!s||!u)return null;var d={"aria-hidden":"true"};return Y.createElement(s,ct({},o,{innerProps:d,isDisabled:l,isFocused:f}))}},{key:"renderIndicatorSeparator",value:function(){var r=this.getComponents(),s=r.DropdownIndicator,o=r.IndicatorSeparator;if(!s||!o)return null;var a=this.commonProps,l=this.props.isDisabled,u=this.state.isFocused;return Y.createElement(o,ct({},a,{isDisabled:l,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var r=this.getComponents(),s=r.DropdownIndicator;if(!s)return null;var o=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return Y.createElement(s,ct({},o,{innerProps:u,isDisabled:a,isFocused:l}))}},{key:"renderMenu",value:function(){var r=this,s=this.getComponents(),o=s.Group,a=s.GroupHeading,l=s.Menu,u=s.MenuList,f=s.MenuPortal,d=s.LoadingMessage,p=s.NoOptionsMessage,g=s.Option,v=this.commonProps,x=this.state.focusedOption,_=this.props,m=_.captureMenuScroll,w=_.inputValue,S=_.isLoading,b=_.loadingMessage,R=_.minMenuHeight,A=_.maxMenuHeight,C=_.menuIsOpen,L=_.menuPlacement,I=_.menuPosition,E=_.menuPortalTarget,N=_.menuShouldBlockScroll,z=_.menuShouldScrollIntoView,O=_.noOptionsMessage,q=_.onMenuScrollToTop,j=_.onMenuScrollToBottom;if(!C)return null;var Q=function(_e,J){var pe=_e.type,Me=_e.data,de=_e.isDisabled,Qe=_e.isSelected,lt=_e.label,K=_e.value,tt=x===Me,he=de?void 0:function(){return r.onOptionHover(Me)},we=de?void 0:function(){return r.selectOption(Me)},ye="".concat(r.getElementId("option"),"-").concat(J),Ce={id:ye,onClick:we,onMouseMove:he,onMouseOver:he,tabIndex:-1,role:"option","aria-selected":r.isAppleDevice?void 0:Qe};return Y.createElement(g,ct({},v,{innerProps:Ce,data:Me,isDisabled:de,isSelected:Qe,key:ye,label:lt,type:pe,value:K,isFocused:tt,innerRef:tt?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(_e.data,"menu"))},oe;if(this.hasOptions())oe=this.getCategorizedOptions().map(function(me){if(me.type==="group"){var _e=me.data,J=me.options,pe=me.index,Me="".concat(r.getElementId("group"),"-").concat(pe),de="".concat(Me,"-heading");return Y.createElement(o,ct({},v,{key:Me,data:_e,options:J,Heading:a,headingProps:{id:de,data:me.data},label:r.formatGroupLabel(me.data)}),me.options.map(function(Qe){return Q(Qe,"".concat(pe,"-").concat(Qe.index))}))}else if(me.type==="option")return Q(me,"".concat(me.index))});else if(S){var k=b({inputValue:w});if(k===null)return null;oe=Y.createElement(d,v,k)}else{var W=O({inputValue:w});if(W===null)return null;oe=Y.createElement(p,v,W)}var G={minMenuHeight:R,maxMenuHeight:A,menuPlacement:L,menuPosition:I,menuShouldScrollIntoView:z},ne=Y.createElement(w9,ct({},v,G),function(me){var _e=me.ref,J=me.placerProps,pe=J.placement,Me=J.maxHeight;return Y.createElement(l,ct({},v,G,{innerRef:_e,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove},isLoading:S,placement:pe}),Y.createElement(Yj,{captureEnabled:m,onTopArrive:q,onBottomArrive:j,lockEnabled:N},function(de){return Y.createElement(u,ct({},v,{innerRef:function(lt){r.getMenuListRef(lt),de(lt)},innerProps:{role:"listbox","aria-multiselectable":v.isMulti,id:r.getElementId("listbox")},isLoading:S,maxHeight:Me,focusedOption:x}),oe)}))});return E||I==="fixed"?Y.createElement(f,ct({},v,{appendTo:E,controlElement:this.controlRef,menuPlacement:L,menuPosition:I}),ne):ne}},{key:"renderFormField",value:function(){var r=this,s=this.props,o=s.delimiter,a=s.isDisabled,l=s.isMulti,u=s.name,f=s.required,d=this.state.selectValue;if(f&&!this.hasValue()&&!a)return Y.createElement(Jj,{name:u,onFocus:this.onValueInputFocus});if(!(!u||a))if(l)if(o){var p=d.map(function(x){return r.getOptionValue(x)}).join(o);return Y.createElement("input",{name:u,type:"hidden",value:p})}else{var g=d.length>0?d.map(function(x,_){return Y.createElement("input",{key:"i-".concat(_),name:u,type:"hidden",value:r.getOptionValue(x)})}):Y.createElement("input",{name:u,type:"hidden",value:""});return Y.createElement("div",null,g)}else{var v=d[0]?this.getOptionValue(d[0]):"";return Y.createElement("input",{name:u,type:"hidden",value:v})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,s=this.state,o=s.ariaSelection,a=s.focusedOption,l=s.focusedValue,u=s.isFocused,f=s.selectValue,d=this.getFocusableOptions();return Y.createElement(Fj,ct({},r,{id:this.getElementId("live-region"),ariaSelection:o,focusedOption:a,focusedValue:l,isFocused:u,selectValue:f,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var r=this.getComponents(),s=r.Control,o=r.IndicatorsContainer,a=r.SelectContainer,l=r.ValueContainer,u=this.props,f=u.className,d=u.id,p=u.isDisabled,g=u.menuIsOpen,v=this.state.isFocused,x=this.commonProps=this.getCommonProps();return Y.createElement(a,ct({},x,{className:f,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:p,isFocused:v}),this.renderLiveRegion(),Y.createElement(s,ct({},x,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:p,isFocused:v,menuIsOpen:g}),Y.createElement(l,ct({},x,{isDisabled:p}),this.renderPlaceholderOrValue(),this.renderInput()),Y.createElement(o,ct({},x,{isDisabled:p}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(r,s){var o=s.prevProps,a=s.clearFocusValueOnUpdate,l=s.inputIsHiddenAfterUpdate,u=s.ariaSelection,f=s.isFocused,d=s.prevWasFocused,p=s.instancePrefix,g=r.options,v=r.value,x=r.menuIsOpen,_=r.inputValue,m=r.isMulti,w=yR(v),S={};if(o&&(v!==o.value||g!==o.options||x!==o.menuIsOpen||_!==o.inputValue)){var b=x?p7(r,w):[],R=x?NR(yg(r,w),"".concat(p,"-option")):[],A=a?m7(s,w):null,C=g7(s,b),L=Wx(R,C);S={selectValue:w,focusedOption:C,focusedOptionId:L,focusableOptionsWithIds:R,focusedValue:A,clearFocusValueOnUpdate:!1}}var I=l!=null&&r!==o?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},E=u,N=f&&d;return f&&!N&&(E={value:zm(m,w,w[0]||null),options:w,action:"initial-input-focus"},N=!d),(u==null?void 0:u.action)==="initial-input-focus"&&(E=null),st(st(st({},S),I),{},{prevProps:r,ariaSelection:E,prevWasFocused:N})}}]),t}(Y.Component);tD.defaultProps=d7;var y7=Y.forwardRef(function(n,e){var t=IW(n);return Y.createElement(tD,ct({ref:e},t))}),_7=y7;const x7=({conceptCategories:n,concepts:e,setConcepts:t,onCalculateEmbeddings:i})=>{const r=s=>{s in n&&t(n[s].map((o,a)=>({label:o.label,description:o.description,color:EW(a),embeddings:[],position:[0,0,0],index:a})))};return We.jsxs("div",{className:"PanelConceptCategories",children:[We.jsx("h3",{style:{textAlign:"left"},children:"# Categories"}),We.jsx(_7,{className:"SelectConcept",placeholder:"pick a concept...",isSearchable:!1,menuPortalTarget:document.body,options:Object.keys(n).map(s=>({value:s,label:s})),onChange:s=>r((s==null?void 0:s.value)||"")}),We.jsx("h2",{style:{height:"300px",overflow:"scroll"},className:"HiddenOnMobile",children:e.map(s=>We.jsx(cN,{color:s.color,inputValue:s.label,inputId:`prompt-${s.index}`,title:s.description},`prompt-${s.index}`))}),We.jsx("div",{style:{textAlign:"center"},children:We.jsx("button",{onClick:i,children:"Represent Category"})})]})},w7=({onChangeMyConcept:n})=>We.jsxs("div",{className:"PanelMyConcept",children:[We.jsx("h3",{style:{textAlign:"left"},children:"# Your Concept"}),We.jsx("h2",{children:We.jsx(cN,{color:"black",inputId:"prompt-test"})}),We.jsx("div",{style:{textAlign:"center"},children:We.jsx("button",{onClick:()=>{n(document.getElementById("prompt-test").value)},children:"Represent Concept"})})]}),S7=({text:n})=>We.jsx("div",{className:"CardHoveredConcept HiddenOnMobile",children:We.jsx("strong",{children:We.jsx("em",{children:n})})}),nD=[{label:"Pure happiness",description:'Joy - "Pure happiness." Joy is a powerful, often euphoric state of happiness that is usually caused by something exceptionally good or satisfying. It often includes feelings of contentment, satisfaction, and well-being.'},{label:"Sorrowful distress",description:'Sadness - "Sorrowful distress." This emotion is typically associated with feelings of disadvantage, loss, and helplessness. When someone is sad, they often feel down and might have a low mood that affects their day-to-day activities.'},{label:"Anxiety anticipation",description:'Fear - "Anxiety anticipation." Fear is a response to an impending threat or danger, characterized by increased alertness and preparation for physical action. It often serves a protective purpose, triggering the "fight-or-flight" response.'},{label:"Fierce irritation",description:'Anger - "Fierce irritation." Anger is an emotional response to perceived wrongs and injustice, often resulting in a desire to assert authority or independence, or a tendency to retaliate against the source of offense.'},{label:"Unexpected astonishment",description:`Surprise - "Unexpected astonishment." This emotion is a response to an unexpected event. It can be either positive or negative, depending on the nature of the surprise. It's characterized by a high level of stimulation and a need to re-evaluate one's understanding of the situation.`},{label:"Revulsion reaction",description:'Disgust - "Revulsion reaction." Disgust is a powerful aversion to something perceived as unpleasant or offensive. This emotion can be triggered by various stimuli including unpleasant tastes, sights, or moral situations.'},{label:"Scornful disdain",description:'Contempt - "Scornful disdain." Contempt is an emotion that puts someone or something considered worthless or beneath consideration. This emotion often involves moral superiority and a lack of respect.'},{label:"Confident reliance",description:'Trust - "Confident reliance." Trust is an emotion reflecting a level of comfort and firm belief in the reliability or truth of someone or something. It involves a complex mix of affective experiences with a significant history of interactions.'}],iD=[{label:"Visionary guidance",description:'Authoritative Leadership - "Visionary guidance." This style is characterized by a leader who sets clear objectives and directions but allows individuals some flexibility in how they achieve these goals. They motivate by appealing to people’s shared goals.'},{label:"Collective input",description:'Democratic Leadership - "Collective input." Leaders using this style solicit input from team members in decision-making processes, fostering collaboration and participation. This approach can boost morale and creativity by making members feel valued and involved.'},{label:"Hands-off management",description:'Laissez-faire Leadership - "Hands-off management." In this style, the leader provides little guidance to team members, who are then allowed to make decisions and solve problems on their own. This can be effective in highly skilled teams but risky in teams needing direction.'},{label:"Performance reward",description:'Transactional Leadership - "Performance reward." Leaders focusing on this style are centered on clear structures wherein specific tasks are rewarded. Performance is closely monitored and feedback is given directly related to achievements. This approach works well in environments where tasks are routine and outcomes are predictable.'},{label:"Inspiring change",description:'Transformational Leadership - "Inspiring change." These leaders focus on initiating change in organizations, staff, and themselves. They are characterized by their ability to inspire and motivate employees to exceed expectations by aligning team goals with a higher vision.'},{label:"Personal development",description:'Coaching Leadership - "Personal development." Coaching leaders focus heavily on the professional and personal development of their team members. They provide one-on-one guidance to help team members meet their individual goals, which in turn enhances their performance at work.'},{label:"Directive control",description:'Autocratic Leadership - "Directive control." This style is defined by individual control over all decisions with little input from group members. It can be effective in crises but might stifle creativity and autonomy in a standard setting.'},{label:"Supportive facilitator",description:'Servant Leadership - "Supportive facilitator." Servant leaders put the needs of their team members first and help people develop and perform as highly as possible. They lead by example and gain authority by earning trust and fostering a service-oriented environment.'}],rD=[{label:"Continuous focus",description:'Sustained Attention - "Continuous focus." This type of attention is required for activities that demand prolonged concentration, such as studying for an exam or driving a long distance. It involves maintaining focus on a task over an extended period without becoming distracted.'},{label:"Targeted filtering",description:'Selective Attention - "Targeted filtering." Selective attention involves focusing on one specific aspect of the environment while ignoring other stimuli. For example, listening to a friend talk in a noisy room requires the ability to filter out the background noise.'},{label:"Switching focus",description:'Alternating Attention - "Switching focus." This type of attention allows an individual to shift focus between tasks that require different cognitive demands. For instance, alternating between writing a report and responding to emails.'},{label:"Multitasking efficiency",description:'Divided Attention - "Multitasking efficiency." Divided attention refers to the ability to process two or more responses or react to multiple tasks at the same time, such as cooking while watching TV.'},{label:"Complex management",description:'Executive Attention - "Complex management." This involves high-level thought, decision-making, and the management of attention resources among several tasks or priorities, such as planning a project while considering multiple variables.'},{label:"Involuntary awareness",description:'Passive Attention - "Involuntary awareness." Passive attention is drawn to stimuli without any conscious effort, often triggered by something surprising or significant, such as the sudden sound of a loud crash.'},{label:"Minimal engagement",description:'Bored Attention - "Minimal engagement." This is a form of attention where the focus is maintained nominally, often under unstimulating conditions. It’s the kind of attention you might use during a dull lecture or a repetitive task.'},{label:"Intense concentration",description:'Hyperfocus - "Intense concentration." This is an extreme form of mental concentration or visualization that focuses consciousness on a subject, topic, or task. In hyperfocus, one can become so absorbed in the task that they become oblivious to everything else around them, often found in highly engaging activities like playing video games or during a creative burst.'}],sD=[{label:"Persistent sadness",description:'Major Depression - "Persistent sadness." This mood disorder is characterized by a persistent feeling of sadness and a lack of interest in external stimuli. Symptoms can also include changes in sleep, appetite, energy level, concentration, daily behavior, or self-esteem.'},{label:"Constant worry",description:'Generalized Anxiety Disorder (GAD) - "Constant worry." GAD involves excessive, uncontrollable worry about everyday issues, such as health, money, or career. This worry is disproportionate to the actual source of concern and can affect physical health.'},{label:"Mood extremes",description:`Bipolar Disorder - "Mood extremes." This condition is marked by dramatic shifts in a person's mood, energy and ability to think clearly. These mood swings can range from highs (mania) to lows (depression), sometimes with periods of normal mood in between.`},{label:"Altered perceptions",description:'Schizophrenia - "Altered perceptions." Schizophrenia is a complex, long-term medical illness, characterized by symptoms like hallucinations, delusions, and extremely disordered thinking and behavior that impairs daily functioning.'},{label:"Compulsive behavior",description:'Obsessive-Compulsive Disorder (OCD) - "Compulsive behavior." OCD is characterized by unreasonable thoughts and fears (obsessions) that lead to compulsive behaviors. This disorder often centers on themes such as fear of germs or the need to arrange objects in a specific manner.'},{label:"Trauma aftermath",description:'Post-Traumatic Stress Disorder (PTSD) - "Trauma aftermath." PTSD can occur after a person has experienced or witnessed a traumatic event such as a natural disaster, a serious accident, a terrorist act, war/combat, rape, or other violent personal assault.'},{label:"Emotional instability",description:'Borderline Personality Disorder (BPD) - "Emotional instability." BPD is characterized by difficulties in regulating emotion. This can lead to severe, unstable mood swings, impulsivity and instability, poor self-image, and tumultuous personal relationships.'},{label:"Focus deficiency",description:'Attention Deficit Hyperactivity Disorder (ADHD) - "Focus deficiency." ADHD is characterized by a continuous pattern of inattention and/or hyperactivity-impulsivity that interferes with functioning or development. It often presents problems with organizing tasks, staying focused on one task, and social interaction.'}],oD=[{label:"Equitable entitlements",description:'Social Rights - "Equitable entitlements." This involves advocating and ensuring that all individuals have equal access to basic rights and liberties, such as education, healthcare, and fair treatment under the law.'},{label:"Eco-conscious actions",description:`Environmental Care - "Eco-conscious actions." Environmental responsibility emphasizes the protection and improvement of the planet's ecosystems. This includes efforts to reduce pollution, conserve resources, and uphold biodiversity.`},{label:"Wealth distribution",description:'Economic Equality - "Wealth distribution." This type of social responsibility focuses on reducing the disparities in economic opportunity and wealth among different groups within society, aiming to achieve a more equitable economic landscape.'},{label:"Ethical management",description:'Corporate Governance - "Ethical management." This pertains to the way in which companies are directed and controlled, ensuring they operate with fairness, transparency, and accountability to their stakeholders.'},{label:"Local engagement",description:'Community Involvement - "Local engagement." This emphasizes the importance of businesses and individuals participating in community development and support, such as local volunteering, support for community projects, and enhancement of local facilities.'},{label:"Diversity acceptance",description:'Cultural Awareness - "Diversity acceptance." Cultural responsibility involves recognizing, respecting, and preserving the various cultures within a community or society, promoting diversity and inclusion.'},{label:"Promoting well-being",description:'Health and Wellness - "Promoting well-being." This focuses on improving health outcomes for all members of society by advocating for better health services, education, and preventive measures to ensure public health and safety.'},{label:"Responsible purchasing",description:'Ethical Consumption - "Responsible purchasing." This involves making purchasing decisions that are conscious of the environmental and social impacts of products and services, supporting fair trade and ethically produced goods.'}],aD=[{label:"Bodily harm",description:'Physical Abuse - "Bodily harm." This form involves any intentional act causing injury or trauma to another person through physical contact. It includes hitting, punching, slapping, and other forms of physical assault.'},{label:"Psychological harm",description:'Emotional Abuse - "Psychological harm." Emotional or psychological abuse involves exposing someone to behavior that may result in psychological trauma, including anxiety, chronic depression, or post-traumatic stress disorder. It typically involves verbal assault, humiliation, intimidation, or infantilization.'},{label:"Violated consent",description:'Sexual Abuse - "Violated consent." This type of abuse involves forcing undesired sexual behavior by one person upon another. It ranges from non-consensual touching and coercive sexual acts to any sexual contact with someone unable to give consent.'},{label:"Economic control",description:`Financial Abuse - "Economic control." Financial or economic abuse involves controlling a person's ability to acquire, use, and maintain financial resources. Victims are often restricted from accessing funds or are stolen from directly, which diminishes their capacity to support themselves and forces dependency.`},{label:"Care deprivation",description:'Neglect - "Care deprivation." Neglect is a form of abuse where the caregiver fails to provide adequate care in terms of food, shelter, health care, and clothing to someone who cannot care for themselves, often resulting in deteriorating health or wellbeing.'},{label:"Destructive words",description:`Verbal Abuse - "Destructive words." This encompasses any use of language that is demeaning, derogatory, or insulting, intended to undermine the self-esteem of the person it's directed towards. It can be loud or subtle, including threats, insults, or excessively critical comments.`},{label:"Faith manipulation",description:'Spiritual Abuse - "Faith manipulation." This involves using a person’s spiritual beliefs to manipulate, control, or dominate them. It can include misusing doctrine, applying undue pressure to conform to specific beliefs, or exploiting spiritual authority for personal gain.'},{label:"Digital harassment",description:'Cyber Abuse - "Digital harassment." Cyber abuse takes place online and includes cyberbullying, stalking, and harassment. It uses digital technology to intimidate, threaten, or upset someone, often anonymously and repetitively.'}],lD=[{label:"Governance systems",description:'Politics - "Governance systems." This area involves the activities associated with the governance of a country or other area, especially the debate among individuals or parties having or hoping to achieve power. It shapes laws, policies, and the distribution of resources.'},{label:"Financial infrastructure",description:'Economy - "Financial infrastructure." The economy encompasses all activities related to production, consumption, and trade of goods and services in an area. It affects employment, income levels, and overall economic growth and stability.'},{label:"Knowledge dissemination",description:'Education - "Knowledge dissemination." This sector involves the systems and processes through which education is delivered, including schools, colleges, and educational content. It plays a crucial role in skill development, critical thinking, and social mobility.'},{label:"Spiritual practices",description:'Religion - "Spiritual practices." Religion pertains to the organized collection of beliefs, cultural systems, and world views that relate humanity to an order of existence. It often influences personal values, cultural norms, and community traditions.'},{label:"Medical services",description:'Healthcare - "Medical services." Healthcare represents the organized provision of medical care to individuals or a community through services offered by medical professionals. It impacts public health, life expectancy, and quality of life.'},{label:"Social expressions",description:'Culture - "Social expressions." Culture includes the arts, customs, practices, languages, values, and items that are passed along and valued by a group of people. It enriches societal interactions and reflects the historical and social context of the community.'},{label:"Ecological context",description:'Environment - "Ecological context." This area deals with the interaction between society and the natural surroundings, including issues of conservation, pollution control, and sustainable management of natural resources.'},{label:"Judicial frameworks",description:'Legal System - "Judicial frameworks." The legal system comprises the laws and regulations, as well as the processes and infrastructure for enforcing them, governing the behavior of the populace. It ensures order, resolves disputes, and maintains social justice.'}],M7={Emotions:nD,"Leadership styles":iD,"Attention types":rD,"Mental illness":sD,"Social rights":oD,"Abuse forms":aD,"Social areas":lD},uD=[];Object.values(M7).forEach(n=>n.forEach(e=>uD.push(e)));const E7={Emotions:nD,"Leadership styles":iD,"Attention types":rD,"Mental illness":sD,"Social rights":oD,"Abuse forms":aD,"Social areas":lD,All:uD},Iu="4.47.1";let OR=!1,hf,cD,hD,GS,fD,dD,pD,mD,gD;function b7(n,e={auto:!1}){if(OR)throw new Error(`you must \`import 'openai/shims/${n.kind}'\` before importing anything else from openai`);if(hf)throw new Error(`can't \`import 'openai/shims/${n.kind}'\` after \`import 'openai/shims/${hf}'\``);OR=e.auto,hf=n.kind,cD=n.fetch,hD=n.FormData,GS=n.File,fD=n.ReadableStream,dD=n.getMultipartRequestOptions,pD=n.getDefaultAgent,mD=n.fileFromPath,gD=n.isFsReadStream}class T7{constructor(e){this.body=e}get[Symbol.toStringTag](){return"MultipartBody"}}function A7({manuallyImported:n}={}){const e=n?"You may need to use polyfills":"Add one of these imports before your first `import … from 'openai'`:\n- `import 'openai/shims/node'` (if you're running on Node)\n- `import 'openai/shims/web'` (otherwise)\n";let t,i,r,s;try{t=fetch,i=Request,r=Response,s=Headers}catch(o){throw new Error(`this environment is missing the following Web Fetch API type: ${o.message}. ${e}`)}return{kind:"web",fetch:t,Request:i,Response:r,Headers:s,FormData:typeof FormData<"u"?FormData:class{constructor(){throw new Error(`file uploads aren't supported in this environment yet as 'FormData' is undefined. ${e}`)}},Blob:typeof Blob<"u"?Blob:class{constructor(){throw new Error(`file uploads aren't supported in this environment yet as 'Blob' is undefined. ${e}`)}},File:typeof File<"u"?File:class{constructor(){throw new Error(`file uploads aren't supported in this environment yet as 'File' is undefined. ${e}`)}},ReadableStream:typeof ReadableStream<"u"?ReadableStream:class{constructor(){throw new Error(`streaming isn't supported in this environment yet as 'ReadableStream' is undefined. ${e}`)}},getMultipartRequestOptions:async(o,a)=>({...a,body:new T7(o)}),getDefaultAgent:o=>{},fileFromPath:()=>{throw new Error("The `fileFromPath` function is only supported in Node. See the README for more details: https://www.github.com/openai/openai-node#file-uploads")},isFsReadStream:o=>!1}}hf||b7(A7(),{auto:!0});class kt extends Error{}class ci extends kt{constructor(e,t,i,r){super(`${ci.makeMessage(e,t,i)}`),this.status=e,this.headers=r,this.request_id=r==null?void 0:r["x-request-id"];const s=t;this.error=s,this.code=s==null?void 0:s.code,this.param=s==null?void 0:s.param,this.type=s==null?void 0:s.type}static makeMessage(e,t,i){const r=t!=null&&t.message?typeof t.message=="string"?t.message:JSON.stringify(t.message):t?JSON.stringify(t):i;return e&&r?`${e} ${r}`:e?`${e} status code (no body)`:r||"(no status code or body)"}static generate(e,t,i,r){if(!e)return new Q0({cause:jS(t)});const s=t==null?void 0:t.error;return e===400?new vD(e,s,i,r):e===401?new yD(e,s,i,r):e===403?new _D(e,s,i,r):e===404?new xD(e,s,i,r):e===409?new wD(e,s,i,r):e===422?new SD(e,s,i,r):e===429?new MD(e,s,i,r):e>=500?new ED(e,s,i,r):new ci(e,s,i,r)}}class _r extends ci{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0),this.status=void 0}}class Q0 extends ci{constructor({message:e,cause:t}){super(void 0,void 0,e||"Connection error.",void 0),this.status=void 0,t&&(this.cause=t)}}class aE extends Q0{constructor({message:e}={}){super({message:e??"Request timed out."})}}class vD extends ci{constructor(){super(...arguments),this.status=400}}class yD extends ci{constructor(){super(...arguments),this.status=401}}class _D extends ci{constructor(){super(...arguments),this.status=403}}class xD extends ci{constructor(){super(...arguments),this.status=404}}class wD extends ci{constructor(){super(...arguments),this.status=409}}class SD extends ci{constructor(){super(...arguments),this.status=422}}class MD extends ci{constructor(){super(...arguments),this.status=429}}class ED extends ci{}class Bs{constructor(e,t){this.iterator=e,this.controller=t}static fromSSEResponse(e,t){let i=!1;async function*r(){if(i)throw new Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let s=!1;try{for await(const o of C7(e,t))if(!s){if(o.data.startsWith("[DONE]")){s=!0;continue}if(o.event===null){let a;try{a=JSON.parse(o.data)}catch(l){throw console.error("Could not parse message into JSON:",o.data),console.error("From chunk:",o.raw),l}if(a&&a.error)throw new ci(void 0,a.error,void 0,void 0);yield a}else{let a;try{a=JSON.parse(o.data)}catch(l){throw console.error("Could not parse message into JSON:",o.data),console.error("From chunk:",o.raw),l}if(o.event=="error")throw new ci(void 0,a.error,a.message,void 0);yield{event:o.event,data:a}}}s=!0}catch(o){if(o instanceof Error&&o.name==="AbortError")return;throw o}finally{s||t.abort()}}return new Bs(r,t)}static fromReadableStream(e,t){let i=!1;async function*r(){const o=new Il,a=bD(e);for await(const l of a)for(const u of o.decode(l))yield u;for(const l of o.flush())yield l}async function*s(){if(i)throw new Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let o=!1;try{for await(const a of r())o||a&&(yield JSON.parse(a));o=!0}catch(a){if(a instanceof Error&&a.name==="AbortError")return;throw a}finally{o||t.abort()}}return new Bs(s,t)}[Symbol.asyncIterator](){return this.iterator()}tee(){const e=[],t=[],i=this.iterator(),r=s=>({next:()=>{if(s.length===0){const o=i.next();e.push(o),t.push(o)}return s.shift()}});return[new Bs(()=>r(e),this.controller),new Bs(()=>r(t),this.controller)]}toReadableStream(){const e=this;let t;const i=new TextEncoder;return new fD({async start(){t=e[Symbol.asyncIterator]()},async pull(r){try{const{value:s,done:o}=await t.next();if(o)return r.close();const a=i.encode(JSON.stringify(s)+` `);r.enqueue(a)}catch(s){r.error(s)}},async cancel(){var r;await((r=t.return)==null?void 0:r.call(t))}})}}async function*C7(n,e){if(!n.body)throw e.abort(),new kt("Attempted to iterate over a response with no body");const t=new I7,i=new Il,r=bD(n.body);for await(const s of R7(r))for(const o of i.decode(s)){const a=t.decode(o);a&&(yield a)}for(const s of i.flush()){const o=t.decode(s);o&&(yield o)}}async function*R7(n){let e=new Uint8Array;for await(const t of n){if(t==null)continue;const i=t instanceof ArrayBuffer?new Uint8Array(t):typeof t=="string"?new TextEncoder().encode(t):t;let r=new Uint8Array(e.length+i.length);r.set(e),r.set(i,e.length),e=r;let s;for(;(s=P7(e))!==-1;)yield e.slice(0,s),e=e.slice(s)}e.length>0&&(yield e)}function P7(n){for(let i=0;i0&&(r=[this.buffer.join("")+r[0],...r.slice(1)],this.buffer=[]),i||(this.buffer=[r.pop()||""]),r)}decodeText(e){if(e==null)return"";if(typeof e=="string")return e;if(typeof Buffer<"u"){if(e instanceof Buffer)return e.toString();if(e instanceof Uint8Array)return Buffer.from(e).toString();throw new kt(`Unexpected: received non-Uint8Array (${e.constructor.name}) stream chunk in an environment with a global "Buffer" defined, which this library assumes to be Node. Please report this error.`)}if(typeof TextDecoder<"u"){if(e instanceof Uint8Array||e instanceof ArrayBuffer)return this.textDecoder??(this.textDecoder=new TextDecoder("utf8")),this.textDecoder.decode(e);throw new kt(`Unexpected: received non-Uint8Array/ArrayBuffer (${e.constructor.name}) in a web platform. Please report this error.`)}throw new kt("Unexpected: neither Buffer nor TextDecoder are available as globals. Please report this error.")}flush(){if(!this.buffer.length&&!this.trailingCR)return[];const e=[this.buffer.join("")];return this.buffer=[],this.trailingCR=!1,e}}Il.NEWLINE_CHARS=new Set([` `,"\r"]);Il.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function L7(n,e){const t=n.indexOf(e);return t!==-1?[n.substring(0,t),e,n.substring(t+e.length)]:[n,"",""]}function bD(n){if(n[Symbol.asyncIterator])return n;const e=n.getReader();return{async next(){try{const t=await e.read();return t!=null&&t.done&&e.releaseLock(),t}catch(t){throw e.releaseLock(),t}},async return(){const t=e.cancel();return e.releaseLock(),await t,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}const TD=n=>n!=null&&typeof n=="object"&&typeof n.url=="string"&&typeof n.blob=="function",AD=n=>n!=null&&typeof n=="object"&&typeof n.name=="string"&&typeof n.lastModified=="number"&&CD(n),CD=n=>n!=null&&typeof n=="object"&&typeof n.size=="number"&&typeof n.type=="string"&&typeof n.text=="function"&&typeof n.slice=="function"&&typeof n.arrayBuffer=="function",N7=n=>AD(n)||TD(n)||gD(n);async function RD(n,e,t){var r;if(n=await n,t??(t=AD(n)?{lastModified:n.lastModified,type:n.type}:{}),TD(n)){const s=await n.blob();return e||(e=new URL(n.url).pathname.split(/[\\/]/).pop()??"unknown_file"),new GS([s],e,t)}const i=await D7(n);if(e||(e=k7(n)??"unknown_file"),!t.type){const s=(r=i[0])==null?void 0:r.type;typeof s=="string"&&(t={...t,type:s})}return new GS(i,e,t)}async function D7(n){var t;let e=[];if(typeof n=="string"||ArrayBuffer.isView(n)||n instanceof ArrayBuffer)e.push(n);else if(CD(n))e.push(await n.arrayBuffer());else if(F7(n))for await(const i of n)e.push(i);else throw new Error(`Unexpected data type: ${typeof n}; constructor: ${(t=n==null?void 0:n.constructor)==null?void 0:t.name}; props: ${O7(n)}`);return e}function O7(n){return`[${Object.getOwnPropertyNames(n).map(t=>`"${t}"`).join(", ")}]`}function k7(n){var e;return jx(n.name)||jx(n.filename)||((e=jx(n.path))==null?void 0:e.split(/[\\/]/).pop())}const jx=n=>{if(typeof n=="string")return n;if(typeof Buffer<"u"&&n instanceof Buffer)return String(n)},F7=n=>n!=null&&typeof n=="object"&&typeof n[Symbol.asyncIterator]=="function",kR=n=>n&&typeof n=="object"&&n.body&&n[Symbol.toStringTag]==="MultipartBody",td=async n=>{const e=await U7(n.body);return dD(e,n)},U7=async n=>{const e=new hD;return await Promise.all(Object.entries(n||{}).map(([t,i])=>WS(e,t,i))),e},WS=async(n,e,t)=>{if(t!==void 0){if(t==null)throw new TypeError(`Received null for "${e}"; to pass null in FormData, you must use the string 'null'`);if(typeof t=="string"||typeof t=="number"||typeof t=="boolean")n.append(e,String(t));else if(N7(t)){const i=await RD(t);n.append(e,i)}else if(Array.isArray(t))await Promise.all(t.map(i=>WS(n,e+"[]",i)));else if(typeof t=="object")await Promise.all(Object.entries(t).map(([i,r])=>WS(n,`${e}[${i}]`,r)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${t} instead`)}};var uc={},z7=function(n,e,t,i,r){if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(n,t),t},B7=function(n,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)},Bm;async function PD(n){const{response:e}=n;if(n.options.stream)return cc("response",e.status,e.url,e.headers,e.body),n.options.__streamClass?n.options.__streamClass.fromSSEResponse(e,n.controller):Bs.fromSSEResponse(e,n.controller);if(e.status===204)return null;if(n.options.__binaryResponse)return e;const t=e.headers.get("content-type");if((t==null?void 0:t.includes("application/json"))||(t==null?void 0:t.includes("application/vnd.api+json"))){const s=await e.json();return cc("response",e.status,e.url,e.headers,s),s}const r=await e.text();return cc("response",e.status,e.url,e.headers,r),r}class ey extends Promise{constructor(e,t=PD){super(i=>{i(null)}),this.responsePromise=e,this.parseResponse=t}_thenUnwrap(e){return new ey(this.responsePromise,async t=>e(await this.parseResponse(t)))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){const[e,t]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:t}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(this.parseResponse)),this.parsedPromise}then(e,t){return this.parse().then(e,t)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}}class V7{constructor({baseURL:e,maxRetries:t=2,timeout:i=6e5,httpAgent:r,fetch:s}){this.baseURL=e,this.maxRetries=Xx("maxRetries",t),this.timeout=Xx("timeout",i),this.httpAgent=r,this.fetch=s??cD}authHeaders(e){return{}}defaultHeaders(e){return{Accept:"application/json","Content-Type":"application/json","User-Agent":this.getUserAgent(),...$7(),...this.authHeaders(e)}}validateHeaders(e,t){}defaultIdempotencyKey(){return`stainless-node-retry-${K7()}`}get(e,t){return this.methodRequest("get",e,t)}post(e,t){return this.methodRequest("post",e,t)}patch(e,t){return this.methodRequest("patch",e,t)}put(e,t){return this.methodRequest("put",e,t)}delete(e,t){return this.methodRequest("delete",e,t)}methodRequest(e,t,i){return this.request(Promise.resolve(i).then(r=>({method:e,path:t,...r})))}getAPIList(e,t,i){return this.requestAPIList(t,{method:"get",path:e,...i})}calculateContentLength(e){if(typeof e=="string"){if(typeof Buffer<"u")return Buffer.byteLength(e,"utf8").toString();if(typeof TextEncoder<"u")return new TextEncoder().encode(e).length.toString()}return null}buildRequest(e){var v;const{method:t,path:i,query:r,headers:s={}}=e,o=kR(e.body)?e.body.body:e.body?JSON.stringify(e.body,null,2):null,a=this.calculateContentLength(o),l=this.buildURL(i,r);"timeout"in e&&Xx("timeout",e.timeout);const u=e.timeout??this.timeout,f=e.httpAgent??this.httpAgent??pD(l),d=u+1e3;typeof((v=f==null?void 0:f.options)==null?void 0:v.timeout)=="number"&&d>(f.options.timeout??0)&&(f.options.timeout=d),this.idempotencyHeader&&t!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),s[this.idempotencyHeader]=e.idempotencyKey);const p=this.buildHeaders({options:e,headers:s,contentLength:a});return{req:{method:t,...o&&{body:o},headers:p,...f&&{agent:f},signal:e.signal??null},url:l,timeout:u}}buildHeaders({options:e,headers:t,contentLength:i}){const r={};i&&(r["content-length"]=i);const s=this.defaultHeaders(e);return BR(r,s),BR(r,t),kR(e.body)&&hf!=="node"&&delete r["content-type"],this.validateHeaders(r,t),r}async prepareOptions(e){}async prepareRequest(e,{url:t,options:i}){}parseHeaders(e){return e?Symbol.iterator in e?Object.fromEntries(Array.from(e).map(t=>[...t])):{...e}:{}}makeStatusError(e,t,i,r){return ci.generate(e,t,i,r)}request(e,t=null){return new ey(this.makeRequest(e,t))}async makeRequest(e,t){var f,d;const i=await e;t==null&&(t=i.maxRetries??this.maxRetries),await this.prepareOptions(i);const{req:r,url:s,timeout:o}=this.buildRequest(i);if(await this.prepareRequest(r,{url:s,options:i}),cc("request",s,i,r.headers),(f=i.signal)!=null&&f.aborted)throw new _r;const a=new AbortController,l=await this.fetchWithTimeout(s,r,o,a).catch(jS);if(l instanceof Error){if((d=i.signal)!=null&&d.aborted)throw new _r;if(t)return this.retryRequest(i,t);throw l.name==="AbortError"?new aE:new Q0({cause:l})}const u=G7(l.headers);if(!l.ok){if(t&&this.shouldRetry(l)){const m=`retrying, ${t} attempts remaining`;return cc(`response (error; ${m})`,l.status,s,u),this.retryRequest(i,t,u)}const p=await l.text().catch(m=>jS(m).message),g=q7(p),v=g?void 0:p;throw cc(`response (error; ${t?"(error; no more retries left)":"(error; not retryable)"})`,l.status,s,u,v),this.makeStatusError(l.status,g,v,u)}return{response:l,options:i,controller:a}}requestAPIList(e,t){const i=this.makeRequest(t,null);return new H7(this,i,e)}buildURL(e,t){const i=Z7(e)?new URL(e):new URL(this.baseURL+(this.baseURL.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),r=this.defaultQuery();return LD(r)||(t={...r,...t}),typeof t=="object"&&t&&!Array.isArray(t)&&(i.search=this.stringifyQuery(t)),i.toString()}stringifyQuery(e){return Object.entries(e).filter(([t,i])=>typeof i<"u").map(([t,i])=>{if(typeof i=="string"||typeof i=="number"||typeof i=="boolean")return`${encodeURIComponent(t)}=${encodeURIComponent(i)}`;if(i===null)return`${encodeURIComponent(t)}=`;throw new kt(`Cannot stringify type ${typeof i}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}async fetchWithTimeout(e,t,i,r){const{signal:s,...o}=t||{};s&&s.addEventListener("abort",()=>r.abort());const a=setTimeout(()=>r.abort(),i);return this.getRequestClient().fetch.call(void 0,e,{signal:r.signal,...o}).finally(()=>{clearTimeout(a)})}getRequestClient(){return{fetch:this.fetch}}shouldRetry(e){const t=e.headers.get("x-should-retry");return t==="true"?!0:t==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,t,i){let r;const s=i==null?void 0:i["retry-after-ms"];if(s){const a=parseFloat(s);Number.isNaN(a)||(r=a)}const o=i==null?void 0:i["retry-after"];if(o&&!r){const a=parseFloat(o);Number.isNaN(a)?r=Date.parse(o)-Date.now():r=a*1e3}if(!(r&&0<=r&&r<60*1e3)){const a=e.maxRetries??this.maxRetries;r=this.calculateDefaultRetryTimeoutMillis(t,a)}return await Ed(r),this.makeRequest(e,t-1)}calculateDefaultRetryTimeoutMillis(e,t){const s=t-e,o=Math.min(.5*Math.pow(2,s),8),a=1-Math.random()*.25;return o*a*1e3}getUserAgent(){return`${this.constructor.name}/JS ${Iu}`}}class ID{constructor(e,t,i,r){Bm.set(this,void 0),z7(this,Bm,e),this.options=r,this.response=t,this.body=i}hasNextPage(){return this.getPaginatedItems().length?this.nextPageInfo()!=null:!1}async getNextPage(){const e=this.nextPageInfo();if(!e)throw new kt("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");const t={...this.options};if("params"in e&&typeof t.query=="object")t.query={...t.query,...e.params};else if("url"in e){const i=[...Object.entries(t.query||{}),...e.url.searchParams.entries()];for(const[r,s]of i)e.url.searchParams.set(r,s);t.query=void 0,t.path=e.url.toString()}return await B7(this,Bm,"f").requestAPIList(this.constructor,t)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(Bm=new WeakMap,Symbol.asyncIterator)](){for await(const e of this.iterPages())for(const t of e.getPaginatedItems())yield t}}class H7 extends ey{constructor(e,t,i){super(t,async r=>new i(e,r.response,await PD(r),r.options))}async*[Symbol.asyncIterator](){const e=await this;for await(const t of e)yield t}}const G7=n=>new Proxy(Object.fromEntries(n.entries()),{get(e,t){const i=t.toString();return e[i.toLowerCase()]||e[i]}}),W7={method:!0,path:!0,query:!0,body:!0,headers:!0,maxRetries:!0,stream:!0,timeout:!0,httpAgent:!0,signal:!0,idempotencyKey:!0,__binaryResponse:!0,__streamClass:!0},br=n=>typeof n=="object"&&n!==null&&!LD(n)&&Object.keys(n).every(e=>ND(W7,e)),j7=()=>{var e;if(typeof Deno<"u"&&Deno.build!=null)return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Iu,"X-Stainless-OS":UR(Deno.build.os),"X-Stainless-Arch":FR(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:((e=Deno.version)==null?void 0:e.deno)??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Iu,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":process.version};if(Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Iu,"X-Stainless-OS":UR(process.platform),"X-Stainless-Arch":FR(process.arch),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":process.version};const n=X7();return n?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Iu,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${n.browser}`,"X-Stainless-Runtime-Version":n.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":Iu,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function X7(){if(typeof navigator>"u"||!navigator)return null;const n=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(const{key:e,pattern:t}of n){const i=t.exec(navigator.userAgent);if(i){const r=i[1]||0,s=i[2]||0,o=i[3]||0;return{browser:e,version:`${r}.${s}.${o}`}}}return null}const FR=n=>n==="x32"?"x32":n==="x86_64"||n==="x64"?"x64":n==="arm"?"arm":n==="aarch64"||n==="arm64"?"arm64":n?`other:${n}`:"unknown",UR=n=>(n=n.toLowerCase(),n.includes("ios")?"iOS":n==="android"?"Android":n==="darwin"?"MacOS":n==="win32"?"Windows":n==="freebsd"?"FreeBSD":n==="openbsd"?"OpenBSD":n==="linux"?"Linux":n?`Other:${n}`:"Unknown");let zR;const $7=()=>zR??(zR=j7()),q7=n=>{try{return JSON.parse(n)}catch{return}},Y7=new RegExp("^(?:[a-z]+:)?//","i"),Z7=n=>Y7.test(n),Ed=n=>new Promise(e=>setTimeout(e,n)),Xx=(n,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new kt(`${n} must be an integer`);if(e<0)throw new kt(`${n} must be a positive integer`);return e},jS=n=>n instanceof Error?n:new Error(n),Vm=n=>{var e,t,i,r;if(typeof process<"u")return((e=uc==null?void 0:uc[n])==null?void 0:e.trim())??void 0;if(typeof Deno<"u")return(r=(i=(t=Deno.env)==null?void 0:t.get)==null?void 0:i.call(t,n))==null?void 0:r.trim()};function LD(n){if(!n)return!0;for(const e in n)return!1;return!0}function ND(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function BR(n,e){for(const t in e){if(!ND(e,t))continue;const i=t.toLowerCase();if(!i)continue;const r=e[t];r===null?delete n[i]:r!==void 0&&(n[i]=r)}}function cc(n,...e){typeof process<"u"&&(uc==null?void 0:uc.DEBUG)==="true"&&console.log(`OpenAI:DEBUG:${n}`,...e)}const K7=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,n=>{const e=Math.random()*16|0;return(n==="x"?e:e&3|8).toString(16)}),J7=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";function VR(n){return n!=null&&typeof n=="object"&&!Array.isArray(n)}class lE extends ID{constructor(e,t,i,r){super(e,t,i,r),this.data=i.data||[],this.object=i.object}getPaginatedItems(){return this.data??[]}nextPageParams(){return null}nextPageInfo(){return null}}class ws extends ID{constructor(e,t,i,r){super(e,t,i,r),this.data=i.data||[]}getPaginatedItems(){return this.data??[]}nextPageParams(){const e=this.nextPageInfo();if(!e)return null;if("params"in e)return e.params;const t=Object.fromEntries(e.url.searchParams);return Object.keys(t).length?t:null}nextPageInfo(){var i;const e=this.getPaginatedItems();if(!e.length)return null;const t=(i=e[e.length-1])==null?void 0:i.id;return t?{params:{after:t}}:null}}class tn{constructor(e){this._client=e}}let xv=class extends tn{create(e,t){return this._client.post("/chat/completions",{body:e,...t,stream:e.stream??!1})}};xv||(xv={});let wv=class extends tn{constructor(){super(...arguments),this.completions=new xv(this._client)}};(function(n){n.Completions=xv})(wv||(wv={}));class Sv extends tn{create(e,t){return this._client.post("/audio/speech",{body:e,...t,__binaryResponse:!0})}}Sv||(Sv={});class Mv extends tn{create(e,t){return this._client.post("/audio/transcriptions",td({body:e,...t}))}}Mv||(Mv={});class Ev extends tn{create(e,t){return this._client.post("/audio/translations",td({body:e,...t}))}}Ev||(Ev={});class bv extends tn{constructor(){super(...arguments),this.transcriptions=new Mv(this._client),this.translations=new Ev(this._client),this.speech=new Sv(this._client)}}(function(n){n.Transcriptions=Mv,n.Translations=Ev,n.Speech=Sv})(bv||(bv={}));class Tv extends tn{create(e,t){return this._client.post("/batches",{body:e,...t})}retrieve(e,t){return this._client.get(`/batches/${e}`,t)}list(e={},t){return br(e)?this.list({},e):this._client.getAPIList("/batches",uE,{query:e,...t})}cancel(e,t){return this._client.post(`/batches/${e}/cancel`,t)}}class uE extends ws{}(function(n){n.BatchesPage=uE})(Tv||(Tv={}));class Av extends tn{create(e,t){return this._client.post("/assistants",{body:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t==null?void 0:t.headers}})}retrieve(e,t){return this._client.get(`/assistants/${e}`,{...t,headers:{"OpenAI-Beta":"assistants=v2",...t==null?void 0:t.headers}})}update(e,t,i){return this._client.post(`/assistants/${e}`,{body:t,...i,headers:{"OpenAI-Beta":"assistants=v2",...i==null?void 0:i.headers}})}list(e={},t){return br(e)?this.list({},e):this._client.getAPIList("/assistants",cE,{query:e,...t,headers:{"OpenAI-Beta":"assistants=v2",...t==null?void 0:t.headers}})}del(e,t){return this._client.delete(`/assistants/${e}`,{...t,headers:{"OpenAI-Beta":"assistants=v2",...t==null?void 0:t.headers}})}}class cE extends ws{}(function(n){n.AssistantsPage=cE})(Av||(Av={}));function HR(n){return typeof n.parse=="function"}const hc=n=>(n==null?void 0:n.role)==="assistant",DD=n=>(n==null?void 0:n.role)==="function",OD=n=>(n==null?void 0:n.role)==="tool";var os=function(n,e,t,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(n,t):r?r.value=t:e.set(n,t),t},It=function(n,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)},Mi,_g,xg,Bh,Vh,wg,Hh,uo,Gh,Sg,Mg,Lu,XS,Cv,$S,qS,YS,ZS,kD,KS;const GR=10;class FD{constructor(){Mi.add(this),this.controller=new AbortController,_g.set(this,void 0),xg.set(this,()=>{}),Bh.set(this,()=>{}),Vh.set(this,void 0),wg.set(this,()=>{}),Hh.set(this,()=>{}),uo.set(this,{}),this._chatCompletions=[],this.messages=[],Gh.set(this,!1),Sg.set(this,!1),Mg.set(this,!1),Lu.set(this,!1),ZS.set(this,e=>{if(os(this,Sg,!0,"f"),e instanceof Error&&e.name==="AbortError"&&(e=new _r),e instanceof _r)return os(this,Mg,!0,"f"),this._emit("abort",e);if(e instanceof kt)return this._emit("error",e);if(e instanceof Error){const t=new kt(e.message);return t.cause=e,this._emit("error",t)}return this._emit("error",new kt(String(e)))}),os(this,_g,new Promise((e,t)=>{os(this,xg,e,"f"),os(this,Bh,t,"f")}),"f"),os(this,Vh,new Promise((e,t)=>{os(this,wg,e,"f"),os(this,Hh,t,"f")}),"f"),It(this,_g,"f").catch(()=>{}),It(this,Vh,"f").catch(()=>{})}_run(e){setTimeout(()=>{e().then(()=>{this._emitFinal(),this._emit("end")},It(this,ZS,"f"))},0)}_addChatCompletion(e){var i;this._chatCompletions.push(e),this._emit("chatCompletion",e);const t=(i=e.choices[0])==null?void 0:i.message;return t&&this._addMessage(t),e}_addMessage(e,t=!0){if("content"in e||(e.content=null),this.messages.push(e),t){if(this._emit("message",e),(DD(e)||OD(e))&&e.content)this._emit("functionCallResult",e.content);else if(hc(e)&&e.function_call)this._emit("functionCall",e.function_call);else if(hc(e)&&e.tool_calls)for(const i of e.tool_calls)i.type==="function"&&this._emit("functionCall",i.function)}}_connected(){this.ended||(It(this,xg,"f").call(this),this._emit("connect"))}get ended(){return It(this,Gh,"f")}get errored(){return It(this,Sg,"f")}get aborted(){return It(this,Mg,"f")}abort(){this.controller.abort()}on(e,t){return(It(this,uo,"f")[e]||(It(this,uo,"f")[e]=[])).push({listener:t}),this}off(e,t){const i=It(this,uo,"f")[e];if(!i)return this;const r=i.findIndex(s=>s.listener===t);return r>=0&&i.splice(r,1),this}once(e,t){return(It(this,uo,"f")[e]||(It(this,uo,"f")[e]=[])).push({listener:t,once:!0}),this}emitted(e){return new Promise((t,i)=>{os(this,Lu,!0,"f"),e!=="error"&&this.once("error",i),this.once(e,t)})}async done(){os(this,Lu,!0,"f"),await It(this,Vh,"f")}async finalChatCompletion(){await this.done();const e=this._chatCompletions[this._chatCompletions.length-1];if(!e)throw new kt("stream ended without producing a ChatCompletion");return e}async finalContent(){return await this.done(),It(this,Mi,"m",XS).call(this)}async finalMessage(){return await this.done(),It(this,Mi,"m",Cv).call(this)}async finalFunctionCall(){return await this.done(),It(this,Mi,"m",$S).call(this)}async finalFunctionCallResult(){return await this.done(),It(this,Mi,"m",qS).call(this)}async totalUsage(){return await this.done(),It(this,Mi,"m",YS).call(this)}allChatCompletions(){return[...this._chatCompletions]}_emit(e,...t){if(It(this,Gh,"f"))return;e==="end"&&(os(this,Gh,!0,"f"),It(this,wg,"f").call(this));const i=It(this,uo,"f")[e];if(i&&(It(this,uo,"f")[e]=i.filter(r=>!r.once),i.forEach(({listener:r})=>r(...t))),e==="abort"){const r=t[0];!It(this,Lu,"f")&&!(i!=null&&i.length)&&Promise.reject(r),It(this,Bh,"f").call(this,r),It(this,Hh,"f").call(this,r),this._emit("end");return}if(e==="error"){const r=t[0];!It(this,Lu,"f")&&!(i!=null&&i.length)&&Promise.reject(r),It(this,Bh,"f").call(this,r),It(this,Hh,"f").call(this,r),this._emit("end")}}_emitFinal(){const e=this._chatCompletions[this._chatCompletions.length-1];e&&this._emit("finalChatCompletion",e);const t=It(this,Mi,"m",Cv).call(this);t&&this._emit("finalMessage",t);const i=It(this,Mi,"m",XS).call(this);i&&this._emit("finalContent",i);const r=It(this,Mi,"m",$S).call(this);r&&this._emit("finalFunctionCall",r);const s=It(this,Mi,"m",qS).call(this);s!=null&&this._emit("finalFunctionCallResult",s),this._chatCompletions.some(o=>o.usage)&&this._emit("totalUsage",It(this,Mi,"m",YS).call(this))}async _createChatCompletion(e,t,i){const r=i==null?void 0:i.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),It(this,Mi,"m",kD).call(this,t);const s=await e.create({...t,stream:!1},{...i,signal:this.controller.signal});return this._connected(),this._addChatCompletion(s)}async _runChatCompletion(e,t,i){for(const r of t.messages)this._addMessage(r,!1);return await this._createChatCompletion(e,t,i)}async _runFunctions(e,t,i){var p;const r="function",{function_call:s="auto",stream:o,...a}=t,l=typeof s!="string"&&(s==null?void 0:s.name),{maxChatCompletions:u=GR}=i||{},f={};for(const g of t.functions)f[g.name||g.function.name]=g;const d=t.functions.map(g=>({name:g.name||g.function.name,parameters:g.parameters,description:g.description}));for(const g of t.messages)this._addMessage(g,!1);for(let g=0;gJSON.stringify(C.name)).join(", ")}. Please try again`;this._addMessage({role:r,name:_,content:A});continue}let S;try{S=HR(w)?await w.parse(m):m}catch(A){this._addMessage({role:r,name:_,content:A instanceof Error?A.message:String(A)});continue}const b=await w.function(S,this),R=It(this,Mi,"m",KS).call(this,b);if(this._addMessage({role:r,name:_,content:R}),l)return}}async _runTools(e,t,i){var p,g;const r="tool",{tool_choice:s="auto",stream:o,...a}=t,l=typeof s!="string"&&((p=s==null?void 0:s.function)==null?void 0:p.name),{maxChatCompletions:u=GR}=i||{},f={};for(const v of t.tools)v.type==="function"&&(f[v.function.name||v.function.function.name]=v.function);const d="tools"in t?t.tools.map(v=>v.type==="function"?{type:"function",function:{name:v.function.name||v.function.function.name,parameters:v.function.parameters,description:v.function.description}}:v):void 0;for(const v of t.messages)this._addMessage(v,!1);for(let v=0;vJSON.stringify(E.function.name)).join(", ")}. Please try again`;this._addMessage({role:r,tool_call_id:w,content:I});continue}let A;try{A=HR(R)?await R.parse(b):b}catch(I){const E=I instanceof Error?I.message:String(I);this._addMessage({role:r,tool_call_id:w,content:E});continue}const C=await R.function(A,this),L=It(this,Mi,"m",KS).call(this,C);if(this._addMessage({role:r,tool_call_id:w,content:L}),l)return}}}}_g=new WeakMap,xg=new WeakMap,Bh=new WeakMap,Vh=new WeakMap,wg=new WeakMap,Hh=new WeakMap,uo=new WeakMap,Gh=new WeakMap,Sg=new WeakMap,Mg=new WeakMap,Lu=new WeakMap,ZS=new WeakMap,Mi=new WeakSet,XS=function(){return It(this,Mi,"m",Cv).call(this).content??null},Cv=function(){let e=this.messages.length;for(;e-- >0;){const t=this.messages[e];if(hc(t))return{...t,content:t.content??null}}throw new kt("stream ended without producing a ChatCompletionMessage with role=assistant")},$S=function(){var e,t;for(let i=this.messages.length-1;i>=0;i--){const r=this.messages[i];if(hc(r)&&(r!=null&&r.function_call))return r.function_call;if(hc(r)&&((e=r==null?void 0:r.tool_calls)!=null&&e.length))return(t=r.tool_calls.at(-1))==null?void 0:t.function}},qS=function(){for(let e=this.messages.length-1;e>=0;e--){const t=this.messages[e];if(DD(t)&&t.content!=null||OD(t)&&t.content!=null&&this.messages.some(i=>{var r;return i.role==="assistant"&&((r=i.tool_calls)==null?void 0:r.some(s=>s.type==="function"&&s.id===t.tool_call_id))}))return t.content}},YS=function(){const e={completion_tokens:0,prompt_tokens:0,total_tokens:0};for(const{usage:t}of this._chatCompletions)t&&(e.completion_tokens+=t.completion_tokens,e.prompt_tokens+=t.prompt_tokens,e.total_tokens+=t.total_tokens);return e},kD=function(e){if(e.n!=null&&e.n>1)throw new kt("ChatCompletion convenience helpers only support n=1 at this time. To use n>1, please use chat.completions.create() directly.")},KS=function(e){return typeof e=="string"?e:e===void 0?"undefined":JSON.stringify(e)};class nd extends FD{static runFunctions(e,t,i){const r=new nd,s={...i,headers:{...i==null?void 0:i.headers,"X-Stainless-Helper-Method":"runFunctions"}};return r._run(()=>r._runFunctions(e,t,s)),r}static runTools(e,t,i){const r=new nd,s={...i,headers:{...i==null?void 0:i.headers,"X-Stainless-Helper-Method":"runTools"}};return r._run(()=>r._runTools(e,t,s)),r}_addMessage(e){super._addMessage(e),hc(e)&&e.content&&this._emit("content",e.content)}}var as=function(n,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)},$x=function(n,e,t,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(n,t):r?r.value=t:e.set(n,t),t},Ps,na,qx,Yx,Hm,WR;class id extends FD{constructor(){super(...arguments),Ps.add(this),na.set(this,void 0)}get currentChatCompletionSnapshot(){return as(this,na,"f")}static fromReadableStream(e){const t=new id;return t._run(()=>t._fromReadableStream(e)),t}static createChatCompletion(e,t,i){const r=new id;return r._run(()=>r._runChatCompletion(e,{...t,stream:!0},{...i,headers:{...i==null?void 0:i.headers,"X-Stainless-Helper-Method":"stream"}})),r}async _createChatCompletion(e,t,i){var o;const r=i==null?void 0:i.signal;r&&(r.aborted&&this.controller.abort(),r.addEventListener("abort",()=>this.controller.abort())),as(this,Ps,"m",qx).call(this);const s=await e.create({...t,stream:!0},{...i,signal:this.controller.signal});this._connected();for await(const a of s)as(this,Ps,"m",Yx).call(this,a);if((o=s.controller.signal)!=null&&o.aborted)throw new _r;return this._addChatCompletion(as(this,Ps,"m",Hm).call(this))}async _fromReadableStream(e,t){var o;const i=t==null?void 0:t.signal;i&&(i.aborted&&this.controller.abort(),i.addEventListener("abort",()=>this.controller.abort())),as(this,Ps,"m",qx).call(this),this._connected();const r=Bs.fromReadableStream(e,this.controller);let s;for await(const a of r)s&&s!==a.id&&this._addChatCompletion(as(this,Ps,"m",Hm).call(this)),as(this,Ps,"m",Yx).call(this,a),s=a.id;if((o=r.controller.signal)!=null&&o.aborted)throw new _r;return this._addChatCompletion(as(this,Ps,"m",Hm).call(this))}[(na=new WeakMap,Ps=new WeakSet,qx=function(){this.ended||$x(this,na,void 0,"f")},Yx=function(t){var o,a,l;if(this.ended)return;const i=as(this,Ps,"m",WR).call(this,t);this._emit("chunk",t,i);const r=(a=(o=t.choices[0])==null?void 0:o.delta)==null?void 0:a.content,s=(l=i.choices[0])==null?void 0:l.message;r!=null&&(s==null?void 0:s.role)==="assistant"&&(s!=null&&s.content)&&this._emit("content",r,s.content)},Hm=function(){if(this.ended)throw new kt("stream has ended, this shouldn't happen");const t=as(this,na,"f");if(!t)throw new kt("request ended without sending any chunks");return $x(this,na,void 0,"f"),Q7(t)},WR=function(t){var i,r,s;let o=as(this,na,"f");const{choices:a,...l}=t;o?Object.assign(o,l):o=$x(this,na,{...l,choices:[]},"f");for(const{delta:u,finish_reason:f,index:d,logprobs:p=null,...g}of t.choices){let v=o.choices[d];if(v||(v=o.choices[d]={finish_reason:f,index:d,message:{},logprobs:p,...g}),p)if(!v.logprobs)v.logprobs=Object.assign({},p);else{const{content:b,...R}=p;Object.assign(v.logprobs,R),b&&((i=v.logprobs).content??(i.content=[]),v.logprobs.content.push(...b))}if(f&&(v.finish_reason=f),Object.assign(v,g),!u)continue;const{content:x,function_call:_,role:m,tool_calls:w,...S}=u;if(Object.assign(v.message,S),x&&(v.message.content=(v.message.content||"")+x),m&&(v.message.role=m),_&&(v.message.function_call?(_.name&&(v.message.function_call.name=_.name),_.arguments&&((r=v.message.function_call).arguments??(r.arguments=""),v.message.function_call.arguments+=_.arguments)):v.message.function_call=_),w){v.message.tool_calls||(v.message.tool_calls=[]);for(const{index:b,id:R,type:A,function:C,...L}of w){const I=(s=v.message.tool_calls)[b]??(s[b]={});Object.assign(I,L),R&&(I.id=R),A&&(I.type=A),C&&(I.function??(I.function={arguments:""})),C!=null&&C.name&&(I.function.name=C.name),C!=null&&C.arguments&&(I.function.arguments+=C.arguments)}}}return o},Symbol.asyncIterator)](){const e=[],t=[];let i=!1;return this.on("chunk",r=>{const s=t.shift();s?s.resolve(r):e.push(r)}),this.on("end",()=>{i=!0;for(const r of t)r.resolve(void 0);t.length=0}),this.on("abort",r=>{i=!0;for(const s of t)s.reject(r);t.length=0}),this.on("error",r=>{i=!0;for(const s of t)s.reject(r);t.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:i?{value:void 0,done:!0}:new Promise((s,o)=>t.push({resolve:s,reject:o})).then(s=>s?{value:s,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new Bs(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}function Q7(n){const{id:e,choices:t,created:i,model:r,system_fingerprint:s,...o}=n;return{...o,id:e,choices:t.map(({message:a,finish_reason:l,index:u,logprobs:f,...d})=>{if(!l)throw new kt(`missing finish_reason for choice ${u}`);const{content:p=null,function_call:g,tool_calls:v,...x}=a,_=a.role;if(!_)throw new kt(`missing role for choice ${u}`);if(g){const{arguments:m,name:w}=g;if(m==null)throw new kt(`missing function_call.arguments for choice ${u}`);if(!w)throw new kt(`missing function_call.name for choice ${u}`);return{...d,message:{content:p,function_call:{arguments:m,name:w},role:_},finish_reason:l,index:u,logprobs:f}}return v?{...d,index:u,finish_reason:l,logprobs:f,message:{...x,role:_,content:p,tool_calls:v.map((m,w)=>{const{function:S,type:b,id:R,...A}=m,{arguments:C,name:L,...I}=S||{};if(R==null)throw new kt(`missing choices[${u}].tool_calls[${w}].id @@ -3990,4 +3990,4 @@ ${Wm}] ${Wm}rows: ${n.rows} ${Wm}columns: ${n.columns} }`}function r$(n,e,t,i,r){const{rows:s,columns:o}=n,a=Math.min(s,e),l=Math.min(o,t),u=[];if(r==="auto"){r=!1;e:for(let f=0;f=0&&t?` ${tP(n,e-1)}`:tP(n,e)).padEnd(e)}function tP(n,e){let t=n.toString();if(t.length<=e)return t;let i=n.toFixed(e);if(i.length>e&&(i=n.toFixed(Math.max(0,e-(i.length-e)))),i.length<=e&&!i.startsWith("0.000")&&!i.startsWith("-0.000"))return i;let r=n.toExponential(e);return r.length>e&&(r=n.toExponential(Math.max(0,e-(r.length-e)))),r.slice(0)}function o$(n,e){n.prototype.add=function(i){return typeof i=="number"?this.addS(i):this.addM(i)},n.prototype.addS=function(i){for(let r=0;r>i);return this},n.prototype.signPropagatingRightShiftM=function(i){if(i=e.checkMatrix(i),this.rows!==i.rows||this.columns!==i.columns)throw new RangeError("Matrices dimensions must be equal");for(let r=0;r>i.get(r,s));return this},n.signPropagatingRightShift=function(i,r){return new e(i).signPropagatingRightShift(r)},n.prototype.rightShift=function(i){return typeof i=="number"?this.rightShiftS(i):this.rightShiftM(i)},n.prototype.rightShiftS=function(i){for(let r=0;r>>i);return this},n.prototype.rightShiftM=function(i){if(i=e.checkMatrix(i),this.rows!==i.rows||this.columns!==i.columns)throw new RangeError("Matrices dimensions must be equal");for(let r=0;r>>i.get(r,s));return this},n.rightShift=function(i,r){return new e(i).rightShift(r)},n.prototype.zeroFillRightShift=n.prototype.rightShift,n.prototype.zeroFillRightShiftS=n.prototype.rightShiftS,n.prototype.zeroFillRightShiftM=n.prototype.rightShiftM,n.zeroFillRightShift=n.rightShift,n.prototype.not=function(){for(let i=0;ii)throw new RangeError("Row index out of range")}function Br(n,e,t){let i=t?n.columns:n.columns-1;if(e<0||e>i)throw new RangeError("Column index out of range")}function Du(n,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==n.columns)throw new RangeError("vector size must be the same as the number of columns");return e}function Ou(n,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==n.rows)throw new RangeError("vector size must be the same as the number of rows");return e}function wE(n,e){if(!Zi.isAnyArray(e))throw new TypeError("row indices must be an array");for(let t=0;t=n.rows)throw new RangeError("row indices are out of range")}function SE(n,e){if(!Zi.isAnyArray(e))throw new TypeError("column indices must be an array");for(let t=0;t=n.columns)throw new RangeError("column indices are out of range")}function s1(n,e,t,i,r){if(arguments.length!==5)throw new RangeError("expected 4 arguments");if(jm("startRow",e),jm("endRow",t),jm("startColumn",i),jm("endColumn",r),e>t||i>r||e<0||e>=n.rows||t<0||t>=n.rows||i<0||i>=n.columns||r<0||r>=n.columns)throw new RangeError("Submatrix indices are out of range")}function sy(n,e=0){let t=[];for(let i=0;i=s)throw new RangeError("min must be smaller than max");let a=s-r,l=new Oe(e,t);for(let u=0;ui?(s=!0,i=t):(r=!1,s=!0);e++}return r}isReducedEchelonForm(){let e=0,t=0,i=-1,r=!0,s=!1;for(;ei?(s=!0,i=t):(r=!1,s=!0);for(let o=t+1;oe.get(r,i)&&(r=s);if(e.get(r,i)===0)i++;else{e.swapRows(t,r);let s=e.get(t,i);for(let o=i;o=0;)if(e.maxRow(r)===0)r--;else{let s=0,o=!1;for(;st[i]&&(t[i]=this.get(i,r));return t}case"column":{const t=new Array(this.columns).fill(Number.NEGATIVE_INFINITY);for(let i=0;it[r]&&(t[r]=this.get(i,r));return t}case void 0:{let t=this.get(0,0);for(let i=0;it&&(t=this.get(i,r));return t}default:throw new Error(`invalid option: ${e}`)}}maxIndex(){Cu(this);let e=this.get(0,0),t=[0,0];for(let i=0;ie&&(e=this.get(i,r),t[0]=i,t[1]=r);return t}min(e){if(this.isEmpty())return NaN;switch(e){case"row":{const t=new Array(this.rows).fill(Number.POSITIVE_INFINITY);for(let i=0;it&&(t=this.get(e,i));return t}maxRowIndex(e){zr(this,e),Cu(this);let t=this.get(e,0),i=[e,0];for(let r=1;rt&&(t=this.get(e,r),i[1]=r);return i}minRow(e){if(zr(this,e),this.isEmpty())return NaN;let t=this.get(e,0);for(let i=1;it&&(t=this.get(i,e));return t}maxColumnIndex(e){Br(this,e),Cu(this);let t=this.get(0,e),i=[0,e];for(let r=1;rt&&(t=this.get(r,e),i[0]=r);return i}minColumn(e){if(Br(this,e),this.isEmpty())return NaN;let t=this.get(0,e);for(let i=1;i=i)throw new RangeError("min must be smaller than max");let r=new Oe(this.rows,this.columns);for(let s=0;s0&&eP(o,{min:t,max:i,output:o}),r.setRow(s,o)}return r}scaleColumns(e={}){if(typeof e!="object")throw new TypeError("options must be an object");const{min:t=0,max:i=1}=e;if(!Number.isFinite(t))throw new TypeError("min must be a number");if(!Number.isFinite(i))throw new TypeError("max must be a number");if(t>=i)throw new RangeError("min must be smaller than max");let r=new Oe(this.rows,this.columns);for(let s=0;si||t<0||t>=this.columns||i<0||i>=this.columns)throw new RangeError("Argument out of range");let r=new Oe(e.length,i-t+1);for(let s=0;s=this.rows)throw new RangeError(`Row index out of range: ${e[s]}`);r.set(s,o-t,this.get(e[s],o))}return r}subMatrixColumn(e,t,i){if(t===void 0&&(t=0),i===void 0&&(i=this.rows-1),t>i||t<0||t>=this.rows||i<0||i>=this.rows)throw new RangeError("Argument out of range");let r=new Oe(i-t+1,e.length);for(let s=0;s=this.columns)throw new RangeError(`Column index out of range: ${e[s]}`);r.set(o-t,s,this.get(o,e[s]))}return r}setSubMatrix(e,t,i){if(e=Oe.checkMatrix(e),e.isEmpty())return this;let r=t+e.rows-1,s=i+e.columns-1;s1(this,t,r,i,s);for(let o=0;otypeof e=="number")}xt.random=xt.rand;xt.randomInt=xt.randInt;xt.diagonal=xt.diag;xt.prototype.diagonal=xt.prototype.diag;xt.identity=xt.eye;xt.prototype.negate=xt.prototype.neg;xt.prototype.tensorProduct=xt.prototype.kroneckerProduct;var od,o1,Ac;let Oe=(Ac=class extends xt{constructor(t,i){super();g_(this,od);wp(this,"data");if(Ac.isMatrix(t))v_(this,od,o1).call(this,t.rows,t.columns),Ac.copy(t,this);else if(Number.isInteger(t)&&t>=0)v_(this,od,o1).call(this,t,i);else if(Zi.isAnyArray(t)){const r=t;if(t=r.length,i=t?r[0].length:0,typeof i!="number")throw new TypeError("Data must be a 2D array with at least one element");this.data=[];for(let s=0;s"u"&&(i=t,t=this.columns),Br(this,t,!0),i=Ou(this,i);for(let r=0;r=0)for(let r=0;r=0)Sp(this,Ei,new Oe(t,t));else if(Sp(this,Ei,new Oe(t)),!this.isSymmetric())throw new TypeError("not symmetric data")}get size(){return ts(this,Ei).size}get rows(){return ts(this,Ei).rows}get columns(){return ts(this,Ei).columns}get diagonalSize(){return this.rows}static isSymmetricMatrix(t){return Oe.isMatrix(t)&&t.klassType==="SymmetricMatrix"}static zeros(t){return new this(t)}static ones(t){return new this(t).fill(1)}clone(){const t=new Yv(this.diagonalSize);for(const[i,r,s]of this.upperRightEntries())t.set(i,r,s);return t}toMatrix(){return new Oe(this)}get(t,i){return ts(this,Ei).get(t,i)}set(t,i,r){return ts(this,Ei).set(t,i,r),ts(this,Ei).set(i,t,r),this}removeCross(t){return ts(this,Ei).removeRow(t),ts(this,Ei).removeColumn(t),this}addCross(t,i){i===void 0&&(i=t,t=this.diagonalSize);const r=i.slice();return r.splice(t,1),ts(this,Ei).addRow(t,r),ts(this,Ei).addColumn(t,i),this}applyMask(t){if(t.length!==this.diagonalSize)throw new RangeError("Mask size do not match with matrix size");const i=[];for(const[r,s]of t.entries())s||i.push(r);i.reverse();for(const r of i)this.removeCross(r);return this}toCompact(){const{diagonalSize:t}=this,i=new Array(t*(t+1)/2);for(let r=0,s=0,o=0;o=t&&(r=++s);return i}static fromCompact(t){const i=t.length,r=(Math.sqrt(8*i+1)-1)/2;if(!Number.isInteger(r))throw new TypeError(`This array is not a compact representation of a Symmetric Matrix, ${JSON.stringify(t)}`);const s=new Yv(r);for(let o=0,a=0,l=0;l=r&&(o=++a);return s}*upperRightEntries(){for(let t=0,i=0;t=this.diagonalSize&&(i=++t)}}*upperRightValues(){for(let t=0,i=0;t=this.diagonalSize&&(i=++t)}};Ei=new WeakMap;let wl=Yv;wl.prototype.klassType="SymmetricMatrix";class oy extends wl{static isDistanceMatrix(e){return wl.isSymmetricMatrix(e)&&e.klassSubType==="DistanceMatrix"}constructor(e){if(super(e),!this.isDistance())throw new TypeError("Provided arguments do no produce a distance matrix")}set(e,t,i){return e===t&&(i=0),super.set(e,t,i)}addCross(e,t){return t===void 0&&(t=e,e=this.diagonalSize),t=t.slice(),t[e]=0,super.addCross(e,t)}toSymmetricMatrix(){return new wl(this)}clone(){const e=new oy(this.diagonalSize);for(const[t,i,r]of this.upperRightEntries())t!==i&&e.set(t,i,r);return e}toCompact(){const{diagonalSize:e}=this,t=(e-1)*e/2,i=new Array(t);for(let r=1,s=0,o=0;o=e&&(r=++s+1);return i}static fromCompact(e){const t=e.length,i=(Math.sqrt(8*t+1)+1)/2;if(!Number.isInteger(i))throw new TypeError(`This array is not a compact representation of a DistanceMatrix, ${JSON.stringify(e)}`);const r=new this(i);for(let s=1,o=0,a=0;a=i&&(s=++o+1);return r}}oy.prototype.klassSubType="DistanceMatrix";class ko extends xt{constructor(e,t,i){super(),this.matrix=e,this.rows=t,this.columns=i}}class T$ extends ko{constructor(e,t){Br(e,t),super(e,e.rows,1),this.column=t}set(e,t,i){return this.matrix.set(e,this.column,i),this}get(e){return this.matrix.get(e,this.column)}}class A$ extends ko{constructor(e,t){SE(e,t),super(e,e.rows,t.length),this.columnIndices=t}set(e,t,i){return this.matrix.set(e,this.columnIndices[t],i),this}get(e,t){return this.matrix.get(e,this.columnIndices[t])}}class C$ extends ko{constructor(e){super(e,e.rows,e.columns)}set(e,t,i){return this.matrix.set(e,this.columns-t-1,i),this}get(e,t){return this.matrix.get(e,this.columns-t-1)}}class R$ extends ko{constructor(e){super(e,e.rows,e.columns)}set(e,t,i){return this.matrix.set(this.rows-e-1,t,i),this}get(e,t){return this.matrix.get(this.rows-e-1,t)}}class P$ extends ko{constructor(e,t){zr(e,t),super(e,1,e.columns),this.row=t}set(e,t,i){return this.matrix.set(this.row,t,i),this}get(e,t){return this.matrix.get(this.row,t)}}class I$ extends ko{constructor(e,t){wE(e,t),super(e,t.length,e.columns),this.rowIndices=t}set(e,t,i){return this.matrix.set(this.rowIndices[e],t,i),this}get(e,t){return this.matrix.get(this.rowIndices[e],t)}}class Ng extends ko{constructor(e,t,i){wE(e,t),SE(e,i),super(e,t.length,i.length),this.rowIndices=t,this.columnIndices=i}set(e,t,i){return this.matrix.set(this.rowIndices[e],this.columnIndices[t],i),this}get(e,t){return this.matrix.get(this.rowIndices[e],this.columnIndices[t])}}class L$ extends ko{constructor(e,t,i,r,s){s1(e,t,i,r,s),super(e,i-t+1,s-r+1),this.startRow=t,this.startColumn=r}set(e,t,i){return this.matrix.set(this.startRow+e,this.startColumn+t,i),this}get(e,t){return this.matrix.get(this.startRow+e,this.startColumn+t)}}class N$ extends ko{constructor(e){super(e,e.columns,e.rows)}set(e,t,i){return this.matrix.set(t,e,i),this}get(e,t){return this.matrix.get(t,e)}}class JD extends xt{constructor(e,t={}){const{rows:i=1}=t;if(e.length%i!==0)throw new Error("the data length is not divisible by the number of rows");super(),this.rows=i,this.columns=e.length/i,this.data=e}set(e,t,i){let r=this._calculateIndex(e,t);return this.data[r]=i,this}get(e,t){let i=this._calculateIndex(e,t);return this.data[i]}_calculateIndex(e,t){return e*this.columns+t}}class Tr extends xt{constructor(e){super(),this.data=e,this.rows=e.length,this.columns=e[0].length}set(e,t,i){return this.data[e][t]=i,this}get(e,t){return this.data[e][t]}}function D$(n,e){if(Zi.isAnyArray(n))return n[0]&&Zi.isAnyArray(n[0])?new Tr(n):new JD(n,e);throw new Error("the argument is not an array")}class ay{constructor(e){e=Tr.checkMatrix(e);let t=e.clone(),i=t.rows,r=t.columns,s=new Float64Array(i),o=1,a,l,u,f,d,p,g,v,x;for(a=0;aMath.abs(v[f])&&(f=a);if(f!==l){for(u=0;u=0;u--){for(l=0;lo?r.set(s,o,e.get(s,o)):s===o?r.set(s,o,1):r.set(s,o,0);return r}get upperTriangularMatrix(){let e=this.LU,t=e.rows,i=e.columns,r=new Oe(t,i);for(let s=0;sMath.abs(e)?(t=e/n,Math.abs(n)*Math.sqrt(1+t*t)):e!==0?(t=n/e,Math.abs(e)*Math.sqrt(1+t*t)):0}class ME{constructor(e){e=Tr.checkMatrix(e);let t=e.clone(),i=e.rows,r=e.columns,s=new Float64Array(r),o,a,l,u;for(l=0;l=0;u--){for(l=0;l=0;a--){for(s=0;s=0;E--)if(v[E]!==0){for(let N=E+1;N=0;E--){if(E0;){let E,N;for(E=C-2;E>=-1&&E!==-1;E--){const z=Number.MIN_VALUE+I*Math.abs(v[E]+Math.abs(v[E+1]));if(Math.abs(m[E])<=z||Number.isNaN(m[E])){m[E]=0;break}}if(E===C-2)N=4;else{let z;for(z=C-1;z>=E&&z!==E;z--){let O=(z!==C?Math.abs(m[z]):0)+(z!==E+1?Math.abs(m[z-1]):0);if(Math.abs(v[z])<=I*O){v[z]=0;break}}z===E?N=3:z===C-1?N=1:(N=2,E=z)}switch(E++,N){case 1:{let z=m[C-2];m[C-2]=0;for(let O=C-2;O>=E;O--){let q=po(v[O],z),j=v[O]/q,Q=z/q;if(v[O]=q,O!==E&&(z=-Q*m[O-1],m[O-1]=j*m[O-1]),u)for(let oe=0;oe=v[E+1]);){let z=v[E];if(v[E]=v[E+1],v[E+1]=z,u&&Et&&s.set(f,d,e.get(f,d)/this.s[d]);let o=this.U,a=o.rows,l=o.columns,u=new Oe(i,a);for(let f=0;fe&&t++;return t}get diagonal(){return Array.from(this.s)}get threshold(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}get leftSingularVectors(){return this.U}get rightSingularVectors(){return this.V}get diagonalMatrix(){return Oe.diag(this.s)}}function O$(n,e=!1){return n=Tr.checkMatrix(n),e?new Vc(n).inverse():QD(n,Oe.eye(n.rows))}function QD(n,e,t=!1){return n=Tr.checkMatrix(n),e=Tr.checkMatrix(e),t?new Vc(n).solve(e):n.isSquare()?new ay(n).solve(e):new ME(n).solve(e)}function Dg(n){if(n=Oe.checkMatrix(n),n.isSquare()){if(n.columns===0)return 1;let e,t,i,r;if(n.columns===2)return e=n.get(0,0),t=n.get(0,1),i=n.get(1,0),r=n.get(1,1),e*r-t*i;if(n.columns===3){let s,o,a;return s=new Ng(n,[1,2],[1,2]),o=new Ng(n,[1,2],[0,2]),a=new Ng(n,[1,2],[0,1]),e=n.get(0,0),t=n.get(0,1),i=n.get(0,2),e*Dg(s)-t*Dg(o)+i*Dg(a)}else return new ay(n).determinant}else throw Error("determinant can only be calculated for a square matrix")}function k$(n,e){let t=[];for(let i=0;ir)return new Array(e.rows+1).fill(0);{let s=e.addRow(t,[0]);for(let o=0;oe?s[o]=1/s[o]:s[o]=0;return r.mmul(Oe.diag(s).mmul(i.transpose()))}function B$(n,e=n,t={}){n=new Oe(n);let i=!1;if(typeof e=="object"&&!Oe.isMatrix(e)&&!Zi.isAnyArray(e)?(t=e,e=n,i=!0):e=new Oe(e),n.rows!==e.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:r=!0}=t;r&&(n=n.center("column"),i||(e=e.center("column")));const s=n.transpose().mmul(e);for(let o=0;o0?r.set(s,s+1,t[s]):t[s]<0&&r.set(s,s-1,t[s])}return r}}function H$(n,e,t,i){let r,s,o,a,l,u,f,d;for(l=0;l0;a--){for(d=0,o=0,u=0;u0&&(s=-s),e[a]=d*s,o=o-r*s,t[a-1]=r-s,l=0;lu)do{for(r=t[u],d=(t[u+1]-r)/(2*e[u]),p=po(d,1),d<0&&(p=-p),t[u]=e[u]/(d+p),t[u+1]=e[u]*(d+p),g=t[u+1],s=r-t[u],o=u+2;o=u;o--)for(_=x,x=v,S=w,r=v*e[o],s=v*d,p=po(d,e[o]),e[o+1]=w*p,w=e[o]/p,v=d/p,d=v*t[o]-w*r,t[o+1]=s+w*(v*r+w*t[o]),l=0;lA*R);t[u]=t[u]+b,e[u]=0}for(o=0;o=d;u--)t[u]=e.get(u,d-1)/p,l+=t[u]*t[u];for(a=Math.sqrt(l),t[d]>0&&(a=-a),l=l-t[d]*a,t[d]=t[d]-a,f=d;f=d;u--)o+=t[u]*e.get(u,f);for(o=o/l,u=d;u<=s;u++)e.set(u,f,e.get(u,f)-o*t[u])}for(u=0;u<=s;u++){for(o=0,f=s;f>=d;f--)o+=t[f]*e.get(u,f);for(o=o/l,f=d;f<=s;f++)e.set(u,f,e.get(u,f)-o*t[f])}t[d]=p*t[d],e.set(d,d-1,p*a)}}for(u=0;u=r+1;d--)if(e.get(d,d-1)!==0){for(u=d+1;u<=s;u++)t[u]=e.get(u,d-1);for(f=d;f<=s;f++){for(a=0,u=d;u<=s;u++)a+=t[u]*i.get(u,f);for(a=a/t[d]/e.get(d,d-1),u=d;u<=s;u++)i.set(u,f,i.get(u,f)+a*t[u])}}}function j$(n,e,t,i,r){let s=n-1,o=0,a=n-1,l=Number.EPSILON,u=0,f=0,d=0,p=0,g=0,v=0,x=0,_=0,m,w,S,b,R,A,C,L,I,E,N,z,O,q,j;for(m=0;ma)&&(t[m]=r.get(m,m),e[m]=0),w=Math.max(m-1,0);w=o;){for(b=s;b>o&&(v=Math.abs(r.get(b-1,b-1))+Math.abs(r.get(b,b)),v===0&&(v=f),!(Math.abs(r.get(b,b-1))=0){for(x=d>=0?d+x:d-x,t[s-1]=L+x,t[s]=t[s-1],x!==0&&(t[s]=L-C/x),e[s-1]=0,e[s]=0,L=r.get(s,s-1),v=Math.abs(L)+Math.abs(x),d=L/v,p=x/v,g=Math.sqrt(d*d+p*p),d=d/g,p=p/g,w=s-1;w0)){for(v=Math.sqrt(v),I=b&&(x=r.get(R,R),g=L-x,v=I-x,d=(g*v-C)/r.get(R+1,R)+r.get(R,R+1),p=r.get(R+1,R+1)-x-g-v,g=r.get(R+2,R+1),v=Math.abs(d)+Math.abs(p)+Math.abs(g),d=d/v,p=p/v,g=g/v,!(R===b||Math.abs(r.get(R,R-1))*(Math.abs(p)+Math.abs(g))R+2&&r.set(m,m-3,0);for(S=R;S<=s-1&&(q=S!==s-1,S!==R&&(d=r.get(S,S-1),p=r.get(S+1,S-1),g=q?r.get(S+2,S-1):0,L=Math.abs(d)+Math.abs(p)+Math.abs(g),L!==0&&(d=d/L,p=p/L,g=g/L)),L!==0);S++)if(v=Math.sqrt(d*d+p*p+g*g),d<0&&(v=-v),v!==0){for(S!==R?r.set(S,S-1,-v*L):b!==R&&r.set(S,S-1,-r.get(S,S-1)),d=d+v,L=d/v,I=p/v,x=g/v,p=p/d,g=g/d,w=S;w=0;s--)if(d=t[s],p=e[s],p===0)for(b=s,r.set(s,s,1),m=s-1;m>=0;m--){for(C=r.get(m,m)-d,g=0,w=b;w<=s;w++)g=g+r.get(m,w)*r.get(w,s);if(e[m]<0)x=C,v=g;else if(b=m,e[m]===0?r.set(m,s,C!==0?-g/C:-g/(l*f)):(L=r.get(m,m+1),I=r.get(m+1,m),p=(t[m]-d)*(t[m]-d)+e[m]*e[m],A=(L*v-x*g)/p,r.set(m,s,A),r.set(m+1,s,Math.abs(L)>Math.abs(x)?(-g-C*A)/L:(-v-I*A)/x)),A=Math.abs(r.get(m,s)),l*A*A>1)for(w=m;w<=s;w++)r.set(w,s,r.get(w,s)/A)}else if(p<0)for(b=s-1,Math.abs(r.get(s,s-1))>Math.abs(r.get(s-1,s))?(r.set(s-1,s-1,p/r.get(s,s-1)),r.set(s-1,s,-(r.get(s,s)-d)/r.get(s,s-1))):(j=Xm(0,-r.get(s-1,s),r.get(s-1,s-1)-d,p),r.set(s-1,s-1,j[0]),r.set(s-1,s,j[1])),r.set(s,s-1,0),r.set(s,s,1),m=s-2;m>=0;m--){for(E=0,N=0,w=b;w<=s;w++)E=E+r.get(m,w)*r.get(w,s-1),N=N+r.get(m,w)*r.get(w,s);if(C=r.get(m,m)-d,e[m]<0)x=C,g=E,v=N;else if(b=m,e[m]===0?(j=Xm(-E,-N,C,p),r.set(m,s-1,j[0]),r.set(m,s,j[1])):(L=r.get(m,m+1),I=r.get(m+1,m),z=(t[m]-d)*(t[m]-d)+e[m]*e[m]-p*p,O=(t[m]-d)*2*p,z===0&&O===0&&(z=l*f*(Math.abs(C)+Math.abs(p)+Math.abs(L)+Math.abs(I)+Math.abs(x))),j=Xm(L*g-x*E+p*N,L*v-x*N-p*E,z,O),r.set(m,s-1,j[0]),r.set(m,s,j[1]),Math.abs(L)>Math.abs(x)+Math.abs(p)?(r.set(m+1,s-1,(-E-C*r.get(m,s-1)+p*r.get(m,s))/L),r.set(m+1,s,(-N-C*r.get(m,s)-p*r.get(m,s-1))/L)):(j=Xm(-g-I*r.get(m,s-1),-v-I*r.get(m,s),x,p),r.set(m+1,s-1,j[0]),r.set(m+1,s,j[1]))),A=Math.max(Math.abs(r.get(m,s-1)),Math.abs(r.get(m,s))),l*A*A>1)for(w=m;w<=s;w++)r.set(w,s-1,r.get(w,s-1)/A),r.set(w,s,r.get(w,s)/A)}for(m=0;ma)for(w=m;w=o;w--)for(m=o;m<=a;m++){for(x=0,S=o;S<=Math.min(w,a);S++)x=x+i.get(m,S)*r.get(S,w);i.set(m,w,x)}}}function Xm(n,e,t,i){let r,s;return Math.abs(t)>Math.abs(i)?(r=i/t,s=t+r*i,[(n+r*e)/s,(e-r*n)/s]):(r=t/i,s=i+r*t,[(r*n+e)/s,(r*e-n)/s])}class tO{constructor(e){if(e=Tr.checkMatrix(e),!e.isSymmetric())throw new Error("Matrix is not symmetric");let t=e,i=t.rows,r=new Oe(i,i),s=!0,o,a,l;for(a=0;a0,r.set(a,a,Math.sqrt(Math.max(u,0))),l=a+1;l=0;l--)for(a=0;ao;g++)d=e.transpose().mmul(a).div(a.transpose().mmul(a).get(0,0)),d=d.div(d.norm()),u=e.mmul(d).div(d.transpose().mmul(d).get(0,0)),g>0&&(l=u.clone().sub(p).pow(2).sum()),p=u.clone(),i?(f=i.transpose().mmul(u).div(u.transpose().mmul(u).get(0,0)),f=f.div(f.norm()),a=i.mmul(f).div(f.transpose().mmul(f).get(0,0))):a=u;if(i){let g=e.transpose().mmul(u).div(u.transpose().mmul(u).get(0,0));g=g.div(g.norm());let v=e.clone().sub(u.clone().mmul(g.transpose())),x=a.transpose().mmul(u).div(u.transpose().mmul(u).get(0,0)),_=i.clone().sub(u.clone().mulS(x.get(0,0)).mmul(f.transpose()));this.t=u,this.p=g.transpose(),this.w=d.transpose(),this.q=f,this.u=a,this.s=u.transpose().mmul(u),this.xResidual=v,this.yResidual=_,this.betas=x}else this.w=d.transpose(),this.s=u.transpose().mmul(u).sqrt(),r?this.t=u.clone().div(this.s.get(0,0)):this.t=u,this.xResidual=e.sub(u.mmul(d.transpose()))}}Nt.AbstractMatrix=xt;Nt.CHO=tO;Nt.CholeskyDecomposition=tO;Nt.DistanceMatrix=oy;Nt.EVD=eO;Nt.EigenvalueDecomposition=eO;Nt.LU=ay;Nt.LuDecomposition=ay;var iO=Nt.Matrix=Oe;Nt.MatrixColumnSelectionView=A$;Nt.MatrixColumnView=T$;Nt.MatrixFlipColumnView=C$;Nt.MatrixFlipRowView=R$;Nt.MatrixRowSelectionView=I$;Nt.MatrixRowView=P$;Nt.MatrixSelectionView=Ng;Nt.MatrixSubView=L$;Nt.MatrixTransposeView=N$;Nt.NIPALS=nO;Nt.Nipals=nO;Nt.QR=ME;Nt.QrDecomposition=ME;Nt.SVD=Vc;Nt.SingularValueDecomposition=Vc;Nt.SymmetricMatrix=wl;Nt.WrapperMatrix1D=JD;Nt.WrapperMatrix2D=Tr;Nt.correlation=V$;Nt.covariance=B$;var iP=Nt.default=Oe;Nt.determinant=Dg;var X$=Nt.inverse=O$;Nt.linearDependencies=U$;Nt.pseudoInverse=z$;Nt.solve=QD;Nt.wrap=D$;const qv=iO;iP.Matrix&&iP.Matrix;const $$=X$;function q$(n,e,t,i,r){const s=t.length,o=n.x.length;let a=new Array(s);for(let l=0;l0&&s[s.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]0)&&!(r=i.next()).done;)s.push(r.value)}catch(a){o={error:a}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return s},oP=Ft&&Ft.__spread||function(){for(var n=[],e=0;e0&&s.set(o,f,d)}var p=Mn.transpose(s);return Mn.maximum(s,p)},n.prototype.transform=function(e){var t=this,i=this.X;if(i===void 0||i.length===0)throw new Error("No data has been fit.");var r=Math.floor(this.nNeighbors*this.transformQueueSize);r=Math.min(i.length,r);var s=$m.initializeSearch(this.rpForest,i,e,r,this.initFromRandom,this.initFromTree,this.random),o=this.search(i,this.searchGraph,s,e),a=tq.deheapSort(o),l=a.indices,u=a.weights;l=l.map(function(j){return j.slice(0,t.nNeighbors)}),u=u.map(function(j){return j.slice(0,t.nNeighbors)});var f=Math.max(0,this.localConnectivity-1),d=this.smoothKNNDistance(u,this.nNeighbors,f),p=d.sigmas,g=d.rhos,v=this.computeMembershipStrengths(l,u,p,g),x=v.rows,_=v.cols,m=v.vals,w=[e.length,i.length],S=new Mn.SparseMatrix(x,_,m,w),b=Mn.normalize(S,"l1"),R=Mn.getCSR(b),A=e.length,C=In.reshape2d(R.indices,A,this.nNeighbors),L=In.reshape2d(R.values,A,this.nNeighbors),I=lO(C,L,this.embedding),E=this.nEpochs?this.nEpochs/3:S.nRows<=1e4?100:30,N=S.getValues().reduce(function(j,Q){return Q>j?Q:j},0);S=S.map(function(j){return j0});if(v.length>=i){var x=Math.floor(i),_=i-x;x>0?(a[u]=v[x-1],_>lP&&(a[u]+=_*(v[x]-v[x-1]))):a[u]=_*v[0]}else v.length>0&&(a[u]=In.max(v));for(var m=0;m0?w+=Math.exp(-(b/p)):w+=1}if(Math.abs(w-o)o?(d=p,p=(f+d)/2):(f=p,d===1/0?p*=2:p=(f+d)/2)}if(l[u]=p,a[u]>0){var R=In.mean(g);l[u]0&&(i[a]=t/s[a])}),i},n.prototype.assignOptimizationStateParameters=function(e){Object.assign(this.optimizationState,e)},n.prototype.prepareForOptimizationLoop=function(){var e=this,t=e.repulsionStrength,i=e.learningRate,r=e.negativeSampleRate,s=this.optimizationState,o=s.epochsPerSample,a=s.headEmbedding,l=s.tailEmbedding,u=a[0].length,f=a.length===l.length,d=o.map(function(v){return v/r}),p=oP(d),g=oP(o);this.assignOptimizationStateParameters({epochOfNextSample:g,epochOfNextNegativeSample:p,epochsPerNegativeSample:d,moveOther:f,initialAlpha:i,alpha:i,gamma:t,dim:u})},n.prototype.initializeOptimization=function(){var e=this.embedding,t=this.embedding,i=this.optimizationState,r=i.head,s=i.tail,o=i.epochsPerSample,a=this.getNEpochs(),l=this.graph.nCols,u=sO(this.spread,this.minDist),f=u.a,d=u.b;this.assignOptimizationStateParameters({headEmbedding:e,tailEmbedding:t,head:r,tail:s,epochsPerSample:o,a:f,b:d,nEpochs:a,nVertices:l})},n.prototype.optimizeLayoutStep=function(e){for(var t=this.optimizationState,i=t.head,r=t.tail,s=t.headEmbedding,o=t.tailEmbedding,a=t.epochsPerSample,l=t.epochOfNextSample,u=t.epochOfNextNegativeSample,f=t.epochsPerNegativeSample,d=t.moveOther,p=t.initialAlpha,g=t.alpha,v=t.gamma,x=t.a,_=t.b,m=t.dim,w=t.nEpochs,S=t.nVertices,b=4,R=0;Re)){var A=i[R],C=r[R],L=s[A],I=o[C],E=cP(L,I),N=0;E>0&&(N=-2*x*_*Math.pow(E,_-1),N/=x*Math.pow(E,_)+1);for(var z=0;z0)W=2*v*_,W/=(.001+k)*(x*Math.pow(k,_)+1);else if(A===Q)continue;for(var z=0;z0&&(O=uP(W*(L[z]-oe[z]),b)),L[z]+=O*g}}u[R]+=q*f[R]}return t.alpha=p*(1-e/w),t.currentEpoch+=1,s},n.prototype.optimizeLayoutAsync=function(e){var t=this;return e===void 0&&(e=function(){return!0}),new Promise(function(i,r){var s=function(){return rP(t,void 0,void 0,function(){var o,a,l,u,f,d;return sP(this,function(p){try{if(o=this.optimizationState,a=o.nEpochs,l=o.currentEpoch,this.embedding=this.optimizeLayoutStep(l),u=this.optimizationState.currentEpoch,f=e(u)===!1,d=u===a,!f&&!d)setTimeout(function(){return s()},0);else return[2,i(d)]}catch(g){r(g)}return[2]})})};setTimeout(function(){return s()},0)})},n.prototype.optimizeLayout=function(e){e===void 0&&(e=function(){return!0});for(var t=!1,i=[];!t;){var r=this.optimizationState,s=r.nEpochs,o=r.currentEpoch;i=this.optimizeLayoutStep(o);var a=this.optimizationState.currentEpoch,l=e(a)===!1;t=a===s||l}return i},n.prototype.getNEpochs=function(){var e=this.graph;if(this.nEpochs>0)return this.nEpochs;var t=e.nRows;return t<=2500?500:t<=5e3?400:t<=7500?300:200},n}();Oo.UMAP=iq;function rO(n,e){for(var t=0,i=0;ie?e:n<-e?-e:n}function cP(n,e){for(var t=0,i=0;i=e;return v?Math.exp(-(i[g]-e)/n):p}),s=[.5,.5],o={x:i,y:r},a={damping:1.5,initialValues:s,gradientDifference:.1,maxIterations:100,errorTolerance:.01},l=nq.default(o,t,a).parameterValues,u=a1(l,2),f=u[0],d=u[1];return{a:f,b:d}}Oo.findABParams=sO;function oO(n,e,t,i){return t===void 0&&(t=1),i===void 0&&(i=5),n.map(function(r,s,o){return e[s]===-1||e[o]===-1?r*Math.exp(-t):e[s]!==e[o]?r*Math.exp(-i):r})}Oo.fastIntersection=oO;function aO(n){n=Mn.normalize(n,"max");var e=Mn.transpose(n),t=Mn.pairwiseMultiply(e,n);return n=Mn.add(n,Mn.subtract(e,t)),Mn.eliminateZeros(n)}Oo.resetLocalConnectivity=aO;function lO(n,e,t){for(var i=In.zeros(n.length).map(function(l){return In.zeros(t[0].length)}),r=0;rthis.calculateEmbedding(i)));return this.theUMAP=new aq({nNeighbors:1,nComponents:3,minDist:.5}),this.theUMAP.fit(t)}async calculateProjection(e){if(this.initOpenAi(),!this.theUMAP)return[0,0,0];const t=await this.calculateEmbedding(e);return this.theUMAP.transform([t])[0]}}const uq=()=>Ge.jsxs("div",{style:{padding:"3px",textAlign:"left"},children:["OpenAI API key ",Ge.jsx("input",{id:"llm-key",style:{width:"400px"},type:"password"})]});function cq(){let[n]=Y.useState(new lq);const[e,t]=Y.useState(-1),[i,r]=Y.useState([]),[s,o]=Y.useState([0,0,0]),a=async u=>{o(await n.calculateProjection(u))},l=async()=>{const u=await n.initializeProjection(i.map(f=>f.label));i.map(f=>{f.position=u[f.index]}),r(i.slice())};return setTimeout(()=>{document.getElementById("three-canvas").style.height="100%"},400),Ge.jsxs(Ge.Fragment,{children:[Ge.jsx(uq,{}),Ge.jsxs("div",{id:"main-div",children:[Ge.jsxs("div",{id:"left-pane",children:[Ge.jsx(x7,{conceptCategories:E7,concepts:i,setConcepts:r,onCalculateEmbeddings:l}),Ge.jsx(w7,{onChangeMyConcept:a}),e!=-1&&Ge.jsx(S7,{text:`${i[e].label}`})]}),Ge.jsx("div",{id:"right-pane",children:Ge.jsx(M8,{concepts:i,spherePos:s,onHoverConcept:t})})]})]})}Kx.createRoot(document.getElementById("root")).render(Ge.jsx(wP.StrictMode,{children:Ge.jsx(cq,{})})); +${ZD}`)}function s$(n,e,t){return(n>=0&&t?` ${tP(n,e-1)}`:tP(n,e)).padEnd(e)}function tP(n,e){let t=n.toString();if(t.length<=e)return t;let i=n.toFixed(e);if(i.length>e&&(i=n.toFixed(Math.max(0,e-(i.length-e)))),i.length<=e&&!i.startsWith("0.000")&&!i.startsWith("-0.000"))return i;let r=n.toExponential(e);return r.length>e&&(r=n.toExponential(Math.max(0,e-(r.length-e)))),r.slice(0)}function o$(n,e){n.prototype.add=function(i){return typeof i=="number"?this.addS(i):this.addM(i)},n.prototype.addS=function(i){for(let r=0;r>i);return this},n.prototype.signPropagatingRightShiftM=function(i){if(i=e.checkMatrix(i),this.rows!==i.rows||this.columns!==i.columns)throw new RangeError("Matrices dimensions must be equal");for(let r=0;r>i.get(r,s));return this},n.signPropagatingRightShift=function(i,r){return new e(i).signPropagatingRightShift(r)},n.prototype.rightShift=function(i){return typeof i=="number"?this.rightShiftS(i):this.rightShiftM(i)},n.prototype.rightShiftS=function(i){for(let r=0;r>>i);return this},n.prototype.rightShiftM=function(i){if(i=e.checkMatrix(i),this.rows!==i.rows||this.columns!==i.columns)throw new RangeError("Matrices dimensions must be equal");for(let r=0;r>>i.get(r,s));return this},n.rightShift=function(i,r){return new e(i).rightShift(r)},n.prototype.zeroFillRightShift=n.prototype.rightShift,n.prototype.zeroFillRightShiftS=n.prototype.rightShiftS,n.prototype.zeroFillRightShiftM=n.prototype.rightShiftM,n.zeroFillRightShift=n.rightShift,n.prototype.not=function(){for(let i=0;ii)throw new RangeError("Row index out of range")}function Br(n,e,t){let i=t?n.columns:n.columns-1;if(e<0||e>i)throw new RangeError("Column index out of range")}function Du(n,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==n.columns)throw new RangeError("vector size must be the same as the number of columns");return e}function Ou(n,e){if(e.to1DArray&&(e=e.to1DArray()),e.length!==n.rows)throw new RangeError("vector size must be the same as the number of rows");return e}function wE(n,e){if(!Zi.isAnyArray(e))throw new TypeError("row indices must be an array");for(let t=0;t=n.rows)throw new RangeError("row indices are out of range")}function SE(n,e){if(!Zi.isAnyArray(e))throw new TypeError("column indices must be an array");for(let t=0;t=n.columns)throw new RangeError("column indices are out of range")}function s1(n,e,t,i,r){if(arguments.length!==5)throw new RangeError("expected 4 arguments");if(jm("startRow",e),jm("endRow",t),jm("startColumn",i),jm("endColumn",r),e>t||i>r||e<0||e>=n.rows||t<0||t>=n.rows||i<0||i>=n.columns||r<0||r>=n.columns)throw new RangeError("Submatrix indices are out of range")}function sy(n,e=0){let t=[];for(let i=0;i=s)throw new RangeError("min must be smaller than max");let a=s-r,l=new Oe(e,t);for(let u=0;ui?(s=!0,i=t):(r=!1,s=!0);e++}return r}isReducedEchelonForm(){let e=0,t=0,i=-1,r=!0,s=!1;for(;ei?(s=!0,i=t):(r=!1,s=!0);for(let o=t+1;oe.get(r,i)&&(r=s);if(e.get(r,i)===0)i++;else{e.swapRows(t,r);let s=e.get(t,i);for(let o=i;o=0;)if(e.maxRow(r)===0)r--;else{let s=0,o=!1;for(;st[i]&&(t[i]=this.get(i,r));return t}case"column":{const t=new Array(this.columns).fill(Number.NEGATIVE_INFINITY);for(let i=0;it[r]&&(t[r]=this.get(i,r));return t}case void 0:{let t=this.get(0,0);for(let i=0;it&&(t=this.get(i,r));return t}default:throw new Error(`invalid option: ${e}`)}}maxIndex(){Cu(this);let e=this.get(0,0),t=[0,0];for(let i=0;ie&&(e=this.get(i,r),t[0]=i,t[1]=r);return t}min(e){if(this.isEmpty())return NaN;switch(e){case"row":{const t=new Array(this.rows).fill(Number.POSITIVE_INFINITY);for(let i=0;it&&(t=this.get(e,i));return t}maxRowIndex(e){zr(this,e),Cu(this);let t=this.get(e,0),i=[e,0];for(let r=1;rt&&(t=this.get(e,r),i[1]=r);return i}minRow(e){if(zr(this,e),this.isEmpty())return NaN;let t=this.get(e,0);for(let i=1;it&&(t=this.get(i,e));return t}maxColumnIndex(e){Br(this,e),Cu(this);let t=this.get(0,e),i=[0,e];for(let r=1;rt&&(t=this.get(r,e),i[0]=r);return i}minColumn(e){if(Br(this,e),this.isEmpty())return NaN;let t=this.get(0,e);for(let i=1;i=i)throw new RangeError("min must be smaller than max");let r=new Oe(this.rows,this.columns);for(let s=0;s0&&eP(o,{min:t,max:i,output:o}),r.setRow(s,o)}return r}scaleColumns(e={}){if(typeof e!="object")throw new TypeError("options must be an object");const{min:t=0,max:i=1}=e;if(!Number.isFinite(t))throw new TypeError("min must be a number");if(!Number.isFinite(i))throw new TypeError("max must be a number");if(t>=i)throw new RangeError("min must be smaller than max");let r=new Oe(this.rows,this.columns);for(let s=0;si||t<0||t>=this.columns||i<0||i>=this.columns)throw new RangeError("Argument out of range");let r=new Oe(e.length,i-t+1);for(let s=0;s=this.rows)throw new RangeError(`Row index out of range: ${e[s]}`);r.set(s,o-t,this.get(e[s],o))}return r}subMatrixColumn(e,t,i){if(t===void 0&&(t=0),i===void 0&&(i=this.rows-1),t>i||t<0||t>=this.rows||i<0||i>=this.rows)throw new RangeError("Argument out of range");let r=new Oe(i-t+1,e.length);for(let s=0;s=this.columns)throw new RangeError(`Column index out of range: ${e[s]}`);r.set(o-t,s,this.get(o,e[s]))}return r}setSubMatrix(e,t,i){if(e=Oe.checkMatrix(e),e.isEmpty())return this;let r=t+e.rows-1,s=i+e.columns-1;s1(this,t,r,i,s);for(let o=0;otypeof e=="number")}xt.random=xt.rand;xt.randomInt=xt.randInt;xt.diagonal=xt.diag;xt.prototype.diagonal=xt.prototype.diag;xt.identity=xt.eye;xt.prototype.negate=xt.prototype.neg;xt.prototype.tensorProduct=xt.prototype.kroneckerProduct;var od,o1,Ac;let Oe=(Ac=class extends xt{constructor(t,i){super();g_(this,od);wp(this,"data");if(Ac.isMatrix(t))v_(this,od,o1).call(this,t.rows,t.columns),Ac.copy(t,this);else if(Number.isInteger(t)&&t>=0)v_(this,od,o1).call(this,t,i);else if(Zi.isAnyArray(t)){const r=t;if(t=r.length,i=t?r[0].length:0,typeof i!="number")throw new TypeError("Data must be a 2D array with at least one element");this.data=[];for(let s=0;s"u"&&(i=t,t=this.columns),Br(this,t,!0),i=Ou(this,i);for(let r=0;r=0)for(let r=0;r=0)Sp(this,Ei,new Oe(t,t));else if(Sp(this,Ei,new Oe(t)),!this.isSymmetric())throw new TypeError("not symmetric data")}get size(){return ts(this,Ei).size}get rows(){return ts(this,Ei).rows}get columns(){return ts(this,Ei).columns}get diagonalSize(){return this.rows}static isSymmetricMatrix(t){return Oe.isMatrix(t)&&t.klassType==="SymmetricMatrix"}static zeros(t){return new this(t)}static ones(t){return new this(t).fill(1)}clone(){const t=new Yv(this.diagonalSize);for(const[i,r,s]of this.upperRightEntries())t.set(i,r,s);return t}toMatrix(){return new Oe(this)}get(t,i){return ts(this,Ei).get(t,i)}set(t,i,r){return ts(this,Ei).set(t,i,r),ts(this,Ei).set(i,t,r),this}removeCross(t){return ts(this,Ei).removeRow(t),ts(this,Ei).removeColumn(t),this}addCross(t,i){i===void 0&&(i=t,t=this.diagonalSize);const r=i.slice();return r.splice(t,1),ts(this,Ei).addRow(t,r),ts(this,Ei).addColumn(t,i),this}applyMask(t){if(t.length!==this.diagonalSize)throw new RangeError("Mask size do not match with matrix size");const i=[];for(const[r,s]of t.entries())s||i.push(r);i.reverse();for(const r of i)this.removeCross(r);return this}toCompact(){const{diagonalSize:t}=this,i=new Array(t*(t+1)/2);for(let r=0,s=0,o=0;o=t&&(r=++s);return i}static fromCompact(t){const i=t.length,r=(Math.sqrt(8*i+1)-1)/2;if(!Number.isInteger(r))throw new TypeError(`This array is not a compact representation of a Symmetric Matrix, ${JSON.stringify(t)}`);const s=new Yv(r);for(let o=0,a=0,l=0;l=r&&(o=++a);return s}*upperRightEntries(){for(let t=0,i=0;t=this.diagonalSize&&(i=++t)}}*upperRightValues(){for(let t=0,i=0;t=this.diagonalSize&&(i=++t)}};Ei=new WeakMap;let wl=Yv;wl.prototype.klassType="SymmetricMatrix";class oy extends wl{static isDistanceMatrix(e){return wl.isSymmetricMatrix(e)&&e.klassSubType==="DistanceMatrix"}constructor(e){if(super(e),!this.isDistance())throw new TypeError("Provided arguments do no produce a distance matrix")}set(e,t,i){return e===t&&(i=0),super.set(e,t,i)}addCross(e,t){return t===void 0&&(t=e,e=this.diagonalSize),t=t.slice(),t[e]=0,super.addCross(e,t)}toSymmetricMatrix(){return new wl(this)}clone(){const e=new oy(this.diagonalSize);for(const[t,i,r]of this.upperRightEntries())t!==i&&e.set(t,i,r);return e}toCompact(){const{diagonalSize:e}=this,t=(e-1)*e/2,i=new Array(t);for(let r=1,s=0,o=0;o=e&&(r=++s+1);return i}static fromCompact(e){const t=e.length,i=(Math.sqrt(8*t+1)+1)/2;if(!Number.isInteger(i))throw new TypeError(`This array is not a compact representation of a DistanceMatrix, ${JSON.stringify(e)}`);const r=new this(i);for(let s=1,o=0,a=0;a=i&&(s=++o+1);return r}}oy.prototype.klassSubType="DistanceMatrix";class ko extends xt{constructor(e,t,i){super(),this.matrix=e,this.rows=t,this.columns=i}}class T$ extends ko{constructor(e,t){Br(e,t),super(e,e.rows,1),this.column=t}set(e,t,i){return this.matrix.set(e,this.column,i),this}get(e){return this.matrix.get(e,this.column)}}class A$ extends ko{constructor(e,t){SE(e,t),super(e,e.rows,t.length),this.columnIndices=t}set(e,t,i){return this.matrix.set(e,this.columnIndices[t],i),this}get(e,t){return this.matrix.get(e,this.columnIndices[t])}}class C$ extends ko{constructor(e){super(e,e.rows,e.columns)}set(e,t,i){return this.matrix.set(e,this.columns-t-1,i),this}get(e,t){return this.matrix.get(e,this.columns-t-1)}}class R$ extends ko{constructor(e){super(e,e.rows,e.columns)}set(e,t,i){return this.matrix.set(this.rows-e-1,t,i),this}get(e,t){return this.matrix.get(this.rows-e-1,t)}}class P$ extends ko{constructor(e,t){zr(e,t),super(e,1,e.columns),this.row=t}set(e,t,i){return this.matrix.set(this.row,t,i),this}get(e,t){return this.matrix.get(this.row,t)}}class I$ extends ko{constructor(e,t){wE(e,t),super(e,t.length,e.columns),this.rowIndices=t}set(e,t,i){return this.matrix.set(this.rowIndices[e],t,i),this}get(e,t){return this.matrix.get(this.rowIndices[e],t)}}class Ng extends ko{constructor(e,t,i){wE(e,t),SE(e,i),super(e,t.length,i.length),this.rowIndices=t,this.columnIndices=i}set(e,t,i){return this.matrix.set(this.rowIndices[e],this.columnIndices[t],i),this}get(e,t){return this.matrix.get(this.rowIndices[e],this.columnIndices[t])}}class L$ extends ko{constructor(e,t,i,r,s){s1(e,t,i,r,s),super(e,i-t+1,s-r+1),this.startRow=t,this.startColumn=r}set(e,t,i){return this.matrix.set(this.startRow+e,this.startColumn+t,i),this}get(e,t){return this.matrix.get(this.startRow+e,this.startColumn+t)}}class N$ extends ko{constructor(e){super(e,e.columns,e.rows)}set(e,t,i){return this.matrix.set(t,e,i),this}get(e,t){return this.matrix.get(t,e)}}class JD extends xt{constructor(e,t={}){const{rows:i=1}=t;if(e.length%i!==0)throw new Error("the data length is not divisible by the number of rows");super(),this.rows=i,this.columns=e.length/i,this.data=e}set(e,t,i){let r=this._calculateIndex(e,t);return this.data[r]=i,this}get(e,t){let i=this._calculateIndex(e,t);return this.data[i]}_calculateIndex(e,t){return e*this.columns+t}}class Tr extends xt{constructor(e){super(),this.data=e,this.rows=e.length,this.columns=e[0].length}set(e,t,i){return this.data[e][t]=i,this}get(e,t){return this.data[e][t]}}function D$(n,e){if(Zi.isAnyArray(n))return n[0]&&Zi.isAnyArray(n[0])?new Tr(n):new JD(n,e);throw new Error("the argument is not an array")}class ay{constructor(e){e=Tr.checkMatrix(e);let t=e.clone(),i=t.rows,r=t.columns,s=new Float64Array(i),o=1,a,l,u,f,d,p,g,v,x;for(a=0;aMath.abs(v[f])&&(f=a);if(f!==l){for(u=0;u=0;u--){for(l=0;lo?r.set(s,o,e.get(s,o)):s===o?r.set(s,o,1):r.set(s,o,0);return r}get upperTriangularMatrix(){let e=this.LU,t=e.rows,i=e.columns,r=new Oe(t,i);for(let s=0;sMath.abs(e)?(t=e/n,Math.abs(n)*Math.sqrt(1+t*t)):e!==0?(t=n/e,Math.abs(e)*Math.sqrt(1+t*t)):0}class ME{constructor(e){e=Tr.checkMatrix(e);let t=e.clone(),i=e.rows,r=e.columns,s=new Float64Array(r),o,a,l,u;for(l=0;l=0;u--){for(l=0;l=0;a--){for(s=0;s=0;E--)if(v[E]!==0){for(let N=E+1;N=0;E--){if(E0;){let E,N;for(E=C-2;E>=-1&&E!==-1;E--){const z=Number.MIN_VALUE+I*Math.abs(v[E]+Math.abs(v[E+1]));if(Math.abs(m[E])<=z||Number.isNaN(m[E])){m[E]=0;break}}if(E===C-2)N=4;else{let z;for(z=C-1;z>=E&&z!==E;z--){let O=(z!==C?Math.abs(m[z]):0)+(z!==E+1?Math.abs(m[z-1]):0);if(Math.abs(v[z])<=I*O){v[z]=0;break}}z===E?N=3:z===C-1?N=1:(N=2,E=z)}switch(E++,N){case 1:{let z=m[C-2];m[C-2]=0;for(let O=C-2;O>=E;O--){let q=po(v[O],z),j=v[O]/q,Q=z/q;if(v[O]=q,O!==E&&(z=-Q*m[O-1],m[O-1]=j*m[O-1]),u)for(let oe=0;oe=v[E+1]);){let z=v[E];if(v[E]=v[E+1],v[E+1]=z,u&&Et&&s.set(f,d,e.get(f,d)/this.s[d]);let o=this.U,a=o.rows,l=o.columns,u=new Oe(i,a);for(let f=0;fe&&t++;return t}get diagonal(){return Array.from(this.s)}get threshold(){return Number.EPSILON/2*Math.max(this.m,this.n)*this.s[0]}get leftSingularVectors(){return this.U}get rightSingularVectors(){return this.V}get diagonalMatrix(){return Oe.diag(this.s)}}function O$(n,e=!1){return n=Tr.checkMatrix(n),e?new Vc(n).inverse():QD(n,Oe.eye(n.rows))}function QD(n,e,t=!1){return n=Tr.checkMatrix(n),e=Tr.checkMatrix(e),t?new Vc(n).solve(e):n.isSquare()?new ay(n).solve(e):new ME(n).solve(e)}function Dg(n){if(n=Oe.checkMatrix(n),n.isSquare()){if(n.columns===0)return 1;let e,t,i,r;if(n.columns===2)return e=n.get(0,0),t=n.get(0,1),i=n.get(1,0),r=n.get(1,1),e*r-t*i;if(n.columns===3){let s,o,a;return s=new Ng(n,[1,2],[1,2]),o=new Ng(n,[1,2],[0,2]),a=new Ng(n,[1,2],[0,1]),e=n.get(0,0),t=n.get(0,1),i=n.get(0,2),e*Dg(s)-t*Dg(o)+i*Dg(a)}else return new ay(n).determinant}else throw Error("determinant can only be calculated for a square matrix")}function k$(n,e){let t=[];for(let i=0;ir)return new Array(e.rows+1).fill(0);{let s=e.addRow(t,[0]);for(let o=0;oe?s[o]=1/s[o]:s[o]=0;return r.mmul(Oe.diag(s).mmul(i.transpose()))}function B$(n,e=n,t={}){n=new Oe(n);let i=!1;if(typeof e=="object"&&!Oe.isMatrix(e)&&!Zi.isAnyArray(e)?(t=e,e=n,i=!0):e=new Oe(e),n.rows!==e.rows)throw new TypeError("Both matrices must have the same number of rows");const{center:r=!0}=t;r&&(n=n.center("column"),i||(e=e.center("column")));const s=n.transpose().mmul(e);for(let o=0;o0?r.set(s,s+1,t[s]):t[s]<0&&r.set(s,s-1,t[s])}return r}}function H$(n,e,t,i){let r,s,o,a,l,u,f,d;for(l=0;l0;a--){for(d=0,o=0,u=0;u0&&(s=-s),e[a]=d*s,o=o-r*s,t[a-1]=r-s,l=0;lu)do{for(r=t[u],d=(t[u+1]-r)/(2*e[u]),p=po(d,1),d<0&&(p=-p),t[u]=e[u]/(d+p),t[u+1]=e[u]*(d+p),g=t[u+1],s=r-t[u],o=u+2;o=u;o--)for(_=x,x=v,S=w,r=v*e[o],s=v*d,p=po(d,e[o]),e[o+1]=w*p,w=e[o]/p,v=d/p,d=v*t[o]-w*r,t[o+1]=s+w*(v*r+w*t[o]),l=0;lA*R);t[u]=t[u]+b,e[u]=0}for(o=0;o=d;u--)t[u]=e.get(u,d-1)/p,l+=t[u]*t[u];for(a=Math.sqrt(l),t[d]>0&&(a=-a),l=l-t[d]*a,t[d]=t[d]-a,f=d;f=d;u--)o+=t[u]*e.get(u,f);for(o=o/l,u=d;u<=s;u++)e.set(u,f,e.get(u,f)-o*t[u])}for(u=0;u<=s;u++){for(o=0,f=s;f>=d;f--)o+=t[f]*e.get(u,f);for(o=o/l,f=d;f<=s;f++)e.set(u,f,e.get(u,f)-o*t[f])}t[d]=p*t[d],e.set(d,d-1,p*a)}}for(u=0;u=r+1;d--)if(e.get(d,d-1)!==0){for(u=d+1;u<=s;u++)t[u]=e.get(u,d-1);for(f=d;f<=s;f++){for(a=0,u=d;u<=s;u++)a+=t[u]*i.get(u,f);for(a=a/t[d]/e.get(d,d-1),u=d;u<=s;u++)i.set(u,f,i.get(u,f)+a*t[u])}}}function j$(n,e,t,i,r){let s=n-1,o=0,a=n-1,l=Number.EPSILON,u=0,f=0,d=0,p=0,g=0,v=0,x=0,_=0,m,w,S,b,R,A,C,L,I,E,N,z,O,q,j;for(m=0;ma)&&(t[m]=r.get(m,m),e[m]=0),w=Math.max(m-1,0);w=o;){for(b=s;b>o&&(v=Math.abs(r.get(b-1,b-1))+Math.abs(r.get(b,b)),v===0&&(v=f),!(Math.abs(r.get(b,b-1))=0){for(x=d>=0?d+x:d-x,t[s-1]=L+x,t[s]=t[s-1],x!==0&&(t[s]=L-C/x),e[s-1]=0,e[s]=0,L=r.get(s,s-1),v=Math.abs(L)+Math.abs(x),d=L/v,p=x/v,g=Math.sqrt(d*d+p*p),d=d/g,p=p/g,w=s-1;w0)){for(v=Math.sqrt(v),I=b&&(x=r.get(R,R),g=L-x,v=I-x,d=(g*v-C)/r.get(R+1,R)+r.get(R,R+1),p=r.get(R+1,R+1)-x-g-v,g=r.get(R+2,R+1),v=Math.abs(d)+Math.abs(p)+Math.abs(g),d=d/v,p=p/v,g=g/v,!(R===b||Math.abs(r.get(R,R-1))*(Math.abs(p)+Math.abs(g))R+2&&r.set(m,m-3,0);for(S=R;S<=s-1&&(q=S!==s-1,S!==R&&(d=r.get(S,S-1),p=r.get(S+1,S-1),g=q?r.get(S+2,S-1):0,L=Math.abs(d)+Math.abs(p)+Math.abs(g),L!==0&&(d=d/L,p=p/L,g=g/L)),L!==0);S++)if(v=Math.sqrt(d*d+p*p+g*g),d<0&&(v=-v),v!==0){for(S!==R?r.set(S,S-1,-v*L):b!==R&&r.set(S,S-1,-r.get(S,S-1)),d=d+v,L=d/v,I=p/v,x=g/v,p=p/d,g=g/d,w=S;w=0;s--)if(d=t[s],p=e[s],p===0)for(b=s,r.set(s,s,1),m=s-1;m>=0;m--){for(C=r.get(m,m)-d,g=0,w=b;w<=s;w++)g=g+r.get(m,w)*r.get(w,s);if(e[m]<0)x=C,v=g;else if(b=m,e[m]===0?r.set(m,s,C!==0?-g/C:-g/(l*f)):(L=r.get(m,m+1),I=r.get(m+1,m),p=(t[m]-d)*(t[m]-d)+e[m]*e[m],A=(L*v-x*g)/p,r.set(m,s,A),r.set(m+1,s,Math.abs(L)>Math.abs(x)?(-g-C*A)/L:(-v-I*A)/x)),A=Math.abs(r.get(m,s)),l*A*A>1)for(w=m;w<=s;w++)r.set(w,s,r.get(w,s)/A)}else if(p<0)for(b=s-1,Math.abs(r.get(s,s-1))>Math.abs(r.get(s-1,s))?(r.set(s-1,s-1,p/r.get(s,s-1)),r.set(s-1,s,-(r.get(s,s)-d)/r.get(s,s-1))):(j=Xm(0,-r.get(s-1,s),r.get(s-1,s-1)-d,p),r.set(s-1,s-1,j[0]),r.set(s-1,s,j[1])),r.set(s,s-1,0),r.set(s,s,1),m=s-2;m>=0;m--){for(E=0,N=0,w=b;w<=s;w++)E=E+r.get(m,w)*r.get(w,s-1),N=N+r.get(m,w)*r.get(w,s);if(C=r.get(m,m)-d,e[m]<0)x=C,g=E,v=N;else if(b=m,e[m]===0?(j=Xm(-E,-N,C,p),r.set(m,s-1,j[0]),r.set(m,s,j[1])):(L=r.get(m,m+1),I=r.get(m+1,m),z=(t[m]-d)*(t[m]-d)+e[m]*e[m]-p*p,O=(t[m]-d)*2*p,z===0&&O===0&&(z=l*f*(Math.abs(C)+Math.abs(p)+Math.abs(L)+Math.abs(I)+Math.abs(x))),j=Xm(L*g-x*E+p*N,L*v-x*N-p*E,z,O),r.set(m,s-1,j[0]),r.set(m,s,j[1]),Math.abs(L)>Math.abs(x)+Math.abs(p)?(r.set(m+1,s-1,(-E-C*r.get(m,s-1)+p*r.get(m,s))/L),r.set(m+1,s,(-N-C*r.get(m,s)-p*r.get(m,s-1))/L)):(j=Xm(-g-I*r.get(m,s-1),-v-I*r.get(m,s),x,p),r.set(m+1,s-1,j[0]),r.set(m+1,s,j[1]))),A=Math.max(Math.abs(r.get(m,s-1)),Math.abs(r.get(m,s))),l*A*A>1)for(w=m;w<=s;w++)r.set(w,s-1,r.get(w,s-1)/A),r.set(w,s,r.get(w,s)/A)}for(m=0;ma)for(w=m;w=o;w--)for(m=o;m<=a;m++){for(x=0,S=o;S<=Math.min(w,a);S++)x=x+i.get(m,S)*r.get(S,w);i.set(m,w,x)}}}function Xm(n,e,t,i){let r,s;return Math.abs(t)>Math.abs(i)?(r=i/t,s=t+r*i,[(n+r*e)/s,(e-r*n)/s]):(r=t/i,s=i+r*t,[(r*n+e)/s,(r*e-n)/s])}class tO{constructor(e){if(e=Tr.checkMatrix(e),!e.isSymmetric())throw new Error("Matrix is not symmetric");let t=e,i=t.rows,r=new Oe(i,i),s=!0,o,a,l;for(a=0;a0,r.set(a,a,Math.sqrt(Math.max(u,0))),l=a+1;l=0;l--)for(a=0;ao;g++)d=e.transpose().mmul(a).div(a.transpose().mmul(a).get(0,0)),d=d.div(d.norm()),u=e.mmul(d).div(d.transpose().mmul(d).get(0,0)),g>0&&(l=u.clone().sub(p).pow(2).sum()),p=u.clone(),i?(f=i.transpose().mmul(u).div(u.transpose().mmul(u).get(0,0)),f=f.div(f.norm()),a=i.mmul(f).div(f.transpose().mmul(f).get(0,0))):a=u;if(i){let g=e.transpose().mmul(u).div(u.transpose().mmul(u).get(0,0));g=g.div(g.norm());let v=e.clone().sub(u.clone().mmul(g.transpose())),x=a.transpose().mmul(u).div(u.transpose().mmul(u).get(0,0)),_=i.clone().sub(u.clone().mulS(x.get(0,0)).mmul(f.transpose()));this.t=u,this.p=g.transpose(),this.w=d.transpose(),this.q=f,this.u=a,this.s=u.transpose().mmul(u),this.xResidual=v,this.yResidual=_,this.betas=x}else this.w=d.transpose(),this.s=u.transpose().mmul(u).sqrt(),r?this.t=u.clone().div(this.s.get(0,0)):this.t=u,this.xResidual=e.sub(u.mmul(d.transpose()))}}Nt.AbstractMatrix=xt;Nt.CHO=tO;Nt.CholeskyDecomposition=tO;Nt.DistanceMatrix=oy;Nt.EVD=eO;Nt.EigenvalueDecomposition=eO;Nt.LU=ay;Nt.LuDecomposition=ay;var iO=Nt.Matrix=Oe;Nt.MatrixColumnSelectionView=A$;Nt.MatrixColumnView=T$;Nt.MatrixFlipColumnView=C$;Nt.MatrixFlipRowView=R$;Nt.MatrixRowSelectionView=I$;Nt.MatrixRowView=P$;Nt.MatrixSelectionView=Ng;Nt.MatrixSubView=L$;Nt.MatrixTransposeView=N$;Nt.NIPALS=nO;Nt.Nipals=nO;Nt.QR=ME;Nt.QrDecomposition=ME;Nt.SVD=Vc;Nt.SingularValueDecomposition=Vc;Nt.SymmetricMatrix=wl;Nt.WrapperMatrix1D=JD;Nt.WrapperMatrix2D=Tr;Nt.correlation=V$;Nt.covariance=B$;var iP=Nt.default=Oe;Nt.determinant=Dg;var X$=Nt.inverse=O$;Nt.linearDependencies=U$;Nt.pseudoInverse=z$;Nt.solve=QD;Nt.wrap=D$;const qv=iO;iP.Matrix&&iP.Matrix;const $$=X$;function q$(n,e,t,i,r){const s=t.length,o=n.x.length;let a=new Array(s);for(let l=0;l0&&s[s.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]0)&&!(r=i.next()).done;)s.push(r.value)}catch(a){o={error:a}}finally{try{r&&!r.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return s},oP=Ft&&Ft.__spread||function(){for(var n=[],e=0;e0&&s.set(o,f,d)}var p=Mn.transpose(s);return Mn.maximum(s,p)},n.prototype.transform=function(e){var t=this,i=this.X;if(i===void 0||i.length===0)throw new Error("No data has been fit.");var r=Math.floor(this.nNeighbors*this.transformQueueSize);r=Math.min(i.length,r);var s=$m.initializeSearch(this.rpForest,i,e,r,this.initFromRandom,this.initFromTree,this.random),o=this.search(i,this.searchGraph,s,e),a=tq.deheapSort(o),l=a.indices,u=a.weights;l=l.map(function(j){return j.slice(0,t.nNeighbors)}),u=u.map(function(j){return j.slice(0,t.nNeighbors)});var f=Math.max(0,this.localConnectivity-1),d=this.smoothKNNDistance(u,this.nNeighbors,f),p=d.sigmas,g=d.rhos,v=this.computeMembershipStrengths(l,u,p,g),x=v.rows,_=v.cols,m=v.vals,w=[e.length,i.length],S=new Mn.SparseMatrix(x,_,m,w),b=Mn.normalize(S,"l1"),R=Mn.getCSR(b),A=e.length,C=In.reshape2d(R.indices,A,this.nNeighbors),L=In.reshape2d(R.values,A,this.nNeighbors),I=lO(C,L,this.embedding),E=this.nEpochs?this.nEpochs/3:S.nRows<=1e4?100:30,N=S.getValues().reduce(function(j,Q){return Q>j?Q:j},0);S=S.map(function(j){return j0});if(v.length>=i){var x=Math.floor(i),_=i-x;x>0?(a[u]=v[x-1],_>lP&&(a[u]+=_*(v[x]-v[x-1]))):a[u]=_*v[0]}else v.length>0&&(a[u]=In.max(v));for(var m=0;m0?w+=Math.exp(-(b/p)):w+=1}if(Math.abs(w-o)o?(d=p,p=(f+d)/2):(f=p,d===1/0?p*=2:p=(f+d)/2)}if(l[u]=p,a[u]>0){var R=In.mean(g);l[u]0&&(i[a]=t/s[a])}),i},n.prototype.assignOptimizationStateParameters=function(e){Object.assign(this.optimizationState,e)},n.prototype.prepareForOptimizationLoop=function(){var e=this,t=e.repulsionStrength,i=e.learningRate,r=e.negativeSampleRate,s=this.optimizationState,o=s.epochsPerSample,a=s.headEmbedding,l=s.tailEmbedding,u=a[0].length,f=a.length===l.length,d=o.map(function(v){return v/r}),p=oP(d),g=oP(o);this.assignOptimizationStateParameters({epochOfNextSample:g,epochOfNextNegativeSample:p,epochsPerNegativeSample:d,moveOther:f,initialAlpha:i,alpha:i,gamma:t,dim:u})},n.prototype.initializeOptimization=function(){var e=this.embedding,t=this.embedding,i=this.optimizationState,r=i.head,s=i.tail,o=i.epochsPerSample,a=this.getNEpochs(),l=this.graph.nCols,u=sO(this.spread,this.minDist),f=u.a,d=u.b;this.assignOptimizationStateParameters({headEmbedding:e,tailEmbedding:t,head:r,tail:s,epochsPerSample:o,a:f,b:d,nEpochs:a,nVertices:l})},n.prototype.optimizeLayoutStep=function(e){for(var t=this.optimizationState,i=t.head,r=t.tail,s=t.headEmbedding,o=t.tailEmbedding,a=t.epochsPerSample,l=t.epochOfNextSample,u=t.epochOfNextNegativeSample,f=t.epochsPerNegativeSample,d=t.moveOther,p=t.initialAlpha,g=t.alpha,v=t.gamma,x=t.a,_=t.b,m=t.dim,w=t.nEpochs,S=t.nVertices,b=4,R=0;Re)){var A=i[R],C=r[R],L=s[A],I=o[C],E=cP(L,I),N=0;E>0&&(N=-2*x*_*Math.pow(E,_-1),N/=x*Math.pow(E,_)+1);for(var z=0;z0)W=2*v*_,W/=(.001+k)*(x*Math.pow(k,_)+1);else if(A===Q)continue;for(var z=0;z0&&(O=uP(W*(L[z]-oe[z]),b)),L[z]+=O*g}}u[R]+=q*f[R]}return t.alpha=p*(1-e/w),t.currentEpoch+=1,s},n.prototype.optimizeLayoutAsync=function(e){var t=this;return e===void 0&&(e=function(){return!0}),new Promise(function(i,r){var s=function(){return rP(t,void 0,void 0,function(){var o,a,l,u,f,d;return sP(this,function(p){try{if(o=this.optimizationState,a=o.nEpochs,l=o.currentEpoch,this.embedding=this.optimizeLayoutStep(l),u=this.optimizationState.currentEpoch,f=e(u)===!1,d=u===a,!f&&!d)setTimeout(function(){return s()},0);else return[2,i(d)]}catch(g){r(g)}return[2]})})};setTimeout(function(){return s()},0)})},n.prototype.optimizeLayout=function(e){e===void 0&&(e=function(){return!0});for(var t=!1,i=[];!t;){var r=this.optimizationState,s=r.nEpochs,o=r.currentEpoch;i=this.optimizeLayoutStep(o);var a=this.optimizationState.currentEpoch,l=e(a)===!1;t=a===s||l}return i},n.prototype.getNEpochs=function(){var e=this.graph;if(this.nEpochs>0)return this.nEpochs;var t=e.nRows;return t<=2500?500:t<=5e3?400:t<=7500?300:200},n}();Oo.UMAP=iq;function rO(n,e){for(var t=0,i=0;ie?e:n<-e?-e:n}function cP(n,e){for(var t=0,i=0;i=e;return v?Math.exp(-(i[g]-e)/n):p}),s=[.5,.5],o={x:i,y:r},a={damping:1.5,initialValues:s,gradientDifference:.1,maxIterations:100,errorTolerance:.01},l=nq.default(o,t,a).parameterValues,u=a1(l,2),f=u[0],d=u[1];return{a:f,b:d}}Oo.findABParams=sO;function oO(n,e,t,i){return t===void 0&&(t=1),i===void 0&&(i=5),n.map(function(r,s,o){return e[s]===-1||e[o]===-1?r*Math.exp(-t):e[s]!==e[o]?r*Math.exp(-i):r})}Oo.fastIntersection=oO;function aO(n){n=Mn.normalize(n,"max");var e=Mn.transpose(n),t=Mn.pairwiseMultiply(e,n);return n=Mn.add(n,Mn.subtract(e,t)),Mn.eliminateZeros(n)}Oo.resetLocalConnectivity=aO;function lO(n,e,t){for(var i=In.zeros(n.length).map(function(l){return In.zeros(t[0].length)}),r=0;rthis.calculateEmbedding(i)));return this.theUMAP=new aq({nNeighbors:1,nComponents:3,minDist:.5}),this.theUMAP.fit(t)}async calculateProjection(e){if(this.initOpenAi(),!this.theUMAP)return[0,0,0];const t=await this.calculateEmbedding(e);return this.theUMAP.transform([t])[0]}}const uq=()=>We.jsxs("div",{className:"ItemOpenAiKey",children:["OpenAI API key ",We.jsx("input",{id:"llm-key",style:{width:"200px"},type:"password"})]});function cq(){let[n]=Y.useState(new lq);const[e,t]=Y.useState(-1),[i,r]=Y.useState([]),[s,o]=Y.useState([0,0,0]),a=async u=>{o(await n.calculateProjection(u))},l=async()=>{const u=await n.initializeProjection(i.map(f=>f.label));i.map(f=>{f.position=u[f.index]}),r(i.slice())};return We.jsxs(We.Fragment,{children:[We.jsx(uq,{}),We.jsxs("div",{id:"main-div",children:[We.jsxs("div",{id:"left-pane",children:[We.jsx(x7,{conceptCategories:E7,concepts:i,setConcepts:r,onCalculateEmbeddings:l}),We.jsx(w7,{onChangeMyConcept:a})]}),We.jsx("div",{id:"right-pane",children:We.jsx(MW,{concepts:i,spherePos:s,onHoverConcept:t})})]}),e!=-1&&We.jsx(S7,{text:`${i[e].label}`})]})}Kx.createRoot(document.getElementById("root")).render(We.jsx(wP.StrictMode,{children:We.jsx(cq,{})})); diff --git a/index.html b/index.html index 9b56a5f..05e15c7 100644 --- a/index.html +++ b/index.html @@ -5,8 +5,8 @@ Embedding Viewer - - + +