vendor: 1,812 bytes, line 1
1var BS=Object.defineProperty;var $S=(t,e,r)=>e in t?BS(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var nt=(t,e,r)=>$S(t,typeof e!="symbol"?e+"":e,r);function qS(t,e){for(var r=0;r<e.length;r++){const s=e[r];if(typeof s!="string"&&!Array.isArray(s)){for(const o in s)if(o!=="default"&&!(o in t)){const l=Object.getOwnPropertyDescriptor(s,o);l&&Object.defineProperty(t,o,l.get?l:{enumerable:!0,get:()=>s[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function r(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function s(o){if(o.ep)return;o.ep=!0;const l=r(o);fetch(o.href,l)}})();function ym(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function HS(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var r=function s(){return this instanceof s?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(s){var o=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(r,s,o.get?o:{enumerable:!0,get:function(){return t[s]}})}),r}
vendor: 34,905 bytes, lines 1-48
1var Fd={exports:{}},Yo={};/** 2 * @license React 3 * react-jsx-runtime.production.js 4 * 5 * Copyright (c) Meta Platforms, Inc. and affiliates. 6 * 7 * This source code is licensed under the MIT license found in the 8 * LICENSE file in the root directory of this source tree. 9 */var jv;function IS(){if(jv)return Yo;jv=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function r(s,o,l){var u=null;if(l!==void 0&&(u=""+l),o.key!==void 0&&(u=""+o.key),"key"in o){l={};for(var d in o)d!=="key"&&(l[d]=o[d])}else l=o;return o=l.ref,{$$typeof:t,type:s,key:u,ref:o!==void 0?o:null,props:l}}return Yo.Fragment=e,Yo.jsx=r,Yo.jsxs=r,Yo}var Rv;function GS(){return Rv||(Rv=1,Fd.exports=IS()),Fd.exports}var y=GS(),Qd={exports:{}},Ae={};/** 10 * @license React 11 * react.production.js 12 * 13 * Copyright (c) Meta Platforms, Inc. and affiliates. 14 * 15 * This source code is licensed under the MIT license found in the 16 * LICENSE file in the root directory of this source tree. 17 */var Nv;function KS(){if(Nv)return Ae;Nv=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.iterator;function b(j){return j===null||typeof j!="object"?null:(j=v&&j[v]||j["@@iterator"],typeof j=="function"?j:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,E={};function T(j,G,ee){this.props=j,this.context=G,this.refs=E,this.updater=ee||C}T.prototype.isReactComponent={},T.prototype.setState=function(j,G){if(typeof j!="object"&&typeof j!="function"&&j!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,j,G,"setState")},T.prototype.forceUpdate=function(j){this.updater.enqueueForceUpdate(this,j,"forceUpdate")};function k(){}k.prototype=T.prototype;function z(j,G,ee){this.props=j,this.context=G,this.refs=E,this.updater=ee||C}var O=z.prototype=new k;O.constructor=z,x(O,T.prototype),O.isPureReactComponent=!0;var Y=Array.isArray,K={H:null,A:null,T:null,S:null,V:null},re=Object.prototype.hasOwnProperty;function J(j,G,ee,F,se,ve){return ee=ve.ref,{$$typeof:t,type:j,key:G,ref:ee!==void 0?ee:null,props:ve}}function Z(j,G){return J(j.type,G,void 0,void 0,void 0,j.props)}function de(j){return typeof j=="object"&&j!==null&&j.$$typeof===t}function Ee(j){var G={"=":"=0",":":"=2"};return"$"+j.replace(/[=:]/g,function(ee){return G[ee]})}var je=/\/+/g;function ze(j,G){return typeof j=="object"&&j!==null&&j.key!=null?Ee(""+j.key):G.toString(36)}function At(){}function kt(j){switch(j.status){case"fulfilled":return j.value;case"rejected":throw j.reason;default:switch(typeof j.status=="string"?j.then(At,At):(j.status="pending",j.then(function(G){j.status==="pending"&&(j.status="fulfilled",j.value=G)},function(G){j.status==="pending"&&(j.status="rejected",j.reason=G)})),j.status){case"fulfilled":return j.value;case"rejected":throw j.reason}}throw j}function Me(j,G,ee,F,se){var ve=typeof j;(ve==="undefined"||ve==="boolean")&&(j=null);var ie=!1;if(j===null)ie=!0;else switch(ve){case"bigint":case"string":case"number":ie=!0;break;case"object":switch(j.$$typeof){case t:case e:ie=!0;break;case g:return ie=j._init,Me(ie(j._payload),G,ee,F,se)}}if(ie)return se=se(j),ie=F===""?"."+ze(j,0):F,Y(se)?(ee="",ie!=null&&(ee=ie.replace(je,"$&/")+"/"),Me(se,G,ee,"",function(ot){return ot})):se!=null&&(de(se)&&(se=Z(se,ee+(se.key==null||j&&j.key===se.key?"":(""+se.key).replace(je,"$&/")+"/")+ie)),G.push(se)),1;ie=0;var Se=F===""?".":F+":";if(Y(j))for(var Pe=0;Pe<j.length;Pe++)F=j[Pe],ve=Se+ze(F,Pe),ie+=Me(F,G,ee,ve,se);else if(Pe=b(j),typeof Pe=="function")for(j=Pe.call(j),Pe=0;!(F=j.next()).done;)F=F.value,ve=Se+ze(F,Pe++),ie+=Me(F,G,ee,ve,se);else if(ve==="object"){if(typeof j.then=="function")return Me(kt(j),G,ee,F,se);throw G=String(j),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(j).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return ie}function M(j,G,ee){if(j==null)return j;var F=[],se=0;return Me(j,F,"","",function(ve){return G.call(ee,ve,se++)}),F}function ne(j){if(j._status===-1){var G=j._result;G=G(),G.then(function(ee){(j._status===0||j._status===-1)&&(j._status=1,j._result=ee)},function(ee){(j._status===0||j._status===-1)&&(j._status=2,j._result=ee)}),j._status===-1&&(j._status=0,j._result=G)}if(j._status===1)return j._result.default;throw j._result}var W=typeof reportError=="function"?reportError:function(j){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof j=="object"&&j!==null&&typeof j.message=="string"?String(j.message):String(j),error:j});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",j);return}console.error(j)};function _e(){}return Ae.Children={map:M,forEach:function(j,G,ee){M(j,function(){G.apply(this,arguments)},ee)},count:function(j){var G=0;return M(j,function(){G++}),G},toArray:function(j){return M(j,function(G){return G})||[]},only:function(j){if(!de(j))throw Error("React.Children.only expected to receive a single React element child.");return j}},Ae.Component=T,Ae.Fragment=r,Ae.Profiler=o,Ae.PureComponent=z,Ae.StrictMode=s,Ae.Suspense=m,Ae.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=K,Ae.__COMPILER_RUNTIME={__proto__:null,c:function(j){return K.H.useMemoCache(j)}},Ae.cache=function(j){return function(){return j.apply(null,arguments)}},Ae.cloneElement=function(j,G,ee){if(j==null)throw Error("The argument must be a React element, but you passed "+j+".");var F=x({},j.props),se=j.key,ve=void 0;if(G!=null)for(ie in G.ref!==void 0&&(ve=void 0),G.key!==void 0&&(se=""+G.key),G)!re.call(G,ie)||ie==="key"||ie==="__self"||ie==="__source"||ie==="ref"&&G.ref===void 0||(F[ie]=G[ie]);var ie=arguments.length-2;if(ie===1)F.children=ee;else if(1<ie){for(var Se=Array(ie),Pe=0;Pe<ie;Pe++)Se[Pe]=arguments[Pe+2];F.children=Se}return J(j.type,se,void 0,void 0,ve,F)},Ae.createContext=function(j){return j={$$typeof:u,_currentValue:j,_currentValue2:j,_threadCount:0,Provider:null,Consumer:null},j.Provider=j,j.Consumer={$$typeof:l,_context:j},j},Ae.createElement=function(j,G,ee){var F,se={},ve=null;if(G!=null)for(F in G.key!==void 0&&(ve=""+G.key),G)re.call(G,F)&&F!=="key"&&F!=="__self"&&F!=="__source"&&(se[F]=G[F]);var ie=arguments.length-2;if(ie===1)se.children=ee;else if(1<ie){for(var Se=Array(ie),Pe=0;Pe<ie;Pe++)Se[Pe]=arguments[Pe+2];se.children=Se}if(j&&j.defaultProps)for(F in ie=j.defaultProps,ie)se[F]===void 0&&(se[F]=ie[F]);return J(j,ve,void 0,void 0,null,se)},Ae.createRef=function(){return{current:null}},Ae.forwardRef=function(j){return{$$typeof:d,render:j}},Ae.isValidElement=de,Ae.lazy=function(j){return{$$typeof:g,_payload:{_status:-1,_result:j},_init:ne}},Ae.memo=function(j,G){return{$$typeof:h,type:j,compare:G===void 0?null:G}},Ae.startTransition=function(j){var G=K.T,ee={};K.T=ee;try{var F=j(),se=K.S;se!==null&&se(ee,F),typeof F=="object"&&F!==null&&typeof F.then=="function"&&F.then(_e,W)}catch(ve){W(ve)}finally{K.T=G}},Ae.unstable_useCacheRefresh=function(){return K.H.useCacheRefresh()},Ae.use=function(j){return K.H.use(j)},Ae.useActionState=function(j,G,ee){return K.H.useActionState(j,G,ee)},Ae.useCallback=function(j,G){return K.H.useCallback(j,G)},Ae.useContext=function(j){return K.H.useContext(j)},Ae.useDebugValue=function(){},Ae.useDeferredValue=function(j,G){return K.H.useDeferredValue(j,G)},Ae.useEffect=function(j,G,ee){var F=K.H;if(typeof ee=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return F.useEffect(j,G)},Ae.useId=function(){return K.H.useId()},Ae.useImperativeHandle=function(j,G,ee){return K.H.useImperativeHandle(j,G,ee)},Ae.useInsertionEffect=function(j,G){return K.H.useInsertionEffect(j,G)},Ae.useLayoutEffect=function(j,G){return K.H.useLayoutEffect(j,G)},Ae.useMemo=function(j,G){return K.H.useMemo(j,G)},Ae.useOptimistic=function(j,G){return K.H.useOptimistic(j,G)},Ae.useReducer=function(j,G,ee){return K.H.useReducer(j,G,ee)},Ae.useRef=function(j){return K.H.useRef(j)},Ae.useState=function(j){return K.H.useState(j)},Ae.useSyncExternalStore=function(j,G,ee){return K.H.useSyncExternalStore(j,G,ee)},Ae.useTransition=function(){return K.H.useTransition()},Ae.version="19.1.0",Ae}var Ov;function Su(){return Ov||(Ov=1,Qd.exports=KS()),Qd.exports}var _=Su();const ae=ym(_),jb=qS({__proto__:null,default:ae},[_]);var Xd={exports:{}},Fo={},Zd={exports:{}},Wd={};/** 18 * @license React 19 * scheduler.production.js 20 * 21 * Copyright (c) Meta Platforms, Inc. and affiliates. 22 * 23 * This source code is licensed under the MIT license found in the 24 * LICENSE file in the root directory of this source tree. 25 */var Mv;function VS(){return Mv||(Mv=1,function(t){function e(M,ne){var W=M.length;M.push(ne);e:for(;0<W;){var _e=W-1>>>1,j=M[_e];if(0<o(j,ne))M[_e]=ne,M[W]=j,W=_e;else break e}}function r(M){return M.length===0?null:M[0]}function s(M){if(M.length===0)return null;var ne=M[0],W=M.pop();if(W!==ne){M[0]=W;e:for(var _e=0,j=M.length,G=j>>>1;_e<G;){var ee=2*(_e+1)-1,F=M[ee],se=ee+1,ve=M[se];if(0>o(F,W))se<j&&0>o(ve,F)?(M[_e]=ve,M[se]=W,_e=se):(M[_e]=F,M[ee]=W,_e=ee);else if(se<j&&0>o(ve,W))M[_e]=ve,M[se]=W,_e=se;else break e}}return ne}function o(M,ne){var W=M.sortIndex-ne.sortIndex;return W!==0?W:M.id-ne.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;t.unstable_now=function(){return l.now()}}else{var u=Date,d=u.now();t.unstable_now=function(){return u.now()-d}}var m=[],h=[],g=1,v=null,b=3,C=!1,x=!1,E=!1,T=!1,k=typeof setTimeout=="function"?setTimeout:null,z=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function Y(M){for(var ne=r(h);ne!==null;){if(ne.callback===null)s(h);else if(ne.startTime<=M)s(h),ne.sortIndex=ne.expirationTime,e(m,ne);else break;ne=r(h)}}function K(M){if(E=!1,Y(M),!x)if(r(m)!==null)x=!0,re||(re=!0,ze());else{var ne=r(h);ne!==null&&Me(K,ne.startTime-M)}}var re=!1,J=-1,Z=5,de=-1;function Ee(){return T?!0:!(t.unstable_now()-de<Z)}function je(){if(T=!1,re){var M=t.unstable_now();de=M;var ne=!0;try{e:{x=!1,E&&(E=!1,z(J),J=-1),C=!0;var W=b;try{t:{for(Y(M),v=r(m);v!==null&&!(v.expirationTime>M&&Ee());){var _e=v.callback;if(typeof _e=="function"){v.callback=null,b=v.priorityLevel;var j=_e(v.expirationTime<=M);if(M=t.unstable_now(),typeof j=="function"){v.callback=j,Y(M),ne=!0;break t}v===r(m)&&s(m),Y(M)}else s(m);v=r(m)}if(v!==null)ne=!0;else{var G=r(h);G!==null&&Me(K,G.startTime-M),ne=!1}}break e}finally{v=null,b=W,C=!1}ne=void 0}}finally{ne?ze():re=!1}}}var ze;if(typeof O=="function")ze=function(){O(je)};else if(typeof MessageChannel<"u"){var At=new MessageChannel,kt=At.port2;At.port1.onmessage=je,ze=function(){kt.postMessage(null)}}else ze=function(){k(je,0)};function Me(M,ne){J=k(function(){M(t.unstable_now())},ne)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(M){M.callback=null},t.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<M?Math.floor(1e3/M):5},t.unstable_getCurrentPriorityLevel=function(){return b},t.unstable_next=function(M){switch(b){case 1:case 2:case 3:var ne=3;break;default:ne=b}var W=b;b=ne;try{return M()}finally{b=W}},t.unstable_requestPaint=function(){T=!0},t.unstable_runWithPriority=function(M,ne){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var W=b;b=M;try{return ne()}finally{b=W}},t.unstable_scheduleCallback=function(M,ne,W){var _e=t.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?_e+W:_e):W=_e,M){case 1:var j=-1;break;case 2:j=250;break;case 5:j=1073741823;break;case 4:j=1e4;break;default:j=5e3}return j=W+j,M={id:g++,callback:ne,priorityLevel:M,startTime:W,expirationTime:j,sortIndex:-1},W>_e?(M.sortIndex=W,e(h,M),r(m)===null&&M===r(h)&&(E?(z(J),J=-1):E=!0,Me(K,W-_e))):(M.sortIndex=j,e(m,M),x||C||(x=!0,re||(re=!0,ze()))),M},t.unstable_shouldYield=Ee,t.unstable_wrapCallback=function(M){var ne=b;return function(){var W=b;b=ne;try{return M.apply(this,arguments)}finally{b=W}}}}(Wd)),Wd}var Dv;function YS(){return Dv||(Dv=1,Zd.exports=VS()),Zd.exports}var Jd={exports:{}},Yt={};/** 26 * @license React 27 * react-dom.production.js 28 * 29 * Copyright (c) Meta Platforms, Inc. and affiliates. 30 * 31 * This source code is licensed under the MIT license found in the 32 * LICENSE file in the root directory of this source tree. 33 */var Lv;function FS(){if(Lv)return Yt;Lv=1;var t=Su();function e(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+m+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var s={d:{f:r,r:function(){throw Error(e(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for("react.portal");function l(m,h,g){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:v==null?null:""+v,children:m,containerInfo:h,implementation:g}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Yt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Yt.createPortal=function(m,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(e(299));return l(m,h,null,g)},Yt.flushSync=function(m){var h=u.T,g=s.p;try{if(u.T=null,s.p=2,m)return m()}finally{u.T=h,s.p=g,s.d.f()}},Yt.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,s.d.C(m,h))},Yt.prefetchDNS=function(m){typeof m=="string"&&s.d.D(m)},Yt.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var g=h.as,v=d(g,h.crossOrigin),b=typeof h.integrity=="string"?h.integrity:void 0,C=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?s.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:v,integrity:b,fetchPriority:C}):g==="script"&&s.d.X(m,{crossOrigin:v,integrity:b,fetchPriority:C,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Yt.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=d(h.as,h.crossOrigin);s.d.M(m,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&s.d.M(m)},Yt.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,v=d(g,h.crossOrigin);s.d.L(m,g,{crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Yt.preloadModule=function(m,h){if(typeof m=="string")if(h){var g=d(h.as,h.crossOrigin);s.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else s.d.m(m)},Yt.requestFormReset=function(m){s.d.r(m)},Yt.unstable_batchedUpdates=function(m,h){return m(h)},Yt.useFormState=function(m,h,g){return u.H.useFormState(m,h,g)},Yt.useFormStatus=function(){return u.H.useHostTransitionStatus()},Yt.version="19.1.0",Yt}var Uv;function Rb(){if(Uv)return Jd.exports;Uv=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Jd.exports=FS(),Jd.exports}/** 34 * @license React 35 * react-dom-client.production.js 36 * 37 * Copyright (c) Meta Platforms, Inc. and affiliates. 38 * 39 * This source code is licensed under the MIT license found in the 40 * LICENSE file in the root directory of this source tree. 41 */var zv;function QS(){if(zv)return Fo;zv=1;var t=YS(),e=Su(),r=Rb();function s(n){var a="https://react.dev/errors/"+n;if(1<arguments.length){a+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)a+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+n+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(n){return!(!n||n.nodeType!==1&&n.nodeType!==9&&n.nodeType!==11)}function l(n){var a=n,i=n;if(n.alternate)for(;a.return;)a=a.return;else{n=a;do a=n,(a.flags&4098)!==0&&(i=a.return),n=a.return;while(n)}return a.tag===3?i:null}function u(n){if(n.tag===13){var a=n.memoizedState;if(a===null&&(n=n.alternate,n!==null&&(a=n.memoizedState)),a!==null)return a.dehydrated}return null}function d(n){if(l(n)!==n)throw Error(s(188))}function m(n){var a=n.alternate;if(!a){if(a=l(n),a===null)throw Error(s(188));return a!==n?null:n}for(var i=n,c=a;;){var f=i.return;if(f===null)break;var p=f.alternate;if(p===null){if(c=f.return,c!==null){i=c;continue}break}if(f.child===p.child){for(p=f.child;p;){if(p===i)return d(f),n;if(p===c)return d(f),a;p=p.sibling}throw Error(s(188))}if(i.return!==c.return)i=f,c=p;else{for(var w=!1,S=f.child;S;){if(S===i){w=!0,i=f,c=p;break}if(S===c){w=!0,c=f,i=p;break}S=S.sibling}if(!w){for(S=p.child;S;){if(S===i){w=!0,i=p,c=f;break}if(S===c){w=!0,c=p,i=f;break}S=S.sibling}if(!w)throw Error(s(189))}}if(i.alternate!==c)throw Error(s(190))}if(i.tag!==3)throw Error(s(188));return i.stateNode.current===i?n:a}function h(n){var a=n.tag;if(a===5||a===26||a===27||a===6)return n;for(n=n.child;n!==null;){if(a=h(n),a!==null)return a;n=n.sibling}return null}var g=Object.assign,v=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),k=Symbol.for("react.provider"),z=Symbol.for("react.consumer"),O=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),re=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),de=Symbol.for("react.activity"),Ee=Symbol.for("react.memo_cache_sentinel"),je=Symbol.iterator;function ze(n){return n===null||typeof n!="object"?null:(n=je&&n[je]||n["@@iterator"],typeof n=="function"?n:null)}var At=Symbol.for("react.client.reference");function kt(n){if(n==null)return null;if(typeof n=="function")return n.$$typeof===At?null:n.displayName||n.name||null;if(typeof n=="string")return n;switch(n){case x:return"Fragment";case T:return"Profiler";case E:return"StrictMode";case K:return"Suspense";case re:return"SuspenseList";case de:return"Activity"}if(typeof n=="object")switch(n.$$typeof){case C:return"Portal";case O:return(n.displayName||"Context")+".Provider";case z:return(n._context.displayName||"Context")+".Consumer";case Y:var a=n.render;return n=n.displayName,n||(n=a.displayName||a.name||"",n=n!==""?"ForwardRef("+n+")":"ForwardRef"),n;case J:return a=n.displayName||null,a!==null?a:kt(n.type)||"Memo";case Z:a=n._payload,n=n._init;try{return kt(n(a))}catch{}}return null}var Me=Array.isArray,M=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},_e=[],j=-1;function G(n){return{current:n}}function ee(n){0>j||(n.current=_e[j],_e[j]=null,j--)}function F(n,a){j++,_e[j]=n.current,n.current=a}var se=G(null),ve=G(null),ie=G(null),Se=G(null);function Pe(n,a){switch(F(ie,a),F(ve,n),F(se,null),a.nodeType){case 9:case 11:n=(n=a.documentElement)&&(n=n.namespaceURI)?rv(n):0;break;default:if(n=a.tagName,a=a.namespaceURI)a=rv(a),n=av(a,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}ee(se),F(se,n)}function ot(){ee(se),ee(ve),ee(ie)}function Kt(n){n.memoizedState!==null&&F(Se,n);var a=se.current,i=av(a,n.type);a!==i&&(F(ve,n),F(se,i))}function An(n){ve.current===n&&(ee(se),ee(ve)),Se.current===n&&(ee(Se),Ho._currentValue=W)}var hn=Object.prototype.hasOwnProperty,Pa=t.unstable_scheduleCallback,mr=t.unstable_cancelCallback,Cs=t.unstable_shouldYield,Ts=t.unstable_requestPaint,jt=t.unstable_now,Ba=t.unstable_getCurrentPriorityLevel,Wt=t.unstable_ImmediatePriority,As=t.unstable_UserBlockingPriority,Vr=t.unstable_NormalPriority,Pt=t.unstable_LowPriority,kn=t.unstable_IdlePriority,Fi=t.log,Qi=t.unstable_setDisableYieldValue,jn=null,Rt=null;function mn(n){if(typeof Fi=="function"&&Qi(n),Rt&&typeof Rt.setStrictMode=="function")try{Rt.setStrictMode(jn,n)}catch{}}var bt=Math.clz32?Math.clz32:Jn,Wn=Math.log,ks=Math.LN2;function Jn(n){return n>>>=0,n===0?32:31-(Wn(n)/ks|0)|0}var Yr=256,Fr=4194304;function Rn(n){var a=n&42;if(a!==0)return a;switch(n&-n){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:return 64;case 128:return 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 n&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function pr(n,a,i){var c=n.pendingLanes;if(c===0)return 0;var f=0,p=n.suspendedLanes,w=n.pingedLanes;n=n.warmLanes;var S=c&134217727;return S!==0?(c=S&~p,c!==0?f=Rn(c):(w&=S,w!==0?f=Rn(w):i||(i=S&~n,i!==0&&(f=Rn(i))))):(S=c&~p,S!==0?f=Rn(S):w!==0?f=Rn(w):i||(i=c&~n,i!==0&&(f=Rn(i)))),f===0?0:a!==0&&a!==f&&(a&p)===0&&(p=f&-f,i=a&-a,p>=i||p===32&&(i&4194048)!==0)?a:f}function er(n,a){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&a)===0}function $a(n,a){switch(n){case 1:case 2:case 4:case 8:case 64:return a+250;case 16:case 32: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 a+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function pn(){var n=Yr;return Yr<<=1,(Yr&4194048)===0&&(Yr=256),n}function js(){var n=Fr;return Fr<<=1,(Fr&62914560)===0&&(Fr=4194304),n}function qa(n){for(var a=[],i=0;31>i;i++)a.push(n);return a}function tr(n,a){n.pendingLanes|=a,a!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function Rs(n,a,i,c,f,p){var w=n.pendingLanes;n.pendingLanes=i,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=i,n.entangledLanes&=i,n.errorRecoveryDisabledLanes&=i,n.shellSuspendCounter=0;var S=n.entanglements,A=n.expirationTimes,U=n.hiddenUpdates;for(i=w&~i;0<i;){var V=31-bt(i),X=1<<V;S[V]=0,A[V]=-1;var B=U[V];if(B!==null)for(U[V]=null,V=0;V<B.length;V++){var $=B[V];$!==null&&($.lane&=-536870913)}i&=~X}c!==0&&xe(n,c,0),p!==0&&f===0&&n.tag!==0&&(n.suspendedLanes|=p&~(w&~a))}function xe(n,a,i){n.pendingLanes|=a,n.suspendedLanes&=~a;var c=31-bt(a);n.entangledLanes|=a,n.entanglements[c]=n.entanglements[c]|1073741824|i&4194090}function st(n,a){var i=n.entangledLanes|=a;for(n=n.entanglements;i;){var c=31-bt(i),f=1<<c;f&a|n[c]&a&&(n[c]|=a),i&=~f}}function lt(n){switch(n){case 2:n=1;break;case 8:n=4;break;case 32:n=16;break;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:n=128;break;case 268435456:n=134217728;break;default:n=0}return n}function wt(n){return n&=-n,2<n?8<n?(n&134217727)!==0?32:268435456:8:2}function gr(){var n=ne.p;return n!==0?n:(n=window.event,n===void 0?32:Sv(n.type))}function P(n,a){var i=ne.p;try{return ne.p=n,a()}finally{ne.p=i}}var Fe=Math.random().toString(36).slice(2),qe="__reactFiber$"+Fe,Ge="__reactProps$"+Fe,te="__reactContainer$"+Fe,Nn="__reactEvents$"+Fe,Qe="__reactListeners$"+Fe,gn="__reactHandles$"+Fe,Cl="__reactResources$"+Fe,Nt="__reactMarker$"+Fe;function Ns(n){delete n[qe],delete n[Ge],delete n[Nn],delete n[Qe],delete n[gn]}function vr(n){var a=n[qe];if(a)return a;for(var i=n.parentNode;i;){if(a=i[te]||i[qe]){if(i=a.alternate,a.child!==null||i!==null&&i.child!==null)for(n=lv(n);n!==null;){if(i=n[qe])return i;n=lv(n)}return a}n=i,i=n.parentNode}return null}function ue(n){if(n=n[qe]||n[te]){var a=n.tag;if(a===5||a===6||a===13||a===26||a===27||a===3)return n}return null}function Ha(n){var a=n.tag;if(a===5||a===26||a===27||a===6)return n.stateNode;throw Error(s(33))}function yr(n){var a=n[Cl];return a||(a=n[Cl]={hoistableStyles:new Map,hoistableScripts:new Map}),a}function pt(n){n[Nt]=!0}var Xi=new Set,Tl={};function br(n,a){Qr(n,a),Qr(n+"Capture",a)}function Qr(n,a){for(Tl[n]=a,n=0;n<a.length;n++)Xi.add(a[n])}var Al=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Zi={},kl={};function Iu(n){return hn.call(kl,n)?!0:hn.call(Zi,n)?!1:Al.test(n)?kl[n]=!0:(Zi[n]=!0,!1)}function Os(n,a,i){if(Iu(a))if(i===null)n.removeAttribute(a);else{switch(typeof i){case"undefined":case"function":case"symbol":n.removeAttribute(a);return;case"boolean":var c=a.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){n.removeAttribute(a);return}}n.setAttribute(a,""+i)}}function Ia(n,a,i){if(i===null)n.removeAttribute(a);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(a);return}n.setAttribute(a,""+i)}}function vn(n,a,i,c){if(c===null)n.removeAttribute(i);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":n.removeAttribute(i);return}n.setAttributeNS(a,i,""+c)}}var Wi,jl;function wr(n){if(Wi===void 0)try{throw Error()}catch(i){var a=i.stack.trim().match(/\n( *(at )?)/);Wi=a&&a[1]||"",jl=-1<i.stack.indexOf(` 42 at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return` 43`+Wi+n+jl}var Ji=!1;function xt(n,a){if(!n||Ji)return"";Ji=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(a){var X=function(){throw Error()};if(Object.defineProperty(X.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(X,[])}catch($){var B=$}Reflect.construct(n,[],X)}else{try{X.call()}catch($){B=$}n.call(X.prototype)}}else{try{throw Error()}catch($){B=$}(X=n())&&typeof X.catch=="function"&&X.catch(function(){})}}catch($){if($&&B&&typeof $.stack=="string")return[$.stack,B.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var p=c.DetermineComponentFrameRoot(),w=p[0],S=p[1];if(w&&S){var A=w.split(` 44`),U=S.split(` 45`);for(f=c=0;c<A.length&&!A[c].includes("DetermineComponentFrameRoot");)c++;for(;f<U.length&&!U[f].includes("DetermineComponentFrameRoot");)f++;if(c===A.length||f===U.length)for(c=A.length-1,f=U.length-1;1<=c&&0<=f&&A[c]!==U[f];)f--;for(;1<=c&&0<=f;c--,f--)if(A[c]!==U[f]){if(c!==1||f!==1)do if(c--,f--,0>f||A[c]!==U[f]){var V=` 46`+A[c].replace(" at new "," at ");return n.displayName&&V.includes("<anonymous>")&&(V=V.replace("<anonymous>",n.displayName)),V}while(1<=c&&0<=f);break}}}finally{Ji=!1,Error.prepareStackTrace=i}return(i=n?n.displayName||n.name:"")?wr(i):""}function D(n){switch(n.tag){case 26:case 27:case 5:return wr(n.type);case 16:return wr("Lazy");case 13:return wr("Suspense");case 19:return wr("SuspenseList");case 0:case 15:return xt(n.type,!1);case 11:return xt(n.type.render,!1);case 1:return xt(n.type,!0);case 31:return wr("Activity");default:return""}}function I(n){try{var a="";do a+=D(n),n=n.return;while(n);return a}catch(i){return` 47Error generating stack: `+i.message+` 48`+i.stack}}function q(n){switch(typeof n){case"bigint":case"boolean":case"number":case"string":case"undefined":return n;case"object":return n;default:return""}}function he(n){var a=n.type;return(n=n.nodeName)&&n.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function me(n){var a=he(n)?"checked":"value",i=Object.getOwnPropertyDescriptor(n.constructor.prototype,a),c=""+n[a];if(!n.hasOwnProperty(a)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var f=i.get,p=i.set;return Object.defineProperty(n,a,{configurable:!0,get:function(){return f.call(this)},set:function(w){c=""+w,p.call(this,w)}}),Object.defineProperty(n,a,{enumerable:i.enumerable}),{getValue:function(){return c},setValue:function(w){c=""+w},stopTracking:function(){n._valueTracker=null,delete n[a]}}}}function Be(n){n._valueTracker||(n._valueTracker=me(n))}function nr(n){if(!n)return!1;var a=n._valueTracker;if(!a)return!0;var i=a.getValue(),c="";return n&&(c=he(n)?n.checked?"true":"false":n.value),n=c,n!==i?(a.setValue(n),!0):!1}function xr(n){if(n=n||(typeof document<"u"?document:void 0),typeof n>"u")return null;try{return n.activeElement||n.body}catch{return n.body}}var Lx=/[\n"\\]/g;function On(n){return n.replace(Lx,function(a){return"\\"+a.charCodeAt(0).toString(16)+" "})}function Gu(n,a,i,c,f,p,w,S){n.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?n.type=w:n.removeAttribute("type"),a!=null?w==="number"?(a===0&&n.value===""||n.value!=a)&&(n.value=""+q(a)):n.value!==""+q(a)&&(n.value=""+q(a)):w!=="submit"&&w!=="reset"||n.removeAttribute("value"),a!=null?Ku(n,w,q(a)):i!=null?Ku(n,w,q(i)):c!=null&&n.removeAttribute("value"),f==null&&p!=null&&(n.defaultChecked=!!p),f!=null&&(n.checked=f&&typeof f!="function"&&typeof f!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?n.name=""+q(S):n.removeAttribute("name")}function ep(n,a,i,c,f,p,w,S){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(n.type=p),a!=null||i!=null){if(!(p!=="submit"&&p!=="reset"||a!=null))return;i=i!=null?""+q(i):"",a=a!=null?""+q(a):i,S||a===n.value||(n.value=a),n.defaultValue=a}c=c??f,c=typeof c!="function"&&typeof c!="symbol"&&!!c,n.checked=S?n.checked:!!c,n.defaultChecked=!!c,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(n.name=w)}function Ku(n,a,i){a==="number"&&xr(n.ownerDocument)===n||n.defaultValue===""+i||(n.defaultValue=""+i)}function Ms(n,a,i,c){if(n=n.options,a){a={};for(var f=0;f<i.length;f++)a["$"+i[f]]=!0;for(i=0;i<n.length;i++)f=a.hasOwnProperty("$"+n[i].value),n[i].selected!==f&&(n[i].selected=f),f&&c&&(n[i].defaultSelected=!0)}else{for(i=""+q(i),a=null,f=0;f<n.length;f++){if(n[f].value===i){n[f].selected=!0,c&&(n[f].defaultSelected=!0);return}a!==null||n[f].disabled||(a=n[f])}a!==null&&(a.selected=!0)}}function tp(n,a,i){if(a!=null&&(a=""+q(a),a!==n.value&&(n.value=a),i==null)){n.defaultValue!==a&&(n.defaultValue=a);return}n.defaultValue=i!=null?""+q(i):""}function np(n,a,i,c){if(a==null){if(c!=null){if(i!=null)throw Error(s(92));if(Me(c)){if(1<c.length)throw Error(s(93));c=c[0]}i=c}i==null&&(i=""),a=i}i=q(a),n.defaultValue=i,c=n.textContent,c===i&&c!==""&&c!==null&&(n.value=c)}function Ds(n,a){if(a){var i=n.firstChild;if(i&&i===n.lastChild&&i.nodeType===3){i.nodeValue=a;return}}n.textContent=a}var Ux=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function rp(n,a,i){var c=a.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?c?n.setProperty(a,""):a==="float"?n.cssFloat="":n[a]="":c?n.setProperty(a,i):typeof i!="number"||i===0||Ux.has(a)?a==="float"?n.cssFloat=i:n[a]=(""+i).trim():n[a]=i+"px"}function ap(n,a,i){if(a!=null&&typeof a!="object")throw Error(s(62));if(n=n.style,i!=null){for(var c in i)!i.hasOwnProperty(c)||a!=null&&a.hasOwnProperty(c)||(c.indexOf("--")===0?n.setProperty(c,""):c==="float"?n.cssFloat="":n[c]="");for(var f in a)c=a[f],a.hasOwnProperty(f)&&i[f]!==c&&rp(n,f,c)}else for(var p in a)a.hasOwnProperty(p)&&rp(n,p,a[p])}function Vu(n){if(n.indexOf("-")===-1)return!1;switch(n){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var zx=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRen
48dering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Px=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Rl(n){return Px.test(""+n)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":n}var Yu=null;function Fu(n){return n=n.target||n.srcElement||window,n.correspondingUseElement&&(n=n.correspondingUseElement),n.nodeType===3?n.parentNode:n}var Ls=null,Us=null;function sp(n){var a=ue(n);if(a&&(n=a.stateNode)){var i=n[Ge]||null;e:switch(n=a.stateNode,a.type){case"input":if(Gu(n,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),a=i.name,i.type==="radio"&&a!=null){for(i=n;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+On(""+a)+'"][type="radio"]'),a=0;a<i.length;a++){var c=i[a];if(c!==n&&c.form===n.form){var f=c[Ge]||null;if(!f)throw Error(s(90));Gu(c,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(a=0;a<i.length;a++)c=i[a],c.form===n.form&&nr(c)}break e;case"textarea":tp(n,i.value,i.defaultValue);break e;case"select":a=i.value,a!=null&&Ms(n,!!i.multiple,a,!1)}}}var Qu=!1;function ip(n,a,i){if(Qu)return n(a,i);Qu=!0;try{var c=n(a);return c}finally{if(Qu=!1,(Ls!==null||Us!==null)&&(pc(),Ls&&(a=Ls,n=Us,Us=Ls=null,sp(a),n)))for(a=0;a<n.length;a++)sp(n[a])}}function eo(n,a){var i=n.stateNode;if(i===null)return null;var c=i[Ge]||null;if(c===null)return null;i=c[a];e:switch(a){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(n=n.type,c=!(n==="button"||n==="input"||n==="select"||n==="textarea")),n=!c;break e;default:n=!1}if(n)return null;if(i&&typeof i!="function")throw Error(s(231,a,typeof i));return i}var _r=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xu=!1;if(_r)try{var to={};Object.defineProperty(to,"passive",{get:function(){Xu=!0}}),window.addEventListener("test",to,to),window.removeEventListener("test",to,to)}catch{Xu=!1}var Xr=null,Zu=null,Nl=null;
vendor: 3,152 bytes, line 48
48function op(){if(Nl)return Nl;var n,a=Zu,i=a.length,c,f="value"in Xr?Xr.value:Xr.textContent,p=f.length;for(n=0;n<i&&a[n]===f[n];n++);var w=i-n;for(c=1;c<=w&&a[i-c]===f[p-c];c++);return Nl=f.slice(n,1<c?1-c:void 0)}function Ol(n){var a=n.keyCode;return"charCode"in n?(n=n.charCode,n===0&&a===13&&(n=13)):n=a,n===10&&(n=13),32<=n||n===13?n:0}function Ml(){return!0}function lp(){return!1}function Jt(n){function a(i,c,f,p,w){this._reactName=i,this._targetInst=f,this.type=c,this.nativeEvent=p,this.target=w,this.currentTarget=null;for(var S in n)n.hasOwnProperty(S)&&(i=n[S],this[S]=i?i(p):p[S]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Ml:lp,this.isPropagationStopped=lp,this}return g(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Ml)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Ml)},persist:function(){},isPersistent:Ml}),a}var Ga={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(n){return n.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Dl=Jt(Ga),no=g({},Ga,{view:0,detail:0}),Bx=Jt(no),Wu,Ju,ro,Ll=g({},no,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:tf,button:0,buttons:0,relatedTarget:function(n){return n.relatedTarget===void 0?n.fromElement===n.srcElement?n.toElement:n.fromElement:n.relatedTarget},movementX:function(n){return"movementX"in n?n.movementX:(n!==ro&&(ro&&n.type==="mousemove"?(Wu=n.screenX-ro.screenX,Ju=n.screenY-ro.screenY):Ju=Wu=0,ro=n),Wu)},movementY:function(n){return"movementY"in n?n.movementY:Ju}}),cp=Jt(Ll),$x=g({},Ll,{dataTransfer:0}),qx=Jt($x),Hx=g({},no,{relatedTarget:0}),ef=Jt(Hx),Ix=g({},Ga,{animationName:0,elapsedTime:0,pseudoElement:0}),Gx=Jt(Ix),Kx=g({},Ga,{clipboardData:function(n){return"clipboardData"in n?n.clipboardData:window.clipboardData}}),Vx=Jt(Kx),Yx=g({},Ga,{data:0}),up=Jt(Yx),Fx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Qx={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Xx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Zx(n){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(n):(n=Xx[n])?!!a[n]:!1}function tf(){return Zx}var Wx=g({},no,{key:function(n){if(n.key){var a=Fx[n.key]||n.key;if(a!=="Unidentified")return a}return n.type==="keypress"?(n=Ol(n),n===13?"Enter":String.fromCharCode(n)):n.type==="
48keydown"||n.type==="keyup"?Qx[n.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:tf,charCode:function(n){return n.type==="keypress"?Ol(n):0},keyCode:function(n){return n.type==="keydown"||n.type==="keyup"?n.keyCode:0},which:function(n){return n.type==="keypress"?Ol(n):n.type==="keydown"||n.type==="keyup"?n.keyCode:0}}),Jx=Jt(Wx),e_=g({},Ll,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fp=Jt(e_),t_=g({},no,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:tf}),n_=Jt(t_),r_=g({},Ga,{propertyName:0,elapsedTime:0,pseudoElement:0}),a_=Jt(r_),s_=g({},Ll,{deltaX:function(n){return"deltaX"in n?n.deltaX:"wheelDeltaX"in n?-n.wheelDeltaX:0},deltaY:function(n){return"deltaY"in n?n.deltaY:"wheelDeltaY"in n?-n.wheelDeltaY:"wheelDelta"in n?-n.wheelDelta:0},deltaZ:0,deltaMode:0}),i_=Jt(s_),o_=g({},Ga,{newState:0,oldState:0}),l_=Jt(o_),c_=[9,13,27,32],nf=_r&&"CompositionEvent"in window,ao=null;_r&&"documentMode"in document&&(ao=document.documentMode);var u_=_r&&"TextEvent"in window&&!ao,dp=_r&&(!nf||ao&&8<ao&&11>=ao),hp=" ",mp=!1;function pp(n,a){switch(n){case"keyup":return c_.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gp(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var zs=!1;function f_(n,a){switch(n){case"compositionend":return gp(a);case"keypress":return a.which!==32?null:(mp=!0,hp);case"textInput":return n=a.data,n===hp&&mp?null:n;default:return null}}function d_(n,a){if(zs)return n==="compositionend"||!nf&&pp(n,a)?(n=op(),Nl=Zu=Xr=null,zs=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return dp&&a.locale!=="ko"?null:a.data;default:return null}}var h_={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function vp(n){var a=n&&n.nodeName&&n.nodeName.toLowerCase();return a==="input"?!!h_[n.type]:a==="textarea"}function yp(n,a,i,c){Ls?Us?Us.push(c):Us=[c]:Ls=c,a=xc(a,"onChange"),0<a.length&&(i=new Dl("onChange","change",null,i,c),n.push({event:i,listeners:a}))}var so=null,io=null;function m_(n){W0(n,0)}function Ul(n){var a=Ha(n);if(nr(a))return n}function bp(n,a){if(n==="change")return a}var wp=!1;if(_r){var rf;if(_r){var af="oninput"in document;if(!af){var xp=document.createElement("div");xp.setAttribute("oninput","return;"),af=typeof xp.oninput=="function"}rf=af}else rf=!1;wp=rf&&(!document.documentMode||9<document.documentMode)}function _p(){so&&(so.detachEvent("onpropertychange",Sp),io=so=null)}function Sp(n){if(n.propertyName==="value"&&Ul(io)){var a=[];yp(a,io,n,Fu(n)),ip(m_,a)}}function p_(n,a,i){n==="focusin"?(_p(),so=a,io=i,so.attachEvent("onpropertychange",Sp)):n==="focusout"&&_p()}function g_(n){if(n==="selectionchange"||n==="keyup"||n==="keydown")return Ul(io)}function v_(n,a){if(n==="click")return Ul(a)}function y_(n,a){if(n==="input"||n==="change")return Ul(a)}function b_(n,a){return n===a&&(n!==0||1/n===1/a)||n!==n&&a!==a}var yn=typeof Object.is=="function"?Object.is:b_;function oo(n,a){if(yn(n,a))return!0;if(typeof n!="object"||n===null||typeof a!="object"||a===null)return!1;var i=Object.keys(n),c=Object.keys(a);if(i.length!==c.length)return!1;for(c=0;c<i.length;c++){var f=i[c];if(!hn.call(a,f)||!yn(n[f],a[f]))return!1}return!0}function Ep(n){for(;n&&n.firstChild;)n=n.firstChild;return n}function Cp(n,a){var i=Ep(n);n=0;for(var c;i;){if(i.nodeType===3){if(c=n+i.textContent.length,n<=a&&c>=a)return{node:i,offset:a-n};n=c}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Ep(i)}}function Tp(n,a){return n&&a?n===a?!0:n&&n.nodeType===3?!1:a&&a.nodeType===3?Tp(n,a.parentNode):"contains"in n?n.contains(a):n.compareDocumentPosition?!!(n.compareDocumentPosition(a)&16):!1:!1}function Ap(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var a=xr(n.document);a instanceof n.HTMLIFrameElement;){try{var i=typeof a.contentWindow.location.href=="string"}catch{i=!1}if(i)n=a.contentWindow;else break;a=xr(n.document)}return a}function sf(n){var a=n&&n.nodeName&&n.nodeName.toLowerCase();return a&&(a==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||a==="textarea"||n.contentEditable==="true")}var w_=_r&&"documentMode"in document&&11>=document.documentMode,Ps=null,of=null,lo=null,lf=!1;function kp(n,a,i){var c=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;lf||Ps==null||Ps!==xr(c)||(c=Ps,"selectionStart"in c&&sf(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focu
vendor: 72,785 bytes, line 48
48sNode:c.focusNode,focusOffset:c.focusOffset}),lo&&oo(lo,c)||(lo=c,c=xc(of,"onSelect"),0<c.length&&(a=new Dl("onSelect","select",null,a,i),n.push({event:a,listeners:c}),a.target=Ps)))}function Ka(n,a){var i={};return i[n.toLowerCase()]=a.toLowerCase(),i["Webkit"+n]="webkit"+a,i["Moz"+n]="moz"+a,i}var Bs={animationend:Ka("Animation","AnimationEnd"),animationiteration:Ka("Animation","AnimationIteration"),animationstart:Ka("Animation","AnimationStart"),transitionrun:Ka("Transition","TransitionRun"),transitionstart:Ka("Transition","TransitionStart"),transitioncancel:Ka("Transition","TransitionCancel"),transitionend:Ka("Transition","TransitionEnd")},cf={},jp={};_r&&(jp=document.createElement("div").style,"AnimationEvent"in window||(delete Bs.animationend.animation,delete Bs.animationiteration.animation,delete Bs.animationstart.animation),"TransitionEvent"in window||delete Bs.transitionend.transition);function Va(n){if(cf[n])return cf[n];if(!Bs[n])return n;var a=Bs[n],i;for(i in a)if(a.hasOwnProperty(i)&&i in jp)return cf[n]=a[i];return n}var Rp=Va("animationend"),Np=Va("animationiteration"),Op=Va("animationstart"),x_=Va("transitionrun"),__=Va("transitionstart"),S_=Va("transitioncancel"),Mp=Va("transitionend"),Dp=new Map,uf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");uf.push("scrollEnd");function qn(n,a){Dp.set(n,a),br(a,[n])}var Lp=new WeakMap;function Mn(n,a){if(typeof n=="object"&&n!==null){var i=Lp.get(n);return i!==void 0?i:(a={value:n,source:a,stack:I(a)},Lp.set(n,a),a)}return{value:n,source:a,stack:I(a)}}var Dn=[],$s=0,ff=0;function zl(){for(var n=$s,a=ff=$s=0;a<n;){var i=Dn[a];Dn[a++]=null;var c=Dn[a];Dn[a++]=null;var f=Dn[a];Dn[a++]=null;var p=Dn[a];if(Dn[a++]=null,c!==null&&f!==null){var w=c.pending;w===null?f.next=f:(f.next=w.next,w.next=f),c.pending=f}p!==0&&Up(i,f,p)}}function Pl(n,a,i,c){Dn[$s++]=n,Dn[$s++]=a,Dn[$s++]=i,Dn[$s++]=c,ff|=c,n.lanes|=c,n=n.alternate,n!==null&&(n.lanes|=c)}function df(n,a,i,c){return Pl(n,a,i,c),Bl(n)}function qs(n,a){return Pl(n,null,null,a),Bl(n)}function Up(n,a,i){n.lanes|=i;var c=n.alternate;c!==null&&(c.lanes|=i);for(var f=!1,p=n.return;p!==null;)p.childLanes|=i,c=p.alternate,c!==null&&(c.childLanes|=i),p.tag===22&&(n=p.stateNode,n===null||n._visibility&1||(f=!0)),n=p,p=p.return;return n.tag===3?(p=n.stateNode,f&&a!==null&&(f=31-bt(i),n=p.hiddenUpdates,c=n[f],c===null?n[f]=[a]:c.push(a),a.lane=i|536870912),p):null}function Bl(n){if(50<Do)throw Do=0,yd=null,Error(s(185));for(var a=n.return;a!==null;)n=a,a=n.return;return n.tag===3?n.stateNode:null}var Hs={};function E_(n,a,i,c){this.tag=n,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=a,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function bn(n,a,i,c){return new E_(n,a,i,c)}function hf(n){return n=n.prototype,!(!n||!n.isReactComponent)}function Sr(n,a){var i=n.alternate;return i===null?(i=bn(n.tag,a,n.key,n.mode),i.elementType=n.elementType,i.type=n.type,i.stateNode=n.stateNode,i.alternate=n,n.alternate=i):(i.pendingProps=a,i.type=n.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=n.flags&65011712,i.childLanes=n.childLanes,i.lanes=n.lanes,i.child=n.child,i.memoizedProps=n.memoizedProps,i.memoizedState=n.memoizedState,i.updateQueue=n.updateQueue,a=n.dependencies,i.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},i.sibling=n.sibling,i.index=n.index,i.ref=n.ref,i.refCleanup=n.refCleanup,i}function zp(n,a){n.flags&=65011714;var i=n.alternate;return i===null?(n.childLanes=0,n.lanes=a,n.child=null,n.subtreeFlags=0,n.memoizedProps=null,n.memoizedState=null,n.updateQueue=null,n.dependencies=null,n.stateNode=null):(n.childLanes=i.childLanes,n.lanes=i.lanes,n.child=i.child,n.subtreeFlags=0,n.deletions=null,n.memoizedProps=i.memoizedProps,n.memoizedState=i.memoizedState,n.updateQueue=i.updateQueue,n.type=i.type,a=i.dependencies,n.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),n}function $l(n,a,i,c,f,p){var w=0;if(c=n,typeof n=="function")hf(n)&&(w=1);else if(typeof n=="string")w=TS(n,i,se.current)?26:n==="html"||n==="head"||n==="body"?27:5;else e:switch(n){case de:return n=bn(31,i,a,f),n.elementType=de,n.lanes=p,n;case x:return Ya(i.children,f,p,a);case E:w=8,f|=24;break;case T:return n=bn(12,i,a,f|2),n.elementType=T,n.lanes=p,n;case K:return n=bn(13,i,a,f),n.elementType=K,n.lanes=p,n;case re:return n=bn(19,i,a,f),n.elementType=re,n.lanes=p,n;default:if(typeof n=="object"&&n!==null)switch(n.$$typeof){case k:case O:w=10;break e;case z:w=9;break e;case Y:w=11;break e;case J:w=14;break e;case Z:w=16,c=null;break e}w=29,i=Error(s(130,n===null?"null":typeof n,"")),c=null}return a=bn(w,i,a,f),a.elementType=n,a.type=c,a.lanes=p,a}function Ya(n,a,i,c){return n=bn(7,n,c,a),n.lanes=i,n}function mf(n,a,i){return n=bn(6,n,null,a),n.lanes=i,n}function pf(n,a,i){return a=bn(4,n.children!==null?n.children:[],n.key,a),a.lanes=i,a.stateNode={containerInfo:n.containerInfo,pendingChildren:null,implementation:n.implementation},a}var Is=[],Gs=0,ql=null,Hl=0,Ln=[],Un=0,Fa=null,Er=1,Cr="";function Qa(n,a){Is[Gs++]=Hl,Is[Gs++]=ql,ql=n,Hl=a}function Pp(n,a,i){Ln[Un++]=Er,Ln[Un++]=Cr,Ln[Un++]=Fa,Fa=n;var c=Er;n=Cr;var f=32-bt(c)-1;c&=~(1<<f),i+=1;var p=32-bt(a)+f;if(30<p){var w=f-f%5;p=(c&(1<<w)-1).toString(32),c>>=w,f-=w,Er=1<<32-bt(a)+f|i<<f|c,Cr=p+n}else Er=1<<p|i<<f|c,Cr=n}function gf(n){n.return!==null&&(Qa(n,1),Pp(n,1,0))}function vf(n){for(;n===ql;)ql=Is[--Gs],Is[Gs]=null,Hl=Is[--Gs],Is[Gs]=null;for(;n===Fa;)Fa=Ln[--Un],Ln[Un]=null,Cr=Ln[--Un],Ln[Un]=null,Er=Ln[--Un],Ln[Un]=null}var Xt=null,ct=null,Ke=!1,Xa=null,rr=!1,yf=Error(s(519));function Za(n){var a=Error(s(418,""));throw fo(Mn(a,n)),yf}function Bp(n){var a=n.stateNode,i=n.type,c=n.memoizedProps;switch(a[qe]=n,a[Ge]=c,i){case"dialog":Le("cancel",a),Le("close",a);break;case"iframe":case"object":case"embed":Le("load",a);break;case"video":case"audio":for(i=0;i<Uo.length;i++)Le(Uo[i],a);break;case"source":Le("error",a);break;case"img":case"image":case"link":Le("error",a),Le("load",a);break;case"details":Le("toggle",a);break;case"input":Le("invalid",a),ep(a,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0),Be(a);break;case"select":Le("invalid",a);break;case"textarea":Le("invalid",a),np(a,c.value,c.defaultValue,c.children),Be(a)}i=c.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||a.textContent===""+i||c.suppressHydrationWarning===!0||nv(a.textContent,i)?(c.popover!=null&&(Le("beforetoggle",a),Le("toggle",a)),c.onScroll!=null&&Le("scroll",a),c.onScrollEnd!=null&&Le("scrollend",a),c.onClick!=null&&(a.onclick=_c),a=!0):a=!1,a||Za(n)}function $p(n){for(Xt=n.return;Xt;)switch(Xt.tag){case 5:case 13:rr=!1;return;case 27:case 3:rr=!0;return;default:Xt=Xt.return}}function co(n){if(n!==Xt)return!1;if(!Ke)return $p(n),Ke=!0,!1;var a=n.tag,i;if((i=a!==3&&a!==27)&&((i=a===5)&&(i=n.type,i=!(i!=="form"&&i!=="button")||Dd(n.type,n.memoizedProps)),i=!i),i&&ct&&Za(n),$p(n),a===13){if(n=n.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(317));e:{for(n=n.nextSibling,a=0;n;){if(n.nodeType===8)if(i=n.data,i==="/$"){if(a===0){ct=In(n.nextSibling);break e}a--}else i!=="$"&&i!=="$!"&&i!=="$?"||a++;n=n.nextSibling}ct=null}}else a===27?(a=ct,da(n.type)?(n=Pd,Pd=null,ct=n):ct=a):ct=Xt?In(n.stateNode.nextSibling):null;return!0}function uo(){ct=Xt=null,Ke=!1}function qp(){var n=Xa;return n!==null&&(nn===null?nn=n:nn.push.apply(nn,n),Xa=null),n}function fo(n){Xa===null?Xa=[n]:Xa.push(n)}var bf=G(null),Wa=null,Tr=null;function Zr(n,a,i){F(bf,a._currentValue),a._currentValue=i}function Ar(n){n._currentValue=bf.current,ee(bf)}function wf(n,a,i){for(;n!==null;){var c=n.alternate;if((n.childLanes&a)!==a?(n.childLanes|=a,c!==null&&(c.childLanes|=a)):c!==null&&(c.childLanes&a)!==a&&(c.childLanes|=a),n===i)break;n=n.return}}function xf(n,a,i,c){var f=n.child;for(f!==null&&(f.return=n);f!==null;){var p=f.dependencies;if(p!==null){var w=f.child;p=p.firstContext;e:for(;p!==null;){var S=p;p=f;for(var A=0;A<a.length;A++)if(S.context===a[A]){p.lanes|=i,S=p.alternate,S!==null&&(S.lanes|=i),wf(p.return,i,n),c||(w=null);break e}p=S.next}}else if(f.tag===18){if(w=f.return,w===null)throw Error(s(341));w.lanes|=i,p=w.alternate,p!==null&&(p.lanes|=i),wf(w,i,n),w=null}else w=f.child;if(w!==null)w.return=f;else for(w=f;w!==null;){if(w===n){w=null;break}if(f=w.sibling,f!==null){f.return=w.return,w=f;break}w=w.return}f=w}}function ho(n,a,i,c){n=null;for(var f=a,p=!1;f!==null;){if(!p){if((f.flags&524288)!==0)p=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var w=f.alternate;if(w===null)throw Error(s(387));if(w=w.memoizedProps,w!==null){var S=f.type;yn(f.pendingProps.value,w.value)||(n!==null?n.push(S):n=[S])}}else if(f===Se.current){if(w=f.alternate,w===null)throw Error(s(387));w.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(n!==null?n.push(Ho):n=[Ho])}f=f.return}n!==null&&xf(a,n,i,c),a.flags|=262144}function Il(n){for(n=n.firstContext;n!==null;){if(!yn(n.context._currentValue,n.memoizedValue))return!0;n=n.next}return!1}function Ja(n){Wa=n,Tr=null,n=n.dependencies,n!==null&&(n.firstContext=null)}function Vt(n){return Hp(Wa,n)}function Gl(n,a){return Wa===null&&Ja(n),Hp(n,a)}function Hp(n,a){var i=a._currentValue;if(a={context:a,memoizedValue:i,next:null},Tr===null){if(n===null)throw Error(s(308));Tr=a,n.dependencies={lanes:0,firstContext:a},n.flags|=524288}else Tr=Tr.next=a;return i}var C_=typeof AbortController<"u"?AbortController:function(){var n=[],a=this.signal={aborted:!1,addEventListener:function(i,c){n.push(c)}};this.abort=function(){a.aborted=!0,n.forEach(function(i){return i()})}},T_=t.unstable_scheduleCallback,A_=t.unstable_NormalPriority,_t={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function _f(){return{controller:new C_,data:new Map,refCount:0}}function mo(n){n.refCount--,n.refCount===0&&T_(A_,function(){n.controller.abort()})}var po=null,Sf=0,Ks=0,Vs=null;function k_(n,a){if(po===null){var i=po=[];Sf=0,Ks=Cd(),Vs={status:"pending",value:void 0,then:function(c){i.push(c)}}}return Sf++,a.then(Ip,Ip),a}function Ip(){if(--Sf===0&&po!==null){Vs!==null&&(Vs.status="fulfilled");var n=po;po=null,Ks=0,Vs=null;for(var a=0;a<n.length;a++)(0,n[a])()}}function j_(n,a){var i=[],c={status:"pending",value:null,reason:null,then:function(f){i.push(f)}};return n.then(function(){c.status="fulfilled",c.value=a;for(var f=0;f<i.length;f++)(0,i[f])(a)},function(f){for(c.status="rejected",c.reason=f,f=0;f<i.length;f++)(0,i[f])(void 0)}),c}var Gp=M.S;M.S=function(n,a){typeof a=="object"&&a!==null&&typeof a.then=="function"&&k_(n,a),Gp!==null&&Gp(n,a)};var es=G(null);function Ef(){var n=es.current;return n!==null?n:et.pooledCache}function Kl(n,a){a===null?F(es,es.current):F(es,a.pool)}function Kp(){var n=Ef();return n===null?null:{parent:_t._currentValue,pool:n}}var go=Error(s(460)),Vp=Error(s(474)),Vl=Error(s(542)),Cf={then:function(){}};function Yp(n){return n=n.status,n==="fulfilled"||n==="rejected"}function Yl(){}function Fp(n,a,i){switch(i=n[i],i===void 0?n.push(a):i!==a&&(a.then(Yl,Yl),a=i),a.status){case"fulfilled":return a.value;case"rejected":throw n=a.reason,Xp(n),n;default:if(typeof a.status=="string")a.then(Yl,Yl);else{if(n=et,n!==null&&100<n.shellSuspendCounter)throw Error(s(482));n=a,n.status="pending",n.then(function(c){if(a.status==="pending"){var f=a;f.status="fulfilled",f.value=c}},function(c){if(a.status==="pending"){var f=a;f.status="rejected",f.reason=c}})}switch(a.status){case"fulfilled":return a.value;case"rejected":throw n=a.reason,Xp(n),n}throw vo=a,go}}var vo=null;function Qp(){if(vo===null)throw Error(s(459));var n=vo;return vo=null,n}function Xp(n){if(n===go||n===Vl)throw Error(s(483))}var Wr=!1;function Tf(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Af(n,a){n=n.updateQueue,a.updateQueue===n&&(a.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Jr(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function ea(n,a,i){var c=n.updateQueue;if(c===null)return null;if(c=c.shared,(Ve&2)!==0){var f=c.pending;return f===null?a.next=a:(a.next=f.next,f.next=a),c.pending=a,a=Bl(n),Up(n,null,i),a}return Pl(n,c,a,i),Bl(n)}function yo(n,a,i){if(a=a.updateQueue,a!==null&&(a=a.shared,(i&4194048)!==0)){var c=a.lanes;c&=n.pendingLanes,i|=c,a.lanes=i,st(n,i)}}function kf(n,a){var i=n.updateQueue,c=n.alternate;if(c!==null&&(c=c.updateQueue,i===c)){var f=null,p=null;if(i=i.firstBaseUpdate,i!==null){do{var w={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};p===null?f=p=w:p=p.next=w,i=i.next}while(i!==null);p===null?f=p=a:p=p.next=a}else f=p=a;i={baseState:c.baseState,firstBaseUpdate:f,lastBaseUpdate:p,shared:c.shared,callbacks:c.callbacks},n.updateQueue=i;return}n=i.lastBaseUpdate,n===null?i.firstBaseUpdate=a:n.next=a,i.lastBaseUpdate=a}var jf=!1;function bo(){if(jf){var n=Vs;if(n!==null)throw n}}function wo(n,a,i,c){jf=!1;var f=n.updateQueue;Wr=!1;var p=f.firstBaseUpdate,w=f.lastBaseUpdate,S=f.shared.pending;if(S!==null){f.shared.pending=null;var A=S,U=A.next;A.next=null,w===null?p=U:w.next=U,w=A;var V=n.alternate;V!==null&&(V=V.updateQueue,S=V.lastBaseUpdate,S!==w&&(S===null?V.firstBaseUpdate=U:S.next=U,V.lastBaseUpdate=A))}if(p!==null){var X=f.baseState;w=0,V=U=A=null,S=p;do{var B=S.lane&-536870913,$=B!==S.lane;if($?($e&B)===B:(c&B)===B){B!==0&&B===Ks&&(jf=!0),V!==null&&(V=V.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var ye=n,pe=S;B=a;var We=i;switch(pe.tag){case 1:if(ye=pe.payload,typeof ye=="function"){X=ye.call(We,X,B);break e}X=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=pe.payload,B=typeof ye=="function"?ye.call(We,X,B):ye,B==null)break e;X=g({},X,B);break e;case 2:Wr=!0}}B=S.callback,B!==null&&(n.flags|=64,$&&(n.flags|=8192),$=f.callbacks,$===null?f.callbacks=[B]:$.push(B))}else $={lane:B,tag:S.tag,payload:S.payload,callback:S.callback,next:null},V===null?(U=V=$,A=X):V=V.next=$,w|=B;if(S=S.next,S===null){if(S=f.shared.pending,S===null)break;$=S,S=$.next,$.next=null,f.lastBaseUpdate=$,f.shared.pending=null}}while(!0);V===null&&(A=X),f.baseState=A,f.firstBaseUpdate=U,f.lastBaseUpdate=V,p===null&&(f.shared.lanes=0),la|=w,n.lanes=w,n.memoizedState=X}}function Zp(n,a){if(typeof n!="function")throw Error(s(191,n));n.call(a)}function Wp(n,a){var i=n.callbacks;if(i!==null)for(n.callbacks=null,n=0;n<i.length;n++)Zp(i[n],a)}var Ys=G(null),Fl=G(0);function Jp(n,a){n=Dr,F(Fl,n),F(Ys,a),Dr=n|a.baseLanes}function Rf(){F(Fl,Dr),F(Ys,Ys.current)}function Nf(){Dr=Fl.current,ee(Ys),ee(Fl)}var ta=0,Re=null,Xe=null,gt=null,Ql=!1,Fs=!1,ts=!1,Xl=0,xo=0,Qs=null,R_=0;function dt(){throw Error(s(321))}function Of(n,a){if(a===null)return!1;for(var i=0;i<a.length&&i<n.length;i++)if(!yn(n[i],a[i]))return!1;return!0}function Mf(n,a,i,c,f,p){return ta=p,Re=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,M.H=n===null||n.memoizedState===null?Ug:zg,ts=!1,p=i(c,f),ts=!1,Fs&&(p=tg(a,i,c,f)),eg(n),p}function eg(n){M.H=nc;var a=Xe!==null&&Xe.next!==null;if(ta=0,gt=Xe=Re=null,Ql=!1,xo=0,Qs=null,a)throw Error(s(300));n===null||Ot||(n=n.dependencies,n!==null&&Il(n)&&(Ot=!0))}function tg(n,a,i,c){Re=n;var f=0;do{if(Fs&&(Qs=null),xo=0,Fs=!1,25<=f)throw Error(s(301));if(f+=1,gt=Xe=null,n.updateQueue!=null){var p=n.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}M.H=z_,p=a(i,c)}while(Fs);return p}function N_(){var n=M.H,a=n.useState()[0];return a=typeof a.then=="function"?_o(a):a,n=n.useState()[0],(Xe!==null?Xe.memoizedState:null)!==n&&(Re.flags|=1024),a}function Df(){var n=Xl!==0;return Xl=0,n}function Lf(n,a,i){a.updateQueue=n.updateQueue,a.flags&=-2053,n.lanes&=~i}function Uf(n){if(Ql){for(n=n.memoizedState;n!==null;){var a=n.queue;a!==null&&(a.pending=null),n=n.next}Ql=!1}ta=0,gt=Xe=Re=null,Fs=!1,xo=Xl=0,Qs=null}function en(){var n={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return gt===null?Re.memoizedState=gt=n:gt=gt.next=n,gt}function vt(){if(Xe===null){var n=Re.alternate;n=n!==null?n.memoizedState:null}else n=Xe.next;var a=gt===null?Re.memoizedState:gt.next;if(a!==null)gt=a,Xe=n;else{if(n===null)throw Re.alternate===null?Error(s(467)):Error(s(310));Xe=n,n={memoizedState:Xe.memoizedState,baseState:Xe.baseState,baseQueue:Xe.baseQueue,queue:Xe.queue,next:null},gt===null?Re.memoizedState=gt=n:gt=gt.next=n}return gt}function zf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function _o(n){var a=xo;return xo+=1,Qs===null&&(Qs=[]),n=Fp(Qs,n,a),a=Re,(gt===null?a.memoizedState:gt.next)===null&&(a=a.alternate,M.H=a===null||a.memoizedState===null?Ug:zg),n}function Zl(n){if(n!==null&&typeof n=="object"){if(typeof n.then=="function")return _o(n);if(n.$$typeof===O)return Vt(n)}throw Error(s(438,String(n)))}function Pf(n){var a=null,i=Re.updateQueue;if(i!==null&&(a=i.memoCache),a==null){var c=Re.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(a={data:c.data.map(function(f){return f.slice()}),index:0})))}if(a==null&&(a={data:[],index:0}),i===null&&(i=zf(),Re.updateQueue=i),i.memoCache=a,i=a.data[a.index],i===void 0)for(i=a.data[a.index]=Array(n),c=0;c<n;c++)i[c]=Ee;return a.index++,i}function kr(n,a){return typeof a=="function"?a(n):a}function Wl(n){var a=vt();return Bf(a,Xe,n)}function Bf(n,a,i){var c=n.queue;if(c===null)throw Error(s(311));c.lastRenderedReducer=i;var f=n.baseQueue,p=c.pending;if(p!==null){if(f!==null){var w=f.next;f.next=p.next,p.next=w}a.baseQueue=f=p,c.pending=null}if(p=n.baseState,f===null)n.memoizedState=p;else{a=f.next;var S=w=null,A=null,U=a,V=!1;do{var X=U.lane&-536870913;if(X!==U.lane?($e&X)===X:(ta&X)===X){var B=U.revertLane;if(B===0)A!==null&&(A=A.next={lane:0,revertLane:0,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null}),X===Ks&&(V=!0);else if((ta&B)===B){U=U.next,B===Ks&&(V=!0);continue}else X={lane:0,revertLane:U.revertLane,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},A===null?(S=A=X,w=p):A=A.next=X,Re.lanes|=B,la|=B;X=U.action,ts&&i(p,X),p=U.hasEagerState?U.eagerState:i(p,X)}else B={lane:X,revertLane:U.revertLane,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},A===null?(S=A=B,w=p):A=A.next=B,Re.lanes|=X,la|=X;U=U.next}while(U!==null&&U!==a);if(A===null?w=p:A.next=S,!yn(p,n.memoizedState)&&(Ot=!0,V&&(i=Vs,i!==null)))throw i;n.memoizedState=p,n.baseState=w,n.baseQueue=A,c.lastRenderedState=p}return f===null&&(c.lanes=0),[n.memoizedState,c.dispatch]}function $f(n){var a=vt(),i=a.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=n;var c=i.dispatch,f=i.pending,p=a.memoizedState;if(f!==null){i.pending=null;var w=f=f.next;do p=n(p,w.action),w=w.next;while(w!==f);yn(p,a.memoizedState)||(Ot=!0),a.memoizedState=p,a.baseQueue===null&&(a.baseState=p),i.lastRenderedState=p}return[p,c]}function ng(n,a,i){var c=Re,f=vt(),p=Ke;if(p){if(i===void 0)throw Error(s(407));i=i()}else i=a();var w=!yn((Xe||f).memoizedState,i);w&&(f.memoizedState=i,Ot=!0),f=f.queue;var S=sg.bind(null,c,f,n);if(So(2048,8,S,[n]),f.getSnapshot!==a||w||gt!==null&>.memoizedState.tag&1){if(c.flags|=2048,Xs(9,Jl(),ag.bind(null,c,f,i,a),null),et===null)throw Error(s(349));p||(ta&124)!==0||rg(c,a,i)}return i}function rg(n,a,i){n.flags|=16384,n={getSnapshot:a,value:i},a=Re.updateQueue,a===null?(a=zf(),Re.updateQueue=a,a.stores=[n]):(i=a.stores,i===null?a.stores=[n]:i.push(n))}function ag(n,a,i,c){a.value=i,a.getSnapshot=c,ig(a)&&og(n)}function sg(n,a,i){return i(function(){ig(a)&&og(n)})}function ig(n){var a=n.getSnapshot;n=n.value;try{var i=a();return!yn(n,i)}catch{return!0}}function og(n){var a=qs(n,2);a!==null&&En(a,n,2)}function qf(n){var a=en();if(typeof n=="function"){var i=n;if(n=i(),ts){mn(!0);try{i()}finally{mn(!1)}}}return a.memoizedState=a.baseState=n,a.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:kr,lastRenderedState:n},a}function lg(n,a,i,c){return n.baseState=i,Bf(n,Xe,typeof c=="function"?c:kr)}function O_(n,a,i,c,f){if(tc(n))throw Error(s(485));if(n=a.action,n!==null){var p={payload:f,action:n,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){p.listeners.push(w)}};M.T!==null?i(!0):p.isTransition=!1,c(p),i=a.pending,i===null?(p.next=a.pending=p,cg(a,p)):(p.next=i.next,a.pending=i.next=p)}}function cg(n,a){var i=a.action,c=a.payload,f=n.state;if(a.isTransition){var p=M.T,w={};M.T=w;try{var S=i(f,c),A=M.S;A!==null&&A(w,S),ug(n,a,S)}catch(U){Hf(n,a,U)}finally{M.T=p}}else try{p=i(f,c),ug(n,a,p)}catch(U){Hf(n,a,U)}}function ug(n,a,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(c){fg(n,a,c)},function(c){return Hf(n,a,c)}):fg(n,a,i)}function fg(n,a,i){a.status="fulfilled",a.value=i,dg(a),n.state=i,a=n.pending,a!==null&&(i=a.next,i===a?n.pending=null:(i=i.next,a.next=i,cg(n,i)))}function Hf(n,a,i){var c=n.pending;if(n.pending=null,c!==null){c=c.next;do a.status="rejected",a.reason=i,dg(a),a=a.next;while(a!==c)}n.action=null}function dg(n){n=n.listeners;for(var a=0;a<n.length;a++)(0,n[a])()}function hg(n,a){return a}function mg(n,a){if(Ke){var i=et.formState;if(i!==null){e:{var c=Re;if(Ke){if(ct){t:{for(var f=ct,p=rr;f.nodeType!==8;){if(!p){f=null;break t}if(f=In(f.nextSibling),f===null){f=null;break t}}p=f.data,f=p==="F!"||p==="F"?f:null}if(f){ct=In(f.nextSibling),c=f.data==="F!";break e}}Za(c)}c=!1}c&&(a=i[0])}}return i=en(),i.memoizedState=i.baseState=a,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hg,lastRenderedState:a},i.queue=c,i=Mg.bind(null,Re,c),c.dispatch=i,c=qf(!1),p=Yf.bind(null,Re,!1,c.queue),c=en(),f={state:a,dispatch:null,action:n,pending:null},c.queue=f,i=O_.bind(null,Re,f,p,i),f.dispatch=i,c.memoizedState=n,[a,i,!1]}function pg(n){var a=vt();return gg(a,Xe,n)}function gg(n,a,i){if(a=Bf(n,a,hg)[0],n=Wl(kr)[0],typeof a=="object"&&a!==null&&typeof a.then=="function")try{var c=_o(a)}catch(w){throw w===go?Vl:w}else c=a;a=vt();var f=a.queue,p=f.dispatch;return i!==a.memoizedState&&(Re.flags|=2048,Xs(9,Jl(),M_.bind(null,f,i),null)),[c,p,n]}function M_(n,a){n.action=a}function vg(n){var a=vt(),i=Xe;if(i!==null)return gg(a,i,n);vt(),a=a.memoizedState,i=vt();var c=i.queue.dispatch;return i.memoizedState=n,[a,c,!1]}function Xs(n,a,i,c){return n={tag:n,create:i,deps:c,inst:a,next:null},a=Re.updateQueue,a===null&&(a=zf(),Re.updateQueue=a),i=a.lastEffect,i===null?a.lastEffect=n.next=n:(c=i.next,i.next=n,n.next=c,a.lastEffect=n),n}function Jl(){return{destroy:void 0,resource:void 0}}function yg(){return vt().memoizedState}function ec(n,a,i,c){var f=en();c=c===void 0?null:c,Re.flags|=n,f.memoizedState=Xs(1|a,Jl(),i,c)}function So(n,a,i,c){var f=vt();c=c===void 0?null:c;var p=f.memoizedState.inst;Xe!==null&&c!==null&&Of(c,Xe.memoizedState.deps)?f.memoizedState=Xs(a,p,i,c):(Re.flags|=n,f.memoizedState=Xs(1|a,p,i,c))}function bg(n,a){ec(8390656,8,n,a)}function wg(n,a){So(2048,8,n,a)}function xg(n,a){return So(4,2,n,a)}function _g(n,a){return So(4,4,n,a)}function Sg(n,a){if(typeof a=="function"){n=n();var i=a(n);return function(){typeof i=="function"?i():a(null)}}if(a!=null)return n=n(),a.current=n,function(){a.current=null}}function Eg(n,a,i){i=i!=null?i.concat([n]):null,So(4,4,Sg.bind(null,a,n),i)}function If(){}function Cg(n,a){var i=vt();a=a===void 0?null:a;var c=i.memoizedState;return a!==null&&Of(a,c[1])?c[0]:(i.memoizedState=[n,a],n)}function Tg(n,a){var i=vt();a=a===void 0?null:a;var c=i.memoizedState;if(a!==null&&Of(a,c[1]))return c[0];if(c=n(),ts){mn(!0);try{n()}finally{mn(!1)}}return i.memoizedState=[c,a],c}function Gf(n,a,i){return i===void 0||(ta&1073741824)!==0?n.memoizedState=a:(n.memoizedState=i,n=j0(),Re.lanes|=n,la|=n,i)}function Ag(n,a,i,c){return yn(i,a)?i:Ys.current!==null?(n=Gf(n,i,c),yn(n,a)||(Ot=!0),n):(ta&42)===0?(Ot=!0,n.memoizedState=i):(n=j0(),Re.lanes|=n,la|=n,a)}function kg(n,a,i,c,f){var p=ne.p;ne.p=p!==0&&8>p?p:8;var w=M.T,S={};M.T=S,Yf(n,!1,a,i);try{var A=f(),U=M.S;if(U!==null&&U(S,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var V=j_(A,c);Eo(n,a,V,Sn(n))}else Eo(n,a,c,Sn(n))}catch(X){Eo(n,a,{then:function(){},status:"rejected",reason:X},Sn())}finally{ne.p=p,M.T=w}}function D_(){}function Kf(n,a,i,c){if(n.tag!==5)throw Error(s(476));var f=jg(n).queue;kg(n,f,a,W,i===null?D_:function(){return Rg(n),i(c)})}function jg(n){var a=n.memoizedState;if(a!==null)return a;a={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:kr,lastRenderedState:W},next:null};var i={};return a.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:kr,lastRenderedState:i},next:null},n.memoizedState=a,n=n.alternate,n!==null&&(n.memoizedState=a),a}function Rg(n){var a=jg(n).next.queue;Eo(n,a,{},Sn())}function Vf(){return Vt(Ho)}function Ng(){return vt().memoizedState}function Og(){return vt().memoizedState}function L_(n){for(var a=n.return;a!==null;){switch(a.tag){case 24:case 3:var i=Sn();n=Jr(i);var c=ea(a,n,i);c!==null&&(En(c,a,i),yo(c,a,i)),a={cache:_f()},n.payload=a;return}a=a.return}}function U_(n,a,i){var c=Sn();i={lane:c,revertLane:0,action:i,hasEagerState:!1,eagerState:null,next:null},tc(n)?Dg(a,i):(i=df(n,a,i,c),i!==null&&(En(i,n,c),Lg(i,a,c)))}function Mg(n,a,i){var c=Sn();Eo(n,a,i,c)}function Eo(n,a,i,c){var f={lane:c,revertLane:0,action:i,hasEagerState:!1,eagerState:null,next:null};if(tc(n))Dg(a,f);else{var p=n.alternate;if(n.lanes===0&&(p===null||p.lanes===0)&&(p=a.lastRenderedReducer,p!==null))try{var w=a.lastRenderedState,S=p(w,i);if(f.hasEagerState=!0,f.eagerState=S,yn(S,w))return Pl(n,a,f,0),et===null&&zl(),!1}catch{}finally{}if(i=df(n,a,f,c),i!==null)return En(i,n,c),Lg(i,a,c),!0}return!1}function Yf(n,a,i,c){if(c={lane:2,revertLane:Cd(),action:c,hasEagerState:!1,eagerState:null,next:null},tc(n)){if(a)throw Error(s(479))}else a=df(n,i,c,2),a!==null&&En(a,n,2)}function tc(n){var a=n.alternate;return n===Re||a!==null&&a===Re}function Dg(n,a){Fs=Ql=!0;var i=n.pending;i===null?a.next=a:(a.next=i.next,i.next=a),n.pending=a}function Lg(n,a,i){if((i&4194048)!==0){var c=a.lanes;c&=n.pendingLanes,i|=c,a.lanes=i,st(n,i)}}var nc={readContext:Vt,use:Zl,useCallback:dt,useContext:dt,useEffect:dt,useImperativeHandle:dt,useLayoutEffect:dt,useInsertionEffect:dt,useMemo:dt,useReducer:dt,useRef:dt,useState:dt,useDebugValue:dt,useDeferredValue:dt,useTransition:dt,useSyncExternalStore:dt,useId:dt,useHostTransitionStatus:dt,useFormState:dt,useActionState:dt,useOptimistic:dt,useMemoCache:dt,useCacheRefresh:dt},Ug={readContext:Vt,use:Zl,useCallback:function(n,a){return en().memoizedState=[n,a===void 0?null:a],n},useContext:Vt,useEffect:bg,useImperativeHandle:function(n,a,i){i=i!=null?i.concat([n]):null,ec(4194308,4,Sg.bind(null,a,n),i)},useLayoutEffect:function(n,a){return ec(4194308,4,n,a)},useInsertionEffect:function(n,a){ec(4,2,n,a)},useMemo:function(n,a){var i=en();a=a===void 0?null:a;var c=n();if(ts){mn(!0);try{n()}finally{mn(!1)}}return i.memoizedState=[c,a],c},useReducer:function(n,a,i){var c=en();if(i!==void 0){var f=i(a);if(ts){mn(!0);try{i(a)}finally{mn(!1)}}}else f=a;return c.memoizedState=c.baseState=f,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:f},c.queue=n,n=n.dispatch=U_.bind(null,Re,n),[c.memoizedState,n]},useRef:function(n){var a=en();return n={current:n},a.memoizedState=n},useState:function(n){n=qf(n);var a=n.queue,i=Mg.bind(null,Re,a);return a.dispatch=i,[n.memoizedState,i]},useDebugValue:If,useDeferredValue:function(n,a){var i=en();return Gf(i,n,a)},useTransition:function(){var n=qf(!1);return n=kg.bind(null,Re,n.queue,!0,!1),en().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,a,i){var c=Re,f=en();if(Ke){if(i===void 0)throw Error(s(407));i=i()}else{if(i=a(),et===null)throw Error(s(349));($e&124)!==0||rg(c,a,i)}f.memoizedState=i;var p={value:i,getSnapshot:a};return f.queue=p,bg(sg.bind(null,c,p,n),[n]),c.flags|=2048,Xs(9,Jl(),ag.bind(null,c,p,i,a),null),i},useId:function(){var n=en(),a=et.identifierPrefix;if(Ke){var i=Cr,c=Er;i=(c&~(1<<32-bt(c)-1)).toString(32)+i,a="«"+a+"R"+i,i=Xl++,0<i&&(a+="H"+i.toString(32)),a+="»"}else i=R_++,a="«"+a+"r"+i.toString(32)+"»";return n.memoizedState=a},useHostTransitionStatus:Vf,useFormState:mg,useActionState:mg,useOptimistic:function(n){var a=en();a.memoizedState=a.baseState=n;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return a.queue=i,a=Yf.bind(null,Re,!0,i),i.dispatch=a,[n,a]},useMemoCache:Pf,useCacheRefresh:function(){return en().memoizedState=L_.bind(null,Re)}},zg={readContext:Vt,use:Zl,useCallback:Cg,useContext:Vt,useEffect:wg,useImperativeHandle:Eg,useInsertionEffect:xg,useLayoutEffect:_g,useMemo:Tg,useReducer:Wl,useRef:yg,useState:function(){return Wl(kr)},useDebugValue:If,useDeferredValue:function(n,a){var i=vt();return Ag(i,Xe.memoizedState,n,a)},useTransition:function(){var n=Wl(kr)[0],a=vt().memoizedState;return[typeof n=="boolean"?n:_o(n),a]},useSyncExternalStore:ng,useId:Ng,useHostTransitionStatus:Vf,useFormState:pg,useActionState:pg,useOptimistic:function(n,a){var i=vt();return lg(i,Xe,n,a)},useMemoCache:Pf,useCacheRefresh:Og},z_={readContext:Vt,use:Zl,useCallback:Cg,useContext:Vt,useEffect:wg,useImperativeHandle:Eg,useInsertionEffect:xg,useLayoutEffect:_g,useMemo:Tg,useReducer:$f,useRef:yg,useState:function(){return $f(kr)},useDebugValue:If,useDeferredValue:function(n,a){var i=vt();return Xe===null?Gf(i,n,a):Ag(i,Xe.memoizedState,n,a)},useTransition:function(){var n=$f(kr)[0],a=vt().memoizedState;return[typeof n=="boolean"?n:_o(n),a]},useSyncExternalStore:ng,useId:Ng,useHostTransitionStatus:Vf,useFormState:vg,useActionState:vg,useOptimistic:function(n,a){var i=vt();return Xe!==null?lg(i,Xe,n,a):(i.baseState=n,[n,i.queue.dispatch])},useMemoCache:Pf,useCacheRefresh:Og},Zs=null,Co=0;function rc(n){var a=Co;return Co+=1,Zs===null&&(Zs=[]),Fp(Zs,n,a)}function To(n,a){a=a.props.ref,n.ref=a!==void 0?a:null}function ac(n,a){throw a.$$typeof===v?Error(s(525)):(n=Object.prototype.toString.call(a),Error(s(31,n==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":n)))}function Pg(n){var a=n._init;return a(n._payload)}function Bg(n){function a(N,R){if(n){var L=N.deletions;L===null?(N.deletions=[R],N.flags|=16):L.push(R)}}function i(N,R){if(!n)return null;for(;R!==null;)a(N,R),R=R.sibling;return null}function c(N){for(var R=new Map;N!==null;)N.key!==null?R.set(N.key,N):R.set(N.index,N),N=N.sibling;return R}function f(N,R){return N=Sr(N,R),N.index=0,N.sibling=null,N}function p(N,R,L){return N.index=L,n?(L=N.alternate,L!==null?(L=L.index,L<R?(N.flags|=67108866,R):L):(N.flags|=67108866,R)):(N.flags|=1048576,R)}function w(N){return n&&N.alternate===null&&(N.flags|=67108866),N}function S(N,R,L,Q){return R===null||R.tag!==6?(R=mf(L,N.mode,Q),R.return=N,R):(R=f(R,L),R.return=N,R)}function A(N,R,L,Q){var oe=L.type;return oe===x?V(N,R,L.props.children,Q,L.key):R!==null&&(R.elementType===oe||typeof oe=="object"&&oe!==null&&oe.$$typeof===Z&&Pg(oe)===R.type)?(R=f(R,L.props),To(R,L),R.return=N,R):(R=$l(L.type,L.key,L.props,null,N.mode,Q),To(R,L),R.return=N,R)}function U(N,R,L,Q){return R===null||R.tag!==4||R.stateNode.containerInfo!==L.containerInfo||R.stateNode.implementation!==L.implementation?(R=pf(L,N.mode,Q),R.return=N,R):(R=f(R,L.children||[]),R.return=N,R)}function V(N,R,L,Q,oe){return R===null||R.tag!==7?(R=Ya(L,N.mode,Q,oe),R.return=N,R):(R=f(R,L),R.return=N,R)}function X(N,R,L){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return R=mf(""+R,N.mode,L),R.return=N,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case b:return L=$l(R.type,R.key,R.props,null,N.mode,L),To(L,R),L.return=N,L;case C:return R=pf(R,N.mode,L),R.return=N,R;case Z:var Q=R._init;return R=Q(R._payload),X(N,R,L)}if(Me(R)||ze(R))return R=Ya(R,N.mode,L,null),R.return=N,R;if(typeof R.then=="function")return X(N,rc(R),L);if(R.$$typeof===O)return X(N,Gl(N,R),L);ac(N,R)}return null}function B(N,R,L,Q){var oe=R!==null?R.key:null;if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return oe!==null?null:S(N,R,""+L,Q);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case b:return L.key===oe?A(N,R,L,Q):null;case C:return L.key===oe?U(N,R,L,Q):null;case Z:return oe=L._init,L=oe(L._payload),B(N,R,L,Q)}if(Me(L)||ze(L))return oe!==null?null:V(N,R,L,Q,null);if(typeof L.then=="function")return B(N,R,rc(L),Q);if(L.$$typeof===O)return B(N,R,Gl(N,L),Q);ac(N,L)}return null}function $(N,R,L,Q,oe){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return N=N.get(L)||null,S(R,N,""+Q,oe);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case b:return N=N.get(Q.key===null?L:Q.key)||null,A(R,N,Q,oe);case C:return N=N.get(Q.key===null?L:Q.key)||null,U(R,N,Q,oe);case Z:var Oe=Q._init;return Q=Oe(Q._payload),$(N,R,L,Q,oe)}if(Me(Q)||ze(Q))return N=N.get(L)||null,V(R,N,Q,oe,null);if(typeof Q.then=="function")return $(N,R,L,rc(Q),oe);if(Q.$$typeof===O)return $(N,R,L,Gl(R,Q),oe);ac(R,Q)}return null}function ye(N,R,L,Q){for(var oe=null,Oe=null,fe=R,ge=R=0,Dt=null;fe!==null&&ge<L.length;ge++){fe.index>ge?(Dt=fe,fe=null):Dt=fe.sibling;var He=B(N,fe,L[ge],Q);if(He===null){fe===null&&(fe=Dt);break}n&&fe&&He.alternate===null&&a(N,fe),R=p(He,R,ge),Oe===null?oe=He:Oe.sibling=He,Oe=He,fe=Dt}if(ge===L.length)return i(N,fe),Ke&&Qa(N,ge),oe;if(fe===null){for(;ge<L.length;ge++)fe=X(N,L[ge],Q),fe!==null&&(R=p(fe,R,ge),Oe===null?oe=fe:Oe.sibling=fe,Oe=fe);return Ke&&Qa(N,ge),oe}for(fe=c(fe);ge<L.length;ge++)Dt=$(fe,N,ge,L[ge],Q),Dt!==null&&(n&&Dt.alternate!==null&&fe.delete(Dt.key===null?ge:Dt.key),R=p(Dt,R,ge),Oe===null?oe=Dt:Oe.sibling=Dt,Oe=Dt);return n&&fe.forEach(function(va){return a(N,va)}),Ke&&Qa(N,ge),oe}function pe(N,R,L,Q){if(L==null)throw Error(s(151));for(var oe=null,Oe=null,fe=R,ge=R=0,Dt=null,He=L.next();fe!==null&&!He.done;ge++,He=L.next()){fe.index>ge?(Dt=fe,fe=null):Dt=fe.sibling;var va=B(N,fe,He.value,Q);if(va===null){fe===null&&(fe=Dt);break}n&&fe&&va.alternate===null&&a(N,fe),R=p(va,R,ge),Oe===null?oe=va:Oe.sibling=va,Oe=va,fe=Dt}if(He.done)return i(N,fe),Ke&&Qa(N,ge),oe;if(fe===null){for(;!He.done;ge++,He=L.next())He=X(N,He.value,Q),He!==null&&(R=p(He,R,ge),Oe===null?oe=He:Oe.sibling=He,Oe=He);return Ke&&Qa(N,ge),oe}for(fe=c(fe);!He.done;ge++,He=L.next())He=$(fe,N,ge,He.value,Q),He!==null&&(n&&He.alternate!==null&&fe.delete(He.key===null?ge:He.key),R=p(He,R,ge),Oe===null?oe=He:Oe.sibling=He,Oe=He);return n&&fe.forEach(function(PS){return a(N,PS)}),Ke&&Qa(N,ge),oe}function We(N,R,L,Q){if(typeof L=="object"&&L!==null&&L.type===x&&L.key===null&&(L=L.props.children),typeof L=="object"&&L!==null){switch(L.$$typeof){case b:e:{for(var oe=L.key;R!==null;){if(R.key===oe){if(oe=L.type,oe===x){if(R.tag===7){i(N,R.sibling),Q=f(R,L.props.children),Q.return=N,N=Q;break e}}else if(R.elementType===oe||typeof oe=="object"&&oe!==null&&oe.$$typeof===Z&&Pg(oe)===R.type){i(N,R.sibling),Q=f(R,L.props),To(Q,L),Q.return=N,N=Q;break e}i(N,R);break}else a(N,R);R=R.sibling}L.type===x?(Q=Ya(L.props.children,N.mode,Q,L.key),Q.return=N,N=Q):(Q=$l(L.type,L.key,L.props,null,N.mode,Q),To(Q,L),Q.return=N,N=Q)}return w(N);case C:e:{for(oe=L.key;R!==null;){if(R.key===oe)if(R.tag===4&&R.stateNode.containerInfo===L.containerInfo&&R.stateNode.implementation===L.implementation){i(N,R.sibling),Q=f(R,L.children||[]),Q.return=N,N=Q;break e}else{i(N,R);break}else a(N,R);R=R.sibling}Q=pf(L,N.mode,Q),Q.return=N,N=Q}return w(N);case Z:return oe=L._init,L=oe(L._payload),We(N,R,L,Q)}if(Me(L))return ye(N,R,L,Q);if(ze(L)){if(oe=ze(L),typeof oe!="function")throw Error(s(150));return L=oe.call(L),pe(N,R,L,Q)}if(typeof L.then=="function")return We(N,R,rc(L),Q);if(L.$$typeof===O)return We(N,R,Gl(N,L),Q);ac(N,L)}return typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint"?(L=""+L,R!==null&&R.tag===6?(i(N,R.sibling),Q=f(R,L),Q.return=N,N=Q):(i(N,R),Q=mf(L,N.mode,Q),Q.return=N,N=Q),w(N)):i(N,R)}return function(N,R,L,Q){try{Co=0;var oe=We(N,R,L,Q);return Zs=null,oe}catch(fe){if(fe===go||fe===Vl)throw fe;var Oe=bn(29,fe,null,N.mode);return Oe.lanes=Q,Oe.return=N,Oe}finally{}}}var Ws=Bg(!0),$g=Bg(!1),zn=G(null),ar=null;function na(n){var a=n.alternate;F(St,St.current&1),F(zn,n),ar===null&&(a===null||Ys.current!==null||a.memoizedState!==null)&&(ar=n)}function qg(n){if(n.tag===22){if(F(St,St.current),F(zn,n),ar===null){var a=n.alternate;a!==null&&a.memoizedState!==null&&(ar=n)}}else ra()}function ra(){F(St,St.current),F(zn,zn.current)}function jr(n){ee(zn),ar===n&&(ar=null),ee(St)}var St=G(0);function sc(n){for(var a=n;a!==null;){if(a.tag===13){var i=a.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||zd(i)))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===n)break;for(;a.sibling===null;){if(a.return===null||a.return===n)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}function Ff(n,a,i,c){a=n.memoizedState,i=i(c,a),i=i==null?a:g({},a,i),n.memoizedState=i,n.lanes===0&&(n.updateQueue.baseState=i)}var Qf={enqueueSetState:function(n,a,i){n=n._reactInternals;var c=Sn(),f=Jr(c);f.payload=a,i!=null&&(f.callback=i),a=ea(n,f,c),a!==null&&(En(a,n,c),yo(a,n,c))},enqueueReplaceState:function(n,a,i){n=n._reactInternals;var c=Sn(),f=Jr(c);f.tag=1,f.payload=a,i!=null&&(f.callback=i),a=ea(n,f,c),a!==null&&(En(a,n,c),yo(a,n,c))},enqueueForceUpdate:function(n,a){n=n._reactInternals;var i=Sn(),c=Jr(i);c.tag=2,a!=null&&(c.callback=a),a=ea(n,c,i),a!==null&&(En(a,n,i),yo(a,n,i))}};function Hg(n,a,i,c,f,p,w){return n=n.stateNode,typeof n.shouldComponentUpdate=="function"?n.shouldComponentUpdate(c,p,w):a.prototype&&a.prototype.isPureReactComponent?!oo(i,c)||!oo(f,p):!0}function Ig(n,a,i,c){n=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(i,c),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(i,c),a.state!==n&&Qf.enqueueReplaceState(a,a.state,null)}function ns(n,a){var i=a;if("ref"in a){i={};for(var c in a)c!=="ref"&&(i[c]=a[c])}if(n=n.defaultProps){i===a&&(i=g({},i));for(var f in n)i[f]===void 0&&(i[f]=n[f])}return i}var ic=typeof reportError=="function"?reportError:function(n){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var a=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof n=="object"&&n!==null&&typeof n.message=="string"?String(n.message):String(n),error:n});if(!window.dispatchEvent(a))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",n);return}console.error(n)};function Gg(n){ic(n)}function Kg(n){console.error(n)}function Vg(n){ic(n)}function oc(n,a){try{var i=n.onUncaughtError;i(a.value,{componentStack:a.stack})}catch(c){setTimeout(function(){throw c})}}function Yg(n,a,i){try{var c=n.onCaughtError;c(i.value,{componentStack:i.stack,errorBoundary:a.tag===1?a.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Xf(n,a,i){return i=Jr(i),i.tag=3,i.payload={element:null},i.callback=function(){oc(n,a)},i}function Fg(n){return n=Jr(n),n.tag=3,n}function Qg(n,a,i,c){var f=i.type.getDerivedStateFromError;if(typeof f=="function"){var p=c.value;n.payload=function(){return f(p)},n.callback=function(){Yg(a,i,c)}}var w=i.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(n.callback=function(){Yg(a,i,c),typeof f!="function"&&(ca===null?ca=new Set([this]):ca.add(this));var S=c.stack;this.componentDidCatch(c.value,{componentStack:S!==null?S:""})})}function P_(n,a,i,c,f){if(i.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(a=i.alternate,a!==null&&ho(a,i,f,!0),i=zn.current,i!==null){switch(i.tag){case 13:return ar===null?wd():i.alternate===null&&ut===0&&(ut=3),i.flags&=-257,i.flags|=65536,i.lanes=f,c===Cf?i.flags|=16384:(a=i.updateQueue,a===null?i.updateQueue=new Set([c]):a.add(c),_d(n,c,f)),!1;case 22:return i.flags|=65536,c===Cf?i.flags|=16384:(a=i.updateQueue,a===null?(a={transitions:null,markerInstances:null,retryQueue:new Set([c])},i.updateQueue=a):(i=a.retryQueue,i===null?a.retryQueue=new Set([c]):i.add(c)),_d(n,c,f)),!1}throw Error(s(435,i.tag))}return _d(n,c,f),wd(),!1}if(Ke)return a=zn.current,a!==null?((a.flags&65536)===0&&(a.flags|=256),a.flags|=65536,a.lanes=f,c!==yf&&(n=Error(s(422),{cause:c}),fo(Mn(n,i)))):(c!==yf&&(a=Error(s(423),{cause:c}),fo(Mn(a,i))),n=n.current.alternate,n.flags|=65536,f&=-f,n.lanes|=f,c=Mn(c,i),f=Xf(n.stateNode,c,f),kf(n,f),ut!==4&&(ut=2)),!1;var p=Error(s(520),{cause:c});if(p=Mn(p,i),Mo===null?Mo=[p]:Mo.push(p),ut!==4&&(ut=2),a===null)return!0;c=Mn(c,i),i=a;do{switch(i.tag){case 3:return i.flags|=65536,n=f&-f,i.lanes|=n,n=Xf(i.stateNode,c,n),kf(i,n),!1;case 1:if(a=i.type,p=i.stateNode,(i.flags&128)===0&&(typeof a.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(ca===null||!ca.has(p))))return i.flags|=65536,f&=-f,i.lanes|=f,f=Fg(f),Qg(f,n,i,c),kf(i,f),!1}i=i.return}while(i!==null);return!1}var Xg=Error(s(461)),Ot=!1;function Bt(n,a,i,c){a.child=n===null?$g(a,null,i,c):Ws(a,n.child,i,c)}function Zg(n,a,i,c,f){i=i.render;var p=a.ref;if("ref"in c){var w={};for(var S in c)S!=="ref"&&(w[S]=c[S])}else w=c;return Ja(a),c=Mf(n,a,i,w,p,f),S=Df(),n!==null&&!Ot?(Lf(n,a,f),Rr(n,a,f)):(Ke&&S&&gf(a),a.flags|=1,Bt(n,a,c,f),a.child)}function Wg(n,a,i,c,f){if(n===null){var p=i.type;return typeof p=="function"&&!hf(p)&&p.defaultProps===void 0&&i.compare===null?(a.tag=15,a.type=p,Jg(n,a,p,c,f)):(n=$l(i.type,null,c,a,a.mode,f),n.ref=a.ref,n.return=a,a.child=n)}if(p=n.child,!ad(n,f)){var w=p.memoizedProps;if(i=i.compare,i=i!==null?i:oo,i(w,c)&&n.ref===a.ref)return Rr(n,a,f)}return a.flags|=1,n=Sr(p,c),n.ref=a.ref,n.return=a,a.child=n}function Jg(n,a,i,c,f){if(n!==null){var p=n.memoizedProps;if(oo(p,c)&&n.ref===a.ref)if(Ot=!1,a.pendingProps=c=p,ad(n,f))(n.flags&131072)!==0&&(Ot=!0);else return a.lanes=n.lanes,Rr(n,a,f)}return Zf(n,a,i,c,f)}function e0(n,a,i){var c=a.pendingProps,f=c.children,p=n!==null?n.memoizedState:null;if(c.mode==="hidden"){if((a.flags&128)!==0){if(c=p!==null?p.baseLanes|i:i,n!==null){for(f=a.child=n.child,p=0;f!==null;)p=p|f.lanes|f.childLanes,f=f.sibling;a.childLanes=p&~c}else a.childLanes=0,a.child=null;return t0(n,a,c,i)}if((i&536870912)!==0)a.memoizedState={baseLanes:0,cachePool:null},n!==null&&Kl(a,p!==null?p.cachePool:null),p!==null?Jp(a,p):Rf(),qg(a);else return a.lanes=a.childLanes=536870912,t0(n,a,p!==null?p.baseLanes|i:i,i)}else p!==null?(Kl(a,p.cachePool),Jp(a,p),ra(),a.memoizedState=null):(n!==null&&Kl(a,null),Rf(),ra());return Bt(n,a,f,i),a.child}function t0(n,a,i,c){var f=Ef();return f=f===null?null:{parent:_t._currentValue,pool:f},a.memoizedState={baseLanes:i,cachePool:f},n!==null&&Kl(a,null),Rf(),qg(a),n!==null&&ho(n,a,c,!0),null}function lc(n,a){var i=a.ref;if(i===null)n!==null&&n.ref!==null&&(a.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(s(284));(n===null||n.ref!==i)&&(a.flags|=4194816)}}function Zf(n,a,i,c,f){return Ja(a),i=Mf(n,a,i,c,void 0,f),c=Df(),n!==null&&!Ot?(Lf(n,a,f),Rr(n,a,f)):(Ke&&c&&gf(a),a.flags|=1,Bt(n,a,i,f),a.child)}function n0(n,a,i,c,f,p){return Ja(a),a.updateQueue=null,i=tg(a,c,i,f),eg(n),c=Df(),n!==null&&!Ot?(Lf(n,a,p),Rr(n,a,p)):(Ke&&c&&gf(a),a.flags|=1,Bt(n,a,i,p),a.child)}function r0(n,a,i,c,f){if(Ja(a),a.stateNode===null){var p=Hs,w=i.contextType;typeof w=="object"&&w!==null&&(p=Vt(w)),p=new i(c,p),a.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=Qf,a.stateNode=p,p._reactInternals=a,p=a.stateNode,p.props=c,p.state=a.memoizedState,p.refs={},Tf(a),w=i.contextType,p.context=typeof w=="object"&&w!==null?Vt(w):Hs,p.state=a.memoizedState,w=i.getDerivedStateFromProps,typeof w=="function"&&(Ff(a,i,w,c),p.state=a.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(w=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),w!==p.state&&Qf.enqueueReplaceState(p,p.state,null),wo(a,c,p,f),bo(),p.state=a.memoizedState),typeof p.componentDidMount=="function"&&(a.flags|=4194308),c=!0}else if(n===null){p=a.stateNode;var S=a.memoizedProps,A=ns(i,S);p.props=A;var U=p.context,V=i.contextType;w=Hs,typeof V=="object"&&V!==null&&(w=Vt(V));var X=i.getDerivedStateFromProps;V=typeof X=="function"||typeof p.getSnapshotBeforeUpdate=="function",S=a.pendingProps!==S,V||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(S||U!==w)&&Ig(a,p,c,w),Wr=!1;var B=a.memoizedState;p.state=B,wo(a,c,p,f),bo(),U=a.memoizedState,S||B!==U||Wr?(typeof X=="function"&&(Ff(a,i,X,c),U=a.memoizedState),(A=Wr||Hg(a,i,A,c,B,U,w))?(V||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(a.flags|=4194308)):(typeof p.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=c,a.memoizedState=U),p.props=c,p.state=U,p.context=w,c=A):(typeof p.componentDidMount=="function"&&(a.flags|=4194308),c=!1)}else{p=a.stateNode,Af(n,a),w=a.memoizedProps,V=ns(i,w),p.props=V,X=a.pendingProps,B=p.context,U=i.contextType,A=Hs,typeof U=="object"&&U!==null&&(A=Vt(U)),S=i.getDerivedStateFromProps,(U=typeof S=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(w!==X||B!==A)&&Ig(a,p,c,A),Wr=!1,B=a.memoizedState,p.state=B,wo(a,c,p,f),bo();var $=a.memoizedState;w!==X||B!==$||Wr||n!==null&&n.dependencies!==null&&Il(n.dependencies)?(typeof S=="function"&&(Ff(a,i,S,c),$=a.memoizedState),(V=Wr||Hg(a,i,V,c,B,$,A)||n!==null&&n.dependencies!==null&&Il(n.dependencies))?(U||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(c,$,A),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(c,$,A)),typeof p.componentDidUpdate=="function"&&(a.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof p.componentDidUpdate!="function"||w===n.memoizedProps&&B===n.memoizedState||(a.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||w===n.memoizedProps&&B===n.memoizedState||(a.flags|=1024),a.memoizedProps=c,a.memoizedState=$),p.props=c,p.state=$,p.context=A,c=V):(typeof p.componentDidUpdate!="function"||w===n.memoizedProps&&B===n.memoizedState||(a.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||w===n.memoizedProps&&B===n.memoizedState||(a.flags|=1024),c=!1)}return p=c,lc(n,a),c=(a.flags&128)!==0,p||c?(p=a.stateNode,i=c&&typeof i.getDerivedStateFromError!="function"?null:p.render(),a.flags|=1,n!==null&&c?(a.child=Ws(a,n.child,null,f),a.child=Ws(a,null,i,f)):Bt(n,a,i,f),a.memoizedState=p.state,n=a.child):n=Rr(n,a,f),n}function a0(n,a,i,c){return uo(),a.flags|=256,Bt(n,a,i,c),a.child}var Wf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Jf(n){return{baseLanes:n,cachePool:Kp()}}function ed(n,a,i){return n=n!==null?n.childLanes&~i:0,a&&(n|=Pn),n}function s0(n,a,i){var c=a.pendingProps,f=!1,p=(a.flags&128)!==0,w;if((w=p)||(w=n!==null&&n.memoizedState===null?!1:(St.current&2)!==0),w&&(f=!0,a.flags&=-129),w=(a.flags&32)!==0,a.flags&=-33,n===null){if(Ke){if(f?na(a):ra(),Ke){var S=ct,A;if(A=S){e:{for(A=S,S=rr;A.nodeType!==8;){if(!S){S=null;break e}if(A=In(A.nextSibling),A===null){S=null;break e}}S=A}S!==null?(a.memoizedState={dehydrated:S,treeContext:Fa!==null?{id:Er,overflow:Cr}:null,retryLane:536870912,hydrationErrors:null},A=bn(18,null,null,0),A.stateNode=S,A.return=a,a.child=A,Xt=a,ct=null,A=!0):A=!1}A||Za(a)}if(S=a.memoizedState,S!==null&&(S=S.dehydrated,S!==null))return zd(S)?a.lanes=32:a.lanes=536870912,null;jr(a)}return S=c.children,c=c.fallback,f?(ra(),f=a.mode,S=cc({mode:"hidden",children:S},f),c=Ya(c,f,i,null),S.return=a,c.return=a,S.sibling=c,a.child=S,f=a.child,f.memoizedState=Jf(i),f.childLanes=ed(n,w,i),a.memoizedState=Wf,c):(na(a),td(a,S))}if(A=n.memoizedState,A!==null&&(S=A.dehydrated,S!==null)){if(p)a.flags&256?(na(a),a.flags&=-257,a=nd(n,a,i)):a.memoizedState!==null?(ra(),a.child=n.child,a.flags|=128,a=null):(ra(),f=c.fallback,S=a.mode,c=cc({mode:"visible",children:c.children},S),f=Ya(f,S,i,null),f.flags|=2,c.return=a,f.return=a,c.sibling=f,a.child=c,Ws(a,n.child,null,i),c=a.child,c.memoizedState=Jf(i),c.childLanes=ed(n,w,i),a.memoizedState=Wf,a=f);else if(na(a),zd(S)){if(w=S.nextSibling&&S.nextSibling.dataset,w)var U=w.dgst;w=U,c=Error(s(419)),c.stack="",c.digest=w,fo({value:c,source:null,stack:null}),a=nd(n,a,i)}else if(Ot||ho(n,a,i,!1),w=(i&n.childLanes)!==0,Ot||w){if(w=et,w!==null&&(c=i&-i,c=(c&42)!==0?1:lt(c),c=(c&(w.suspendedLanes|i))!==0?0:c,c!==0&&c!==A.retryLane))throw A.retryLane=c,qs(n,c),En(w,n,c),Xg;S.data==="$?"||wd(),a=nd(n,a,i)}else S.data==="$?"?(a.flags|=192,a.child=n.child,a=null):(n=A.treeContext,ct=In(S.nextSibling),Xt=a,Ke=!0,Xa=null,rr=!1,n!==null&&(Ln[Un++]=Er,Ln[Un++]=Cr,Ln[Un++]=Fa,Er=n.id,Cr=n.overflow,Fa=a),a=td(a,c.children),a.flags|=4096);return a}return f?(ra(),f=c.fallback,S=a.mode,A=n.child,U=A.sibling,c=Sr(A,{mode:"hidden",children:c.children}),c.subtreeFlags=A.subtreeFlags&65011712,U!==null?f=Sr(U,f):(f=Ya(f,S,i,null),f.flags|=2),f.return=a,c.return=a,c.sibling=f,a.child=c,c=f,f=a.child,S=n.child.memoizedState,S===null?S=Jf(i):(A=S.cachePool,A!==null?(U=_t._currentValue,A=A.parent!==U?{parent:U,pool:U}:A):A=Kp(),S={baseLanes:S.baseLanes|i,cachePool:A}),f.memoizedState=S,f.childLanes=ed(n,w,i),a.memoizedState=Wf,c):(na(a),i=n.child,n=i.sibling,i=Sr(i,{mode:"visible",children:c.children}),i.return=a,i.sibling=null,n!==null&&(w=a.deletions,w===null?(a.deletions=[n],a.flags|=16):w.push(n)),a.child=i,a.memoizedState=null,i)}function td(n,a){return a=cc({mode:"visible",children:a},n.mode),a.return=n,n.child=a}function cc(n,a){return n=bn(22,n,null,a),n.lanes=0,n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},n}function nd(n,a,i){return Ws(a,n.child,null,i),n=td(a,a.pendingProps.children),n.flags|=2,a.memoizedState=null,n}function i0(n,a,i){n.lanes|=a;var c=n.alternate;c!==null&&(c.lanes|=a),wf(n.return,a,i)}function rd(n,a,i,c,f){var p=n.memoizedState;p===null?n.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:c,tail:i,tailMode:f}:(p.isBackwards=a,p.rendering=null,p.renderingStartTime=0,p.last=c,p.tail=i,p.tailMode=f)}function o0(n,a,i){var c=a.pendingProps,f=c.revealOrder,p=c.tail;if(Bt(n,a,c.children,i),c=St.current,(c&2)!==0)c=c&1|2,a.flags|=128;else{if(n!==null&&(n.flags&128)!==0)e:for(n=a.child;n!==null;){if(n.tag===13)n.memoizedState!==null&&i0(n,i,a);else if(n.tag===19)i0(n,i,a);else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===a)break e;for(;n.sibling===null;){if(n.return===null||n.return===a)break e;n=n.return}n.sibling.return=n.return,n=n.sibling}c&=1}switch(F(St,c),f){case"forwards":for(i=a.child,f=null;i!==null;)n=i.alternate,n!==null&&sc(n)===null&&(f=i),i=i.sibling;i=f,i===null?(f=a.child,a.child=null):(f=i.sibling,i.sibling=null),rd(a,!1,f,i,p);break;case"backwards":for(i=null,f=a.child,a.child=null;f!==null;){if(n=f.alternate,n!==null&&sc(n)===null){a.child=f;break}n=f.sibling,f.sibling=i,i=f,f=n}rd(a,!0,i,null,p);break;case"together":rd(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function Rr(n,a,i){if(n!==null&&(a.dependencies=n.dependencies),la|=a.lanes,(i&a.childLanes)===0)if(n!==null){if(ho(n,a,i,!1),(i&a.childLanes)===0)return null}else return null;if(n!==null&&a.child!==n.child)throw Error(s(153));if(a.child!==null){for(n=a.child,i=Sr(n,n.pendingProps),a.child=i,i.return=a;n.sibling!==null;)n=n.sibling,i=i.sibling=Sr(n,n.pendingProps),i.return=a;i.sibling=null}return a.child}function ad(n,a){return(n.lanes&a)!==0?!0:(n=n.dependencies,!!(n!==null&&Il(n)))}function B_(n,a,i){switch(a.tag){case 3:Pe(a,a.stateNode.containerInfo),Zr(a,_t,n.memoizedState.cache),uo();break;case 27:case 5:Kt(a);break;case 4:Pe(a,a.stateNode.containerInfo);break;case 10:Zr(a,a.type,a.memoizedProps.value);break;case 13:var c=a.memoizedState;if(c!==null)return c.dehydrated!==null?(na(a),a.flags|=128,null):(i&a.child.childLanes)!==0?s0(n,a,i):(na(a),n=Rr(n,a,i),n!==null?n.sibling:null);na(a);break;case 19:var f=(n.flags&128)!==0;if(c=(i&a.childLanes)!==0,c||(ho(n,a,i,!1),c=(i&a.childLanes)!==0),f){if(c)return o0(n,a,i);a.flags|=128}if(f=a.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),F(St,St.current),c)break;return null;case 22:case 23:return a.lanes=0,e0(n,a,i);case 24:Zr(a,_t,n.memoizedState.cache)}return Rr(n,a,i)}function l0(n,a,i){if(n!==null)if(n.memoizedProps!==a.pendingProps)Ot=!0;else{if(!ad(n,i)&&(a.flags&128)===0)return Ot=!1,B_(n,a,i);Ot=(n.flags&131072)!==0}else Ot=!1,Ke&&(a.flags&1048576)!==0&&Pp(a,Hl,a.index);switch(a.lanes=0,a.tag){case 16:e:{n=a.pendingProps;var c=a.elementType,f=c._init;if(c=f(c._payload),a.type=c,typeof c=="function")hf(c)?(n=ns(c,n),a.tag=1,a=r0(null,a,c,n,i)):(a.tag=0,a=Zf(null,a,c,n,i));else{if(c!=null){if(f=c.$$typeof,f===Y){a.tag=11,a=Zg(null,a,c,n,i);break e}else if(f===J){a.tag=14,a=Wg(null,a,c,n,i);break e}}throw a=kt(c)||c,Error(s(306,a,""))}}return a;case 0:return Zf(n,a,a.type,a.pendingProps,i);case 1:return c=a.type,f=ns(c,a.pendingProps),r0(n,a,c,f,i);case 3:e:{if(Pe(a,a.stateNode.containerInfo),n===null)throw Error(s(387));c=a.pendingProps;var p=a.memoizedState;f=p.element,Af(n,a),wo(a,c,null,i);var w=a.memoizedState;if(c=w.cache,Zr(a,_t,c),c!==p.cache&&xf(a,[_t],i,!0),bo(),c=w.element,p.isDehydrated)if(p={element:c,isDehydrated:!1,cache:w.cache},a.updateQueue.baseState=p,a.memoizedState=p,a.flags&256){a=a0(n,a,c,i);break e}else if(c!==f){f=Mn(Error(s(424)),a),fo(f),a=a0(n,a,c,i);break e}else{switch(n=a.stateNode.containerInfo,n.nodeType){case 9:n=n.body;break;default:n=n.nodeName==="HTML"?n.ownerDocument.body:n}for(ct=In(n.firstChild),Xt=a,Ke=!0,Xa=null,rr=!0,i=$g(a,null,c,i),a.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(uo(),c===f){a=Rr(n,a,i);break e}Bt(n,a,c,i)}a=a.child}return a;case 26:return lc(n,a),n===null?(i=dv(a.type,null,a.pendingProps,null))?a.memoizedState=i:Ke||(i=a.type,n=a.pendingProps,c=Sc(ie.current).createElement(i),c[qe]=a,c[Ge]=n,qt(c,i,n),pt(c),a.stateNode=c):a.memoizedState=dv(a.type,n.memoizedProps,a.pendingProps,n.memoizedState),null;case 27:return Kt(a),n===null&&Ke&&(c=a.stateNode=cv(a.type,a.pendingProps,ie.current),Xt=a,rr=!0,f=ct,da(a.type)?(Pd=f,ct=In(c.firstChild)):ct=f),Bt(n,a,a.pendingProps.children,i),lc(n,a),n===null&&(a.flags|=4194304),a.child;case 5:return n===null&&Ke&&((f=c=ct)&&(c=hS(c,a.type,a.pendingProps,rr),c!==null?(a.stateNode=c,Xt=a,ct=In(c.firstChild),rr=!1,f=!0):f=!1),f||Za(a)),Kt(a),f=a.type,p=a.pendingProps,w=n!==null?n.memoizedProps:null,c=p.children,Dd(f,p)?c=null:w!==null&&Dd(f,w)&&(a.flags|=32),a.memoizedState!==null&&(f=Mf(n,a,N_,null,null,i),Ho._currentValue=f),lc(n,a),Bt(n,a,c,i),a.child;case 6:return n===null&&Ke&&((n=i=ct)&&(i=mS(i,a.pendingProps,rr),i!==null?(a.stateNode=i,Xt=a,ct=null,n=!0):n=!1),n||Za(a)),null;case 13:return s0(n,a,i);case 4:return Pe(a,a.stateNode.containerInfo),c=a.pendingProps,n===null?a.child=Ws(a,null,c,i):Bt(n,a,c,i),a.child;case 11:return Zg(n,a,a.type,a.pendingProps,i);case 7:return Bt(n,a,a.pendingProps,i),a.child;case 8:return Bt(n,a,a.pendingProps.children,i),a.child;case 12:return Bt(n,a,a.pendingProps.children,i),a.child;case 10:return c=a.pendingProps,Zr(a,a.type,c.value),Bt(n,a,c.children,i),a.child;case 9:return f=a.type._context,c=a.pendingProps.children,Ja(a),f=Vt(f),c=c(f),a.flags|=1,Bt(n,a,c,i),a.child;case 14:return Wg(n,a,a.type,a.pendingProps,i);case 15:return Jg(n,a,a.type,a.pendingProps,i);case 19:return o0(n,a,i);case 31:return c=a.pendingProps,i=a.mode,c={mode:c.mode,children:c.children},n===null?(i=cc(c,i),i.ref=a.ref,a.child=i,i.return=a,a=i):(i=Sr(n.child,c),i.ref=a.ref,a.child=i,i.return=a,a=i),a;case 22:return e0(n,a,i);case 24:return Ja(a),c=Vt(_t),n===null?(f=Ef(),f===null&&(f=et,p=_f(),f.pooledCache=p,p.refCount++,p!==null&&(f.pooledCacheLanes|=i),f=p),a.memoizedState={parent:c,cache:f},Tf(a),Zr(a,_t,f)):((n.lanes&i)!==0&&(Af(n,a),wo(a,null,null,i),bo()),f=n.memoizedState,p=a.memoizedState,f.parent!==c?(f={parent:c,cache:c},a.memoizedState=f,a.lanes===0&&(a.memoizedState=a.updateQueue.baseState=f),Zr(a,_t,c)):(c=p.cache,Zr(a,_t,c),c!==f.cache&&xf(a,[_t],i,!0))),Bt(n,a,a.pendingProps.children,i),a.child;case 29:throw a.pendingProps}throw Error(s(156,a.tag))}function Nr(n){n.flags|=4}function c0(n,a){if(a.type!=="stylesheet"||(a.state.loading&4)!==0)n.flags&=-16777217;else if(n.flags|=16777216,!vv(a)){if(a=zn.current,a!==null&&(($e&4194048)===$e?ar!==null:($e&62914560)!==$e&&($e&536870912)===0||a!==ar))throw vo=Cf,Vp;n.flags|=8192}}function uc(n,a){a!==null&&(n.flags|=4),n.flags&16384&&(a=n.tag!==22?js():536870912,n.lanes|=a,ni|=a)}function Ao(n,a){if(!Ke)switch(n.tailMode){case"hidden":a=n.tail;for(var i=null;a!==null;)a.alternate!==null&&(i=a),a=a.sibling;i===null?n.tail=null:i.sibling=null;break;case"collapsed":i=n.tail;for(var c=null;i!==null;)i.alternate!==null&&(c=i),i=i.sibling;c===null?a||n.tail===null?n.tail=null:n.tail.sibling=null:c.sibling=null}}function it(n){var a=n.alternate!==null&&n.alternate.child===n.child,i=0,c=0;if(a)for(var f=n.child;f!==null;)i|=f.lanes|f.childLanes,c|=f.subtreeFlags&65011712,c|=f.flags&65011712,f.return=n,f=f.sibling;else for(f=n.child;f!==null;)i|=f.lanes|f.childLanes,c|=f.subtreeFlags,c|=f.flags,f.return=n,f=f.sibling;return n.subtreeFlags|=c,n.childLanes=i,a}function $_(n,a,i){var c=a.pendingProps;switch(vf(a),a.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return it(a),null;case 1:return it(a),null;case 3:return i=a.stateNode,c=null,n!==null&&(c=n.memoizedState.cache),a.memoizedState.cache!==c&&(a.flags|=2048),Ar(_t),ot(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(n===null||n.child===null)&&(co(a)?Nr(a):n===null||n.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,qp())),it(a),null;case 26:return i=a.memoizedState,n===null?(Nr(a),i!==null?(it(a),c0(a,i)):(it(a),a.flags&=-16777217)):i?i!==n.memoizedState?(Nr(a),it(a),c0(a,i)):(it(a),a.flags&=-16777217):(n.memoizedProps!==c&&Nr(a),it(a),a.flags&=-16777217),null;case 27:An(a),i=ie.current;var f=a.type;if(n!==null&&a.stateNode!=null)n.memoizedProps!==c&&Nr(a);else{if(!c){if(a.stateNode===null)throw Error(s(166));return it(a),null}n=se.current,co(a)?Bp(a):(n=cv(f,c,i),a.stateNode=n,Nr(a))}return it(a),null;case 5:if(An(a),i=a.type,n!==null&&a.stateNode!=null)n.memoizedProps!==c&&Nr(a);else{if(!c){if(a.stateNode===null)throw Error(s(166));return it(a),null}if(n=se.current,co(a))Bp(a);else{switch(f=Sc(ie.current),n){case 1:n=f.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:n=f.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":n=f.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":n=f.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":n=f.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof c.is=="string"?f.createElement("select",{is:c.is}):f.createElement("select"),c.multiple?n.multiple=!0:c.size&&(n.size=c.size);break;default:n=typeof c.is=="string"?f.createElement(i,{is:c.is}):f.createElement(i)}}n[qe]=a,n[Ge]=c;e:for(f=a.child;f!==null;){if(f.tag===5||f.tag===6)n.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===a)break e;for(;f.sibling===null;){if(f.return===null||f.return===a)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}a.stateNode=n;e:switch(qt(n,i,c),i){case"button":case"input":case"select":case"textarea":n=!!c.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Nr(a)}}return it(a),a.flags&=-16777217,null;case 6:if(n&&a.stateNode!=null)n.memoizedProps!==c&&Nr(a);else{if(typeof c!="string"&&a.stateNode===null)throw Error(s(166));if(n=ie.current,co(a)){if(n=a.stateNode,i=a.memoizedProps,c=null,f=Xt,f!==null)switch(f.tag){case 27:case 5:c=f.memoizedProps}n[qe]=a,n=!!(n.nodeValue===i||c!==null&&c.suppressHydrationWarning===!0||nv(n.nodeValue,i)),n||Za(a)}else n=Sc(n).createTextNode(c),n[qe]=a,a.stateNode=n}return it(a),null;case 13:if(c=a.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(f=co(a),c!==null&&c.dehydrated!==null){if(n===null){if(!f)throw Error(s(318));if(f=a.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(s(317));f[qe]=a}else uo(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;it(a),f=!1}else f=qp(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=f),f=!0;if(!f)return a.flags&256?(jr(a),a):(jr(a),null)}if(jr(a),(a.flags&128)!==0)return a.lanes=i,a;if(i=c!==null,n=n!==null&&n.memoizedState!==null,i){c=a.child,f=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(f=c.alternate.memoizedState.cachePool.pool);var p=null;c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(p=c.memoizedState.cachePool.pool),p!==f&&(c.flags|=2048)}return i!==n&&i&&(a.child.flags|=8192),uc(a,a.updateQueue),it(a),null;case 4:return ot(),n===null&&jd(a.stateNode.containerInfo),it(a),null;case 10:return Ar(a.type),it(a),null;case 19:if(ee(St),f=a.memoizedState,f===null)return it(a),null;if(c=(a.flags&128)!==0,p=f.rendering,p===null)if(c)Ao(f,!1);else{if(ut!==0||n!==null&&(n.flags&128)!==0)for(n=a.child;n!==null;){if(p=sc(n),p!==null){for(a.flags|=128,Ao(f,!1),n=p.updateQueue,a.updateQueue=n,uc(a,n),a.subtreeFlags=0,n=i,i=a.child;i!==null;)zp(i,n),i=i.sibling;return F(St,St.current&1|2),a.child}n=n.sibling}f.tail!==null&&jt()>hc&&(a.flags|=128,c=!0,Ao(f,!1),a.lanes=4194304)}else{if(!c)if(n=sc(p),n!==null){if(a.flags|=128,c=!0,n=n.updateQueue,a.updateQueue=n,uc(a,n),Ao(f,!0),f.tail===null&&f.tailMode==="hidden"&&!p.alternate&&!Ke)return it(a),null}else 2*jt()-f.renderingStartTime>hc&&i!==536870912&&(a.flags|=128,c=!0,Ao(f,!1),a.lanes=4194304);f.isBackwards?(p.sibling=a.child,a.child=p):(n=f.last,n!==null?n.sibling=p:a.child=p,f.last=p)}return f.tail!==null?(a=f.tail,f.rendering=a,f.tail=a.sibling,f.renderingStartTime=jt(),a.sibling=null,n=St.current,F(St,c?n&1|2:n&1),a):(it(a),null);case 22:case 23:return jr(a),Nf(),c=a.memoizedState!==null,n!==null?n.memoizedState!==null!==c&&(a.flags|=8192):c&&(a.flags|=8192),c?(i&536870912)!==0&&(a.flags&128)===0&&(it(a),a.subtreeFlags&6&&(a.flags|=8192)):it(a),i=a.updateQueue,i!==null&&uc(a,i.retryQueue),i=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),c=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),c!==i&&(a.flags|=2048),n!==null&&ee(es),null;case 24:return i=null,n!==null&&(i=n.memoizedState.cache),a.memoizedState.cache!==i&&(a.flags|=2048),Ar(_t),it(a),null;case 25:return null;case 30:return null}throw Error(s(156,a.tag))}function q_(n,a){switch(vf(a),a.tag){case 1:return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 3:return Ar(_t),ot(),n=a.flags,(n&65536)!==0&&(n&128)===0?(a.flags=n&-65537|128,a):null;case 26:case 27:case 5:return An(a),null;case 13:if(jr(a),n=a.memoizedState,n!==null&&n.dehydrated!==null){if(a.alternate===null)throw Error(s(340));uo()}return n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 19:return ee(St),null;case 4:return ot(),null;case 10:return Ar(a.type),null;case 22:case 23:return jr(a),Nf(),n!==null&&ee(es),n=a.flags,n&65536?(a.flags=n&-65537|128,a):null;case 24:return Ar(_t),null;case 25:return null;default:return null}}function u0(n,a){switch(vf(a),a.tag){case 3:Ar(_t),ot();break;case 26:case 27:case 5:An(a);break;case 4:ot();break;case 13:jr(a);break;case 19:ee(St);break;case 10:Ar(a.type);break;case 22:case 23:jr(a),Nf(),n!==null&&ee(es);break;case 24:Ar(_t)}}function ko(n,a){try{var i=a.updateQueue,c=i!==null?i.lastEffect:null;if(c!==null){var f=c.next;i=f;do{if((i.tag&n)===n){c=void 0;var p=i.create,w=i.inst;c=p(),w.destroy=c}i=i.next}while(i!==f)}}catch(S){Je(a,a.return,S)}}function aa(n,a,i){try{var c=a.updateQueue,f=c!==null?c.lastEffect:null;if(f!==null){var p=f.next;c=p;do{if((c.tag&n)===n){var w=c.inst,S=w.destroy;if(S!==void 0){w.destroy=void 0,f=a;var A=i,U=S;try{U()}catch(V){Je(f,A,V)}}}c=c.next}while(c!==p)}}catch(V){Je(a,a.return,V)}}function f0(n){var a=n.updateQueue;if(a!==null){var i=n.stateNode;try{Wp(a,i)}catch(c){Je(n,n.return,c)}}}function d0(n,a,i){i.props=ns(n.type,n.memoizedProps),i.state=n.memoizedState;try{i.componentWillUnmount()}catch(c){Je(n,a,c)}}function jo(n,a){try{var i=n.ref;if(i!==null){switch(n.tag){case 26:case 27:case 5:var c=n.stateNode;break;case 30:c=n.stateNode;break;default:c=n.stateNode}typeof i=="function"?n.refCleanup=i(c):i.current=c}}catch(f){Je(n,a,f)}}function sr(n,a){var i=n.ref,c=n.refCleanup;if(i!==null)if(typeof c=="function")try{c()}catch(f){Je(n,a,f)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(f){Je(n,a,f)}else i.current=null}function h0(n){var a=n.type,i=n.memoizedProps,c=n.stateNode;try{e:switch(a){case"button":case"input":case"select":case"textarea":i.autoFocus&&c.focus();break e;case"img":i.src?c.src=i.src:i.srcSet&&(c.srcset=i.srcSet)}}catch(f){Je(n,n.return,f)}}function sd(n,a,i){try{var c=n.stateNode;lS(c,n.type,i,a),c[Ge]=a}catch(f){Je(n,n.return,f)}}function m0(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&da(n.type)||n.tag===4}function id(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||m0(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&da(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function od(n,a,i){var c=n.tag;if(c===5||c===6)n=n.stateNode,a?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(n,a):(a=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,a.appendChild(n),i=i._reactRootContainer,i!=null||a.onclick!==null||(a.onclick=_c));else if(c!==4&&(c===27&&da(n.type)&&(i=n.stateNode,a=null),n=n.child,n!==null))for(od(n,a,i),n=n.sibling;n!==null;)od(n,a,i),n=n.sibling}function fc(n,a,i){var c=n.tag;if(c===5||c===6)n=n.stateNode,a?i.insertBefore(n,a):i.appendChild(n);else if(c!==4&&(c===27&&da(n.type)&&(i=n.stateNode),n=n.child,n!==null))for(fc(n,a,i),n=n.sibling;n!==null;)fc(n,a,i),n=n.sibling}function p0(n){var a=n.stateNode,i=n.memoizedProps;try{for(var c=n.type,f=a.attributes;f.length;)a.removeAttributeNode(f[0]);qt(a,c,i),a[qe]=n,a[Ge]=i}catch(p){Je(n,n.return,p)}}var Or=!1,ht=!1,ld=!1,g0=typeof WeakSet=="function"?WeakSet:Set,Mt=null;function H_(n,a){if(n=n.containerInfo,Od=jc,n=Ap(n),sf(n)){if("selectionStart"in n)var i={start:n.selectionStart,end:n.selectionEnd};else e:{i=(i=n.ownerDocument)&&i.defaultView||window;var c=i.getSelection&&i.getSelection();if(c&&c.rangeCount!==0){i=c.anchorNode;var f=c.anchorOffset,p=c.focusNode;c=c.focusOffset;try{i.nodeType,p.nodeType}catch{i=null;break e}var w=0,S=-1,A=-1,U=0,V=0,X=n,B=null;t:for(;;){for(var $;X!==i||f!==0&&X.nodeType!==3||(S=w+f),X!==p||c!==0&&X.nodeType!==3||(A=w+c),X.nodeType===3&&(w+=X.nodeValue.length),($=X.firstChild)!==null;)B=X,X=$;for(;;){if(X===n)break t;if(B===i&&++U===f&&(S=w),B===p&&++V===c&&(A=w),($=X.nextSibling)!==null)break;X=B,B=X.parentNode}X=$}i=S===-1||A===-1?null:{start:S,end:A}}else i=null}i=i||{start:0,end:0}}else i=null;for(Md={focusedElem:n,selectionRange:i},jc=!1,Mt=a;Mt!==null;)if(a=Mt,n=a.child,(a.subtreeFlags&1024)!==0&&n!==null)n.return=a,Mt=n;else for(;Mt!==null;){switch(a=Mt,p=a.alternate,n=a.flags,a.tag){case 0:break;case 11:case 15:break;case 1:if((n&1024)!==0&&p!==null){n=void 0,i=a,f=p.memoizedProps,p=p.memoizedState,c=i.stateNode;try{var ye=ns(i.type,f,i.elementType===i.type);n=c.getSnapshotBeforeUpdate(ye,p),c.__reactInternalSnapshotBeforeUpdate=n}catch(pe){Je(i,i.return,pe)}}break;case 3:if((n&1024)!==0){if(n=a.stateNode.containerInfo,i=n.nodeType,i===9)Ud(n);else if(i===1)switch(n.nodeName){case"HEAD":case"HTML":case"BODY":Ud(n);break;default:n.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((n&1024)!==0)throw Error(s(163))}if(n=a.sibling,n!==null){n.return=a.return,Mt=n;break}Mt=a.return}}function v0(n,a,i){var c=i.flags;switch(i.tag){case 0:case 11:case 15:sa(n,i),c&4&&ko(5,i);break;case 1:if(sa(n,i),c&4)if(n=i.stateNode,a===null)try{n.componentDidMount()}catch(w){Je(i,i.return,w)}else{var f=ns(i.type,a.memoizedProps);a=a.memoizedState;try{n.componentDidUpdate(f,a,n.__reactInternalSnapshotBeforeUpdate)}catch(w){Je(i,i.return,w)}}c&64&&f0(i),c&512&&jo(i,i.return);break;case 3:if(sa(n,i),c&64&&(n=i.updateQueue,n!==null)){if(a=null,i.child!==null)switch(i.child.tag){case 27:case 5:a=i.child.stateNode;break;case 1:a=i.child.stateNode}try{Wp(n,a)}catch(w){Je(i,i.return,w)}}break;case 27:a===null&&c&4&&p0(i);case 26:case 5:sa(n,i),a===null&&c&4&&h0(i),c&512&&jo(i,i.return);break;case 12:sa(n,i);break;case 13:sa(n,i),c&4&&w0(n,i),c&64&&(n=i.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&(i=Z_.bind(null,i),pS(n,i))));break;case 22:if(c=i.memoizedState!==null||Or,!c){a=a!==null&&a.memoizedState!==null||ht,f=Or;var p=ht;Or=c,(ht=a)&&!p?ia(n,i,(i.subtreeFlags&8772)!==0):sa(n,i),Or=f,ht=p}break;case 30:break;default:sa(n,i)}}function y0(n){var a=n.alternate;a!==null&&(n.alternate=null,y0(a)),n.child=null,n.deletions=null,n.sibling=null,n.tag===5&&(a=n.stateNode,a!==null&&Ns(a)),n.stateNode=null,n.return=null,n.dependencies=null,n.memoizedProps=null,n.memoizedState=null,n.pendingProps=null,n.stateNode=null,n.updateQueue=null}var rt=null,tn=!1;function Mr(n,a,i){for(i=i.child;i!==null;)b0(n,a,i),i=i.sibling}function b0(n,a,i){if(Rt&&typeof Rt.onCommitFiberUnmount=="function")try{Rt.onCommitFiberUnmount(jn,i)}catch{}switch(i.tag){case 26:ht||sr(i,a),Mr(n,a,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:ht||sr(i,a);var c=rt,f=tn;da(i.type)&&(rt=i.stateNode,tn=!1),Mr(n,a,i),Po(i.stateNode),rt=c,tn=f;break;case 5:ht||sr(i,a);case 6:if(c=rt,f=tn,rt=null,Mr(n,a,i),rt=c,tn=f,rt!==null)if(tn)try{(rt.nodeType===9?rt.body:rt.nodeName==="HTML"?rt.ownerDocument.body:rt).removeChild(i.stateNode)}catch(p){Je(i,a,p)}else try{rt.removeChild(i.stateNode)}catch(p){Je(i,a,p)}break;case 18:rt!==null&&(tn?(n=rt,ov(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,i.stateNode),Vo(n)):ov(rt,i.stateNode));break;case 4:c=rt,f=tn,rt=i.stateNode.containerInfo,tn=!0,Mr(n,a,i),rt=c,tn=f;break;case 0:case 11:case 14:case 15:ht||aa(2,i,a),ht||aa(4,i,a),Mr(n,a,i);break;case 1:ht||(sr(i,a),c=i.stateNode,typeof c.componentWillUnmount=="function"&&d0(i,a,c)),Mr(n,a,i);break;case 21:Mr(n,a,i);break;case 22:ht=(c=ht)||i.memoizedState!==null,Mr(n,a,i),ht=c;break;default:Mr(n,a,i)}}function w0(n,a){if(a.memoizedState===null&&(n=a.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null))))try{Vo(n)}catch(i){Je(a,a.return,i)}}function I_(n){switch(n.tag){case 13:case 19:var a=n.stateNode;return a===null&&(a=n.stateNode=new g0),a;case 22:return n=n.stateNode,a=n._retryCache,a===null&&(a=n._retryCache=new g0),a;default:throw Error(s(435,n.tag))}}function cd(n,a){var i=I_(n);a.forEach(function(c){var f=W_.bind(null,n,c);i.has(c)||(i.add(c),c.then(f,f))})}
vendor: 3,836 bytes, line 48
48function wn(n,a){var i=a.deletions;if(i!==null)for(var c=0;c<i.length;c++){var f=i[c],p=n,w=a,S=w;e:for(;S!==null;){switch(S.tag){case 27:if(da(S.type)){rt=S.stateNode,tn=!1;break e}break;case 5:rt=S.stateNode,tn=!1;break e;case 3:case 4:rt=S.stateNode.containerInfo,tn=!0;break e}S=S.return}if(rt===null)throw Error(s(160));b0(p,w,f),rt=null,tn=!1,p=f.alternate,p!==null&&(p.return=null),f.return=null}if(a.subtreeFlags&13878)for(a=a.child;a!==null;)x0(a,n),a=a.sibling}var Hn=null;function x0(n,a){var i=n.alternate,c=n.flags;switch(n.tag){case 0:case 11:case 14:case 15:wn(a,n),xn(n),c&4&&(aa(3,n,n.return),ko(3,n),aa(5,n,n.return));break;case 1:wn(a,n),xn(n),c&512&&(ht||i===null||sr(i,i.return)),c&64&&Or&&(n=n.updateQueue,n!==null&&(c=n.callbacks,c!==null&&(i=n.shared.hiddenCallbacks,n.shared.hiddenCallbacks=i===null?c:i.concat(c))));break;case 26:var f=Hn;if(wn(a,n),xn(n),c&512&&(ht||i===null||sr(i,i.return)),c&4){var p=i!==null?i.memoizedState:null;if(c=n.memoizedState,i===null)if(c===null)if(n.stateNode===null){e:{c=n.type,i=n.memoizedProps,f=f.ownerDocument||f;t:switch(c){case"title":p=f.getElementsByTagName("title")[0],(!p||p[Nt]||p[qe]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=f.createElement(c),f.head.insertBefore(p,f.querySelector("head > title"))),qt(p,c,i),p[qe]=n,pt(p),c=p;break e;case"link":var w=pv("link","href",f).get(c+(i.href||""));if(w){for(var S=0;S<w.length;S++)if(p=w[S],p.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&p.getAttribute("rel")===(i.rel==null?null:i.rel)&&p.getAttribute("title")===(i.title==null?null:i.title)&&p.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){w.splice(S,1);break t}}p=f.createElement(c),qt(p,c,i),f.head.appendChild(p);break;case"meta":if(w=pv("meta","content",f).get(c+(i.content||""))){for(S=0;S<w.length;S++)if(p=w[S],p.getAttribute("content")===(i.content==null?null:""+i.content)&&p.getAttribute("name")===(i.name==null?null:i.name)&&p.getAttribute("property")===(i.property==null?null:i.property)&&p.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&p.getAttribute("charset")===(i.charSet==null?null:i.charSet)){w.splice(S,1);break t}}p=f.createElement(c),qt(p,c,i),f.head.appendChild(p);break;default:throw Error(s(468,c))}p[qe]=n,pt(p),c=p}n.stateNode=c}else gv(f,n.type,n.stateNode);else n.stateNode=mv(f,c,n.memoizedProps);else p!==c?(p===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):p.count--,c===null?gv(f,n.type,n.stateNode):mv(f,c,n.memoizedProps)):c===null&&n.stateNode!==null&&sd(n,n.memoizedProps,i.memoizedProps)}break;case 27:wn(a,n),xn(n),c&512&&(ht||i===null||sr(i,i.return)),i!==null&&c&4&&sd(n,n.memoizedProps,i.memoizedProps);break;case 5:if(wn(a,n),xn(n),c&512&&(ht||i===null||sr(i,i.return)),n.flags&32){f=n.stateNode;try{Ds(f,"")}catch($){Je(n,n.return,$)}}c&4&&n.stateNode!=null&&(f=n.memoizedProps,sd(n,f,i!==null?i.memoizedProps:f)),c&1024&&(ld=!0);break;case 6:if(wn(a,n),xn(n),c&4){if(n.stateNode===null)throw Error(s(162));c=n.memoizedProps,i=n.stateNode;try{i.nodeValue=c}catch($){Je(n,n.return,$)}}break;case 3:if(Tc=null,f=Hn,Hn=Ec(a.containerInfo),wn(a,n),Hn=f,xn(n),c&4&&i!==null&&i.memoizedState.isDehydrated)try{Vo(a.containerInfo)}catch($){Je(n,n.return,$)}ld&&(ld=!1,_0(n));break;case 4:c=Hn,Hn=Ec(n.stateNode.containerInfo),wn(a,n),xn(n),Hn=c;break;case 12:wn(a,n),xn(n);break;case 13:wn(a,n),xn(n),n.child.flags&8192&&n.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(pd=jt()),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,cd(n,c)));break;case 22:f=n.memoizedState!==null;var A=i!==null&&i.memoizedState!==null,U=Or,V=ht;if(Or=U||f,ht=V||A,wn(a,n),ht=V,Or=U,xn(n),c&8192)e:for(a=n.stateNode,a._visibility=f?a._visibility&-2:a._visibility|1,f&&(i===null||A||Or||ht||rs(n)),i=null,a=n;;
vendor: 21,206 bytes, line 48
48){if(a.tag===5||a.tag===26){if(i===null){A=i=a;try{if(p=A.stateNode,f)w=p.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{S=A.stateNode;var X=A.memoizedProps.style,B=X!=null&&X.hasOwnProperty("display")?X.display:null;S.style.display=B==null||typeof B=="boolean"?"":(""+B).trim()}}catch($){Je(A,A.return,$)}}}else if(a.tag===6){if(i===null){A=a;try{A.stateNode.nodeValue=f?"":A.memoizedProps}catch($){Je(A,A.return,$)}}}else if((a.tag!==22&&a.tag!==23||a.memoizedState===null||a===n)&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===n)break e;for(;a.sibling===null;){if(a.return===null||a.return===n)break e;i===a&&(i=null),a=a.return}i===a&&(i=null),a.sibling.return=a.return,a=a.sibling}c&4&&(c=n.updateQueue,c!==null&&(i=c.retryQueue,i!==null&&(c.retryQueue=null,cd(n,i))));break;case 19:wn(a,n),xn(n),c&4&&(c=n.updateQueue,c!==null&&(n.updateQueue=null,cd(n,c)));break;case 30:break;case 21:break;default:wn(a,n),xn(n)}}function xn(n){var a=n.flags;if(a&2){try{for(var i,c=n.return;c!==null;){if(m0(c)){i=c;break}c=c.return}if(i==null)throw Error(s(160));switch(i.tag){case 27:var f=i.stateNode,p=id(n);fc(n,p,f);break;case 5:var w=i.stateNode;i.flags&32&&(Ds(w,""),i.flags&=-33);var S=id(n);fc(n,S,w);break;case 3:case 4:var A=i.stateNode.containerInfo,U=id(n);od(n,U,A);break;default:throw Error(s(161))}}catch(V){Je(n,n.return,V)}n.flags&=-3}a&4096&&(n.flags&=-4097)}function _0(n){if(n.subtreeFlags&1024)for(n=n.child;n!==null;){var a=n;_0(a),a.tag===5&&a.flags&1024&&a.stateNode.reset(),n=n.sibling}}function sa(n,a){if(a.subtreeFlags&8772)for(a=a.child;a!==null;)v0(n,a.alternate,a),a=a.sibling}function rs(n){for(n=n.child;n!==null;){var a=n;switch(a.tag){case 0:case 11:case 14:case 15:aa(4,a,a.return),rs(a);break;case 1:sr(a,a.return);var i=a.stateNode;typeof i.componentWillUnmount=="function"&&d0(a,a.return,i),rs(a);break;case 27:Po(a.stateNode);case 26:case 5:sr(a,a.return),rs(a);break;case 22:a.memoizedState===null&&rs(a);break;case 30:rs(a);break;default:rs(a)}n=n.sibling}}function ia(n,a,i){for(i=i&&(a.subtreeFlags&8772)!==0,a=a.child;a!==null;){var c=a.alternate,f=n,p=a,w=p.flags;switch(p.tag){case 0:case 11:case 15:ia(f,p,i),ko(4,p);break;case 1:if(ia(f,p,i),c=p,f=c.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(U){Je(c,c.return,U)}if(c=p,f=c.updateQueue,f!==null){var S=c.stateNode;try{var A=f.shared.hiddenCallbacks;if(A!==null)for(f.shared.hiddenCallbacks=null,f=0;f<A.length;f++)Zp(A[f],S)}catch(U){Je(c,c.return,U)}}i&&w&64&&f0(p),jo(p,p.return);break;case 27:p0(p);case 26:case 5:ia(f,p,i),i&&c===null&&w&4&&h0(p),jo(p,p.return);break;case 12:ia(f,p,i);break;case 13:ia(f,p,i),i&&w&4&&w0(f,p);break;case 22:p.memoizedState===null&&ia(f,p,i),jo(p,p.return);break;case 30:break;default:ia(f,p,i)}a=a.sibling}}function ud(n,a){var i=null;n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(i=n.memoizedState.cachePool.pool),n=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(n=a.memoizedState.cachePool.pool),n!==i&&(n!=null&&n.refCount++,i!=null&&mo(i))}function fd(n,a){n=null,a.alternate!==null&&(n=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==n&&(a.refCount++,n!=null&&mo(n))}function ir(n,a,i,c){if(a.subtreeFlags&10256)for(a=a.child;a!==null;)S0(n,a,i,c),a=a.sibling}function S0(n,a,i,c){var f=a.flags;switch(a.tag){case 0:case 11:case 15:ir(n,a,i,c),f&2048&&ko(9,a);break;case 1:ir(n,a,i,c);break;case 3:ir(n,a,i,c),f&2048&&(n=null,a.alternate!==null&&(n=a.alternate.memoizedState.cache),a=a.memoizedState.cache,a!==n&&(a.refCount++,n!=null&&mo(n)));break;case 12:if(f&2048){ir(n,a,i,c),n=a.stateNode;try{var p=a.memoizedProps,w=p.id,S=p.onPostCommit;typeof S=="function"&&S(w,a.alternate===null?"mount":"update",n.passiveEffectDuration,-0)}catch(A){Je(a,a.return,A)}}else ir(n,a,i,c);break;case 13:ir(n,a,i,c);break;case 23:break;case 22:p=a.stateNode,w=a.alternate,a.memoizedState!==null?p._visibility&2?ir(n,a,i,c):Ro(n,a):p._visibility&2?ir(n,a,i,c):(p._visibility|=2,Js(n,a,i,c,(a.subtreeFlags&10256)!==0)),f&2048&&ud(w,a);break;case 24:ir(n,a,i,c),f&2048&&fd(a.alternate,a);break;default:ir(n,a,i,c)}}function Js(n,a,i,c,f){for(f=f&&(a.subtreeFlags&10256)!==0,a=a.child;a!==null;){var p=n,w=a,S=i,A=c,U=w.flags;switch(w.tag){case 0:case 11:case 15:Js(p,w,S,A,f),ko(8,w);break;case 23:break;case 22:var V=w.stateNode;w.memoizedState!==null?V._visibility&2?Js(p,w,S,A,f):Ro(p,w):(V._visibility|=2,Js(p,w,S,A,f)),f&&U&2048&&ud(w.alternate,w);break;case 24:Js(p,w,S,A,f),f&&U&2048&&fd(w.alternate,w);break;default:Js(p,w,S,A,f)}a=a.sibling}}function Ro(n,a){if(a.subtreeFlags&10256)for(a=a.child;a!==null;){var i=n,c=a,f=c.flags;switch(c.tag){case 22:Ro(i,c),f&2048&&ud(c.alternate,c);break;case 24:Ro(i,c),f&2048&&fd(c.alternate,c);break;default:Ro(i,c)}a=a.sibling}}var No=8192;function ei(n){if(n.subtreeFlags&No)for(n=n.child;n!==null;)E0(n),n=n.sibling}function E0(n){switch(n.tag){case 26:ei(n),n.flags&No&&n.memoizedState!==null&&kS(Hn,n.memoizedState,n.memoizedProps);break;case 5:ei(n);break;case 3:case 4:var a=Hn;Hn=Ec(n.stateNode.containerInfo),ei(n),Hn=a;break;case 22:n.memoizedState===null&&(a=n.alternate,a!==null&&a.memoizedState!==null?(a=No,No=16777216,ei(n),No=a):ei(n));break;default:ei(n)}}function C0(n){var a=n.alternate;if(a!==null&&(n=a.child,n!==null)){a.child=null;do a=n.sibling,n.sibling=null,n=a;while(n!==null)}}function Oo(n){var a=n.deletions;if((n.flags&16)!==0){if(a!==null)for(var i=0;i<a.length;i++){var c=a[i];Mt=c,A0(c,n)}C0(n)}if(n.subtreeFlags&10256)for(n=n.child;n!==null;)T0(n),n=n.sibling}function T0(n){switch(n.tag){case 0:case 11:case 15:Oo(n),n.flags&2048&&aa(9,n,n.return);break;case 3:Oo(n);break;case 12:Oo(n);break;case 22:var a=n.stateNode;n.memoizedState!==null&&a._visibility&2&&(n.return===null||n.return.tag!==13)?(a._visibility&=-3,dc(n)):Oo(n);break;default:Oo(n)}}function dc(n){var a=n.deletions;if((n.flags&16)!==0){if(a!==null)for(var i=0;i<a.length;i++){var c=a[i];Mt=c,A0(c,n)}C0(n)}for(n=n.child;n!==null;){switch(a=n,a.tag){case 0:case 11:case 15:aa(8,a,a.return),dc(a);break;case 22:i=a.stateNode,i._visibility&2&&(i._visibility&=-3,dc(a));break;default:dc(a)}n=n.sibling}}function A0(n,a){for(;Mt!==null;){var i=Mt;switch(i.tag){case 0:case 11:case 15:aa(8,i,a);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var c=i.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:mo(i.memoizedState.cache)}if(c=i.child,c!==null)c.return=i,Mt=c;else e:for(i=n;Mt!==null;){c=Mt;var f=c.sibling,p=c.return;if(y0(c),c===i){Mt=null;break e}if(f!==null){f.return=p,Mt=f;break e}Mt=p}}}var G_={getCacheForType:function(n){var a=Vt(_t),i=a.data.get(n);return i===void 0&&(i=n(),a.data.set(n,i)),i}},K_=typeof WeakMap=="function"?WeakMap:Map,Ve=0,et=null,De=null,$e=0,Ye=0,_n=null,oa=!1,ti=!1,dd=!1,Dr=0,ut=0,la=0,as=0,hd=0,Pn=0,ni=0,Mo=null,nn=null,md=!1,pd=0,hc=1/0,mc=null,ca=null,$t=0,ua=null,ri=null,ai=0,gd=0,vd=null,k0=null,Do=0,yd=null;function Sn(){if((Ve&2)!==0&&$e!==0)return $e&-$e;if(M.T!==null){var n=Ks;return n!==0?n:Cd()}return gr()}function j0(){Pn===0&&(Pn=($e&536870912)===0||Ke?pn():536870912);var n=zn.current;return n!==null&&(n.flags|=32),Pn}function En(n,a,i){(n===et&&(Ye===2||Ye===9)||n.cancelPendingCommit!==null)&&(si(n,0),fa(n,$e,Pn,!1)),tr(n,i),((Ve&2)===0||n!==et)&&(n===et&&((Ve&2)===0&&(as|=i),ut===4&&fa(n,$e,Pn,!1)),or(n))}function R0(n,a,i){if((Ve&6)!==0)throw Error(s(327));var c=!i&&(a&124)===0&&(a&n.expiredLanes)===0||er(n,a),f=c?F_(n,a):xd(n,a,!0),p=c;do{if(f===0){ti&&!c&&fa(n,a,0,!1);break}else{if(i=n.current.alternate,p&&!V_(i)){f=xd(n,a,!1),p=!1;continue}if(f===2){if(p=a,n.errorRecoveryDisabledLanes&p)var w=0;else w=n.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){a=w;e:{var S=n;f=Mo;var A=S.current.memoizedState.isDehydrated;if(A&&(si(S,w).flags|=256),w=xd(S,w,!1),w!==2){if(dd&&!A){S.errorRecoveryDisabledLanes|=p,as|=p,f=4;break e}p=nn,nn=f,p!==null&&(nn===null?nn=p:nn.push.apply(nn,p))}f=w}if(p=!1,f!==2)continue}}if(f===1){si(n,0),fa(n,a,0,!0);break}e:{switch(c=n,p=f,p){case 0:case 1:throw Error(s(345));case 4:if((a&4194048)!==a)break;case 6:fa(c,a,Pn,!oa);break e;case 2:nn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((a&62914560)===a&&(f=pd+300-jt(),10<f)){if(fa(c,a,Pn,!oa),pr(c,0,!0)!==0)break e;c.timeoutHandle=sv(N0.bind(null,c,i,nn,mc,md,a,Pn,as,ni,oa,p,2,-0,0),f);break e}N0(c,i,nn,mc,md,a,Pn,as,ni,oa,p,0,-0,0)}}break}while(!0);or(n)}function N0(n,a,i,c,f,p,w,S,A,U,V,X,B,$){if(n.timeoutHandle=-1,X=a.subtreeFlags,(X&8192||(X&16785408)===16785408)&&(qo={stylesheets:null,count:0,unsuspend:AS},E0(a),X=jS(),X!==null)){n.cancelPendingCommit=X(P0.bind(null,n,a,p,i,c,f,w,S,A,V,1,B,$)),fa(n,p,w,!U);return}P0(n,a,p,i,c,f,w,S,A)}function V_(n){for(var a=n;;){var i=a.tag;if((i===0||i===11||i===15)&&a.flags&16384&&(i=a.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var c=0;c<i.length;c++){var f=i[c],p=f.getSnapshot;f=f.value;try{if(!yn(p(),f))return!1}catch{return!1}}if(i=a.child,a.subtreeFlags&16384&&i!==null)i.return=a,a=i;else{if(a===n)break;for(;a.sibling===null;){if(a.return===null||a.return===n)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function fa(n,a,i,c){a&=~hd,a&=~as,n.suspendedLanes|=a,n.pingedLanes&=~a,c&&(n.warmLanes|=a),c=n.expirationTimes;for(var f=a;0<f;){var p=31-bt(f),w=1<<p;c[p]=-1,f&=~w}i!==0&&xe(n,i,a)}function pc(){return(Ve&6)===0?(Lo(0),!1):!0}function bd(){if(De!==null){if(Ye===0)var n=De.return;else n=De,Tr=Wa=null,Uf(n),Zs=null,Co=0,n=De;for(;n!==null;)u0(n.alternate,n),n=n.return;De=null}}function si(n,a){var i=n.timeoutHandle;i!==-1&&(n.timeoutHandle=-1,uS(i)),i=n.cancelPendingCommit,i!==null&&(n.cancelPendingCommit=null,i()),bd(),et=n,De=i=Sr(n.current,null),$e=a,Ye=0,_n=null,oa=!1,ti=er(n,a),dd=!1,ni=Pn=hd=as=la=ut=0,nn=Mo=null,md=!1,(a&8)!==0&&(a|=a&32);var c=n.entangledLanes;if(c!==0)for(n=n.entanglements,c&=a;0<c;){var f=31-bt(c),p=1<<f;a|=n[f],c&=~p}return Dr=a,zl(),i}function O0(n,a){Re=null,M.H=nc,a===go||a===Vl?(a=Qp(),Ye=3):a===Vp?(a=Qp(),Ye=4):Ye=a===Xg?8:a!==null&&typeof a=="object"&&typeof a.then=="function"?6:1,_n=a,De===null&&(ut=1,oc(n,Mn(a,n.current)))}function M0(){var n=M.H;return M.H=nc,n===null?nc:n}function D0(){var n=M.A;return M.A=G_,n}function wd(){ut=4,oa||($e&4194048)!==$e&&zn.current!==null||(ti=!0),(la&134217727)===0&&(as&134217727)===0||et===null||fa(et,$e,Pn,!1)}function xd(n,a,i){var c=Ve;Ve|=2;var f=M0(),p=D0();(et!==n||$e!==a)&&(mc=null,si(n,a)),a=!1;var w=ut;e:do try{if(Ye!==0&&De!==null){var S=De,A=_n;switch(Ye){case 8:bd(),w=6;break e;case 3:case 2:case 9:case 6:zn.current===null&&(a=!0);var U=Ye;if(Ye=0,_n=null,ii(n,S,A,U),i&&ti){w=0;break e}break;default:U=Ye,Ye=0,_n=null,ii(n,S,A,U)}}Y_(),w=ut;break}catch(V){O0(n,V)}while(!0);return a&&n.shellSuspendCounter++,Tr=Wa=null,Ve=c,M.H=f,M.A=p,De===null&&(et=null,$e=0,zl()),w}function Y_(){for(;De!==null;)L0(De)}function F_(n,a){var i=Ve;Ve|=2;var c=M0(),f=D0();et!==n||$e!==a?(mc=null,hc=jt()+500,si(n,a)):ti=er(n,a);e:do try{if(Ye!==0&&De!==null){a=De;var p=_n;t:switch(Ye){case 1:Ye=0,_n=null,ii(n,a,p,1);break;case 2:case 9:if(Yp(p)){Ye=0,_n=null,U0(a);break}a=function(){Ye!==2&&Ye!==9||et!==n||(Ye=7),or(n)},p.then(a,a);break e;case 3:Ye=7;break e;case 4:Ye=5;break e;case 7:Yp(p)?(Ye=0,_n=null,U0(a)):(Ye=0,_n=null,ii(n,a,p,7));break;case 5:var w=null;switch(De.tag){case 26:w=De.memoizedState;case 5:case 27:var S=De;if(!w||vv(w)){Ye=0,_n=null;var A=S.sibling;if(A!==null)De=A;else{var U=S.return;U!==null?(De=U,gc(U)):De=null}break t}}Ye=0,_n=null,ii(n,a,p,5);break;case 6:Ye=0,_n=null,ii(n,a,p,6);break;case 8:bd(),ut=6;break e;default:throw Error(s(462))}}Q_();break}catch(V){O0(n,V)}while(!0);return Tr=Wa=null,M.H=c,M.A=f,Ve=i,De!==null?0:(et=null,$e=0,zl(),ut)}function Q_(){for(;De!==null&&!Cs();)L0(De)}function L0(n){var a=l0(n.alternate,n,Dr);n.memoizedProps=n.pendingProps,a===null?gc(n):De=a}function U0(n){var a=n,i=a.alternate;switch(a.tag){case 15:case 0:a=n0(i,a,a.pendingProps,a.type,void 0,$e);break;case 11:a=n0(i,a,a.pendingProps,a.type.render,a.ref,$e);break;case 5:Uf(a);default:u0(i,a),a=De=zp(a,Dr),a=l0(i,a,Dr)}n.memoizedProps=n.pendingProps,a===null?gc(n):De=a}function ii(n,a,i,c){Tr=Wa=null,Uf(a),Zs=null,Co=0;var f=a.return;try{if(P_(n,f,a,i,$e)){ut=1,oc(n,Mn(i,n.current)),De=null;return}}catch(p){if(f!==null)throw De=f,p;ut=1,oc(n,Mn(i,n.current)),De=null;return}a.flags&32768?(Ke||c===1?n=!0:ti||($e&536870912)!==0?n=!1:(oa=n=!0,(c===2||c===9||c===3||c===6)&&(c=zn.current,c!==null&&c.tag===13&&(c.flags|=16384))),z0(a,n)):gc(a)}function gc(n){var a=n;do{if((a.flags&32768)!==0){z0(a,oa);return}n=a.return;var i=$_(a.alternate,a,Dr);if(i!==null){De=i;return}if(a=a.sibling,a!==null){De=a;return}De=a=n}while(a!==null);ut===0&&(ut=5)}function z0(n,a){do{var i=q_(n.alternate,n);if(i!==null){i.flags&=32767,De=i;return}if(i=n.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!a&&(n=n.sibling,n!==null)){De=n;return}De=n=i}while(n!==null);ut=6,De=null}function P0(n,a,i,c,f,p,w,S,A){n.cancelPendingCommit=null;do vc();while($t!==0);if((Ve&6)!==0)throw Error(s(327));if(a!==null){if(a===n.current)throw Error(s(177));if(p=a.lanes|a.childLanes,p|=ff,Rs(n,i,p,w,S,A),n===et&&(De=et=null,$e=0),ri=a,ua=n,ai=i,gd=p,vd=f,k0=c,(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?(n.callbackNode=null,n.callbackPriority=0,J_(Vr,function(){return I0(),null})):(n.callbackNode=null,n.callbackPriority=0),c=(a.flags&13878)!==0,(a.subtreeFlags&13878)!==0||c){c=M.T,M.T=null,f=ne.p,ne.p=2,w=Ve,Ve|=4;try{H_(n,a,i)}finally{Ve=w,ne.p=f,M.T=c}}$t=1,B0(),$0(),q0()}}function B0(){if($t===1){$t=0;var n=ua,a=ri,i=(a.flags&13878)!==0;if((a.subtreeFlags&13878)!==0||i){i=M.T,M.T=null;var c=ne.p;ne.p=2;var f=Ve;Ve|=4;try{x0(a,n);var p=Md,w=Ap(n.containerInfo),S=p.focusedElem,A=p.selectionRange;if(w!==S&&S&&S.ownerDocument&&Tp(S.ownerDocument.documentElement,S)){if(A!==null&&sf(S)){var U=A.start,V=A.end;if(V===void 0&&(V=U),"selectionStart"in S)S.selectionStart=U,S.selectionEnd=Math.min(V,S.value.length);else{var X=S.ownerDocument||document,B=X&&X.defaultView||window;if(B.getSelection){var $=B.getSelection(),ye=S.textContent.length,pe=Math.min(A.start,ye),We=A.end===void 0?pe:Math.min(A.end,ye);!$.extend&&pe>We&&(w=We,We=pe,pe=w);var N=Cp(S,pe),R=Cp(S,We);if(N&&R&&($.rangeCount!==1||$.anchorNode!==N.node||$.anchorOffset!==N.offset||$.focusNode!==R.node||$.focusOffset!==R.offset)){var L=X.createRange();L.setStart(N.node,N.offset),$.removeAllRanges(),pe>We?($.addRange(L),$.extend(R.node,R.offset)):(L.setEnd(R.node,R.offset),$.addRange(L))}}}}for(X=[],$=S;$=$.parentNode;)$.nodeType===1&&X.push({element:$,left:$.scrollLeft,top:$.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<X.length;S++){var Q=X[S];Q.element.scrollLeft=Q.left,Q.element.scrollTop=Q.top}}jc=!!Od,Md=Od=null}finally{Ve=f,ne.p=c,M.T=i}}n.current=a,$t=2}}function $0(){if($t===2){$t=0;var n=ua,a=ri,i=(a.flags&8772)!==0;if((a.subtreeFlags&8772)!==0||i){i=M.T,M.T=null;var c=ne.p;ne.p=2;var f=Ve;Ve|=4;try{v0(n,a.alternate,a)}finally{Ve=f,ne.p=c,M.T=i}}$t=3}}function q0(){if($t===4||$t===3){$t=0,Ts();var n=ua,a=ri,i=ai,c=k0;(a.subtreeFlags&10256)!==0||(a.flags&10256)!==0?$t=5:($t=0,ri=ua=null,H0(n,n.pendingLanes));var f=n.pendingLanes;if(f===0&&(ca=null),wt(i),a=a.stateNode,Rt&&typeof Rt.onCommitFiberRoot=="function")try{Rt.onCommitFiberRoot(jn,a,void 0,(a.current.flags&128)===128)}catch{}if(c!==null){a=M.T,f=ne.p,ne.p=2,M.T=null;try{for(var p=n.onRecoverableError,w=0;w<c.length;w++){var S=c[w];p(S.value,{componentStack:S.stack})}}finally{M.T=a,ne.p=f}}(ai&3)!==0&&vc(),or(n),f=n.pendingLanes,(i&4194090)!==0&&(f&42)!==0?n===yd?Do++:(Do=0,yd=n):Do=0,Lo(0)}}function H0(n,a){(n.pooledCacheLanes&=a)===0&&(a=n.pooledCache,a!=null&&(n.pooledCache=null,mo(a)))}function vc(n){return B0(),$0(),q0(),I0()}function I0(){if($t!==5)return!1;var n=ua,a=gd;gd=0;var i=wt(ai),c=M.T,f=ne.p;try{ne.p=32>i?32:i,M.T=null,i=vd,vd=null;var p=ua,w=ai;if($t=0,ri=ua=null,ai=0,(Ve&6)!==0)throw Error(s(331));var S=Ve;if(Ve|=4,T0(p.current),S0(p,p.current,w,i),Ve=S,Lo(0,!1),Rt&&typeof Rt.onPostCommitFiberRoot=="function")try{Rt.onPostCommitFiberRoot(jn,p)}catch{}return!0}finally{ne.p=f,M.T=c,H0(n,a)}}function G0(n,a,i){a=Mn(i,a),a=Xf(n.stateNode,a,2),n=ea(n,a,2),n!==null&&(tr(n,2),or(n))}function Je(n,a,i){if(n.tag===3)G0(n,n,i);else for(;a!==null;){if(a.tag===3){G0(a,n,i);break}else if(a.tag===1){var c=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(ca===null||!ca.has(c))){n=Mn(i,n),i=Fg(2),c=ea(a,i,2),c!==null&&(Qg(i,c,a,n),tr(c,2),or(c));break}}a=a.return}}function _d(n,a,i){var c=n.pingCache;if(c===null){c=n.pingCache=new K_;var f=new Set;c.set(a,f)}else f=c.get(a),f===void 0&&(f=new Set,c.set(a,f));f.has(i)||(dd=!0,f.add(i),n=X_.bind(null,n,a,i),a.then(n,n))}function X_(n,a,i){var c=n.pingCache;c!==null&&c.delete(a),n.pingedLanes|=n.suspendedLanes&i,n.warmLanes&=~i,et===n&&($e&i)===i&&(ut===4||ut===3&&($e&62914560)===$e&&300>jt()-pd?(Ve&2)===0&&si(n,0):hd|=i,ni===$e&&(ni=0)),or(n)}function K0(n,a){a===0&&(a=js()),n=qs(n,a),n!==null&&(tr(n,a),or(n))}function Z_(n){var a=n.memoizedState,i=0;a!==null&&(i=a.retryLane),K0(n,i)}function W_(n,a){var i=0;switch(n.tag){case 13:var c=n.stateNode,f=n.memoizedState;f!==null&&(i=f.retryLane);break;case 19:c=n.stateNode;break;case 22:c=n.stateNode._retryCache;break;default:throw Error(s(314))}c!==null&&c.delete(a),K0(n,i)}function J_(n,a){return Pa(n,a)}var yc=null,oi=null,Sd=!1,bc=!1,Ed=!1,ss=0;function or(n){n!==oi&&n.next===null&&(oi===null?yc=oi=n:oi=oi.next=n),bc=!0,Sd||(Sd=!0,tS())}function Lo(n,a){if(!Ed&&bc){Ed=!0;do for(var i=!1,c=yc;c!==null;){if(n!==0){var f=c.pendingLanes;if(f===0)var p=0;else{var w=c.suspendedLanes,S=c.pingedLanes;p=(1<<31-bt(42|n)+1)-1,p&=f&~(w&~S),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(i=!0,Q0(c,p))}else p=$e,p=pr(c,c===et?p:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(p&3)===0||er(c,p)||(i=!0,Q0(c,p));c=c.next}while(i);Ed=!1}}function eS(){V0()}function V0(){bc=Sd=!1;var n=0;ss!==0&&(cS()&&(n=ss),ss=0);for(var a=jt(),i=null,c=yc;c!==null;){var f=c.next,p=Y0(c,a);p===0?(c.next=null,i===null?yc=f:i.next=f,f===null&&(oi=i)):(i=c,(n!==0||(p&3)!==0)&&(bc=!0)),c=f}Lo(n)}function Y0(n,a){for(var i=n.suspendedLanes,c=n.pingedLanes,f=n.expirationTimes,p=n.pendingLanes&-62914561;0<p;){var w=31-bt(p),S=1<<w,A=f[w];A===-1?((S&i)===0||(S&c)!==0)&&(f[w]=$a(S,a)):A<=a&&(n.expiredLanes|=S),p&=~S}if(a=et,i=$e,i=pr(n,n===a?i:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c=n.callbackNode,i===0||n===a&&(Ye===2||Ye===9)||n.cancelPendingCommit!==null)return c!==null&&c!==null&&mr(c),n.callbackNode=null,n.callbackPriority=0;if((i&3)===0||er(n,i)){if(a=i&-i,a===n.callbackPriority)return a;switch(c!==null&&mr(c),wt(i)){case 2:case 8:i=As;break;case 32:i=Vr;break;case 268435456:i=kn;break;default:i=Vr}return c=F0.bind(null,n),i=Pa(i,c),n.callbackPriority=a,n.callbackNode=i,a}return c!==null&&c!==null&&mr(c),n.callbackPriority=2,n.callbackNode=null,2}function F0(n,a){if($t!==0&&$t!==5)return n.callbackNode=null,n.callbackPriority=0,null;var i=n.callbackNode;if(vc()&&n.callbackNode!==i)return null;var c=$e;return c=pr(n,n===et?c:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),c===0?null:(R0(n,c,a),Y0(n,jt()),n.callbackNode!=null&&n.callbackNode===i?F0.bind(null,n):null)}function Q0(n,a){if(vc())return null;R0(n,a,!0)}function tS(){fS(function(){(Ve&6)!==0?Pa(Wt,eS):V0()})}function Cd(){return ss===0&&(ss=pn()),ss}function X0(n){return n==null||typeof n=="symbol"||typeof n=="boolean"?null:typeof n=="function"?n:Rl(""+n)}function Z0(n,a){var i=a.ownerDocument.createElement("input");return i.name=a.name,i.value=a.value,n.id&&i.setAttribute("form",n.id),a.parentNode.insertBefore(i,a),n=new FormData(n),i.parentNode.removeChild(i),n}function nS(n,a,i,c,f){if(a==="submit"&&i&&i.stateNode===f){var p=X0((f[Ge]||null).action),w=c.submitter;w&&(a=(a=w[Ge]||null)?X0(a.formAction):w.getAttribute("formAction"),a!==null&&(p=a,w=null));var S=new Dl("action","action",null,c,f);n.push({event:S,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(ss!==0){var A=w?Z0(f,w):new FormData(f);Kf(i,{pending:!0,data:A,method:f.method,action:p},null,A)}}else typeof p=="function"&&(S.preventDefault(),A=w?Z0(f,w):new FormData(f),Kf(i,{pending:!0,data:A,method:f.method,action:p},p,A))},currentTarget:f}]})}}for(var Td=0;Td<uf.length;Td++){var Ad=uf[Td],rS=Ad.toLowerCase(),aS=Ad[0].toUpperCase()+Ad.slice(1);qn(rS,"on"+aS)}qn(Rp,"onAnimationEnd"),qn(Np,"onAnimationIteration"),qn(Op,"onAnimationStart"),qn("dblclick","onDoubleClick"),qn("focusin","onFocus"),qn("focusout","onBlur"),qn(x_,"onTransitionRun"),qn(__,"onTransitionStart"),qn(S_,"onTransitionCancel"),qn(Mp,"onTransitionEnd"),Qr("onMouseEnter",["mouseout","mouseover"]),Qr("onMouseLeave",["mouseout","mouseover"]),Qr("onPointerEnter",["pointerout","pointerover"]),Qr("onPointerLeave",["pointerout","pointerover"]),br("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),br("onSelect","focusout contextmenu dragend focu
48sin keydown keyup mousedown mouseup selectionchange".split(" ")),br("onBeforeInput",["compositionend","keypress","textInput","paste"]),br("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),br("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),br("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Uo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),sS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Uo));function W0(n,a){a=(a&4)!==0;for(var i=0;i<n.length;i++){var c=n[i],f=c.event;c=c.listeners;e:{var p=void 0;if(a)for(var w=c.length-1;0<=w;w--){var S=c[w],A=S.instance,U=S.currentTarget;if(S=S.listener,A!==p&&f.isPropagationStopped())break e;p=S,f.currentTarget=U;try{p(f)}catch(V){ic(V)}f.currentTarget=null,p=A}else for(w=0;w<c.length;w++){if(S=c[w],A=S.instance,U=S.currentTarget,S=S.listener,A!==p&&f.isPropagationStopped())break e;p=S,f.currentTarget=U;try{p(f)}catch(V){ic(V)}f.currentTarget=null,p=A}}}}function Le(n,a){var i=a[Nn];i===void 0&&(i=a[Nn]=new Set);var c=n+"__bubble";i.has(c)||(J0(a,n,2,!1),i.add(c))}function kd(n,a,i){var c=0;a&&(c|=4),J0(i,n,c,a)}var wc="_reactListening"+Math.random().toString(36).slice(2);function jd(n){if(!n[wc]){n[wc]=!0,Xi.forEach(function(i){i!=="selectionchange"&&(sS.has(i)||kd(i,!1,n),kd(i,!0,n))});var a=n.nodeType===9?n:n.ownerDocument;a===null||a[wc]||(a[wc]=!0,kd("selectionchange",!1,a))}}function J0(n,a,i,c){switch(Sv(a)){case 2:var f=OS;break;case 8:f=MS;break;default:f=Id}i=f.bind(null,a,i,n),f=void 0,!Xu||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(f=!0),c?f!==void 0?n.addEventListener(a,i,{capture:!0,passive:f}):n.addEventListener(a,i,!0):f!==void 0?n.addEventListener(a,i,{passive:f}):n.addEventListener(a,i,!1)}function Rd(n,a,i,c,f){var p=c;if((a&1)===0&&(a&2)===0&&c!==null)e:for(;;){if(c===null)return;var w=c.tag;if(w===3||w===4){var S=c.stateNode.containerInfo;if(S===f)break;if(w===4)for(w=c.return;w!==null;){var A=w.tag;if((A===3||A===4)&&w.stateNode.containerInfo===f)return;w=w.return}for(;S!==null;){if(w=vr(S),w===null)return;if(A=w.tag,A===5||A===6||A===26||A===27){c=p=w;continue e}S=S.parentNode}}c=c.return}ip(function(){var U=p,V=Fu(i),X=[];e:{var B=Dp.get(n);if(B!==void 0){var $=Dl,ye=n;switch(n){case"keypress":if(Ol(i)===0)break e;case"keydown":case"keyup":$=Jx;break;case"focusin":ye="focus",$=ef;break;case"focusout":ye="blur",$=ef;break;case"beforeblur":case"afterblur":$=ef;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":$=cp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":$=qx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":$=n_;break;case Rp:case Np:case Op:$=Gx;break;case Mp:$=a_;break;case"scroll":case"scrollend":$=Bx;break;case"wheel":$=i_;break;case"copy":case"cut":case"paste":$=Vx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":$=fp;break;case"toggle":case"beforetoggle":$=l_}var pe=(a&4)!==0,We=!pe&&(n==="scroll"||n==="scrollend"),N=pe?B!==null?B+"Capture":null:B;pe=[];for(var R=U,L;R!==null;){var Q=R;if(L=Q.stateNode,Q=Q.tag,Q!==5&&Q!==26&&Q!==27||L===null||N===null||(Q=eo(R,N),Q!=null&&pe.push(zo(R,Q,L))),We)break;R=R.return}0<pe.length&&(B=new $(B,ye,null,i,V),X.push({event:B,listeners:pe}))}}if((a&7)===0){e:{if(B=n==="mouseover"||n==="pointerover",$=n==="mouseout"||n==="pointerout",B&&i!==Yu&&(ye=i.relatedTarget||i.fromElement)&&(vr(ye)||ye[te]))break e;if(($||B)&&(B=V.window===V?V:(B=V.ownerDocument)?B.defaultView||B.parentWindow:window,$?(ye=i.relatedTarget||i.toElement,$=U,ye=ye?vr(ye):null,ye!==null&&(We=l(ye),pe=ye.tag,ye!==We||pe!==5&&pe!==27&&pe!==6)&&(ye=null)):($=null,ye=U),$!==ye)){if(pe=cp,Q="onMouseLeave",N="onMouseEnter",R="mouse",(n==="pointerout"||n==="pointerover")&&(pe=fp,Q="onPointerLeave",N="onPointerEnter",R="pointer"),We=$==null?B:Ha($),L=ye==null?B:Ha(ye),B=new pe(Q,R+"leave",$,i,V),B.target=We,B.relatedTarget=L,Q=null,vr(V)===U&&(pe=new pe(N,R+"enter",ye,i,V),pe.target=L,pe.relatedTarget=We,Q=pe),We=Q,$&&ye)t:{for(pe=$,N=ye,R=0,L=pe;L;L=li(L))R++;for(L=0,Q=N;Q;Q=li(Q))L++;for(;0<R-L;)pe=li(pe),R--;for(;0<L-R;)N=li(N),L--;for(;R--;){if(pe===N||N!==null&&pe===N.alternate)break t;pe=li(pe),N=li(N)}pe=null}else pe=null;$!==null&&ev(X,B,$,pe,!1),ye!==null&&We!==null&&ev(X,We,ye,pe,!0)}}
vendor: 5,204 bytes, lines 48-49
48e:{if(B=U?Ha(U):window,$=B.nodeName&&B.nodeName.toLowerCase(),$==="select"||$==="input"&&B.type==="file")var oe=bp;else if(vp(B))if(wp)oe=y_;else{oe=g_;var Oe=p_}else $=B.nodeName,!$||$.toLowerCase()!=="input"||B.type!=="checkbox"&&B.type!=="radio"?U&&Vu(U.elementType)&&(oe=bp):oe=v_;if(oe&&(oe=oe(n,U))){yp(X,oe,i,V);break e}Oe&&Oe(n,B,U),n==="focusout"&&U&&B.type==="number"&&U.memoizedProps.value!=null&&Ku(B,"number",B.value)}switch(Oe=U?Ha(U):window,n){case"focusin":(vp(Oe)||Oe.contentEditable==="true")&&(Ps=Oe,of=U,lo=null);break;case"focusout":lo=of=Ps=null;break;case"mousedown":lf=!0;break;case"contextmenu":case"mouseup":case"dragend":lf=!1,kp(X,i,V);break;case"selectionchange":if(w_)break;case"keydown":case"keyup":kp(X,i,V)}var fe;if(nf)e:{switch(n){case"compositionstart":var ge="onCompositionStart";break e;case"compositionend":ge="onCompositionEnd";break e;case"compositionupdate":ge="onCompositionUpdate";break e}ge=void 0}else zs?pp(n,i)&&(ge="onCompositionEnd"):n==="keydown"&&i.keyCode===229&&(ge="onCompositionStart");ge&&(dp&&i.locale!=="ko"&&(zs||ge!=="onCompositionStart"?ge==="onCompositionEnd"&&zs&&(fe=op()):(Xr=V,Zu="value"in Xr?Xr.value:Xr.textContent,zs=!0)),Oe=xc(U,ge),0<Oe.length&&(ge=new up(ge,n,null,i,V),X.push({event:ge,listeners:Oe}),fe?ge.data=fe:(fe=gp(i),fe!==null&&(ge.data=fe)))),(fe=u_?f_(n,i):d_(n,i))&&(ge=xc(U,"onBeforeInput"),0<ge.length&&(Oe=new up("onBeforeInput","beforeinput",null,i,V),X.push({event:Oe,listeners:ge}),Oe.data=fe)),nS(X,n,U,i,V)}W0(X,a)})}function zo(n,a,i){return{instance:n,listener:a,currentTarget:i}}function xc(n,a){for(var i=a+"Capture",c=[];n!==null;){var f=n,p=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||p===null||(f=eo(n,i),f!=null&&c.unshift(zo(n,f,p)),f=eo(n,a),f!=null&&c.push(zo(n,f,p))),n.tag===3)return c;n=n.return}return[]}function li(n){if(n===null)return null;do n=n.return;while(n&&n.tag!==5&&n.tag!==27);return n||null}function ev(n,a,i,c,f){for(var p=a._reactName,w=[];i!==null&&i!==c;){var S=i,A=S.alternate,U=S.stateNode;if(S=S.tag,A!==null&&A===c)break;S!==5&&S!==26&&S!==27||U===null||(A=U,f?(U=eo(i,p),U!=null&&w.unshift(zo(i,U,A))):f||(U=eo(i,p),U!=null&&w.push(zo(i,U,A)))),i=i.return}w.length!==0&&n.push({event:a,listeners:w})}var iS=/\r\n?/g,oS=/\u0000|\uFFFD/g;function tv(n){return(typeof n=="string"?n:""+n).replace(iS,` 49`).replace(oS,"")}function nv(n,a){return a=tv(a),tv(n)===a}function _c(){}function Ze(n,a,i,c,f,p){switch(i){case"children":typeof c=="string"?a==="body"||a==="textarea"&&c===""||Ds(n,c):(typeof c=="number"||typeof c=="bigint")&&a!=="body"&&Ds(n,""+c);break;case"className":Ia(n,"class",c);break;case"tabIndex":Ia(n,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Ia(n,i,c);break;case"style":ap(n,c,p);break;case"data":if(a!=="object"){Ia(n,"data",c);break}case"src":case"href":if(c===""&&(a!=="a"||i!=="href")){n.removeAttribute(i);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(i);break}c=Rl(""+c),n.setAttribute(i,c);break;case"action":case"formAction":if(typeof c=="function"){n.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof p=="function"&&(i==="formAction"?(a!=="input"&&Ze(n,a,"name",f.name,f,null),Ze(n,a,"formEncType",f.formEncType,f,null),Ze(n,a,"formMethod",f.formMethod,f,null),Ze(n,a,"formTarget",f.formTarget,f,null)):(Ze(n,a,"encType",f.encType,f,null),Ze(n,a,"method",f.method,f,null),Ze(n,a,"target",f.target,f,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){n.removeAttribute(i);break}c=Rl(""+c),n.setAttribute(i,c);break;case"onClick":c!=null&&(n.onclick=_c);break;case"onScroll":c!=null&&Le("scroll",n);break;case"onScrollEnd":c!=null&&Le("scrollend",n);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(s(61));if(i=c.__html,i!=null){if(f.children!=null)throw Error(s(60));n.innerHTML=i}}break;case"multiple":n.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":n.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){n.removeAttribute("xlink:href");break}i=Rl(""+c),n.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(i,""+c):n.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInl
49ine":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(i,""):n.removeAttribute(i);break;case"capture":case"download":c===!0?n.setAttribute(i,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?n.setAttribute(i,c):n.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?n.setAttribute(i,c):n.removeAttribute(i);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?n.removeAttribute(i):n.setAttribute(i,c);break;case"popover":Le("beforetoggle",n),Le("toggle",n),Os(n,"popover",c);break;case"xlinkActuate":vn(n,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":vn(n,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":vn(n,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":vn(n,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":vn(n,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":vn(n,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":vn(n,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":vn(n,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":vn(n,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":Os(n,"is",c);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=zx.get(i)||i,Os(n,i,c))}}function Nd(n,a,i,c,f,p){switch(i){case"style":ap(n,c,p);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(s(61));if(i=c.__html,i!=null){if(f.children!=null)throw Error(s(60));n.innerHTML=i}}break;case"children":typeof c=="string"?Ds(n,c):(typeof c=="number"||typeof c=="bigint")&&Ds(n,""+c);break;case"onScroll":c!=null&&Le("scroll",n);break;case"onScrollEnd":c!=null&&Le("scrollend",n);break;case"onClick":c!=null&&(n.onclick=_c);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Tl.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(f=i.endsWith("Capture"),a=i.slice(2,f?i.length-7:void 0),p=n[Ge]||null,p=p!=null?p[i]:null,typeof p=="function"&&n.removeEventListener(a,p,f),typeof c=="function")){typeof p!="function"&&p!==null&&(i in n?n[i]=null:n.hasAttribute(i)&&n.removeAttribute(i)),n.addEventListener(a,c,f);break e}i in n?n[i]=c:c===!0?n.setAttribute(i,""):Os(n,i,c)}}}function qt(n,a,i){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Le("error",n),Le("load",n);var c=!1,f=!1,p;for(p in i)if(i.hasOwnProperty(p)){var w=i[p];if(w!=null)switch(p){case"src":c=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,a));default:Ze(n,a,p,w,i,null)}}f&&Ze(n,a,"srcSet",i.srcSet,i,null),c&&Ze(n,a,"src",i.src,i,null);return;case"input":Le("invalid",n);var S=p=w=f=null,A=null,U=null;for(c in i)if(i.hasOwnProperty(c)){var V=i[c];if(V!=null)switch(c){case"name":f=V;break;case"type":w=V;break;case"checked":A=V;break;case"defaultChecked":U=V;break;case"value":p=V;break;case"defaultValue":S=V;break;case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(s(137,a));break;default:Ze(n,a,c,V,i,null)}}ep(n,p,S,A,U,w,f,!1),Be(n);return;case"select":Le("invalid",n),c=w=p=null;for(f in i)if(i.hasOwnProperty(f)&&(S=i[f],S!=null))switch(f){case"value":p=S;break;case"defaultValue":w=S;break;case"multiple":c=S;default:Ze(n,a,f,S,i,null)}a=p,i=w,n.multiple=!!c,a!=null?Ms(n,!!c,a,!1):i!=null&&Ms(n,!!c,i,!0);return;case"textarea":Le("invalid",n),p=f=c=null;for(w in i)if(i.hasOwnProperty(w)&&(S=i[w],S!=null))switch(w){case"value":c=S;break;case"defaultValue":f=S;break;case"children":p=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(s(91));break;default:Ze(n,a,w,S,i,null)}np(n,c,f,p),Be(n);return;case"option":for(A in i)if(i.hasOwnProperty(A)&&(c=i[A],c!=null))switch(A){case"selected":n.selected=c&&typeof c!="function"&&typeof c!="symbol";break;default:Ze(n,a,A,c,i,null)}return;case"dialog":Le("beforetoggle",n),Le("toggle",n),Le("cancel",n),Le("close",n);break;case"iframe":case"object":Le("load",n);break;case"video":case"audio":for(c=0;c<Uo.length;c++)Le(Uo[c],n);break;case"image":Le("error",n),Le("load",n);break;case"details":Le("toggle",n);break;case"embed":case"source":case"link":Le("error",n),Le("load",n);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(U in i)if(i.hasOwnProperty(U)&&(c=i[U],c!=null))switch(U){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,a));default:Ze(n,a,U,c,i,null)}return;default:if(Vu(a)){for(V in i)i.hasOwnProperty(V)&&(c=i[V],c!==void 0&&Nd(n,a,V,c,i,void 0));return}}for(S in i)i.hasOwnProperty(S)&&(c=i[S],c!=null&&Ze(n,a,S,c,i,null))}function lS(n,a,i,c){switch(a){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,p=null,w=null,S=null,A=null,U=null,V=null;for($ in i){var X=i[$];if(i.hasOwnProperty($)&&X!=null)switch($){case"checked":break;case"value":break;case"defaultValue":A=X;default:c.hasOwnProperty($)||Ze(n,a,$,null,c,X)}}for(var B in c){var $=c[B];if(X=i[B],c.hasOwnProperty(B)&&($!=null||X!=null))switch(B){case"type":p=$;break;case"name":f=$;break;case"checked":U=$;break;case"defaultChecked":V=$;break;case"value":w=$;break;case"defaultValue":S=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(s(137,a));break;default:$!==X&&Ze(n,a,B,$,c,X)}}Gu(n,w,S,A,U,V,p,f);return;case"select":$=w=S=B=null;for(p in i)if(A=i[p],i.hasOwnProperty(p)&&A!=null)switch(p){case"value":break;case"multiple":$=A;default:c.hasOwnProperty(p)||Ze(n,a,p,null,c,A)}for(f in c)if(p=c[f],A=i[f],c.hasOwnProperty(f)&&(p!=null||A!=null))switch(f){case"value":B=p;break;case"defaultValue":S=p;break;case"multiple":w=p;default:p!==A&&Ze(n,a,f,p,c,A)}a=S,i=w,c=$,B!=null?Ms(n,!!i,B,!1):!!c!=!!i&&(a!=null?Ms(n,!!i,a,!0):Ms(n,!!i,i?[]:"",!1));return;case"textarea":$=B=null;for(S in i)if(f=i[S],i.hasOwnProperty(S)&&f!=null&&!c.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:Ze(n,a,S,null,c,f)}for(w in c)if(f=c[w],p=i[w],c.hasOwnProperty(w)&&(f!=null||p!=null))switch(w){case"value":B=f;break;case"defaultValue":$=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(s(91));break;default:f!==p&&Ze(n,a,w,f,c,p)}tp(n,B,$);return;case"option":for(var ye in i)if(B=i[ye],i.hasOwnProperty(ye)&&B!=null&&!c.hasOwnProperty(ye))switch(ye){case"selected":n.selected=!1;break;default:Ze(n,a,ye,null,c,B)}for(A in c)if(B=c[A],$=i[A],c.hasOwnProperty(A)&&B!==$&&(B!=null||$!=null))switch(A){case"selected":n.selected=B&&typeof B!="function"&&typeof B!="symbol";break;default:Ze(n,a,A,B,c,$)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var pe in i)B=i[pe],i.hasOwnProperty(pe)&&B!=null&&!c.hasOwnProperty(pe)&&Ze(n,a,pe,null,c,B);for(U in c)if(B=c[U],$=i[U],c.hasOwnProperty(U)&&B!==$&&(B!=null||$!=null))switch(U){case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(s(137,a));break;default:Ze(n,a,U,B,c,$)}return;default:if(Vu(a)){for(var We in i)B=i[We],i.hasOwnProperty(We)&&B!==void 0&&!c.hasOwnProperty(We)&&Nd(n,a,We,void 0,c,B);for(V in c)B=c[V],$=i[V],!c.hasOwnProperty(V)||B===$||B===void 0&&$===void 0||Nd(n,a,V,B,c,$);return}}for(var N in i)B=i[N],i.hasOwnProperty(N)&&B!=null&&!c.hasOwnProperty(N)&&Ze(n,a,N,null,c,B);for(X in c)B=c[X],$=i[X],!c.hasOwnProperty(X)||B===$||B==null&&$==null||Ze(n,a,X,B,c,$)}var Od=null,Md=null;function Sc(n){return n.nodeType===9?n:n.ownerDocument}function rv(n){switch(n){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function av(n,a){if(n===0)switch(a){case"svg":return 1;case"math":return 2;default:return 0}return n===1&&a==="foreignObject"?0:n}function Dd(n,a){return n==="textarea"||n==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.children=="bigint"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var Ld=null;function cS(){var n=window.event;return n&&n.type==="popstate"?n===Ld?!1:(Ld=n,!0):(Ld=null,!1)}var sv=typeof setTimeout=="function"?setTimeout:void 0,uS=typeof clearTimeout=="function"?clearTimeout:void 0,iv=typeof Promise=="function"?Promise:void 0,f
vendor: 3,701 bytes, line 49
49S=typeof queueMicrotask=="function"?queueMicrotask:typeof iv<"u"?function(n){return iv.resolve(null).then(n).catch(dS)}:sv;function dS(n){setTimeout(function(){throw n})}function da(n){return n==="head"}function ov(n,a){var i=a,c=0,f=0;do{var p=i.nextSibling;if(n.removeChild(i),p&&p.nodeType===8)if(i=p.data,i==="/$"){if(0<c&&8>c){i=c;var w=n.ownerDocument;if(i&1&&Po(w.documentElement),i&2&&Po(w.body),i&4)for(i=w.head,Po(i),w=i.firstChild;w;){var S=w.nextSibling,A=w.nodeName;w[Nt]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&w.rel.toLowerCase()==="stylesheet"||i.removeChild(w),w=S}}if(f===0){n.removeChild(p),Vo(a);return}f--}else i==="$"||i==="$?"||i==="$!"?f++:c=i.charCodeAt(0)-48;else c=0;i=p}while(i);Vo(a)}function Ud(n){var a=n.firstChild;for(a&&a.nodeType===10&&(a=a.nextSibling);a;){var i=a;switch(a=a.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Ud(i),Ns(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}n.removeChild(i)}}function hS(n,a,i,c){for(;n.nodeType===1;){var f=i;if(n.nodeName.toLowerCase()!==a.toLowerCase()){if(!c&&(n.nodeName!=="INPUT"||n.type!=="hidden"))break}else if(c){if(!n[Nt])switch(a){case"meta":if(!n.hasAttribute("itemprop"))break;return n;case"link":if(p=n.getAttribute("rel"),p==="stylesheet"&&n.hasAttribute("data-precedence"))break;if(p!==f.rel||n.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||n.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||n.getAttribute("title")!==(f.title==null?null:f.title))break;return n;case"style":if(n.hasAttribute("data-precedence"))break;return n;case"script":if(p=n.getAttribute("src"),(p!==(f.src==null?null:f.src)||n.getAttribute("type")!==(f.type==null?null:f.type)||n.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&p&&n.hasAttribute("async")&&!n.hasAttribute("itemprop"))break;return n;default:return n}}else if(a==="input"&&n.type==="hidden"){var p=f.name==null?null:""+f.name;if(f.type==="hidden"&&n.getAttribute("name")===p)return n}else return n;if(n=In(n.nextSibling),n===null)break}return null}function mS(n,a,i){if(a==="")return null;for(;n.nodeType!==3;)if((n.nodeType!==1||n.nodeName!=="INPUT"||n.type!=="hidden")&&!i||(n=In(n.nextSibling),n===null))return null;return n}function zd(n){return n.data==="$!"||n.data==="$?"&&n.ownerDocument.readyState==="complete"}function pS(n,a){var i=n.ownerDocument;if(n.data!=="$?"||i.readyState==="complete")a();else{var c=function(){a(),i.removeEventListener("DOMContentLoaded",c)};i.addEventListener("DOMContentLoaded",c),n._reactRetry=c}}function In(n){for(;n!=null;n=n.nextSibling){var a=n.nodeType;if(a===1||a===3)break;if(a===8){if(a=n.data,a==="$"||a==="$!"||a==="$?"||a==="F!"||a==="F")break;if(a==="/$")return null}}return n}var Pd=null;function lv(n){n=n.previousSibling;for(var a=0;n;){if(n.nodeType===8){var i=n.data;if(i==="$"||i==="$!"||i==="$?"){if(a===0)return n;a--}else i==="/$"&&a++}n=n.previousSibling}return null}function cv(n,a,i){switch(a=Sc(i),n){case"html":if(n=a.documentElement,!n)throw Error(s(452));return n;case"head":if(n=a.head,!n)throw Error(s(453));return n;case"body":if(n=a.body,!n)throw Error(s(454));return n;default:throw Error(s(451))}}function Po(n){for(var a=n.attributes;a.length;)n.removeAttributeNode(a[0]);Ns(n)}var Bn=new Map,uv=new Set;function Ec(n){return typeof n.getRootNode=="function"?n.getRootNode():n.nodeType===9?n:n.ownerDocument}var Lr=ne.d;ne.d={f:gS,r:vS,D:yS,C:bS,L:wS,m:xS,X:SS,S:_S,M:ES};function gS(){var n=Lr.f(),a=pc();return n||a}function vS(n){var a=ue(n);a!==null&&a.tag===5&&a.type==="form"?Rg(a):Lr.r(n)}var ci=typeof document>"u"?null:document;function fv(n,a,i){var c=ci;
vendor: 1,609 bytes, line 49
49if(c&&typeof a=="string"&&a){var f=On(a);f='link[rel="'+n+'"][href="'+f+'"]',typeof i=="string"&&(f+='[crossorigin="'+i+'"]'),uv.has(f)||(uv.add(f),n={rel:n,crossOrigin:i,href:a},c.querySelector(f)===null&&(a=c.createElement("link"),qt(a,"link",n),pt(a),c.head.appendChild(a)))}}function yS(n){Lr.D(n),fv("dns-prefetch",n,null)}function bS(n,a){Lr.C(n,a),fv("preconnect",n,a)}function wS(n,a,i){Lr.L(n,a,i);var c=ci;if(c&&n&&a){var f='link[rel="preload"][as="'+On(a)+'"]';a==="image"&&i&&i.imageSrcSet?(f+='[imagesrcset="'+On(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(f+='[imagesizes="'+On(i.imageSizes)+'"]')):f+='[href="'+On(n)+'"]';var p=f;switch(a){case"style":p=ui(n);break;case"script":p=fi(n)}Bn.has(p)||(n=g({rel:"preload",href:a==="image"&&i&&i.imageSrcSet?void 0:n,as:a},i),Bn.set(p,n),c.querySelector(f)!==null||a==="style"&&c.querySelector(Bo(p))||a==="script"&&c.querySelector($o(p))||(a=c.createElement("link"),qt(a,"link",n),pt(a),c.head.appendChild(a)))}}function xS(n,a){Lr.m(n,a);var i=ci;if(i&&n){var c=a&&typeof a.as=="string"?a.as:"script",f='link[rel="modulepreload"][as="'+On(c)+'"][href="'+On(n)+'"]',p=f;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=fi(n)}if(!Bn.has(p)&&(n=g({rel:"modulepreload",href:n},a),Bn.set(p,n),i.querySelector(f)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector($o(p)))return}c=i.createElement("link"),qt(c,"link",n),pt(c),i.head.appendChild(c)}}}function _S(n,a,i){Lr.S(n,a,i);var c=ci;
vendor: 5,197 bytes, line 49
49if(c&&n){var f=yr(c).hoistableStyles,p=ui(n);a=a||"default";var w=f.get(p);if(!w){var S={loading:0,preload:null};if(w=c.querySelector(Bo(p)))S.loading=5;else{n=g({rel:"stylesheet",href:n,"data-precedence":a},i),(i=Bn.get(p))&&Bd(n,i);var A=w=c.createElement("link");pt(A),qt(A,"link",n),A._p=new Promise(function(U,V){A.onload=U,A.onerror=V}),A.addEventListener("load",function(){S.loading|=1}),A.addEventListener("error",function(){S.loading|=2}),S.loading|=4,Cc(w,a,c)}w={type:"stylesheet",instance:w,count:1,state:S},f.set(p,w)}}}function SS(n,a){Lr.X(n,a);var i=ci;if(i&&n){var c=yr(i).hoistableScripts,f=fi(n),p=c.get(f);p||(p=i.querySelector($o(f)),p||(n=g({src:n,async:!0},a),(a=Bn.get(f))&&$d(n,a),p=i.createElement("script"),pt(p),qt(p,"link",n),i.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},c.set(f,p))}}function ES(n,a){Lr.M(n,a);var i=ci;if(i&&n){var c=yr(i).hoistableScripts,f=fi(n),p=c.get(f);p||(p=i.querySelector($o(f)),p||(n=g({src:n,async:!0,type:"module"},a),(a=Bn.get(f))&&$d(n,a),p=i.createElement("script"),pt(p),qt(p,"link",n),i.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},c.set(f,p))}}function dv(n,a,i,c){var f=(f=ie.current)?Ec(f):null;if(!f)throw Error(s(446));switch(n){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(a=ui(i.href),i=yr(f).hoistableStyles,c=i.get(a),c||(c={type:"style",instance:null,count:0,state:null},i.set(a,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){n=ui(i.href);var p=yr(f).hoistableStyles,w=p.get(n);if(w||(f=f.ownerDocument||f,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(n,w),(p=f.querySelector(Bo(n)))&&!p._p&&(w.instance=p,w.state.loading=5),Bn.has(n)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Bn.set(n,i),p||CS(f,n,i,w.state))),a&&c===null)throw Error(s(528,""));return w}if(a&&c!==null)throw Error(s(529,""));return null;case"script":return a=i.async,i=i.src,typeof i=="string"&&a&&typeof a!="function"&&typeof a!="symbol"?(a=fi(i),i=yr(f).hoistableScripts,c=i.get(a),c||(c={type:"script",instance:null,count:0,state:null},i.set(a,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,n))}}function ui(n){return'href="'+On(n)+'"'}function Bo(n){return'link[rel="stylesheet"]['+n+"]"}function hv(n){return g({},n,{"data-precedence":n.precedence,precedence:null})}function CS(n,a,i,c){n.querySelector('link[rel="preload"][as="style"]['+a+"]")?c.loading=1:(a=n.createElement("link"),c.preload=a,a.addEventListener("load",function(){return c.loading|=1}),a.addEventListener("error",function(){return c.loading|=2}),qt(a,"link",i),pt(a),n.head.appendChild(a))}function fi(n){return'[src="'+On(n)+'"]'}function $o(n){return"script[async]"+n}function mv(n,a,i){if(a.count++,a.instance===null)switch(a.type){case"style":var c=n.querySelector('style[data-href~="'+On(i.href)+'"]');if(c)return a.instance=c,pt(c),c;var f=g({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return c=(n.ownerDocument||n).createElement("style"),pt(c),qt(c,"style",f),Cc(c,i.precedence,n),a.instance=c;case"stylesheet":f=ui(i.href);var p=n.querySelector(Bo(f));if(p)return a.state.loading|=4,a.instance=p,pt(p),p;c=hv(i),(f=Bn.get(f))&&Bd(c,f),p=(n.ownerDocument||n).createElement("link"),pt(p);var w=p;return w._p=new Promise(function(S,A){w.onload=S,w.onerror=A}),qt(p,"link",c),a.state.loading|=4,Cc(p,i.precedence,n),a.instance=p;case"script":return p=fi(i.src),(f=n.querySelector($o(p)))?(a.instance=f,pt(f),f):(c=i,(f=Bn.get(p))&&(c=g({},i),$d(c,f)),n=n.ownerDocument||n,f=n.createElement("script"),pt(f),qt(f,"link",c),n.head.appendChild(f),a.instance=f);case"void":return null;default:throw Error(s(443,a.type))}else a.type==="stylesheet"&&(a.state.loading&4)===0&&(c=a.instance,a.state.loading|=4,Cc(c,i.precedence,n));return a.instance}function Cc(n,a,i){for(var c=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=c.length?c[c.length-1]:null,p=f,w=0;w<c.length;w++){var S=c[w];if(S.dataset.precedence===a)p=S;else if(p!==f)break}p?p.parentNode.insertBefore(n,p.nextSibling):(a=i.nodeType===9?i.head:i,a.insertBefore(n,a.firstChild))}function Bd(n,a){n.crossOrigin==null&&(n.crossOrigin=a.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=a.referrerPolicy),n.title==null&&(n.title=a.title)}function $d(n,a){n.crossOrigin==null&&(n.crossOrigin=a.crossOrigin),n.referrerPolicy==null&&(n.referrerPolicy=a.referrerPolicy),n.integrity==null&&(n.integrity=a.integrity)}var Tc=null;function pv(n,a,i){if(Tc===null){var c=new Map,f=Tc=new Map;f.set(i,c)}else f=Tc,c=f.get(i),c||(c=new Map,f.set(i,c));if(c.has(n))return c;for(c.set(n,null),i=i.getElementsByTagName(n),f=0;f<i.length;f++){var p=i[f];if(!(p[Nt]||p[qe]||n==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var w=p.getAttribute(a)||"";w=n+w;var S=c.get(w);S?S.push(p):c.set(w,[p])}}return c}
vendor: 9,414 bytes, line 49
49function gv(n,a,i){n=n.ownerDocument||n,n.head.insertBefore(i,a==="title"?n.querySelector("head > title"):null)}function TS(n,a,i){if(i===1||a.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof a.precedence!="string"||typeof a.href!="string"||a.href==="")break;return!0;case"link":if(typeof a.rel!="string"||typeof a.href!="string"||a.href===""||a.onLoad||a.onError)break;switch(a.rel){case"stylesheet":return n=a.disabled,typeof a.precedence=="string"&&n==null;default:return!0}case"script":if(a.async&&typeof a.async!="function"&&typeof a.async!="symbol"&&!a.onLoad&&!a.onError&&a.src&&typeof a.src=="string")return!0}return!1}function vv(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}var qo=null;function AS(){}function kS(n,a,i){if(qo===null)throw Error(s(475));var c=qo;if(a.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var f=ui(i.href),p=n.querySelector(Bo(f));if(p){n=p._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(c.count++,c=Ac.bind(c),n.then(c,c)),a.state.loading|=4,a.instance=p,pt(p);return}p=n.ownerDocument||n,i=hv(i),(f=Bn.get(f))&&Bd(i,f),p=p.createElement("link"),pt(p);var w=p;w._p=new Promise(function(S,A){w.onload=S,w.onerror=A}),qt(p,"link",i),a.instance=p}c.stylesheets===null&&(c.stylesheets=new Map),c.stylesheets.set(a,n),(n=a.state.preload)&&(a.state.loading&3)===0&&(c.count++,a=Ac.bind(c),n.addEventListener("load",a),n.addEventListener("error",a))}}function jS(){if(qo===null)throw Error(s(475));var n=qo;return n.stylesheets&&n.count===0&&qd(n,n.stylesheets),0<n.count?function(a){var i=setTimeout(function(){if(n.stylesheets&&qd(n,n.stylesheets),n.unsuspend){var c=n.unsuspend;n.unsuspend=null,c()}},6e4);return n.unsuspend=a,function(){n.unsuspend=null,clearTimeout(i)}}:null}function Ac(){if(this.count--,this.count===0){if(this.stylesheets)qd(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var kc=null;function qd(n,a){n.stylesheets=null,n.unsuspend!==null&&(n.count++,kc=new Map,a.forEach(RS,n),kc=null,Ac.call(n))}function RS(n,a){if(!(a.state.loading&4)){var i=kc.get(n);if(i)var c=i.get(null);else{i=new Map,kc.set(n,i);for(var f=n.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<f.length;p++){var w=f[p];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(i.set(w.dataset.precedence,w),c=w)}c&&i.set(null,c)}f=a.instance,w=f.getAttribute("data-precedence"),p=i.get(w)||c,p===c&&i.set(null,f),i.set(w,f),this.count++,c=Ac.bind(this),f.addEventListener("load",c),f.addEventListener("error",c),p?p.parentNode.insertBefore(f,p.nextSibling):(n=n.nodeType===9?n.head:n,n.insertBefore(f,n.firstChild)),a.state.loading|=4}}var Ho={$$typeof:O,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function NS(n,a,i,c,f,p,w,S){this.tag=1,this.containerInfo=n,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=qa(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qa(0),this.hiddenUpdates=qa(null),this.identifierPrefix=c,this.onUncaughtError=f,this.onCaughtError=p,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.incompleteTransitions=new Map}function yv(n,a,i,c,f,p,w,S,A,U,V,X){return n=new NS(n,a,i,w,S,A,U,X),a=1,p===!0&&(a|=24),p=bn(3,null,null,a),n.current=p,p.stateNode=n,a=_f(),a.refCount++,n.pooledCache=a,a.refCount++,p.memoizedState={element:c,isDehydrated:i,cache:a},Tf(p),n}function bv(n){return n?(n=Hs,n):Hs}function wv(n,a,i,c,f,p){f=bv(f),c.context===null?c.context=f:c.pendingContext=f,c=Jr(a),c.payload={element:i},p=p===void 0?null:p,p!==null&&(c.callback=p),i=ea(n,c,a),i!==null&&(En(i,n,a),yo(i,n,a))}function xv(n,a){if(n=n.memoizedState,n!==null&&n.dehydrated!==null){var i=n.retryLane;n.retryLane=i!==0&&i<a?i:a}}function Hd(n,a){xv(n,a),(n=n.alternate)&&xv(n,a)}function _v(n){if(n.tag===13){var a=qs(n,67108864);a!==null&&En(a,n,67108864),Hd(n,67108864)}}var jc=!0;function OS(n,a,i,c){var f=M.T;M.T=null;var p=ne.p;try{ne.p=2,Id(n,a,i,c)}finally{ne.p=p,M.T=f}}function MS(n,a,i,c){var f=M.T;M.T=null;var p=ne.p;try{ne.p=8,Id(n,a,i,c)}finally{ne.p=p,M.T=f}}function Id(n,a,i,c){if(jc){var f=Gd(c);if(f===null)Rd(n,a,c,Rc,i),Ev(n,c);else if(LS(f,n,a,i,c))c.stopPropagation();else if(Ev(n,c),a&4&&-1<DS.indexOf(n)){for(;f!==null;){var p=ue(f);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var w=Rn(p.pendingLanes);if(w!==0){var S=p;for(S.pendingLanes|=2,S.entangledLanes|=2;w;){var A=1<<31-bt(w);S.entanglements[1]|=A,w&=~A}or(p),(Ve&6)===0&&(hc=jt()+500,Lo(0))}}break;case 13:S=qs(p,2),S!==null&&En(S,p,2),pc(),Hd(p,2)}if(p=Gd(c),p===null&&Rd(n,a,c,Rc,i),p===f)break;f=p}f!==null&&c.stopPropagation()}else Rd(n,a,c,null,i)}}function Gd(n){return n=Fu(n),Kd(n)}var Rc=null;function Kd(n){if(Rc=null,n=vr(n),n!==null){var a=l(n);if(a===null)n=null;else{var i=a.tag;if(i===13){if(n=u(a),n!==null)return n;n=null}else if(i===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;n=null}else a!==n&&(n=null)}}return Rc=n,null}function Sv(n){switch(n){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ba()){case Wt:return 2;case As:return 8;case Vr:case Pt:return 32;case kn:return 268435456;default:return 32}default:return 32}}var Vd=!1,ha=null,ma=null,pa=null,Io=new Map,Go=new Map,ga=[],DS="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Ev(n,a){switch(n){case"focusin":case"focusout":ha=null;break;case"dragenter":case"dragleave":ma=null;break;case"mouseover":case"mouseout":pa=null;break;case"pointerover":case"pointerout":Io.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Go.delete(a.pointerId)}}function Ko(n,a,i,c,f,p){return n===null||n.nativeEvent!==p?(n={blockedOn:a,domEventName:i,eventSystemFlags:c,nativeEvent:p,targetContainers:[f]},a!==null&&(a=ue(a),a!==null&&_v(a)),n):(n.eventSystemFlags|=c,a=n.targetContainers,f!==null&&a.indexOf(f)===-1&&a.push(f),n)}function LS(n,a,i,c,f){switch(a){case"focusin":return ha=Ko(ha,n,a,i,c,f),!0;case"dragenter":return ma=Ko(ma,n,a,i,c,f),!0;case"mouseover":return pa=Ko(pa,n,a,i,c,f),!0;case"pointerover":var p=f.pointerId;return Io.set(p,Ko(Io.get(p)||null,n,a,i,c,f)),!0;case"gotpointercapture":return p=f.pointerId,Go.set(p,Ko(Go.get(p)||null,n,a,i,c,f)),!0}return!1}function Cv(n){var a=vr(n.target);if(a!==null){var i=l(a);if(i!==null){if(a=i.tag,a===13){if(a=u(i),a!==null){n.blockedOn=a,P(n.priority,function(){if(i.tag===13){var c=Sn();c=lt(c);var f=qs(i,c);f!==null&&En(f,i,c),Hd(i,c)}});return}}else if(a===3&&i.stateNode.current.memoizedState.isDehydrated){n.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}n.blockedOn=null}function Nc(n){if(n.blockedOn!==null)return!1;for(var a=n.targetContainers;0<a.length;){var i=Gd(n.nativeEvent);if(i===null){i=n.nativeEvent;var c=new i.constructor(i.type,i);Yu=c,i.target.dispatchEvent(c),Yu=null}else return a=ue(i),a!==null&&_v(a),n.blockedOn=i,!1;a.shift()}return!0}function Tv(n,a,i){Nc(n)&&i.delete(a)}function US(){Vd=!1,ha!==null&&Nc(ha)&&(ha=null),ma!==null&&Nc(ma)&&(ma=null),pa!==null&&Nc(pa)&&(pa=null),Io.forEach(Tv),Go.forEach(Tv)}function Oc(n,a){n.blockedOn===a&&(n.blockedOn=null,Vd||(Vd=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,US)))}var Mc=null;function Av(n){Mc!==n&&(Mc=n,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Mc===n&&(Mc=null);for(var a=0;a<n.length;a+=3){var i=n[a],c=n[a+1],f=n[a+2];if(typeof c!="function"){if(Kd(c||i)===null)continue;break}var p=ue(i);p!==null&&(n.splice(a,3),a-=3,Kf(p,{pending:!0,data:f,method:i.method,action:c},c,f))}}))}function Vo(n){function a(A){return Oc(A,n)}ha!==null&&Oc(ha,n),ma!==null&&Oc(ma,n),pa!==null&&Oc(pa,n),Io.forEac
vendor: 4,680 bytes, line 49
49h(a),Go.forEach(a);for(var i=0;i<ga.length;i++){var c=ga[i];c.blockedOn===n&&(c.blockedOn=null)}for(;0<ga.length&&(i=ga[0],i.blockedOn===null);)Cv(i),i.blockedOn===null&&ga.shift();if(i=(n.ownerDocument||n).$$reactFormReplay,i!=null)for(c=0;c<i.length;c+=3){var f=i[c],p=i[c+1],w=f[Ge]||null;if(typeof p=="function")w||Av(i);else if(w){var S=null;if(p&&p.hasAttribute("formAction")){if(f=p,w=p[Ge]||null)S=w.formAction;else if(Kd(f)!==null)continue}else S=w.action;typeof S=="function"?i[c+1]=S:(i.splice(c,3),c-=3),Av(i)}}}function Yd(n){this._internalRoot=n}Dc.prototype.render=Yd.prototype.render=function(n){var a=this._internalRoot;if(a===null)throw Error(s(409));var i=a.current,c=Sn();wv(i,c,n,a,null,null)},Dc.prototype.unmount=Yd.prototype.unmount=function(){var n=this._internalRoot;if(n!==null){this._internalRoot=null;var a=n.containerInfo;wv(n.current,2,null,n,null,null),pc(),a[te]=null}};function Dc(n){this._internalRoot=n}Dc.prototype.unstable_scheduleHydration=function(n){if(n){var a=gr();n={blockedOn:null,target:n,priority:a};for(var i=0;i<ga.length&&a!==0&&a<ga[i].priority;i++);ga.splice(i,0,n),i===0&&Cv(n)}};var kv=e.version;if(kv!=="19.1.0")throw Error(s(527,kv,"19.1.0"));ne.findDOMNode=function(n){var a=n._reactInternals;if(a===void 0)throw typeof n.render=="function"?Error(s(188)):(n=Object.keys(n).join(","),Error(s(268,n)));return n=m(a),n=n!==null?h(n):null,n=n===null?null:n.stateNode,n};var zS={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Lc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Lc.isDisabled&&Lc.supportsFiber)try{jn=Lc.inject(zS),Rt=Lc}catch{}}return Fo.createRoot=function(n,a){if(!o(n))throw Error(s(299));var i=!1,c="",f=Gg,p=Kg,w=Vg,S=null;return a!=null&&(a.unstable_strictMode===!0&&(i=!0),a.identifierPrefix!==void 0&&(c=a.identifierPrefix),a.onUncaughtError!==void 0&&(f=a.onUncaughtError),a.onCaughtError!==void 0&&(p=a.onCaughtError),a.onRecoverableError!==void 0&&(w=a.onRecoverableError),a.unstable_transitionCallbacks!==void 0&&(S=a.unstable_transitionCallbacks)),a=yv(n,1,!1,null,null,i,c,f,p,w,S,null),n[te]=a.current,jd(n),new Yd(a)},Fo.hydrateRoot=function(n,a,i){if(!o(n))throw Error(s(299));var c=!1,f="",p=Gg,w=Kg,S=Vg,A=null,U=null;return i!=null&&(i.unstable_strictMode===!0&&(c=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onUncaughtError!==void 0&&(p=i.onUncaughtError),i.onCaughtError!==void 0&&(w=i.onCaughtError),i.onRecoverableError!==void 0&&(S=i.onRecoverableError),i.unstable_transitionCallbacks!==void 0&&(A=i.unstable_transitionCallbacks),i.formState!==void 0&&(U=i.formState)),a=yv(n,1,!0,a,i??null,c,f,p,w,S,A,U),a.context=bv(null),i=a.current,c=Sn(),c=lt(c),f=Jr(c),f.callback=null,ea(i,f,c),i=c,a.current.lanes=i,tr(a,i),or(a),n[te]=a.current,jd(n),new Dc(a)},Fo.version="19.1.0",Fo}var Pv;function XS(){if(Pv)return Xd.exports;Pv=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Xd.exports=QS(),Xd.exports}var ZS=XS(),WS=(t,e,r,s,o,l,u,d)=>{let m=document.documentElement,h=["light","dark"];function g(C){(Array.isArray(t)?t:[t]).forEach(x=>{let E=x==="class",T=E&&l?o.map(k=>l[k]||k):o;E?(m.classList.remove(...T),m.classList.add(l&&l[C]?l[C]:C)):m.setAttribute(x,C)}),v(C)}function v(C){d&&h.includes(C)&&(m.style.colorScheme=C)}function b(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(s)g(s);else try{let C=localStorage.getItem(e)||r,x=u&&C==="system"?b():C;g(x)}catch{}},JS=_.createContext(void 0),e2={setTheme:t=>{},themes:[]},t2=()=>{var t;return(t=_.useContext(JS))!=null?t:e2};_.memo(({forcedTheme:t,storageKey:e,attribute:r,enableSystem:s,enableColorScheme:o,defaultTheme:l,value:u,themes:d,nonce:m,scriptProps:h})=>{let g=JSON.stringify([r,e,l,t,d,u,s,o]).slice(1,-1);return _.createElement("script",{...h,suppressHydrationWarning:!0,nonce:typeof window>"u"?m:"",dangerouslySetInnerHTML:{__html:`(${WS.toString()})(${g})`}})});var Nb=Rb();const Ob=ym(Nb);function n2(t){if(typeof document>"u")return;let e=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}const r2=t=>{switch(t){case"success":return i2;case"info":return l2;case"warning":return o2;case"error":return c2;default:return null}},a2=Array(12).fill(0),s2=({visible:t,className:e})=>ae.createElement("div",{className:["sonner-loading-wrapper",e].filter(
vendor: 5,283 bytes, line 49
49Boolean).join(" "),"data-visible":t},ae.createElement("div",{className:"sonner-spinner"},a2.map((r,s)=>ae.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${s}`})))),i2=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ae.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),o2=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},ae.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),l2=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ae.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),c2=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},ae.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),u2=ae.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},ae.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),ae.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),f2=()=>{const[t,e]=ae.useState(document.hidden);return ae.useEffect(()=>{const r=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),t};let $h=1;class d2{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const r=this.subscribers.indexOf(e);this.subscribers.splice(r,1)}),this.publish=e=>{this.subscribers.forEach(r=>r(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var r;const{message:s,...o}=e,l=typeof(e==null?void 0:e.id)=="number"||((r=e.id)==null?void 0:r.length)>0?e.id:$h++,u=this.toasts.find(m=>m.id===l),d=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(l)&&this.dismissedToasts.delete(l),u?this.toasts=this.toasts.map(m=>m.id===l?(this.publish({...m,...e,id:l,title:s}),{...m,...e,id:l,dismissible:d,title:s}):m):this.addToast({title:s,...o,dismissible:d,id:l}),l},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:e,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(s=>s({id:r.id,dismiss:!0}))}),e),this.message=(e,r)=>this.create({...r,message:e}),this.error=(e,r)=>this.create({...r,message:e,type:"error"}),this.success=(e,r)=>this.create({...r,type:"success",message:e}),this.info=(e,r)=>this.create({...r,type:"info",message:e}),this.warning=(e,r)=>this.create({...r,type:"warning",message:e}),this.loading=(e,r)=>this.create({...r,type:"loading",message:e}),this.promise=(e,r)=>{if(!r)return;let s;r.loading!==void 0&&(s=this.create({...r,promise:e,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const o=Promise.resolve(e instanceof Function?e():e);let l=s!==void 0,u;const d=o.then(async h=>{if(u=["resolve",h],ae.isValidElement(h))l=!1,this.create({id:s,type:"default",message:h});else if(m2(h)&&!h.ok){l=!1;const v=typeof r.error=="function"?await r.error(`HTTP error! status: ${h.status}`):r.error,b=typeof r.description=="function"?await r.description(`HTTP error! status: ${h.status}`):r.description,x=typeof v=="object"&&!ae.isValidElement(v)?v:{message:v};this.create({id:s,type:"error",description:b,...x})}else if(h instanceof Error){l=!1;const v=typeof r.error=="function"?await r.error(h):r.error,b=typeof r.description=="function"?await r.description(h):r.description,x=typeof v=="object"&&!ae.isValidElement(v)?v:{message:v};this.create({id:s,type:"error",description:b,...x})}else if(r.success!==void 0){l=!1;const v=typeof r.success=="function"?await r.success(h):r.success,b=typeof r.description=="function"?await r.description(h):r.description,x=typeof v=="object"&&!ae.isValidElement(v)?v:{message:v};this.create({id:s,type:"success",description:b,...x})}}).catch(async h=>{if(u=["reject",h],r.error!==void 0){l=!1;const g=typeof r.error=="function"?await r.error(h):r.error,v=typeof r.description=="function"?await r.description(h):r.description,C=typeof g=="object"&&!ae.isValidElement(g)?g:{message:g};this.create({id:s,type:"error",description:v,...C})}}).finally(()=>{l&&(this.dismiss(s),s=void 0),r.finally==null||r.finally.call(r)}),m=()=>new Promise((h,g)=>d.then(()=>u[0]==="reject"?g(u[1]):h(u[1])).catch(g));
vendor: 804 bytes, line 49
49return typeof s!="string"&&typeof s!="number"?{unwrap:m}:Object.assign(s,{unwrap:m})},this.custom=(e,r)=>{const s=(r==null?void 0:r.id)||$h++;return this.create({jsx:e(s),id:s,...r}),s},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const sn=new d2,h2=(t,e)=>{const r=(e==null?void 0:e.id)||$h++;return sn.addToast({title:t,...e,id:r}),r},m2=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",p2=h2,g2=()=>sn.toasts,v2=()=>sn.getActiveToasts(),Mb=Object.assign(p2,{success:sn.success,info:sn.info,warning:sn.warning,error:sn.error,custom:sn.custom,message:sn.message,promise:sn.promise,dismiss:sn.dismiss,loading:sn.loading},{getHistory:g2,getToasts:v2});n2
vendor: 14,873 bytes, line 49
49("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function
vendor: 543 bytes, line 49
49Uc(t){return t.label!==void 0}const y2=3,b2="24px",w2="16px",Bv=4e3,x2=356,_2=14,S2=45,E2=200;function lr(...t){return t.filter(Boolean).join(" ")}function C2(t){const[e,r]=t.split("-"),s=[];return e&&s.push(e),r&&s.push(r),s}const T2=t=>{var e,r,s,o,l,u,d,m,h;const{invert:g,toast:v,unstyled:b,interacting:C,setHeights:x,visibleToasts:E,heights:T,index:k,toasts:z,expanded:O,removeToast:Y,defaultRichColors:K,closeButton:re,style:J,cancelButtonStyle:Z,actionButtonStyle:de,className:Ee="",descriptionClassName:je="",duration:ze,position:At,ga
vendor: 13,336 bytes, line 49
49p:kt,expandByDefault:Me,classNames:M,icons:ne,closeButtonAriaLabel:W="Close toast"}=t,[_e,j]=ae.useState(null),[G,ee]=ae.useState(null),[F,se]=ae.useState(!1),[ve,ie]=ae.useState(!1),[Se,Pe]=ae.useState(!1),[ot,Kt]=ae.useState(!1),[An,hn]=ae.useState(!1),[Pa,mr]=ae.useState(0),[Cs,Ts]=ae.useState(0),jt=ae.useRef(v.duration||ze||Bv),Ba=ae.useRef(null),Wt=ae.useRef(null),As=k===0,Vr=k+1<=E,Pt=v.type,kn=v.dismissible!==!1,Fi=v.className||"",Qi=v.descriptionClassName||"",jn=ae.useMemo(()=>T.findIndex(xe=>xe.toastId===v.id)||0,[T,v.id]),Rt=ae.useMemo(()=>{var xe;return(xe=v.closeButton)!=null?xe:re},[v.closeButton,re]),mn=ae.useMemo(()=>v.duration||ze||Bv,[v.duration,ze]),bt=ae.useRef(0),Wn=ae.useRef(0),ks=ae.useRef(0),Jn=ae.useRef(null),[Yr,Fr]=At.split("-"),Rn=ae.useMemo(()=>T.reduce((xe,st,lt)=>lt>=jn?xe:xe+st.height,0),[T,jn]),pr=f2(),er=v.invert||g,$a=Pt==="loading";Wn.current=ae.useMemo(()=>jn*kt+Rn,[jn,Rn]),ae.useEffect(()=>{jt.current=mn},[mn]),ae.useEffect(()=>{se(!0)},[]),ae.useEffect(()=>{const xe=Wt.current;if(xe){const st=xe.getBoundingClientRect().height;return Ts(st),x(lt=>[{toastId:v.id,height:st,position:v.position},...lt]),()=>x(lt=>lt.filter(wt=>wt.toastId!==v.id))}},[x,v.id]),ae.useLayoutEffect(()=>{if(!F)return;const xe=Wt.current,st=xe.style.height;xe.style.height="auto";const lt=xe.getBoundingClientRect().height;xe.style.height=st,Ts(lt),x(wt=>wt.find(P=>P.toastId===v.id)?wt.map(P=>P.toastId===v.id?{...P,height:lt}:P):[{toastId:v.id,height:lt,position:v.position},...wt])},[F,v.title,v.description,x,v.id,v.jsx,v.action,v.cancel]);const pn=ae.useCallback(()=>{ie(!0),mr(Wn.current),x(xe=>xe.filter(st=>st.toastId!==v.id)),setTimeout(()=>{Y(v)},E2)},[v,Y,x,Wn]);ae.useEffect(()=>{if(v.promise&&Pt==="loading"||v.duration===1/0||v.type==="loading")return;let xe;return O||C||pr?(()=>{if(ks.current<bt.current){const wt=new Date().getTime()-bt.current;jt.current=jt.current-wt}ks.current=new Date().getTime()})():(()=>{jt.current!==1/0&&(bt.current=new Date().getTime(),xe=setTimeout(()=>{v.onAutoClose==null||v.onAutoClose.call(v,v),pn()},jt.current))})(),()=>clearTimeout(xe)},[O,C,v,Pt,pr,pn]),ae.useEffect(()=>{v.delete&&(pn(),v.onDismiss==null||v.onDismiss.call(v,v))},[pn,v.delete]);function js(){var xe;if(ne!=null&&ne.loading){var st;return ae.createElement("div",{className:lr(M==null?void 0:M.loader,v==null||(st=v.classNames)==null?void 0:st.loader,"sonner-loader"),"data-visible":Pt==="loading"},ne.loading)}return ae.createElement(s2,{className:lr(M==null?void 0:M.loader,v==null||(xe=v.classNames)==null?void 0:xe.loader),visible:Pt==="loading"})}const qa=v.icon||(ne==null?void 0:ne[Pt])||r2(Pt);var tr,Rs;return ae.createElement("li",{tabIndex:0,ref:Wt,className:lr(Ee,Fi,M==null?void 0:M.toast,v==null||(e=v.classNames)==null?void 0:e.toast,M==null?void 0:M.default,M==null?void 0:M[Pt],v==null||(r=v.classNames)==null?void 0:r[Pt]),"data-sonner-toast":"","data-rich-colors":(tr=v.richColors)!=null?tr:K,"data-styled":!(v.jsx||v.unstyled||b),"data-mounted":F,"data-promise":!!v.promise,"data-swiped":An,"data-removed":ve,"data-visible":Vr,"data-y-position":Yr,"data-x-position":Fr,"data-index":k,"data-front":As,"data-swiping":Se,"data-dismissible":kn,"data-type":Pt,"data-invert":er,"data-swipe-out":ot,"data-swipe-direction":G,"data-expanded":!!(O||Me&&F),style:{"--index":k,"--toasts-before":k,"--z-index":z.length-k,"--offset":`${ve?Pa:Wn.current}px`,"--initial-height":Me?"auto":`${Cs}px`,...J,...v.style},onDragEnd:()=>{Pe(!1),j(null),Jn.current=null},onPointerDown:xe=>{$a||!kn||(Ba.current=new Date,mr(Wn.current),xe.target.setPointerCapture(xe.pointerId),xe.target.tagName!=="BUTTON"&&(Pe(!0),Jn.current={x:xe.clientX,y:xe.clientY}))},onPointerUp:()=>{var xe,st,lt;if(ot||!kn)return;Jn.current=null;const wt=Number(((xe=Wt.current)==null?void 0:xe.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),gr=Number(((st=Wt.current)==null?void 0:st.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),P=new Date().getTime()-((lt=Ba.current)==null?void 0:lt.getTime()),Fe=_e==="x"?wt:gr,qe=Math.abs(Fe)/P;if(Math.abs(Fe)>=S2||qe>.11){mr(Wn.current),v.onDismiss==null||v.onDismiss.call(v,v),ee(_e==="x"?wt>0?"right":"left":gr>0?"down":"up"),pn(),Kt(!0);return}else{var Ge,te;(Ge=Wt.current)==null||Ge.style.setProperty("--swipe-amount-x","0px"),(te=Wt.current)==null||te.style.setProperty("--swipe-amount-y","0px")}hn(!1),Pe(!1),j(null)},onPointerMove:xe=>{var st,lt,wt;if(!Jn.current||!kn||((st=window.getSelection())==null?void 0:st.toString().length)>0)return;const P=xe.clientY-Jn.current.y,Fe=xe.clientX-Jn.current.x;var qe;const Ge=(qe=t.swipeDirections)!=null?qe:C2(At);!_e&&(Math.abs(Fe)>1||Math.abs(P)>1)&&j(Math.abs(Fe)>Math.abs(P)?"x":"y");let te={x:0,y:0};const Nn=Qe=>1/(1.5+Math.abs(Qe)/20);if(_e==="y"){if(Ge.includes("top")||Ge.includes("bottom"))if(Ge.includes("top")&&P<0||Ge.includes("bottom")&&P>0)te.y=P;else{const Qe=P*Nn(P);te.y=Math.abs(Qe)<Math.abs(P)?Qe:P}}else if(_e==="x"&&(Ge.includes("left")||Ge.includes("right")))if(Ge.includes("left")&&Fe<0||Ge.includes("right")&&Fe>0)te.x=Fe;else{const Qe=Fe*Nn(Fe);te.x=Math.abs(Qe)<Math.abs(Fe)?Qe:Fe}(Math.abs(te.x)>0||Math.abs(te.y)>0)&&hn(!0),(lt=Wt.current)==null||lt.style.setProperty("--swipe-amount-x",`${te.x}px`),(wt=Wt.current)==null||wt.style.setProperty("--swipe-amount-y",`${te.y}px`)}},Rt&&!v.jsx&&Pt!=="loading"?ae.createElement("button",{"aria-label":W,"data-disabled":$a,"data-close-button":!0,onClick:$a||!kn?()=>{}:()=>{pn(),v.onDismiss==null||v.onDismiss.call(v,v)},className:lr(M==null?void 0:M.closeButton,v==null||(s=v.classNames)==null?void 0:s.closeButton)},(Rs=ne==null?void 0:ne.close)!=null?Rs:u2):null,(Pt||v.icon||v.promise)&&v.icon!==null&&((ne==null?void 0:ne[Pt])!==null||v.icon)?ae.createElement("div",{"data-icon":"",className:lr(M==null?void 0:M.icon,v==null||(o=v.classNames)==null?void 0:o.icon)},v.promise||v.type==="loading"&&!v.icon?v.icon||js():null,v.type!=="loading"?qa:null):null,ae.createElement("div",{"data-content":"",className:lr(M==null?void 0:M.content,v==null||(l=v.classNames)==null?void 0:l.content)},ae.createElement("div",{"data-title":"",className:lr(M==null?void 0:M.title,v==null||(u=v.classNames)==null?void 0:u.title)},v.jsx?v.jsx:typeof v.title=="function"?v.title():v.title),v.description?ae.createElement("div",{"data-description":"",className:lr(je,Qi,M==null?void 0:M.description,v==null||(d=v.classNames)==null?void 0:d.description)},typeof v.description=="function"?v.description():v.description):null),ae.isValidElement(v.cancel)?v.cancel:v.cancel&&Uc(v.cancel)?ae.createElement("button",{"data-button":!0,"data-cancel":!0,style:v.cancelButtonStyle||Z,onClick:xe=>{Uc(v.cancel)&&kn&&(v.cancel.onClick==null||v.cancel.onClick.call(v.cancel,xe),pn())},className:lr(M==null?void 0:M.cancelButton,v==null||(m=v.classNames)==null?void 0:m.cancelButton)},v.cancel.label):null,ae.isValidElement(v.action)?v.action:v.action&&Uc(v.action)?ae.createElement("button",{"data-button":!0,"data-action":!0,style:v.actionButtonStyle||de,onClick:xe=>{Uc(v.action)&&(v.action.onClick==null||v.action.onClick.call(v.action,xe),!xe.defaultPrevented&&pn())},className:lr(M==null?void 0:M.actionButton,v==null||(h=v.classNames)==null?void 0:h.actionButton)},v.action.label):null)};function $v(){if(typeof window>"u"||typeof document>"u")return"ltr";const t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function A2(t,e){const r={};return[t,e].forEach((s,o)=>{const l=o===1,u=l?"--mobile-offset":"--offset",d=l?w2:b2;function m(h){["top","right","bottom","left"].forEach(g=>{r[`${u}-${g}`]=typeof h=="number"?`${h}px`:h})}typeof s=="number"||typeof s=="string"?m(s):typeof s=="object"?["top","right","bottom","left"].forEach(h=>{s[h]===void 0?r[`${u}-${h}`]=d:r[`${u}-${h}`]=typeof s[h]=="number"?`${s[h]}px`:s[h]}):m(d)}),r}const k2=ae.forwardRef(function(e,r){const{invert:s,position:o="bottom-right",hotkey:l=["altKey","KeyT"],expand:u,closeButton:d,className:m,offset:h,mobileOffset:g,theme:v="light",richColors:b,duration:C,style:x,visibleToasts:E=y2,toastOptions:T,dir:k=$v(),gap:z=_2,icons:O,containerAriaLabel:Y="Notifications"}=e,[K,re]=ae.useState([]),J=ae.useMemo(()=>Array.from(new Set([o].concat(K.filter(G=>G.position).map(G=>G.position)))),[K,o]),[Z,de]=ae.useState([]),[Ee,je]=ae.useState(!1),[ze,At]=ae.useState(!1),[kt,Me]=ae.useState(v!=="system"?v:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),M=ae.useRef(null),ne=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),W=ae.useRef(null),_e=ae.useRef(!1),j=ae.useCallback(G=>{re(ee=>{var F;return(F=ee.find(se=>se.id===G.id))!=null&&F.delete||sn.dismiss(G.id),ee.filter(({id:se})=>se!==G.id)})},[]);return ae.useEffect(()=>sn.subscribe(G=>{if(G.dismiss){requestAnimationFrame(()=>{re(ee=>ee.map(F=>F.id===G.id?{...F,delete:!0}:F))});return}setTimeout(()=>{Ob.flushSync(()=>{re(ee=>{const F=ee.findIndex(se=>se.id===G.id);return F!==-1?[...ee.slice(0,F),{...ee[F],...G},...ee.slice(F+1)]:[G,...ee]})})})}),[K]),ae.useEffect(()=>{if(v!=="system"){Me(v);return}if(v==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Me("dark"):Me("light")),typeof window>"u")return;const G=window.matchMedia("(prefers-color-scheme: dark)");try{G.addEventListener("change",({matches:ee})=>{Me(ee?"dark":"light")})}catch{G.addListener(({matches:F})=>{try{Me(F?"dark":"light")}catch(se){console.error(se)}})}},[v]),ae.useEffect(()=>{K.length<=1&&je(!1)},[K]),ae.useEffect(()=>{const G=ee=>{var F;if(l.every(ie=>ee[ie]||ee.code===ie)){var ve;je(!0),(ve=M.current)==null||ve.focus()}ee.code==="Escape"&&(document.activeElement===M.current||(F=M.current)!=null&&F.contains(document.activeElement))&&je(!1)};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[l]),ae.useEffect(()=>{if(M.current)return()=>{W.current&&(W.current.focus({preventScroll:!0}),W.current=null,_e.current=!1)}},[M.current]),ae.createElement("section",{ref:r,"aria-label":`${Y} ${ne}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},J.map((G,ee)=>{var F;const[se,ve]=G.split("-");return K.length?ae.createElement("ol",{key:G,dir:k==="auto"?$v():k,tabIndex:-1,ref:M,className:m,"data-sonner-toaster":!0,"data-sonner-theme":kt,"data-y-position":se,"data-x-position":ve,style:{"--front-toast-height":`${((F=Z[0])==null?void 0:F.height)||0}px`,"--width":`${x2}px`,"--gap":`${z}px`,...x,...A2(h,g)},onBlur:ie=>{_e.current&&!ie.currentTarget.contains(ie.relatedTarget)&&(_e.current=!1,W.current&&(W.current.focus({preventScroll:!0}),W.current=null))},onFocus:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||_e.current||(_e.current=!0,W.current=ie.relatedTarget)},onMouseEnter:()=>je(!0),onMouseMove:()=>je(!0),onMouseLeave:()=>{ze||je(!1)},onDragEnd:()=>je(!1),onPointerDown:ie=>{ie.target instanceof HTMLElement&&ie.target.dataset.dismissible==="false"||At(!0)},onPointerUp:()=>At(!1)},K.filter(ie=>!ie.position&&ee===0||ie.position===G).map((ie,Se)=>{var Pe,ot;return ae.createElement(T2,{key:ie.id,icons:O,index:Se,toast:ie,defaultRichColors:b,duration:(Pe=T==null?void 0:T.duration)!=null?Pe:C,className:T==null?void 0:T.className,descriptionClassName:T==null?void 0:T.descriptionClassName,invert:s,visibleToasts:E,closeButton:(ot=T==null?void 0:T.closeButton)!=null?ot:d,interacting:ze,position:G,style:T==null?void 0:T.style,unstyled:T==null?void 0:T.unstyled,classNames:T==null?void 0:T.classNames,cancelButtonStyle:T==null?void 0:T.cancelButtonStyle,actionButtonStyle:T==null?void 0:T.actionButtonStyle,closeButtonAriaLabel:T==null?void 0:T.closeButtonAriaLabel,removeToast:j,toasts:K.filter(Kt=>Kt.position==ie.position),heights:Z.filter(Kt=>Kt.position==ie.position),setHeights:de,expandByDefault:u,gap:z,expanded:Ee,swipeDirections:e.swipeDirections})})):null}))}),j2=({...t})=>{const{theme:e="system"}=t2();return y.jsx(k2,{theme:e,className:"toaster group",style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)"},...t})},Db="https://chessarena-ai.motiahub.com",R2="wss://ws-chessarena-ai.motiahub.com",N2="https://wmivucnxsfvpbrtaxzvj.supabase.co",O2="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6IndtaXZ1Y254c2Z2cGJydGF4enZqIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTUwODQxODQsImV4cCI6MjA3MDY2MDE4NH0.7NrhFUBHZ6ZClkz7xx2zpC4n5zZwab_8Zzhjr1frDU4",It=[];for(let t=0;t<256;++t)It.push((t+256).toString(16).slice(1));function M2(t,e=0){return(It[t[e+0]]+It[t[e+1]]+It[t[e+2]]+It[t[e+3]]+"-"+It[t[e+4]]+It[t[e+5]]+"-"+It[t[e+6]]+It[t[e+7]]+"-"+It[t[e+8]]+It[t[e+9]]+"-"+It[t[e+10]]+It[t[e+11]]+It[t[e+12]]+It[t[e+13]]+It[t[e+14]]+It[t[e+15]]).toLowerCase()}let eh;const D2=new Uint8Array(16);function L2(){if(!eh){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");eh=crypto.getRandomValues.bind(crypto)}return eh(D2)}const U2=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),qv={randomUUID:U2};function Hv(t,e,r){var o;if(qv.randomUUID&&!t)return qv.randomUUID();t=t||{};
49const s=t.random??((o=t.rng)==null?void 0:o.call(t))??L2();if(s.length<16)throw new Error("Random bytes length must be >= 16");return s[6]=s[6]&15|64,s[8]=s[8]&63|128,M2(s)}class Lb{constructor(e,r){this.customEventListeners=new Map,this.closeListeners=new Set,this.onChangeListeners=new Set,this.sub=e,this.state=r}onEventReceived(e){const r=this.customEventListeners.get(e.type);if(r){const s=e.data;r.forEach(o=>o(s))}}onEvent(e,r){const s=this.customEventListeners.get(e)||[];this.customEventListeners.set(e,[...s,r])}offEvent(e,r){const s=this.customEventListeners.get(e)||[];this.customEventListeners.set(e,s.filter(o=>o!==r))}onClose(e){this.closeListeners.add(e)}close(){this.closeListeners.forEach(e=>e()),this.closeListeners.clear()}addChangeListener(e){this.onChangeListeners.add(e)}removeChangeListener(e){this.onChangeListeners.delete(e)}getState(){return this.state}setState(e){this.state=e,this.onChangeListeners.forEach(r=>r(e))}}class z2 extends Lb{constructor(e,r){super(e,[]),this.sortKey=r,this.lastTimestamp=0,this.lastTimestampMap=new Map}sort(e){const r=this.sortKey;return r?e.sort((s,o)=>{const l=s[r],u=o[r];return l&&u?l.toString().localeCompare(u.toString()):0}):e}setState(e){super.setState(this.sort(e))}listener(e){if(e.event.type==="sync"){if(e.timestamp<this.lastTimestamp)return;this.lastTimestampMap=new Map,this.lastTimestamp=e.timestamp,this.setState(e.event.data)}else if(e.event.type==="create"){const r=e.event.data.id,s=this.getState();s.find(o=>o.id===r)||this.setState([...s,e.event.data])}else if(e.event.type==="update"){const r=e.event.data,s=r.id,o=this.getState(),l=this.lastTimestampMap.get(s);if(l&&l>=e.timestamp)return;this.lastTimestamp=e.timestamp,this.lastTimestampMap.set(s,e.timestamp),this.setState(o.map(u=>u.id===s?r:u))}else if(e.event.type==="delete"){const r=e.event.data.id,s=this.getState();this.lastTimestamp=e.timestamp,this.lastTimestampMap.set(r,e.timestamp),this.setState(s.filter(o=>o.id!==r))}else e.event.type==="event"&&this.onEventReceived(e.event.event)}}class P2 extends Lb{constructor(e){super(e,null),this.lastEventTimestamp=0}listener(e){e.timestamp<=this.lastEventTimestamp||(this.lastEventTimestamp=e.timestamp,e.event.type==="sync"||e.event.type==="create"||e.event.type==="update"?this.setState(e.event.data):e.event.type==="delete"?this.setState(null):e.event.type==="event"&&this.onEventReceived(e.event.event))}}let B2=class{constructor(e){this.adapterFactory=e,this.listeners={},this.ws=this.createSocket()}createSocket(){return this.ws=this.adapterFactory(),this.ws.onMessage(e=>this.messageListener(e)),this.ws.onOpen(()=>this.onSocketOpen()),this.ws.onClose(()=>this.onSocketClose()),this.ws}subscribeItem(e,r,s){const o=Hv(),l={streamName:e,groupId:r,id:s,subscriptionId:o},u=new P2(l);return this.subscribe(u),u}subscribeGroup(e,r,s){const o=Hv(),l={streamName:e,groupId:r,subscriptionId:o},u=new z2(l,s);return this.subscribe(u),u}close(){this.listeners={},this.ws.close()}onSocketClose(){setTimeout(()=>this.createSocket(),2e3)}onSocketOpen(){Object.values(this.listeners).forEach(e=>{e.forEach(r=>this.join(r))})}messageListener(e){var o,l;const r=JSON.parse(e),s=this.roomName(r);if((o=this.listeners[s])==null||o.forEach(u=>u.listener(r)),r.id&&r.event.type!=="sync"){const u=this.roomName({streamName:r.streamName,groupId:r.groupId});(l=this.listeners[u])==null||l.forEach(d=>d.listener(r))}}subscribe(e){const r=this.roomName(e.sub);this.listeners[r]||(this.listeners[r]=new Set),this.listeners[r].add(e),this.join(e),e.onClose(()=>{var s;(s=this.listeners[r])==null||s.delete(e),this.leave(e)})}join(e){this.ws.isOpen()&&this.ws.send(JSON.stringify({type:"join",data:e.sub}))}leave(e){this.ws.isOpen()&&this.ws.send(JSON.stringify({type:"leave",data:e.sub}))}roomName(e){return e.id?`${e.streamName}:group:${e.groupId}:item:${e.id}`:`${e.streamName}:group:${e.groupId}`}};class $2{constructor(e){this.address=e,this.onMessageListeners=[],this.onOpenListeners=[],this.onCloseListeners=[],this.ws=new WebSocket(this.address)}connect(){}send(e){this.ws.send(e)}onMessage(e){const r=s=>e(s.data);this.ws.addEventListener("message",r),this.onMessageListeners.push(r)}onOpen(e){this.ws.addEventListener("open",e),this.onOpenListeners.push(e)}onClose(e){this.ws.addEventListener("close",e),this.onCloseListeners.push(e)}
49close(){this.ws.close(),this.onMessageListeners.forEach(e=>this.ws.removeEventListener("message",e)),this.onOpenListeners.forEach(e=>this.ws.removeEventListener("open",e)),this.onCloseListeners.forEach(e=>this.ws.removeEventListener("close",e))}isOpen(){return this.ws.readyState===WebSocket.OPEN}}class q2 extends B2{constructor(e){super(()=>new $2(e))}}const Ub=ae.createContext({stream:null}),H2=({children:t,address:e})=>{const[r,s]=_.useState(null);return _.useEffect(()=>{const o=new q2(e);return s(o),()=>o.close()},[e]),y.jsx(Ub.Provider,{value:{stream:r},children:t})},zb=()=>{const t=ae.useContext(Ub);if(!t)throw new Error("useMotiaStream must be used within a MotiaStreamProvider");return t},I2=t=>{const{stream:e}=zb(),[r,s]=_.useState(null),[o,l]=_.useState(null);return _.useEffect(()=>{if(!(t!=null&&t.streamName)||!(t!=null&&t.groupId)||!(t!=null&&t.id)||!e)return;const u=e.subscribeItem(t.streamName,t.groupId,t.id);return u.addChangeListener(d=>s(d)),l(u),()=>{s(null),l(null),u.close()}},[e,t==null?void 0:t.streamName,t==null?void 0:t.groupId,t==null?void 0:t.id]),{data:r,event:o}},Eu=t=>{const{stream:e}=zb(),[r,s]=_.useState([]),[o,l]=_.useState(null);return _.useEffect(()=>{if(!(t!=null&&t.streamName)||!(t!=null&&t.groupId)||!e)return;const u=e.subscribeGroup(t.streamName,t.groupId,t.sortKey);return u.addChangeListener(d=>s(d)),l(u),()=>{s([]),l(null),u.close()}},[e,t==null?void 0:t.streamName,t==null?void 0:t.groupId,t==null?void 0:t.sortKey]),{data:r,event:o}},Iv=({event:t,type:e,listener:r},s)=>{_.useEffect(()=>{if(t)return t.onEvent(e,r),()=>t.offEvent(e,r)},[t,e,...s])};var Qo={},Gv;function G2(){if(Gv)return Qo;Gv=1,Object.defineProperty(Qo,"__esModule",{value:!0}),Qo.parse=u,Qo.serialize=h;const t=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,e=/^[\u0021-\u003A\u003C-\u007E]*$/,r=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,s=/^[\u0020-\u003A\u003D-\u007E]*$/,o=Object.prototype.toString,l=(()=>{const b=function(){};return b.prototype=Object.create(null),b})();function u(b,C){const x=new l,E=b.length;if(E<2)return x;const T=(C==null?void 0:C.decode)||g;let k=0;do{const z=b.indexOf("=",k);if(z===-1)break;const O=b.indexOf(";",k),Y=O===-1?E:O;if(z>Y){k=b.lastIndexOf(";",z-1)+1;continue}const K=d(b,k,z),re=m(b,z,K),J=b.slice(K,re);if(x[J]===void 0){let Z=d(b,z+1,Y),de=m(b,Y,Z);const Ee=T(b.slice(Z,de));x[J]=Ee}k=Y+1}while(k<E);return x}function d(b,C,x){do{const E=b.charCodeAt(C);if(E!==32&&E!==9)return C}while(++C<x);return x}function m(b,C,x){for(;C>x;){const E=b.charCodeAt(--C);if(E!==32&&E!==9)return C+1}return x}function h(b,C,x){const E=(x==null?void 0:x.encode)||encodeURIComponent;if(!t.test(b))throw new TypeError(`argument name is invalid: ${b}`);const T=E(C);if(!e.test(T))throw new TypeError(`argument val is invalid: ${C}`);let k=b+"="+T;if(!x)return k;if(x.maxAge!==void 0){if(!Number.isInteger(x.maxAge))throw new TypeError(`option maxAge is invalid: ${x.maxAge}`);k+="; Max-Age="+x.maxAge}if(x.domain){if(!r.test(x.domain))throw new TypeError(`option domain is invalid: ${x.domain}`);k+="; Domain="+x.domain}if(x.path){if(!s.test(x.path))throw new TypeError(`option path is invalid: ${x.path}`);k+="; Path="+x.path}if(x.expires){if(!v(x.expires)||!Number.isFinite(x.expires.valueOf()))throw new TypeError(`option expires is invali
49d: ${x.expires}`);k+="; Expires="+x.expires.toUTCString()}if(x.httpOnly&&(k+="; HttpOnly"),x.secure&&(k+="; Secure"),x.partitioned&&(k+="; Partitioned"),x.priority)switch(typeof x.priority=="string"?x.priority.toLowerCase():void 0){case"low":k+="; Priority=Low";break;case"medium":k+="; Priority=Medium";break;case"high":k+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${x.priority}`)}if(x.sameSite)switch(typeof x.sameSite=="string"?x.sameSite.toLowerCase():x.sameSite){case!0:case"strict":k+="; SameSite=Strict";break;case"lax":k+="; SameSite=Lax";break;case"none":k+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${x.sameSite}`)}return k}function g(b){if(b.indexOf("%")===-1)return b;try{return decodeURIComponent(b)}catch{return b}}function v(b){return o.call(b)==="[object Date]"}return Qo}G2();var Kv="popstate";function K2(t={}){function e(s,o){let{pathname:l,search:u,hash:d}=s.location;return qh("",{pathname:l,search:u,hash:d},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function r(s,o){return typeof o=="string"?o:fl(o)}return Y2(e,r,null,t)}function at(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Vn(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function V2(){return Math.random().toString(36).substring(2,10)}function Vv(t,e){return{usr:t.state,key:t.key,idx:e}}function qh(t,e,r=null,s){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?Li(e):e,state:r,key:e&&e.key||s||V2()}}function fl({pathname:t="/",search:e="",hash:r=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Li(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substring(r),t=t.substring(0,r));let s=t.indexOf("?");s>=0&&(e.search=t.substring(s),t=t.substring(0,s)),t&&(e.pathname=t)}return e}function Y2(t,e,r,s={}){let{window:o=document.defaultView,v5Compat:l=!1}=s,u=o.history,d="POP",m=null,h=g();h==null&&(h=0,u.replaceState({...u.state,idx:h},""));function g(){return(u.state||{idx:null}).idx}function v(){d="POP";let T=g(),k=T==null?null:T-h;h=T,m&&m({action:d,location:E.location,delta:k})}function b(T,k){d="PUSH";let z=qh(E.location,T,k);h=g()+1;let O=Vv(z,h),Y=E.createHref(z);try{u.pushState(O,"",Y)}catch(K){if(K instanceof DOMException&&K.name==="DataCloneError")throw K;o.location.assign(Y)}l&&m&&m({action:d,location:E.location,delta:1})}function C(T,k){d="REPLACE";let z=qh(E.location,T,k);h=g();let O=Vv(z,h),Y=E.createHref(z);u.replaceState(O,"",Y),l&&m&&m({action:d,location:E.location,delta:0})}function x(T){return F2(T)}let E={get action(){return d},get location(){return t(o,u)},listen(T){if(m)throw new Error("A history only accepts one active listener");return o.addEventListener(Kv,v),m=T,()=>{o.removeEventListener(Kv,v),m=null}},createHref(T){return e(o,T)},createURL:x,encodeLocation(T){let k=x(T);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:b,replace:C,go(T){return u.go(T)}};return E}function F2(t,e=!1){let r="http://localhost";
49typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),at(r,"No window.location.(origin|href) available to create URL");let s=typeof t=="string"?t:fl(t);return s=s.replace(/ $/,"%20"),!e&&s.startsWith("//")&&(s=r+s),new URL(s,r)}function Pb(t,e,r="/"){return Q2(t,e,r,!1)}function Q2(t,e,r,s){let o=typeof e=="string"?Li(e):e,l=Kr(o.pathname||"/",r);if(l==null)return null;let u=Bb(t);X2(u);let d=null;for(let m=0;d==null&&m<u.length;++m){let h=oE(l);d=sE(u[m],h,s)}return d}function Bb(t,e=[],r=[],s=""){let o=(l,u,d)=>{let m={relativePath:d===void 0?l.path||"":d,caseSensitive:l.caseSensitive===!0,childrenIndex:u,route:l};m.relativePath.startsWith("/")&&(at(m.relativePath.startsWith(s),`Absolute route path "${m.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(s.length));let h=Ir([s,m.relativePath]),g=r.concat(m);l.children&&l.children.length>0&&(at(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),Bb(l.children,e,g,h)),!(l.path==null&&!l.index)&&e.push({path:h,score:rE(h,l.index),routesMeta:g})};return t.forEach((l,u)=>{var d;if(l.path===""||!((d=l.path)!=null&&d.includes("?")))o(l,u);else for(let m of $b(l.path))o(l,u,m)}),e}function $b(t){let e=t.split("/");if(e.length===0)return[];let[r,...s]=e,o=r.endsWith("?"),l=r.replace(/\?$/,"");if(s.length===0)return o?[l,""]:[l];let u=$b(s.join("/")),d=[];return d.push(...u.map(m=>m===""?l:[l,m].join("/"))),o&&d.push(...u),d.map(m=>t.startsWith("/")&&m===""?"/":m)}function X2(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:aE(e.routesMeta.map(s=>s.childrenIndex),r.routesMeta.map(s=>s.childrenIndex)))}var Z2=/^:[\w-]+$/,W2=3,J2=2,eE=1,tE=10,nE=-2,Yv=t=>t==="*";function rE(t,e){let r=t.split("/"),s=r.length;return r.some(Yv)&&(s+=nE),e&&(s+=J2),r.filter(o=>!Yv(o)).reduce((o,l)=>o+(Z2.test(l)?W2:l===""?eE:tE),s)}function aE(t,e){return t.length===e.length&&t.slice(0,-1).every((s,o)=>s===e[o])?t[t.length-1]-e[e.length-1]:0}function sE(t,e,r=!1){let{routesMeta:s}=t,o={},l="/",u=[];for(let d=0;d<s.length;++d){let m=s[d],h=d===s.length-1,g=l==="/"?e:e.slice(l.length)||"/",v=cu({path:m.relativePath,caseSensitive:m.caseSensitive,end:h},g),b=m.route;if(!v&&h&&r&&!s[s.length-1].route.index&&(v=cu({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},g)),!v)return null;
49Object.assign(o,v.params),u.push({params:o,pathname:Ir([l,v.pathname]),pathnameBase:fE(Ir([l,v.pathnameBase])),route:b}),v.pathnameBase!=="/"&&(l=Ir([l,v.pathnameBase]))}return u}function cu(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[r,s]=iE(t.path,t.caseSensitive,t.end),o=e.match(r);if(!o)return null;let l=o[0],u=l.replace(/(.)\/+$/,"$1"),d=o.slice(1);return{params:s.reduce((h,{paramName:g,isOptional:v},b)=>{if(g==="*"){let x=d[b]||"";u=l.slice(0,l.length-x.length).replace(/(.)\/+$/,"$1")}const C=d[b];return v&&!C?h[g]=void 0:h[g]=(C||"").replace(/%2F/g,"/"),h},{}),pathname:l,pathnameBase:u,pattern:t}}function iE(t,e=!1,r=!0){Vn(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let s=[],o="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,d,m)=>(s.push({paramName:d,isOptional:m!=null}),m?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(s.push({paramName:"*"}),o+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":t!==""&&t!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,e?void 0:"i"),s]}function oE(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Vn(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function Kr(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,s=t.charAt(r);return s&&s!=="/"?null:t.slice(r)||"/"}function lE(t,e="/"){let{pathname:r,search:s="",hash:o=""}=typeof t=="string"?Li(t):t;return{pathname:r?r.startsWith("/")?r:cE(r,e):e,search:dE(s),hash:hE(o)}}function cE(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function th(t,e,r,s){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function uE(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function bm(t){let e=uE(t);return e.map((r,s)=>s===e.length-1?r.pathname:r.pathnameBase)}function wm(t,e,r,s=!1){let o;typeof t=="string"?o=Li(t):(o={...t},at(!o.pathname||!o.pathname.includes("?"),th("?","pathname","search",o)),at(!o.pathname||!o.pathname.includes("#"),th("#","pathname","hash",o)),at(!o.search||!o.search.includes("#"),th("#","search","hash",o)));let l=t===""||o.pathname==="",u=l?"/":o.pathname,d;if(u==null)d=r;else{let v=e.length-1;if(!s&&u.startsWith("..")){let b=u.split("/");for(;b[0]==="..";)b.shift(),v-=1;o.pathname=b.join("/")}d=v>=0?e[v]:"/"}let m=lE(o,d),h=u&&u!=="/"&&u.endsWith("/"),g=(l||u===".")&&r.endsWith("/");return!m.pathname.endsWith("/")&&(h||g)&&(m.pathname+="/"),m}var Ir=t=>
49t.join("/").replace(/\/\/+/g,"/"),fE=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),dE=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,hE=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function mE(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}var qb=["POST","PUT","PATCH","DELETE"];new Set(qb);var pE=["GET",...qb];new Set(pE);var Ui=_.createContext(null);Ui.displayName="DataRouter";var Cu=_.createContext(null);Cu.displayName="DataRouterState";var Hb=_.createContext({isTransitioning:!1});Hb.displayName="ViewTransition";var gE=_.createContext(new Map);gE.displayName="Fetchers";var vE=_.createContext(null);vE.displayName="Await";var Fn=_.createContext(null);Fn.displayName="Navigation";var gl=_.createContext(null);gl.displayName="Location";var Qn=_.createContext({outlet:null,matches:[],isDataRoute:!1});Qn.displayName="Route";var xm=_.createContext(null);xm.displayName="RouteError";function yE(t,{relative:e}={}){at(zi(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:s}=_.useContext(Fn),{hash:o,pathname:l,search:u}=vl(t,{relative:e}),d=l;return r!=="/"&&(d=l==="/"?r:Ir([r,l])),s.createHref({pathname:d,search:u,hash:o})}function zi(){return _.useContext(gl)!=null}function Ma(){return at(zi(),"useLocation() may be used only in the context of a <Router> component."),_.useContext(gl).location}var Ib="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Gb(t){_.useContext(Fn).static||_.useLayoutEffect(t)}function fn(){let{isDataRoute:t}=_.useContext(Qn);return t?OE():bE()}function bE(){at(zi(),"useNavigate() may be used only in the context of a <Router> component.");let t=_.useContext(Ui),{basename:e,navigator:r}=_.useContext(Fn),{matches:s}=_.useContext(Qn),{pathname:o}=Ma(),l=JSON.stringify(bm(s)),u=_.useRef(!1);return Gb(()=>{u.current=!0}),_.useCallback((m,h={})=>{if(Vn(u.current,Ib),!u.current)return;if(typeof m=="number"){r.go(m);return}let g=wm(m,JSON.parse(l),o,h.relative==="path");t==null&&e!=="/"&&(g.pathname=g.pathname==="/"?e:Ir([e,g.pathname])),(h.replace?r.replace:r.push)(g,h.state,h)},[e,r,l,o,t])}_.createContext(null);function wE(){let{matches:t}=_.useContext(Qn),e=t[t.length-1];return e?e.params:{}}function vl(t,{relative:e}={}){let{matches:r}=_.useContext(Qn),{pathname:s}=Ma(),o=JSON.stringify(bm(r));return _.useMemo(()=>wm(t,JSON.parse(o),s,e==="path"),[t,o,s,e])}function xE(t,e){return Kb(t,e)}function Kb(t,e,r,s){var k;at(zi(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=_.useContext(Fn),{matches:l}=_.useContext(Qn),u=l[l.length-1],d=u?u.params:{},m=u?u.pathname:"/",h=u?u.pathnameBase:"/",g=u&&u.route;{let z=g&&g.path||"";Vb(m,!g||z.endsWith("*")||z.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${z}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. 50 51Please change the parent <Route path="${z}"> to <Route path="${z==="/"?"*":`${z}/*`}">.`)}let v=Ma(),b;if(e){let z=typeof e=="string"?Li(e):e;at(h==="/"||((k=z.pathname)==null?void 0:k.startsWith(h)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${h}" but pathname "${z.pathname}" was given in the \`location\` prop.`),b=z}else b=v;let C=b.pathname||"/",x=C;if(h!=="/"){let z=h.replace(/^\//,"").split("/");x="/"+C.replace(/^\//,"").split("/").slice(z.length).join("/")}let E=Pb(t,{pathname:x});Vn(g||E!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Vn(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let T=TE(E&&E.map(z=>Object.assign({},z,{params:Object.assign({},d,z.params),pathname:Ir([h,o.encodeLocation?o.encodeLocation(z.pathname).pathname:z.pathname]),pathnameBase:z.pathnameBase==="/"?h:Ir([h,o.encodeLocation?o.encodeLocation(z.pathnameBase).pathname:z.pathnameBase])})),l,r,s);return e&&T?_.createElement(gl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...b},navigationType:"POP"}},T):T}function _E(){let t=NE(),e=mE(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,s="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:s},l={padding:"2px 4px",backgroundColor:s},u=null;return console.error("Error handled by React Router default ErrorBoundary:",t),u=_.createElement(_.Fragment,null,_.createElement("p",null,"ð¿ Hey developer ð"),_.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",_.createElement("code",{style:l},"ErrorBoundary")," or"," ",_.createElement("code",{style:l},"errorElement")," prop on your route.")),_.createElement(_.Fragment,null,_.createElement("h2",null,"Unexpected Application
51Error!"),_.createElement("h3",{style:{fontStyle:"italic"}},e),r?_.createElement("pre",{style:o},r):null,u)}var SE=_.createElement(_E,null),EE=class extends _.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){console.error("React Router caught the following error during render",t,e)}render(){return this.state.error!==void 0?_.createElement(Qn.Provider,{value:this.props.routeContext},_.createElement(xm.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function CE({routeContext:t,match:e,children:r}){let s=_.useContext(Ui);return s&&s.static&&s.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=e.route.id),_.createElement(Qn.Provider,{value:t},r)}function TE(t,e=[],r=null,s=null){if(t==null){if(!r)return null;if(r.errors)t=r.matches;else if(e.length===0&&!r.initialized&&r.matches.length>0)t=r.matches;else return null}let o=t,l=r==null?void 0:r.errors;if(l!=null){let m=o.findIndex(h=>h.route.id&&(l==null?void 0:l[h.route.id])!==void 0);at(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),o=o.slice(0,Math.min(o.length,m+1))}let u=!1,d=-1;if(r)for(let m=0;m<o.length;m++){let h=o[m];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(d=m),h.route.id){let{loaderData:g,errors:v}=r,b=h.route.loader&&!g.hasOwnProperty(h.route.id)&&(!v||v[h.route.id]===void 0);if(h.route.lazy||b){u=!0,d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}return o.reduceRight((m,h,g)=>{let v,b=!1,C=null,x=null;r&&(v=l&&h.route.id?l[h.route.id]:void 0,C=h.route.errorElement||SE,u&&(d<0&&g===0?(Vb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,x=null):d===g&&(b=!0,x=h.route.hydrateFallbackElement||null)));let E=e.concat(o.slice(0,g+1)),T=()=>{let k;return v?k=C:b?k=x:h.route.Component?k=_.createElement(h.route.Component,null):h.route.element?k=h.route.element:k=m,_.createElement(CE,{match:h,routeContext:{outlet:m,matches:E,isDataRoute:r!=null},children:k})};return r&&(h.route.ErrorBoundary||h.route.errorElement||g===0)?_.createElement(EE,{location:r.location,revalidation:r.revalidation,component:C,error:v,children:T(),routeContext:{outlet:null,matches:E,isDataRoute:!0}}):T()},null)}function _m(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function AE(t){let e=_.useContext(Ui);return at(e,_m(t)),e}function kE(t){let e=_.useContext(Cu);return at(e,_m(t)),e}function jE(t){let e=_.useContext(Qn);return at(e,_m(t)),e}function Sm(t){let e=jE(t),r=e.matches[e.matches.length-1];return at(r.route.id,`${t} can only be used on routes that contain a unique "id"`),r.route.id}function RE(){return Sm("useRouteId")}function NE(){var s;let t=_.useContext(xm),e=kE("useRouteError"),r=Sm("useRouteError");return t!==void 0?t:(s=e.errors)==null?void 0:s[r]}function OE(){let{router:t}=AE("useNavigate"),e=Sm("useNavigate"),r=_.useRef(!1);return Gb(()=>{r.current=!0}),_.useCallback(async(o,l={})=>{Vn(r.current,Ib),r.current&&(typeof o=="number"?t.navigate(o):await t.navigate(o,{fromRouteId:e,...l}))},[t,e])}var Fv={};function Vb(t,e,r){!e&&!Fv[t]&&(Fv[t]=!0,Vn(!1,r))}_.memo(ME);function ME({routes:t,future:e,state:r}){return Kb(t,void 0,r,e)}function DE({to:t,replace:e,state:r,relative:s}){at(zi(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=_.useContext(Fn);Vn(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:l}=_.useContext(Qn),{pathname:u}=Ma(),d=fn(),m=wm(t,bm(l),u,s==="path"),h=JSON.stringify(m);return _.useEffect(()=>{d(JSON.parse(h),{replace:e,state:r,relative:s})},[d,h,s,e,r]),null}function Pr(t){at(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function LE({basename:t="/",children:e=null,location:r,navigationType:s="POP",navigator:o,static:l=!1}){at(!zi(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=t.replace(/^\/*/,"/"),d=_.useMemo(()=>({basename:u,navigator:o,static:l,future:{}}),[u,o,l]);typeof r=="string"&&(r=Li(r));
51let{pathname:m="/",search:h="",hash:g="",state:v=null,key:b="default"}=r,C=_.useMemo(()=>{let x=Kr(m,u);return x==null?null:{location:{pathname:x,search:h,hash:g,state:v,key:b},navigationType:s}},[u,m,h,g,v,b,s]);return Vn(C!=null,`<Router basename="${u}"> is not able to match the URL "${m}${h}${g}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:_.createElement(Fn.Provider,{value:d},_.createElement(gl.Provider,{children:e,value:C}))}function UE({children:t,location:e}){return xE(Hh(t),e)}function Hh(t,e=[]){let r=[];return _.Children.forEach(t,(s,o)=>{if(!_.isValidElement(s))return;let l=[...e,o];if(s.type===_.Fragment){r.push.apply(r,Hh(s.props.children,l));return}at(s.type===Pr,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),at(!s.props.index||!s.props.children,"An index route cannot have child routes.");let u={id:s.props.id||l.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(u.children=Hh(s.props.children,l)),r.push(u)}),r}var eu="get",tu="application/x-www-form-urlencoded";function Tu(t){return t!=null&&typeof t.tagName=="string"}function zE(t){return Tu(t)&&t.tagName.toLowerCase()==="button"}function PE(t){return Tu(t)&&t.tagName.toLowerCase()==="form"}function BE(t){return Tu(t)&&t.tagName.toLowerCase()==="input"}function $E(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function qE(t,e){return t.button===0&&(!e||e==="_self")&&!$E(t)}var zc=null;function HE(){if(zc===null)try{new FormData(document.createElement("form"),0),zc=!1}catch{zc=!0}return zc}var IE=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function nh(t){return t!=null&&!IE.has(t)?(Vn(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${tu}"`),null):t}function GE(t,e){let r,s,o,l,u;if(PE(t)){let d=t.getAttribute("action");s=d?Kr(d,e):null,r=t.getAttribute("method")||eu,o=nh(t.getAttribute("enctype"))||tu,l=new FormData(t)}else if(zE(t)||BE(t)&&(t.type==="submit"||t.type==="image")){let d=t.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let m=t.getAttribute("formaction")||d.getAttribute("action");if(s=m?Kr(m,e):null,r=t.getAttribute("formmethod")||d.getAttribute("method")||eu,o=nh(t.getAttribute("formenctype"))||nh(d.getAttribute("enctype"))||tu,l=new FormData(d,t),!HE()){let{name:h,type:g,value:v}=t;if(g==="image"){let b=h?`${h}.`:"";l.append(`${b}x`,"0"),l.append(`${b}y`,"0")}else h&&l.append(h,v)}}else{if(Tu(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=eu,s=null,o=tu,u=t}return l&&o==="text/plain"&&(u=l,l=void 0),{action:s,method:r.toLowerCase(),encType:o,formData:l,body:u}}function Em(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}async function KE(t,e){if(t.id in e)return e[t.id];try{let r=await import(t.module);return e[t.id]=r,r}catch(r){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function VE(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function YE(t,e,r){let s=await Promise.all(t.map(async o=>{let l=e.routes[o.route.id];if(l){let u=await KE(l,r);return u.links?u.links():[]}return[]}));return ZE(s.flat(1).filter(VE).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function Qv(t,e,r,s,o,l){let u=(m,h)=>r[h]?m.route.id!==r[h].route.id:!0,d=(m,h)=>{var g;return r[h].pathname!==m.pathname||((g=r[h].route.path)==null?void 0:g.endsWith("*"))&&r[h].params["*"]!==m.params["*"]};return l==="assets"?e.filter((m,h)=>u(m,h)||d(m,h)):l==="data"?e.filter((m,h)=>{var v;let g=s.routes[m.route.id];if(!g||!g.hasLoader)return!1;if(u(m,h)||d(m,h))return!0;
51if(m.route.shouldRevalidate){let b=m.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((v=r[0])==null?void 0:v.params)||{},nextUrl:new URL(t,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function FE(t,e,{includeHydrateFallback:r}={}){return QE(t.map(s=>{let o=e.routes[s.route.id];if(!o)return[];let l=[o.module];return o.clientActionModule&&(l=l.concat(o.clientActionModule)),o.clientLoaderModule&&(l=l.concat(o.clientLoaderModule)),r&&o.hydrateFallbackModule&&(l=l.concat(o.hydrateFallbackModule)),o.imports&&(l=l.concat(o.imports)),l}).flat(1))}function QE(t){return[...new Set(t)]}function XE(t){let e={},r=Object.keys(t).sort();for(let s of r)e[s]=t[s];return e}function ZE(t,e){let r=new Set;return new Set(e),t.reduce((s,o)=>{let l=JSON.stringify(XE(o));return r.has(l)||(r.add(l),s.push({key:l,link:o})),s},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var WE=new Set([100,101,204,205]);function JE(t,e){let r=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return r.pathname==="/"?r.pathname="_root.data":e&&Kr(r.pathname,e)==="/"?r.pathname=`${e.replace(/\/$/,"")}/_root.data`:r.pathname=`${r.pathname.replace(/\/$/,"")}.data`,r}function Yb(){let t=_.useContext(Ui);return Em(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function eC(){let t=_.useContext(Cu);return Em(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var Cm=_.createContext(void 0);Cm.displayName="FrameworkContext";function Fb(){let t=_.useContext(Cm);return Em(t,"You must render this element inside a <HydratedRouter> element"),t}function tC(t,e){let r=_.useContext(Cm),[s,o]=_.useState(!1),[l,u]=_.useState(!1),{onFocus:d,onBlur:m,onMouseEnter:h,onMouseLeave:g,onTouchStart:v}=e,b=_.useRef(null);_.useEffect(()=>{if(t==="render"&&u(!0),t==="viewport"){let E=k=>{k.forEach(z=>{u(z.isIntersecting)})},T=new IntersectionObserver(E,{threshold:.5});return b.current&&T.observe(b.current),()=>{T.disconnect()}}},[t]),_.useEffect(()=>{if(s){let E=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(E)}}},[s]);let C=()=>{o(!0)},x=()=>{o(!1),u(!1)};return r?t!=="intent"?[l,b,{}]:[l,b,{onFocus:Xo(d,C),onBlur:Xo(m,x),onMouseEnter:Xo(h,C),onMouseLeave:Xo(g,x),onTouchStart:Xo(v,C)}]:[!1,b,{}]}function Xo(t,e){return r=>{t&&t(r),r.defaultPrevented||e(r)}}function nC({page:t,...e}){let{router:r}=Yb(),s=_.useMemo(()=>Pb(r.routes,t,r.basename),[r.routes,t,r.basename]);return s?_.createElement(aC,{page:t,matches:s,...e}):null}function rC(t){let{manifest:e,routeModules:r}=Fb(),[s,o]=_.useState([]);return _.useEffect(()=>{let l=!1;return YE(t,e,r).then(u=>{l||o(u)}),()=>{l=!0}},[t,e,r]),s}function aC({page:t,matches:e,...r}){let s=Ma(),{manifest:o,routeModules:l}=Fb(),{basename:u}=Yb(),{loaderData:d,matches:m}=eC(),h=_.useMemo(()=>Qv(t,e,m,o,s,"data"),[t,e,m,o,s]),g=_.useMemo(()=>Qv(t,e,m,o,s,"assets"),[t,e,m,o,s]),v=_.useMemo(()=>{if(t===s.pathname+s.search+s.hash)return[];let x=new Set,E=!1;if(e.forEach(k=>{var O;let z=o.routes[k.route.id];!z||!z.hasLoader||(!h.some(Y=>Y.route.id===k.route.id)&&k.route.id in d&&((O=l[k.route.id])!=null&&O.shouldRevalidate)||z.hasClientLoader?E=!0:x.add(k.route.id))}),x.size===0)return[];let T=JE(t,u);return E&&x.size>0&&T.searchParams.set("_routes",e.filter(k=>x.has(k.route.id)).map(k=>k.route.id).join(",")),[T.pathname+T.search]},[u,d,s,o,h,e,t,l]),b=_.useMemo(()=>FE(g,o),[g,o]),C=rC(g);return _.createElement(_.Fragment,null,v.map(x=>_.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...r})),b.map(x=>_.createElement("link",{key:x,rel:"modulepreload",href:x,...r})),C.map(({key:x,link:E})=>_.createElement("link",{key:x,...E})))}function sC(...t){return e=>{t.forEach(r=>{typeof r=="function"?r(e):r!=null&&(r.current=e)})}}var Qb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Qb&&(window.__reactRouterVersion="7.6.2")}catch{}function iC({basename:t,children:e,window:r}){let s=_.useRef();s.current==null&&(s.current=K2({window:r,v5Compat:!0}));let o=s.current,[l,u]=_.useState({action:o.action,location:o.location}),d=_.useCallback(m=>{_.startTransition(()=>u(m))},[u]);return _.useLayoutEffect(()=>o.listen(d),[o,d]),_.createElement(LE,{basename:t,children:e,location:l.location,navigationType:l.action,navigator:o})}var Xb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Zb=_.forwardRef(function({onClick:e,discover:r="render",prefetch:s="none",relative:o,reloadDocument:l,replace:u,state:d,target:m,to:h,preventScrollReset:g,viewTransition:v,...b}
51,C){let{basename:x}=_.useContext(Fn),E=typeof h=="string"&&Xb.test(h),T,k=!1;if(typeof h=="string"&&E&&(T=h,Qb))try{let de=new URL(window.location.href),Ee=h.startsWith("//")?new URL(de.protocol+h):new URL(h),je=Kr(Ee.pathname,x);Ee.origin===de.origin&&je!=null?h=je+Ee.search+Ee.hash:k=!0}catch{Vn(!1,`<Link to="${h}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let z=yE(h,{relative:o}),[O,Y,K]=tC(s,b),re=uC(h,{replace:u,state:d,target:m,preventScrollReset:g,relative:o,viewTransition:v});function J(de){e&&e(de),de.defaultPrevented||re(de)}let Z=_.createElement("a",{...b,...K,href:T||z,onClick:k||l?e:J,ref:sC(C,Y),target:m,"data-discover":!E&&r==="render"?"true":void 0});return O&&!E?_.createElement(_.Fragment,null,Z,_.createElement(nC,{page:z})):Z});Zb.displayName="Link";var oC=_.forwardRef(function({"aria-current":e="page",caseSensitive:r=!1,className:s="",end:o=!1,style:l,to:u,viewTransition:d,children:m,...h},g){let v=vl(u,{relative:h.relative}),b=Ma(),C=_.useContext(Cu),{navigator:x,basename:E}=_.useContext(Fn),T=C!=null&&pC(v)&&d===!0,k=x.encodeLocation?x.encodeLocation(v).pathname:v.pathname,z=b.pathname,O=C&&C.navigation&&C.navigation.location?C.navigation.location.pathname:null;r||(z=z.toLowerCase(),O=O?O.toLowerCase():null,k=k.toLowerCase()),O&&E&&(O=Kr(O,E)||O);const Y=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let K=z===k||!o&&z.startsWith(k)&&z.charAt(Y)==="/",re=O!=null&&(O===k||!o&&O.startsWith(k)&&O.charAt(k.length)==="/"),J={isActive:K,isPending:re,isTransitioning:T},Z=K?e:void 0,de;typeof s=="function"?de=s(J):de=[s,K?"active":null,re?"pending":null,T?"transitioning":null].filter(Boolean).join(" ");let Ee=typeof l=="function"?l(J):l;return _.createElement(Zb,{...h,"aria-current":Z,className:de,ref:g,style:Ee,to:u,viewTransition:d},typeof m=="function"?m(J):m)});oC.displayName="NavLink";var lC=_.forwardRef(({discover:t="render",fetcherKey:e,navigate:r,reloadDocument:s,replace:o,state:l,method:u=eu,action:d,onSubmit:m,relative:h,preventScrollReset:g,viewTransition:v,...b},C)=>{let x=hC(),E=mC(d,{relative:h}),T=u.toLowerCase()==="get"?"get":"post",k=typeof d=="string"&&Xb.test(d),z=O=>{if(m&&m(O),O.defaultPrevented)return;O.preventDefault();let Y=O.nativeEvent.submitter,K=(Y==null?void 0:Y.getAttribute("formmethod"))||u;x(Y||O.currentTarget,{fetcherKey:e,method:K,navigate:r,replace:o,state:l,relative:h,preventScrollReset:g,viewTransition:v})};return _.createElement("form",{ref:C,method:T,action:E,onSubmit:s?m:z,...b,"data-discover":!k&&t==="render"?"true":void 0})});lC.displayName="Form";function cC(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Wb(t){let e=_.useContext(Ui);return at(e,cC(t)),e}function uC(t,{target:e,replace:r,state:s,preventScrollReset:o,relative:l,viewTransition:u}={}){let d=fn(),m=Ma(),h=vl(t,{relative:l});return _.useCallback(g=>{if(qE(g,e)){g.preventDefault();let v=r!==void 0?r:fl(m)===fl(h);d(t,{replace:v,state:s,preventScrollReset:o,relative:l,viewTransition:u})}},[m,d,h,r,s,e,t,o,l,u])}var fC=0,dC=()=>`__${String(++fC)}__`;function hC(){let{router:t}=Wb("useSubmit"),{basename:e}=_.useContext(Fn),r=RE();return _.useCallback(async(s,o={})=>{let{action:l,method:u,encType:d,formData:m,body:h}=GE(s,e);if(o.navigate===!1){let g=o.fetcherKey||dC();await t.fetch(g,r,o.action||l,{preventScrollReset:o.preventScrollReset,formData:m,body:h,formMethod:o.method||u,formEncType:o.encType||d,flushSync:o.flushSync})}else await t.navigate(o.action||l,{preventScrollReset:o.preventScrollReset,formData:m,body:h,formMethod:o.method||u,formEncType:o.encType||d,replace:o.replace,state:o.state,fromRouteId:r,flushSync:o.flushSync,viewTransition:o.viewTransition})},[t,e,r])}function mC(t,{relative:e}={}){let{basename:r}=_.useContext(Fn),s=_.useContext(Qn);at(s,"useFormAction must be used inside a RouteContext");let[o]=s.matches.slice(-1),l={...vl(t||".",{relative:e})},u=Ma();if(t==null){l.search=u.search;let d=new URLSearchParams(l.search),m=d.getAll("index");if(m.some(g=>g==="")){d.delete("index"),m.filter(v=>v).forEach(v=>d.append("index",v));let g=d.toString();l.search=g?`?${g}`:""}}return(!t||t===".")&&o.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(l.pathname=l.pathname==="/"?r:Ir([r,l.pathname])),fl(l)}function pC(t,e={}){let r=_.useContext(Hb);at(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=Wb("useViewTransitionState"),o=vl(t,{relative:e.relative});if(!r.isTransitioning)return!1;let l=Kr(r.currentLocation.pathname,s)||r.currentLocation.pathname,u=Kr(r.nextLocation.pathname,s)||r.nextLocation.pathname;return cu(o.pathname,u)!=null||cu(o.pathname,l)!=null}[...WE];/** 52 * @license lucide-react v0.511.0 - ISC 53 * 54 * This source code is licensed under the ISC license. 55 * See the LICENSE file in the root directory of this source tree. 56 */const gC=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),vC=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,s)=>s?s.toUpperCase():r.toLowerCase()),Xv=t=>{const e=vC(t);return e.charAt(0).toUpperCase()+e.slice(1)},Jb=(...t)=>t.filter((e,r,s)=>!!e&&e.trim()!==""&&s.indexOf(e)===r).join(" ").trim(),yC=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};/** 57 * @license lucide-react v0.511.0 - ISC 58 * 59 * This source code is licensed under the ISC license. 60 * See the LICENSE file in the root directory of this source tree. 61 */var bC={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** 62 * @license lucide-react v0.511.0 - ISC 63 * 64 * This source code is licensed under the ISC license. 65 * See the LICENSE file in the root directory of this source tree. 66 */const wC=_.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:s,className:o="",children:l,iconNode:u,...d},m)=>_.createElement("svg",{ref:m,...bC,width:e,height:e,stroke:t,strokeWidth:s?Number(r)*24/Number(e):r,className:Jb("lucide",o),...!l&&!yC(d)&&{"aria-hidden":"true"},...d},[...u.map(([h,g])=>_.createElement(h,g)),...Array.isArray(l)?l:[l]]));/** 67 * @license lucide-react v0.511.0 - ISC 68 * 69 * This source code is licensed under the ISC license. 70 * See the LICENSE file in the root directory of this source tree. 71 */const dn=(t,e)=>{const r=_.forwardRef(({className:s,...o},l)=>_.createElement(wC,{ref:l,iconNode:e,className:Jb(`lucide-${gC(Xv(t))}`,`lucide-${t}`,s),...o}));return r.displayName=Xv(t),r};
71/** 72 * @license lucide-react v0.511.0 - ISC 73 * 74 * This source code is licensed under the ISC license. 75 * See the LICENSE file in the root directory of this source tree. 76 */const xC=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],uu=dn("arrow-left",xC);/** 77 * @license lucide-react v0.511.0 - ISC 78 * 79 * This source code is licensed under the ISC license. 80 * See the LICENSE file in the root directory of this source tree. 81 */const _C=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],SC=dn("arrow-right",_C);/** 82 * @license lucide-react v0.511.0 - ISC 83 * 84 * This source code is licensed under the ISC license. 85 * See the LICENSE file in the root directory of this source tree. 86 */const EC=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],CC=dn("chevron-right",EC);/** 87 * @license lucide-react v0.511.0 - ISC 88 * 89 * This source code is licensed under the ISC license. 90 * See the LICENSE file in the root directory of this source tree. 91 */const TC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],AC=dn("info",TC);/** 92 * @license lucide-react v0.511.0 - ISC 93 * 94 * This source code is licensed under the ISC license. 95 * See the LICENSE file in the root directory of this source tree. 96 */const kC=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],bs=dn("loader-circle",kC);/** 97 * @license lucide-react v0.511.0 - ISC 98 * 99 * This source code is licensed under the ISC license. 100 * See the LICENSE file in the root directory of this source tree. 101 */const jC=[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]],RC=dn("log-in",jC);/** 102 * @license lucide-react v0.511.0 - ISC 103 * 104 * This source code is licensed under the ISC license. 105 * See the LICENSE file in the root directory of this source tree. 106 */const NC=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],OC=dn("message-circle",NC);/** 107 * @license lucide-react v0.511.0 - ISC 108 * 109 * This source code is licensed under the ISC license. 110 * See the LICENSE file in the root directory of this source tree. 111 */const MC=[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]],DC=dn("messages-square",MC);/** 112 * @license lucide-react v0.511.0 - ISC 113 * 114 * This source code is licensed under the ISC license. 115 * See the LICENSE file in the root directory of this source tree. 116 */const LC=[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],UC=dn("octagon-x",LC);/** 117 * @license lucide-react v0.511.0 - ISC 118 * 119 * This source code is licensed under the ISC license. 120 * See the LICENSE file in the root directory of this source tree. 121 */const zC=[["path",{d:"M12 2v13",key:"1km8f5"}],["path",{d:"m16 6-4-4-4 4",key:"13yo43"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}]],PC=dn("share",zC);/** 122 * @license lucide-react v0.511.0 - ISC 123 * 124 * This source code is licensed under the ISC license. 125 * See the LICENSE file in the root directory of this source tree. 126 */const BC=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],$C=dn("star",BC);/** 127 * @license lucide-react v0.511.0 - ISC 128 * 129 * This source code is licensed under the ISC license. 130 * See the LICENSE file in the root directory of this source tree. 131 */const qC=[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}
vendor: 7,714 bytes, lines 131-141
131],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]],HC=dn("trophy",qC);/** 132 * @license lucide-react v0.511.0 - ISC 133 * 134 * This source code is licensed under the ISC license. 135 * See the LICENSE file in the root directory of this source tree. 136 */const IC=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],GC=dn("workflow",IC);/** 137 * @license lucide-react v0.511.0 - ISC 138 * 139 * This source code is licensed under the ISC license. 140 * See the LICENSE file in the root directory of this source tree. 141 */const KC=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],VC=dn("x",KC);function e1(t){var e,r,s="";if(typeof t=="string"||typeof t=="number")s+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(r=e1(t[e]))&&(s&&(s+=" "),s+=r)}else for(r in t)t[r]&&(s&&(s+=" "),s+=r);return s}function t1(){for(var t,e,r=0,s="",o=arguments.length;r<o;r++)(t=arguments[r])&&(e=e1(t))&&(s&&(s+=" "),s+=e);return s}const Tm="-",YC=t=>{const e=QC(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=t;return{getClassGroupId:u=>{const d=u.split(Tm);return d[0]===""&&d.length!==1&&d.shift(),n1(d,e)||FC(u)},getConflictingClassGroupIds:(u,d)=>{const m=r[u]||[];return d&&s[u]?[...m,...s[u]]:m}}},n1=(t,e)=>{var u;if(t.length===0)return e.classGroupId;const r=t[0],s=e.nextPart.get(r),o=s?n1(t.slice(1),s):void 0;if(o)return o;if(e.validators.length===0)return;const l=t.join(Tm);return(u=e.validators.find(({validator:d})=>d(l)))==null?void 0:u.classGroupId},Zv=/^\[(.+)\]$/,FC=t=>{if(Zv.test(t)){const e=Zv.exec(t)[1],r=e==null?void 0:e.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},QC=t=>{const{theme:e,classGroups:r}=t,s={nextPart:new Map,validators:[]};for(const o in r)Ih(r[o],s,o,e);return s},Ih=(t,e,r,s)=>{t.forEach(o=>{if(typeof o=="string"){const l=o===""?e:Wv(e,o);l.classGroupId=r;return}if(typeof o=="function"){if(XC(o)){Ih(o(s),e,r,s);return}e.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([l,u])=>{Ih(u,Wv(e,l),r,s)})})},Wv=(t,e)=>{let r=t;return e.split(Tm).forEach(s=>{r.nextPart.has(s)||r.nextPart.set(s,{nextPart:new Map,validators:[]}),r=r.nextPart.get(s)}),r},XC=t=>t.isThemeGetter,ZC=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=new Map,s=new Map;const o=(l,u)=>{r.set(l,u),e++,e>t&&(e=0,s=r,r=new Map)};return{get(l){let u=r.get(l);if(u!==void 0)return u;if((u=s.get(l))!==void 0)return o(l,u),u},set(l,u){r.has(l)?r.set(l,u):o(l,u)}}},Gh="!",Kh=":",WC=Kh.length,JC=t=>{const{prefix:e,experimentalParseClassName:r}=t;let s=o=>{const l=[];let u=0,d=0,m=0,h;for(let x=0;x<o.length;x++){let E=o[x];if(u===0&&d===0){if(E===Kh){l.push(o.slice(m,x)),m=x+WC;continue}if(E==="/"){h=x;continue}}E==="["?u++:E==="]"?u--:E==="("?d++:E===")"&&d--}const g=l.length===0?o:o.substring(m),v=eT(g),b=v!==g,C=h&&h>m?h-m:void 0;return{modifiers:l,hasImportantModifier:b,baseClassName:v,maybePostfixModifierPosition:C}};if(e){const o=e+Kh,l=s;s=u=>u.startsWith(o)?l(u.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:u,maybePostfixModifierPosition:void 0}}if(r){const o=s;s=l=>r({className:l,parseClassName:o})}return s},eT=t=>t.endsWith(Gh)?t.substring(0,t.length-1):t.startsWith(Gh)?t.substring(1):t,tT=t=>{const e=Object.fromEntries(t.orderSensitiveModifiers.map(s=>[s,!0]));return s=>{if(s.length<=1)return s;const o=[];let l=[];return s.forEach(u=>{u[0]==="["||e[u]?(o.push(...l.sort(),u),l=[]):l.push(u)}),o.push(...l.sort()),o}},nT=t=>({cache:ZC(t.cacheSize),parseClassName:JC(t),sortModifiers:tT(t),...YC(t)}),rT=/\s+/,aT=(t,e)=>{const{parseClassName:r,getClassGroupId:s,getConflictingClassGroupIds:o,sortModifiers:l}=e,u=[],d=t.trim().split(rT);let m="";for(let h=d.length-1;h>=0;h-=1){const g=d[h],{isExternal:v,modifiers:b,hasImportantModifier:C,baseClassName:x,maybePostfixModifierPosition:E}=r(g);if(v){m=g+(m.length>0?" "+m:m);continue}let T=!!E,k=s(T?x.substring(0,E):x);if(!k){if(!T){m=g+(m.length>0?" "+m:m);continue}if(k=s(x),!k){m=g+(m.length>0?" "+m:m);continue}T=!1}const z=l(b).join(":"),O=C?z+Gh:z,Y=O+k;if(u.includes(Y))continue;u.push(Y);const K=o(k,T);for(let re=0;re<K.length;++re){const J=K[re];u.push(O+J)}m=g+(m.length>0?" "+m:m)}return m};function sT(){let t=0,e,r,s="";for(;t<arguments.length;)(e=arguments[t++])&&(r=r1(e))&&(s&&(s+=" "),s+=r);return s}const r1=t=>{if(typeof t=="string")return t;let e,r="";for(let s=0;s<t.length;s++)t[s]&&(e=r1(t[s]))&&(r&&(r+=" "),r+=e);return r};function iT(t,...e){let r,s,o,l=u;function u(m){const h=e.reduce((g,v)=>v(g),t());return r=nT(h),s=r.cache.get,o=r.cache.set,l=d,d(m)}function d(m){const h=s(m);if(h)return h;const g=aT(m,r);return o(m,g),g}return function(){return l(sT.apply(null,arguments))}}const Et=t=>{const e=r=>r[t]||[];return e.isThemeGetter=!0,e},a1=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,s1=/^\((?:(\w[\w-]*):)?(.+)\)$/i,oT=/^\d+\/\d+$/,lT=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,cT=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,uT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,fT=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,di=t=>oT.test(t),Ne=t=>!!t&&!Number.isNaN(Number(t)),ya=t=>!!t&&Number.isInteger(Number(t)),rh=t=>t.endsWith("%")&&Ne(t.slice(0,-1)),Ur=t=>lT.test(t),hT=()=>!0,mT=t=>cT.test(t)&&!uT.test(t),i1=()=>!1,pT=t=>fT.test(t),gT=t=>dT.test(t),vT=t=>!le(t)&&!ce(t),yT=t=>Pi(t,c1,i1),le=t=>a1.test(t),is=t=>Pi(t,u1,mT),ah=t=>Pi(t,ST,Ne),Jv=t=>Pi(t,o1,i1),bT=t=>Pi(t,l1,gT),Pc=t=>Pi(t,f1,pT),ce=t=>s1.test(t),Zo=t=>Bi(t,u1),wT=t=>Bi(t,ET),ey=t=>Bi(t,o1),xT=t=>Bi(t,c1),_T=t=>Bi(t,l1),Bc=t=>Bi(t,f1,!0),Pi=(t,e,r)=>{const s=a1.exec(t);return s?s[1]?e(s[1]):r(s[2]):!1},Bi=(t,e,r=!1)=>{const s=s1.exec(t);return s?s[1]?e(s[1]):r:!1},o1=t=>t==="position"||t==="percentage",l1=t=>t==="image"||t==="url",c1=t=>t==="length"||t==="size"||t==="bg-size",u1=t=>t==="length",ST=t=>t==="number",ET=t=>t==="family-name",f1=t=>t==="shadow",CT=()=>{const t=Et("color"),e=Et("font"),r=Et("text"),s=Et("font-weight"),o=Et("tracking"),l=Et("leading"),u=Et("breakpoint"),d=Et("container"),m=Et("spacing"),h=Et("radius"),g=Et("shadow"),v=Et("inset-shadow"),b=Et("text-shadow"),C=Et("drop-shadow"),x=Et("blur"),E=Et("perspective"),T=Et("aspect"),k=Et("ease"),z=Et("animate"),O=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Y=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],K=()=>[...Y(),ce,le],re=()=>["auto","hidden","clip","visible","scroll"],J=()=>["auto","contain","none"],Z=()=>[ce,le,m],de=()=>[di,"full","auto",...Z()],Ee=()=>[ya,"none","subgrid",ce,le],je=()=>["auto",{span:["full",ya,ce,le]},ya,ce,le],ze=()=>[ya,"auto",ce,le],At=()=>["auto","min","max","fr",ce,le],kt=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Me=()=>["start","end","center","stretch","center-safe","end-safe"],M=()=>["auto",...Z()],ne=()=>[di,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...Z()],W=()=>[t,ce,le],_e=()=>[...Y(),ey,Jv,{position:[ce,le]}],j=()=>["no-repeat",{repeat:["","x","y","space","round"]}],G=()=>["auto","cover","contain",xT,yT,{size:[ce,le]}],ee=()=>[rh,Zo,is],F=()=>
vendor: 6,711 bytes, line 141
141["","none","full",h,ce,le],se=()=>["",Ne,Zo,is],ve=()=>["solid","dashed","dotted","double"],ie=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Se=()=>[Ne,rh,ey,Jv],Pe=()=>["","none",x,ce,le],ot=()=>["none",Ne,ce,le],Kt=()=>["none",Ne,ce,le],An=()=>[Ne,ce,le],hn=()=>[di,"full",...Z()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ur],breakpoint:[Ur],color:[hT],container:[Ur],"drop-shadow":[Ur],ease:["in","out","in-out"],font:[vT],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ur],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ur],shadow:[Ur],spacing:["px",Ne],text:[Ur],"text-shadow":[Ur],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",di,le,ce,T]}],container:["container"],columns:[{columns:[Ne,le,ce,d]}],"break-after":[{"break-after":O()}],"break-before":[{"break-before":O()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:K()}],overflow:[{overflow:re()}],"overflow-x":[{"overflow-x":re()}],"overflow-y":[{"overflow-y":re()}],overscroll:[{overscroll:J()}],"overscroll-x":[{"overscroll-x":J()}],"overscroll-y":[{"overscroll-y":J()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:de()}],"inset-x":[{"inset-x":de()}],"inset-y":[{"inset-y":de()}],start:[{start:de()}],end:[{end:de()}],top:[{top:de()}],right:[{right:de()}],bottom:[{bottom:de()}],left:[{left:de()}],visibility:["visible","invisible","collapse"],z:[{z:[ya,"auto",ce,le]}],basis:[{basis:[di,"full","auto",d,...Z()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ne,di,"auto","initial","none",le]}],grow:[{grow:["",Ne,ce,le]}],shrink:[{shrink:["",Ne,ce,le]}],order:[{order:[ya,"first","last","none",ce,le]}],"grid-cols":[{"grid-cols":Ee()}],"col-start-end":[{col:je()}],"col-start":[{"col-start":ze()}],"col-end":[{"col-end":ze()}],"grid-rows":[{"grid-rows":Ee()}],"row-start-end":[{row:je()}],"row-start":[{"row-start":ze()}],"row-end":[{"row-end":ze()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":At()}],"auto-rows":[{"auto-rows":At()}],gap:[{gap:Z()}],"gap-x":[{"gap-x":Z()}],"gap-y":[{"gap-y":Z()}],"justify-content":[{justify:[...kt(),"normal"]}],"justify-items":[{"justify-items":[...Me(),"normal"]}],"justify-self":[{"justify-self":["auto",...Me()]}],"align-content":[{content:["normal",...kt()]}],"align-items":[{items:[...Me(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Me(),{baseline:["","last"]}]}],"place-content":[{"place-content":kt()}],"place-items":[{"place-items":[...Me(),"baseline"]}],"place-self":[{"place-self":["auto",...Me()]}],p:[{p:Z()}],px:[{px:Z()}],py:[{py:Z()}],ps:[{ps:Z()}],pe:[{pe:Z()}],pt:[{pt:Z()}],pr:[{pr:Z()}],pb:[{pb:Z()}],pl:[{pl:Z()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":Z()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":Z()}],"space-y-reverse":["space-y-reverse"],size:[{size:ne()}],w:[{w:[d,"screen",...ne()]}],"min-w":[{"min-w":[d,"screen","none",...ne()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[u]},...ne()]}],h:[{h:["screen","lh",...ne()]}],"min-h":[{"min-h":["screen","lh","none",...ne()]}],"max-h":[{"max-h":["screen","lh",...ne()]}],"font-size":[{text:["base",r,Zo,is]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,ce,ah]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",rh,le]}],"font-family":[{font:[wT,le,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,ce,le]}],"line-clamp":[{"line-clamp":[Ne,"none",ce,ah]}],leading:[{leading:[l,...Z()]}],"list-image":[{"list-image":["none",ce,le]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ce,le]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:W()}],"text-color":[{text:W()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ve(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ne,"from-font","auto",ce,is]}],"text-decoration-color":[{decoration:W()}],"underline-offset":[{"underline-offset":[Ne,"auto",ce,le]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ce,le]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ce,le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:_e()}],"bg-repeat":[{bg:j()}],"bg-size":[{bg:G()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ya,ce,le],radial:["",ce,le],conic:[ya,ce,le]},_T,bT]}],"bg-color":[{bg:W()}],"gradient-from-pos":[{from:ee()}
vendor: 5,335 bytes, line 141
141],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:W()}],"gradient-via":[{via:W()}],"gradient-to":[{to:W()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:se()}],"border-w-x":[{"border-x":se()}],"border-w-y":[{"border-y":se()}],"border-w-s":[{"border-s":se()}],"border-w-e":[{"border-e":se()}],"border-w-t":[{"border-t":se()}],"border-w-r":[{"border-r":se()}],"border-w-b":[{"border-b":se()}],"border-w-l":[{"border-l":se()}],"divide-x":[{"divide-x":se()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":se()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ve(),"hidden","none"]}],"divide-style":[{divide:[...ve(),"hidden","none"]}],"border-color":[{border:W()}],"border-color-x":[{"border-x":W()}],"border-color-y":[{"border-y":W()}],"border-color-s":[{"border-s":W()}],"border-color-e":[{"border-e":W()}],"border-color-t":[{"border-t":W()}],"border-color-r":[{"border-r":W()}],"border-color-b":[{"border-b":W()}],"border-color-l":[{"border-l":W()}],"divide-color":[{divide:W()}],"outline-style":[{outline:[...ve(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ne,ce,le]}],"outline-w":[{outline:["",Ne,Zo,is]}],"outline-color":[{outline:W()}],shadow:[{shadow:["","none",g,Bc,Pc]}],"shadow-color":[{shadow:W()}],"inset-shadow":[{"inset-shadow":["none",v,Bc,Pc]}],"inset-shadow-color":[{"inset-shadow":W()}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:W()}],"ring-offset-w":[{"ring-offset":[Ne,is]}],"ring-offset-color":[{"ring-offset":W()}],"inset-ring-w":[{"inset-ring":se()}],"inset-ring-color":[{"inset-ring":W()}],"text-shadow":[{"text-shadow":["none",b,Bc,Pc]}],"text-shadow-color":[{"text-shadow":W()}],opacity:[{opacity:[Ne,ce,le]}],"mix-blend":[{"mix-blend":[...ie(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ie()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ne]}],"mask-image-linear-from-pos":[{"mask-linear-from":Se()}],"mask-image-linear-to-pos":[{"mask-linear-to":Se()}],"mask-image-linear-from-color":[{"mask-linear-from":W()}],"mask-image-linear-to-color":[{"mask-linear-to":W()}],"mask-image-t-from-pos":[{"mask-t-from":Se()}],"mask-image-t-to-pos":[{"mask-t-to":Se()}],"mask-image-t-from-color":[{"mask-t-from":W()}],"mask-image-t-to-color":[{"mask-t-to":W()}],"mask-image-r-from-pos":[{"mask-r-from":Se()}],"mask-image-r-to-pos":[{"mask-r-to":Se()}],"mask-image-r-from-color":[{"mask-r-from":W()}],"mask-image-r-to-color":[{"mask-r-to":W()}],"mask-image-b-from-pos":[{"mask-b-from":Se()}],"mask-image-b-to-pos":[{"mask-b-to":Se()}],"mask-image-b-from-color":[{"mask-b-from":W()}],"mask-image-b-to-color":[{"mask-b-to":W()}],"mask-image-l-from-pos":[{"mask-l-from":Se()}],"mask-image-l-to-pos":[{"mask-l-to":Se()}],"mask-image-l-from-color":[{"mask-l-from":W()}],"mask-image-l-to-color":[{"mask-l-to":W()}],"mask-image-x-from-pos":[{"mask-x-from":Se()}],"mask-image-x-to-pos":[{"mask-x-to":Se()}],"mask-image-x-from-color":[{"mask-x-from":W()}],"mask-image-x-to-color":[{"mask-x-to":W()}],"mask-image-y-from-pos":[{"mask-y-from":Se()}],"mask-image-y-to-pos":[{"mask-y-to":Se()}],"mask-image-y-from-color":[{"mask-y-from":W()}],"mask-image-y-to-color":[{"mask-y-to":W()}],"mask-image-radial":[{"mask-radial":[ce,le]}],"mask-image-radial-from-pos":[{"mask-radial-from":Se()}],"mask-image-radial-to-pos":[{"mask-radial-to":Se()}],"mask-image-radial-from-color":[{"mask-radial-from":W()}],"mask-image-radial-to-color":[{"mask-radial-to":W()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":Y()}],"mask-image-conic-pos":[{"mask-conic":[Ne]}],"mask-image-conic-from-pos":[{"mask-conic-from":Se()}],"mask-image-conic-to-pos":[{"mask-conic-to":Se()}],"mask-image-conic-from-color":[{"mask-conic-from":W()}],"mask-image-conic-to-color":[{"mask-conic-to":W()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:_e()}],"mask-repeat":[{mask:j()}],"mask-size":[{mask:G()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ce,le]}],filter:[{filter:["","none",ce,le]}],blur:[{blur:Pe()}],brightness:[{brightness:[Ne,ce,le]}],contrast:[{contrast:[Ne,ce,le]}],"drop-shadow":[{"drop-shadow":["","none",C,Bc,Pc]}],"drop-shadow-color":[{"drop-shadow":W()}],grayscale:[{grayscale:["",Ne,ce,le]}],"hue-rotate":[{"hue-rotate":[Ne,ce,le]}],invert:[{invert:["",Ne,ce,le]}],saturate:[{saturate:[Ne,ce,le]}],sepia:[{sepia:["",Ne,ce,le]}],"backdrop-filter":[{"backdrop-filter":["","none",ce,le]}
vendor: 7,985 bytes, line 141
141],"backdrop-blur":[{"backdrop-blur":Pe()}],"backdrop-brightness":[{"backdrop-brightness":[Ne,ce,le]}],"backdrop-contrast":[{"backdrop-contrast":[Ne,ce,le]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ne,ce,le]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ne,ce,le]}],"backdrop-invert":[{"backdrop-invert":["",Ne,ce,le]}],"backdrop-opacity":[{"backdrop-opacity":[Ne,ce,le]}],"backdrop-saturate":[{"backdrop-saturate":[Ne,ce,le]}],"backdrop-sepia":[{"backdrop-sepia":["",Ne,ce,le]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":Z()}],"border-spacing-x":[{"border-spacing-x":Z()}],"border-spacing-y":[{"border-spacing-y":Z()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ce,le]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ne,"initial",ce,le]}],ease:[{ease:["linear","initial",k,ce,le]}],delay:[{delay:[Ne,ce,le]}],animate:[{animate:["none",z,ce,le]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[E,ce,le]}],"perspective-origin":[{"perspective-origin":K()}],rotate:[{rotate:ot()}],"rotate-x":[{"rotate-x":ot()}],"rotate-y":[{"rotate-y":ot()}],"rotate-z":[{"rotate-z":ot()}],scale:[{scale:Kt()}],"scale-x":[{"scale-x":Kt()}],"scale-y":[{"scale-y":Kt()}],"scale-z":[{"scale-z":Kt()}],"scale-3d":["scale-3d"],skew:[{skew:An()}],"skew-x":[{"skew-x":An()}],"skew-y":[{"skew-y":An()}],transform:[{transform:[ce,le,"","none","gpu","cpu"]}],"transform-origin":[{origin:K()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:hn()}],"translate-x":[{"translate-x":hn()}],"translate-y":[{"translate-y":hn()}],"translate-z":[{"translate-z":hn()}],"translate-none":["translate-none"],accent:[{accent:W()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:W()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ce,le]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":Z()}],"scroll-mx":[{"scroll-mx":Z()}],"scroll-my":[{"scroll-my":Z()}],"scroll-ms":[{"scroll-ms":Z()}],"scroll-me":[{"scroll-me":Z()}],"scroll-mt":[{"scroll-mt":Z()}],"scroll-mr":[{"scroll-mr":Z()}],"scroll-mb":[{"scroll-mb":Z()}],"scroll-ml":[{"scroll-ml":Z()}],"scroll-p":[{"scroll-p":Z()}],"scroll-px":[{"scroll-px":Z()}],"scroll-py":[{"scroll-py":Z()}],"scroll-ps":[{"scroll-ps":Z()}],"scroll-pe":[{"scroll-pe":Z()}],"scroll-pt":[{"scroll-pt":Z()}],"scroll-pr":[{"scroll-pr":Z()}],"scroll-pb":[{"scroll-pb":Z()}],"scroll-pl":[{"scroll-pl":Z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ce,le]}],fill:[{fill:["none",...W()]}],"stroke-w":[{stroke:[Ne,Zo,is,ah]}],stroke:[{stroke:["none",...W()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},TT=iT(CT);function ke(...t){return TT(t1(t))}function sl(t=0){if(t>=1e6)return(t/1e6).toFixed(1)+"M";if(t>=1e3)return(t/1e3).toFixed(1)+"K";const e=Math.floor(t);return e===t?e.toString():t.toFixed(1)}const Vh=({size:t="md",githubLogo:e,className:r})=>y.jsxs("a",{href:"https://github.com/MotiaDev/chessarena-ai",target:"_blank",className:ke("flex flex-row md:flex-col gap-2 items-center justify-center",r),children:[y.jsx("img",{src:e?"/github-white.svg":"/icon-white.svg",alt:"Motia Logo",className:ke("h-8",t==="sm"&&"h-6")}),y.jsx("p",{className:"text-muted-foreground font-semibold text-sm",children:"Powered by open-source"})]}),$i=({onBack:t})=>y.jsxs("div",{className:"flex flex-row items-center justify-center w-full",children:[t?y.jsx(uu,{className:"size-6 shrink-0 cursor-pointer mr-2",onClick:t}):null,y.jsx(Vh,{githubLogo:!0,size:"sm",className:ke("grow",t&&"mr-8")})]});function d1(t,e){return function(){return t.apply(e,arguments)}}const{toString:AT}=Object.prototype,{getPrototypeOf:Am}=Object,{iterator:Au,toStringTag:h1}=Symbol,ku=(t=>e=>{const r=AT.call(e);return t[r]||(t[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),Xn=t=>(t=t.toLowerCase(),e=>ku(e)===t),ju=t=>e=>typeof e===t,{isArray:qi}=Array,dl=ju("undefined");function yl(t){return t!==null&&!dl(t)&&t.constructor!==null&&!dl(t.constructor)&&on(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const m1=Xn("ArrayBuffer");function kT(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&m1(t.buffer),e}const jT=ju("string"),on=ju("function"),p1=ju("number"),bl=t=>t!==null&&typeof t=="object",RT=t=>t===!0||t===!1,nu=t=>
vendor: 3,463 bytes, line 141
141{if(ku(t)!=="object")return!1;const e=Am(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(h1 in t)&&!(Au in t)},NT=t=>{if(!bl(t)||yl(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},OT=Xn("Date"),MT=Xn("File"),DT=Xn("Blob"),LT=Xn("FileList"),UT=t=>bl(t)&&on(t.pipe),zT=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||on(t.append)&&((e=ku(t))==="formdata"||e==="object"&&on(t.toString)&&t.toString()==="[object FormData]"))},PT=Xn("URLSearchParams"),[BT,$T,qT,HT]=["ReadableStream","Request","Response","Headers"].map(Xn),IT=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function wl(t,e,{allOwnKeys:r=!1}={}){if(t===null||typeof t>"u")return;let s,o;if(typeof t!="object"&&(t=[t]),qi(t))for(s=0,o=t.length;s<o;s++)e.call(null,t[s],s,t);else{if(yl(t))return;const l=r?Object.getOwnPropertyNames(t):Object.keys(t),u=l.length;let d;for(s=0;s<u;s++)d=l[s],e.call(null,t[d],d,t)}}function g1(t,e){if(yl(t))return null;e=e.toLowerCase();const r=Object.keys(t);let s=r.length,o;for(;s-- >0;)if(o=r[s],e===o.toLowerCase())return o;return null}const hs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,v1=t=>!dl(t)&&t!==hs;function Yh(){const{caseless:t}=v1(this)&&this||{},e={},r=(s,o)=>{const l=t&&g1(e,o)||o;nu(e[l])&&nu(s)?e[l]=Yh(e[l],s):nu(s)?e[l]=Yh({},s):qi(s)?e[l]=s.slice():e[l]=s};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&wl(arguments[s],r);return e}const GT=(t,e,r,{allOwnKeys:s}={})=>(wl(e,(o,l)=>{r&&on(o)?t[l]=d1(o,r):t[l]=o},{allOwnKeys:s}),t),KT=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),VT=(t,e,r,s)=>{t.prototype=Object.create(e.prototype,s),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),r&&Object.assign(t.prototype,r)},YT=(t,e,r,s)=>{let o,l,u;const d={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),l=o.length;l-- >0;)u=o[l],(!s||s(u,t,e))&&!d[u]&&(e[u]=t[u],d[u]=!0);t=r!==!1&&Am(t)}while(t&&(!r||r(t,e))&&t!==Object.prototype);return e},FT=(t,e,r)=>{t=String(t),(r===void 0||r>t.length)&&(r=t.length),r-=e.length;const s=t.indexOf(e,r);return s!==-1&&s===r},QT=t=>{if(!t)return null;if(qi(t))return t;let e=t.length;if(!p1(e))return null;const r=new Array(e);for(;e-- >0;)r[e]=t[e];return r},XT=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Am(Uint8Array)),ZT=(t,e)=>{const s=(t&&t[Au]).call(t);let o;for(;(o=s.next())&&!o.done;){const l=o.value;e.call(t,l[0],l[1])}},WT=(t,e)=>{let r;const s=[];for(;(r=t.exec(e))!==null;)s.push(r);return s},JT=Xn("HTMLFormElement"),eA=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,s,o){return s.toUpperCase()+o}),ty=(({hasOwnProperty:t})=>(e,r)=>t.call(e,r))(Object.prototype),tA=Xn("RegExp"),y1=(t,e)=>{const r=Object.getOwnPropertyDescriptors(t),s={};wl(r,(o,l)=>{let u;(u=e(o,l,t))!==!1&&(s[l]=u||o)}),Object.defineProperties(t,s)},nA=t=>{y1(t,(e,r)=>{if(on(t)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const s=t[r];if(on(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},rA=(t,e)=>{const r={},s=o=>{o.forEach(l=>{r[l]=!0})};return qi(t)?s(t):s(String(t).split(e)),r},aA=()=>{},sA=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function iA(t){return!!(t&&on(t.append)&&t[h1]==="FormData"&&t[Au])}const oA=t=>{const e=new Array(10),r=(s,o)=>
vendor: 4,460 bytes, line 141
141{if(bl(s)){if(e.indexOf(s)>=0)return;if(yl(s))return s;if(!("toJSON"in s)){e[o]=s;const l=qi(s)?[]:{};return wl(s,(u,d)=>{const m=r(u,o+1);!dl(m)&&(l[d]=m)}),e[o]=void 0,l}}return s};return r(t,0)},lA=Xn("AsyncFunction"),cA=t=>t&&(bl(t)||on(t))&&on(t.then)&&on(t.catch),b1=((t,e)=>t?setImmediate:e?((r,s)=>(hs.addEventListener("message",({source:o,data:l})=>{o===hs&&l===r&&s.length&&s.shift()()},!1),o=>{s.push(o),hs.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",on(hs.postMessage)),uA=typeof queueMicrotask<"u"?queueMicrotask.bind(hs):typeof process<"u"&&process.nextTick||b1,fA=t=>t!=null&&on(t[Au]),H={isArray:qi,isArrayBuffer:m1,isBuffer:yl,isFormData:zT,isArrayBufferView:kT,isString:jT,isNumber:p1,isBoolean:RT,isObject:bl,isPlainObject:nu,isEmptyObject:NT,isReadableStream:BT,isRequest:$T,isResponse:qT,isHeaders:HT,isUndefined:dl,isDate:OT,isFile:MT,isBlob:DT,isRegExp:tA,isFunction:on,isStream:UT,isURLSearchParams:PT,isTypedArray:XT,isFileList:LT,forEach:wl,merge:Yh,extend:GT,trim:IT,stripBOM:KT,inherits:VT,toFlatObject:YT,kindOf:ku,kindOfTest:Xn,endsWith:FT,toArray:QT,forEachEntry:ZT,matchAll:WT,isHTMLForm:JT,hasOwnProperty:ty,hasOwnProp:ty,reduceDescriptors:y1,freezeMethods:nA,toObjectSet:rA,toCamelCase:eA,noop:aA,toFiniteNumber:sA,findKey:g1,global:hs,isContextDefined:v1,isSpecCompliantForm:iA,toJSONObject:oA,isAsyncFn:lA,isThenable:cA,setImmediate:b1,asap:uA,isIterable:fA};function Te(t,e,r,s,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),s&&(this.request=s),o&&(this.response=o,this.status=o.status?o.status:null)}H.inherits(Te,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:H.toJSONObject(this.config),code:this.code,status:this.status}}});const w1=Te.prototype,x1={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{x1[t]={value:t}});Object.defineProperties(Te,x1);Object.defineProperty(w1,"isAxiosError",{value:!0});Te.from=(t,e,r,s,o,l)=>{const u=Object.create(w1);return H.toFlatObject(t,u,function(m){return m!==Error.prototype},d=>d!=="isAxiosError"),Te.call(u,t.message,e,r,s,o),u.cause=t,u.name=t.name,l&&Object.assign(u,l),u};const dA=null;function Fh(t){return H.isPlainObject(t)||H.isArray(t)}function _1(t){return H.endsWith(t,"[]")?t.slice(0,-2):t}function ny(t,e,r){return t?t.concat(e).map(function(o,l){return o=_1(o),!r&&l?"["+o+"]":o}).join(r?".":""):e}function hA(t){return H.isArray(t)&&!t.some(Fh)}const mA=H.toFlatObject(H,{},null,function(e){return/^is[A-Z]/.test(e)});function Ru(t,e,r){if(!H.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,r=H.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(E,T){return!H.isUndefined(T[E])});const s=r.metaTokens,o=r.visitor||g,l=r.dots,u=r.indexes,m=(r.Blob||typeof Blob<"u"&&Blob)&&H.isSpecCompliantForm(e);if(!H.isFunction(o))throw new TypeError("visitor must be a function");function h(x){if(x===null)return"";if(H.isDate(x))return x.toISOString();if(H.isBoolean(x))return x.toString();if(!m&&H.isBlob(x))throw new Te("Blob is not supported. Use a Buffer instead.");return H.isArrayBuffer(x)||H.isTypedArray(x)?m&&typeof Blob=="function"?new Blob([x]):Buffer.from(x):x}function g(x,E,T){let k=x;if(x&&!T&&typeof x=="object"){if(H.endsWith(E,"{}"))E=s?E:E.slice(0,-2),x=JSON.stringify(x);else if(H.isArray(x)&&hA(x)||(H.isFileList(x)||H.endsWith(E,"[]"))&&(k=H.toArray(x)))return E=_1(E),k.forEach(function(O,Y){!(H.isUndefined(O)||O===null)&&e.append(u===!0?ny([E],Y,l):u===null?E:E+"[]",h(O))}),!1}return Fh(x)?!0:(e.append(ny(T,E,l),h(x)),!1)}const v=[],b=Object.assign(mA,{defaultVisitor:g,convertValue:h,isVisitable:Fh});function C(x,E){if(!H.isUndefined(x)){if(v.indexOf(x)!==-1)throw Error("Circular reference detected in "+E.join("."));v.push(x),H.forEach(x,function(k,z){(!(H.isUndefined(k)||k===null)&&o.call(e,k,H.isString(z)?z.trim():z,E,b))===!0&&C(k,E?E.concat(z):[z])}),v.pop()}}if(!H.isObject(t))throw new TypeError("data must be an object");return C(t),e}
vendor: 5,399 bytes, lines 141-142
141function ry(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function km(t,e){this._pairs=[],t&&Ru(t,this,e)}const S1=km.prototype;S1.append=function(e,r){this._pairs.push([e,r])};S1.toString=function(e){const r=e?function(s){return e.call(this,s,ry)}:ry;return this._pairs.map(function(o){return r(o[0])+"="+r(o[1])},"").join("&")};function pA(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function E1(t,e,r){if(!e)return t;const s=r&&r.encode||pA;H.isFunction(r)&&(r={serialize:r});const o=r&&r.serialize;let l;if(o?l=o(e,r):l=H.isURLSearchParams(e)?e.toString():new km(e,r).toString(s),l){const u=t.indexOf("#");u!==-1&&(t=t.slice(0,u)),t+=(t.indexOf("?")===-1?"?":"&")+l}return t}class ay{constructor(){this.handlers=[]}use(e,r,s){return this.handlers.push({fulfilled:e,rejected:r,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){H.forEach(this.handlers,function(s){s!==null&&e(s)})}}const C1={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},gA=typeof URLSearchParams<"u"?URLSearchParams:km,vA=typeof FormData<"u"?FormData:null,yA=typeof Blob<"u"?Blob:null,bA={isBrowser:!0,classes:{URLSearchParams:gA,FormData:vA,Blob:yA},protocols:["http","https","file","blob","url","data"]},jm=typeof window<"u"&&typeof document<"u",Qh=typeof navigator=="object"&&navigator||void 0,wA=jm&&(!Qh||["ReactNative","NativeScript","NS"].indexOf(Qh.product)<0),xA=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",_A=jm&&window.location.href||"http://localhost",SA=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:jm,hasStandardBrowserEnv:wA,hasStandardBrowserWebWorkerEnv:xA,navigator:Qh,origin:_A},Symbol.toStringTag,{value:"Module"})),Qt={...SA,...bA};function EA(t,e){return Ru(t,new Qt.classes.URLSearchParams,{visitor:function(r,s,o,l){return Qt.isNode&&H.isBuffer(r)?(this.append(s,r.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)},...e})}function CA(t){return H.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function TA(t){const e={},r=Object.keys(t);let s;const o=r.length;let l;for(s=0;s<o;s++)l=r[s],e[l]=t[l];return e}function T1(t){function e(r,s,o,l){let u=r[l++];if(u==="__proto__")return!0;const d=Number.isFinite(+u),m=l>=r.length;return u=!u&&H.isArray(o)?o.length:u,m?(H.hasOwnProp(o,u)?o[u]=[o[u],s]:o[u]=s,!d):((!o[u]||!H.isObject(o[u]))&&(o[u]=[]),e(r,s,o[u],l)&&H.isArray(o[u])&&(o[u]=TA(o[u])),!d)}if(H.isFormData(t)&&H.isFunction(t.entries)){const r={};return H.forEachEntry(t,(s,o)=>{e(CA(s),o,r,0)}),r}return null}function AA(t,e,r){if(H.isString(t))try{return(e||JSON.parse)(t),H.trim(t)}catch(s){if(s.name!=="SyntaxError")throw s}return(r||JSON.stringify)(t)}const xl={transitional:C1,adapter:["xhr","http","fetch"],transformRequest:[function(e,r){const s=r.getContentType()||"",o=s.indexOf("application/json")>-1,l=H.isObject(e);if(l&&H.isHTMLForm(e)&&(e=new FormData(e)),H.isFormData(e))return o?JSON.stringify(T1(e)):e;if(H.isArrayBuffer(e)||H.isBuffer(e)||H.isStream(e)||H.isFile(e)||H.isBlob(e)||H.isReadableStream(e))return e;if(H.isArrayBufferView(e))return e.buffer;if(H.isURLSearchParams(e))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let d;if(l){if(s.indexOf("application/x-www-form-urlencoded")>-1)return EA(e,this.formSerializer).toString();if((d=H.isFileList(e))||s.indexOf("multipart/form-data")>-1){const m=this.env&&this.env.FormData;return Ru(d?{"files[]":e}:e,m&&new m,this.formSerializer)}}return l||o?(r.setContentType("application/json",!1),AA(e)):e}],transformResponse:[function(e){const r=this.transitional||xl.transitional,s=r&&r.forcedJSONParsing,o=this.responseType==="json";if(H.isResponse(e)||H.isReadableStream(e))return e;if(e&&H.isString(e)&&(s&&!this.responseType||o)){const u=!(r&&r.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(d){if(u)throw d.name==="SyntaxError"?Te.from(d,Te.ERR_BAD_RESPONSE,this,null,this.response):d}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Qt.classes.FormData,Blob:Qt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};H.forEach(["delete","get","head","post","put","patch"],t=>{xl.headers[t]={}});const kA=H.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),jA=t=>{const e={};let r,s,o;return t&&t.split(` 142`).forEach(function(u){o=u.indexOf(":"),r=u.substring(0,o).trim().toLowerCase(),s=u.substring(o+1).trim(),!(!r||e[r]&&kA[r])&&(r==="set-cookie"?e[r]?e[r].push(s):e[r]=[s]:e[r]=e[r]?e[r]+", "+s:s)}),e},sy=Symbol("internals");function Wo(t){return t&&String(t).trim().toLowerCase()}function ru(t){return t===!1||t==null?t:H.isArray(t)?t.map(ru):String(t)}function RA(t){const e=Object.create(null),r=/([^\s,;
142=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=r.exec(t);)e[s[1]]=s[2];return e}const NA=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function sh(t,e,r,s,o){if(H.isFunction(s))return s.call(this,e,r);if(o&&(e=r),!!H.isString(e)){if(H.isString(s))return e.indexOf(s)!==-1;if(H.isRegExp(s))return s.test(e)}}function OA(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,r,s)=>r.toUpperCase()+s)}function MA(t,e){const r=H.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(t,s+r,{value:function(o,l,u){return this[s].call(this,e,o,l,u)},configurable:!0})})}let ln=class{constructor(e){e&&this.set(e)}set(e,r,s){const o=this;function l(d,m,h){const g=Wo(m);if(!g)throw new Error("header name must be a non-empty string");const v=H.findKey(o,g);(!v||o[v]===void 0||h===!0||h===void 0&&o[v]!==!1)&&(o[v||m]=ru(d))}const u=(d,m)=>H.forEach(d,(h,g)=>l(h,g,m));if(H.isPlainObject(e)||e instanceof this.constructor)u(e,r);else if(H.isString(e)&&(e=e.trim())&&!NA(e))u(jA(e),r);else if(H.isObject(e)&&H.isIterable(e)){let d={},m,h;for(const g of e){if(!H.isArray(g))throw TypeError("Object iterator must return a key-value pair");d[h=g[0]]=(m=d[h])?H.isArray(m)?[...m,g[1]]:[m,g[1]]:g[1]}u(d,r)}else e!=null&&l(r,e,s);return this}get(e,r){if(e=Wo(e),e){const s=H.findKey(this,e);if(s){const o=this[s];if(!r)return o;if(r===!0)return RA(o);if(H.isFunction(r))return r.call(this,o,s);if(H.isRegExp(r))return r.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,r){if(e=Wo(e),e){const s=H.findKey(this,e);return!!(s&&this[s]!==void 0&&(!r||sh(this,this[s],s,r)))}return!1}delete(e,r){const s=this;let o=!1;function l(u){if(u=Wo(u),u){const d=H.findKey(s,u);d&&(!r||sh(s,s[d],d,r))&&(delete s[d],o=!0)}}return H.isArray(e)?e.forEach(l):l(e),o}clear(e){const r=Object.keys(this);let s=r.length,o=!1;for(;s--;){const l=r[s];(!e||sh(this,this[l],l,e,!0))&&(delete this[l],o=!0)}return o}normalize(e){const r=this,s={};return H.forEach(this,(o,l)=>{const u=H.findKey(s,l);if(u){r[u]=ru(o),delete r[l];return}const d=e?OA(l):String(l).trim();d!==l&&delete r[l],r[d]=ru(o),s[d]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const r=Object.create(null);return H.forEach(this,(s,o)=>{s!=null&&s!==!1&&(r[o]=e&&H.isArray(s)?s.join(", "):s)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,r])=>e+": "+r).join(` 143`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){const s=new this(e);return r.forEach(o=>s.set(o)),s}static accessor(e){const s=(this[sy]=this[sy]={accessors:{}}).accessors,o=this.prototype;function l(u){const d=Wo(u);s[d]||(MA(o,u),s[d]=!0)}return H.isArray(e)?e.forEach(l):l(e),this}};ln.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);H.reduceDescriptors(ln.prototype,({value:t},e)=>{let r=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(s){this[r]=s}}});H.freezeMethods(ln);function ih(t,e){const r=this||xl,s=e||r,o=ln.from(s.headers);let l=s.data;return H.forEach(t,function(d){l=d.call(r,l,o.normalize(),e?e.status:void 0)}),o.normalize(),l}function A1(t){return!!(t&&t.__CANCEL__)}function Hi(t,e,r){Te.call(this,t??"canceled",Te.ERR_CANCELED,e,r),this.name="CanceledError"}H.inherits(Hi,Te,{__CANCEL__:!0});function k1(t,e,r){const s=r.config.validateStatus;!r.status||!s||s(r.status)?t(r):e(new Te("Request failed with status code "+r.status,[Te.ERR_BAD_REQUEST,Te.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function DA(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function LA(t,e){t=t||10;const r=new Array(t),s=new Array(t);let o=0,l=0,u;return e=e!==void 0?e:1e3,function(m){const h=Date.now(),g=s[l];u||(u=h),r[o]=m,s[o]=h;let v=l,b=0;for(;v!==o;)b+=r[v++],v=v%t;if(o=(o+1)%t,o===l&&(l=(l+1)%t),h-u<e)return;const C=g&&h-g;return C?Math.round(b*1e3/C):void 0}}function UA(t,e){let r=0,s=1e3/e,o,l;const u=(h,g=Date.now())=>{r=g,o=null,l&&(clearTimeout(l),l=null),t(...h)};return[(...h)=>{const g=Date.now(),v=g-r;v>=s?u(h,g):(o=h,l||(l=setTimeout(()=>{l=null,u(o)},s-v)))},()=>o&&u(o)]}const fu=(t,e,r=3)=>{let s=0;const o=LA(50,250);return UA(l=>{const u=l.loaded,d=l.lengthComputable?l.total:void 0,m=u-s,h=o(m),g=u<=d;s=u;const v={loaded:u,total:d,progress:d?u/d:void 0,bytes:m,rate:h||void 0,estimated:h&&d&&g?(d-u)/h:void 0,event:l,lengthComputable:d!=null,[e?"download":"upload"]:!0};t(v)},r)},iy=(t,e)=>{const r=t!=null;return[s=>e[0]({lengthComputable:r,total:t,loaded:s}),e[1]]},oy=t=>(...e)=>H.asap(()=>t(...e)),zA=Qt.hasStandardBrowserEnv?((t,e)=>r=>(r=new URL(r,Qt.origin),t.protocol===r.protocol&&t.host===r.host&&(e||t.port===r.port)))(new URL(Qt.origin),Qt.navigator&&/(msie|trident)/i.test(Qt.navigator.userAgent)):()=>!0,PA=Qt.hasStandardBrowserEnv?{write(t,e,r,s,o,l){const u=[t+"="+encodeURIComponent(e)];H.isNumber(r)&&u.push("expires="+new Date(r).toGMTString()),H.isString(s)&&u.push("path="+s),H.isString(o)&&u.push("domain="+o),l===!0&&u.push("secure"),document.cookie=u.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function BA(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function $A(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function j1(t,e,r){let s=!BA(e);return t&&(s||r==!1)?$A(t,e):e}const ly=t=>t instanceof ln?{...t}:t;function gs(t,e){e=e||{};const r={};function s(h,g,v,b){return H.isPlainObject(h)&&H.isPlainObject(g)?H.merge.call({caseless:b},h,g):H.isPlainObject(g)?H.merge({},g):H.isArray(g)?g.slice():g}function o(h,g,v,b){if(H.isUndefined(g)){if(!H.isUndefined(h))return s(void 0,h,v,b)}else return s(h,g,v,b)}function l(h,g){if(!H.isUndefined(g))return s(void 0,g)}function u(h,g){if(H.isUndefined(g)){if(!H.isUndefined(h))return s(void 0,h)}else return s(void 0,g)}function d(h,g,v){if(v in e)return s(h,g);if(v in t)return s(void 0,h)}const m={url:l,method:l,data:l,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:d,headers:(h,g,v)=>o(ly(h),ly(g),v,!0)};return H.forEach(Object.keys({...t,...e}),function(g){const v=m[g]||o,b=v(t[g],e[g],g);H.isUndefined(b)&&v!==d||(r[g]=b)}),r}const R1=t=>{const e=gs({},t);let{data:r,withXSRFToken:s,xsrfHeaderName:o,xsrfCookieName:l,headers:u,auth:d}=e;e.headers=u=ln.from(u),e.url=E1(j1(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),d&&u.set("Authorization","Basic "+btoa((d.username||"")+":"+(d.password?unescape(encodeURIComponent(d.password)):"")));let m;if(H.isFormData(r)){if(Qt.hasStandardBrowserEnv||Qt.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if((m=u.getContentType())!==!1){const[h,...g]=m?m.split(";").map(v=>
vendor: 4,081 bytes, line 143
143v.trim()).filter(Boolean):[];u.setContentType([h||"multipart/form-data",...g].join("; "))}}if(Qt.hasStandardBrowserEnv&&(s&&H.isFunction(s)&&(s=s(e)),s||s!==!1&&zA(e.url))){const h=o&&l&&PA.read(l);h&&u.set(o,h)}return e},qA=typeof XMLHttpRequest<"u",HA=qA&&function(t){return new Promise(function(r,s){const o=R1(t);let l=o.data;const u=ln.from(o.headers).normalize();let{responseType:d,onUploadProgress:m,onDownloadProgress:h}=o,g,v,b,C,x;function E(){C&&C(),x&&x(),o.cancelToken&&o.cancelToken.unsubscribe(g),o.signal&&o.signal.removeEventListener("abort",g)}let T=new XMLHttpRequest;T.open(o.method.toUpperCase(),o.url,!0),T.timeout=o.timeout;function k(){if(!T)return;const O=ln.from("getAllResponseHeaders"in T&&T.getAllResponseHeaders()),K={data:!d||d==="text"||d==="json"?T.responseText:T.response,status:T.status,statusText:T.statusText,headers:O,config:t,request:T};k1(function(J){r(J),E()},function(J){s(J),E()},K),T=null}"onloadend"in T?T.onloadend=k:T.onreadystatechange=function(){!T||T.readyState!==4||T.status===0&&!(T.responseURL&&T.responseURL.indexOf("file:")===0)||setTimeout(k)},T.onabort=function(){T&&(s(new Te("Request aborted",Te.ECONNABORTED,t,T)),T=null)},T.onerror=function(){s(new Te("Network Error",Te.ERR_NETWORK,t,T)),T=null},T.ontimeout=function(){let Y=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const K=o.transitional||C1;o.timeoutErrorMessage&&(Y=o.timeoutErrorMessage),s(new Te(Y,K.clarifyTimeoutError?Te.ETIMEDOUT:Te.ECONNABORTED,t,T)),T=null},l===void 0&&u.setContentType(null),"setRequestHeader"in T&&H.forEach(u.toJSON(),function(Y,K){T.setRequestHeader(K,Y)}),H.isUndefined(o.withCredentials)||(T.withCredentials=!!o.withCredentials),d&&d!=="json"&&(T.responseType=o.responseType),h&&([b,x]=fu(h,!0),T.addEventListener("progress",b)),m&&T.upload&&([v,C]=fu(m),T.upload.addEventListener("progress",v),T.upload.addEventListener("loadend",C)),(o.cancelToken||o.signal)&&(g=O=>{T&&(s(!O||O.type?new Hi(null,t,T):O),T.abort(),T=null)},o.cancelToken&&o.cancelToken.subscribe(g),o.signal&&(o.signal.aborted?g():o.signal.addEventListener("abort",g)));const z=DA(o.url);if(z&&Qt.protocols.indexOf(z)===-1){s(new Te("Unsupported protocol "+z+":",Te.ERR_BAD_REQUEST,t));return}T.send(l||null)})},IA=(t,e)=>{const{length:r}=t=t?t.filter(Boolean):[];if(e||r){let s=new AbortController,o;const l=function(h){if(!o){o=!0,d();const g=h instanceof Error?h:this.reason;s.abort(g instanceof Te?g:new Hi(g instanceof Error?g.message:g))}};let u=e&&setTimeout(()=>{u=null,l(new Te(`timeout ${e} of ms exceeded`,Te.ETIMEDOUT))},e);const d=()=>{t&&(u&&clearTimeout(u),u=null,t.forEach(h=>{h.unsubscribe?h.unsubscribe(l):h.removeEventListener("abort",l)}),t=null)};t.forEach(h=>h.addEventListener("abort",l));const{signal:m}=s;return m.unsubscribe=()=>H.asap(d),m}},GA=function*(t,e){let r=t.byteLength;if(r<e){yield t;return}let s=0,o;for(;s<r;)o=s+e,yield t.slice(s,o),s=o},KA=async function*(t,e){for await(const r of VA(t))yield*GA(r,e)},VA=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:r,value:s}=await e.read();if(r)break;yield s}}finally{await e.cancel()}},cy=(t,e,r,s)=>{const o=KA(t,e);let l=0,u,d=m=>{u||(u=!0,s&&s(m))};return new ReadableStream({async pull(m){try{const{done:h,value:g}=await o.next();if(h){d(),m.close();return}let v=g.byteLength;if(r){let b=l+=v;r(b)}m.enqueue(new Uint8Array(g))}catch(h){throw d(h),h}},cancel(m){return d(m),o.return()}},{highWaterMark:2})},Nu=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",N1=Nu&&typeof ReadableStream=="function",YA=Nu&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),O1=(t,...e)=>{try{return!!t(...e)}catch{return!1}},FA=N1&&O1(()=>{let t=!1;const e=new Request(Qt.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),uy=64*1024,Xh=N1&&O1(()=>H.isReadableStream(new Response("").body)),du={stream:Xh&&(t=>t.body)};Nu&&(t=>
vendor: 4,162 bytes, lines 143-145
143{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!du[e]&&(du[e]=H.isFunction(t[e])?r=>r[e]():(r,s)=>{throw new Te(`Response type '${e}' is not supported`,Te.ERR_NOT_SUPPORT,s)})})})(new Response);const QA=async t=>{if(t==null)return 0;if(H.isBlob(t))return t.size;if(H.isSpecCompliantForm(t))return(await new Request(Qt.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(H.isArrayBufferView(t)||H.isArrayBuffer(t))return t.byteLength;if(H.isURLSearchParams(t)&&(t=t+""),H.isString(t))return(await YA(t)).byteLength},XA=async(t,e)=>{const r=H.toFiniteNumber(t.getContentLength());return r??QA(e)},ZA=Nu&&(async t=>{let{url:e,method:r,data:s,signal:o,cancelToken:l,timeout:u,onDownloadProgress:d,onUploadProgress:m,responseType:h,headers:g,withCredentials:v="same-origin",fetchOptions:b}=R1(t);h=h?(h+"").toLowerCase():"text";let C=IA([o,l&&l.toAbortSignal()],u),x;const E=C&&C.unsubscribe&&(()=>{C.unsubscribe()});let T;try{if(m&&FA&&r!=="get"&&r!=="head"&&(T=await XA(g,s))!==0){let K=new Request(e,{method:"POST",body:s,duplex:"half"}),re;if(H.isFormData(s)&&(re=K.headers.get("content-type"))&&g.setContentType(re),K.body){const[J,Z]=iy(T,fu(oy(m)));s=cy(K.body,uy,J,Z)}}H.isString(v)||(v=v?"include":"omit");const k="credentials"in Request.prototype;x=new Request(e,{...b,signal:C,method:r.toUpperCase(),headers:g.normalize().toJSON(),body:s,duplex:"half",credentials:k?v:void 0});let z=await fetch(x,b);const O=Xh&&(h==="stream"||h==="response");if(Xh&&(d||O&&E)){const K={};["status","statusText","headers"].forEach(de=>{K[de]=z[de]});const re=H.toFiniteNumber(z.headers.get("content-length")),[J,Z]=d&&iy(re,fu(oy(d),!0))||[];z=new Response(cy(z.body,uy,J,()=>{Z&&Z(),E&&E()}),K)}h=h||"text";let Y=await du[H.findKey(du,h)||"text"](z,t);return!O&&E&&E(),await new Promise((K,re)=>{k1(K,re,{data:Y,headers:ln.from(z.headers),status:z.status,statusText:z.statusText,config:t,request:x})})}catch(k){throw E&&E(),k&&k.name==="TypeError"&&/Load failed|fetch/i.test(k.message)?Object.assign(new Te("Network Error",Te.ERR_NETWORK,t,x),{cause:k.cause||k}):Te.from(k,k&&k.code,t,x)}}),Zh={http:dA,xhr:HA,fetch:ZA};H.forEach(Zh,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const fy=t=>`- ${t}`,WA=t=>H.isFunction(t)||t===null||t===!1,M1={getAdapter:t=>{t=H.isArray(t)?t:[t];const{length:e}=t;let r,s;const o={};for(let l=0;l<e;l++){r=t[l];let u;if(s=r,!WA(r)&&(s=Zh[(u=String(r)).toLowerCase()],s===void 0))throw new Te(`Unknown adapter '${u}'`);if(s)break;o[u||"#"+l]=s}if(!s){const l=Object.entries(o).map(([d,m])=>`adapter ${d} `+(m===!1?"is not supported by the environment":"is not available in the build"));let u=e?l.length>1?`since : 144`+l.map(fy).join(` 145`):" "+fy(l[0]):"as no adapter specified";throw new Te("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return s},adapters:Zh};function oh(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Hi(null,t)}function dy(t){return oh(t),t.headers=ln.from(t.headers),t.data=ih.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),M1.getAdapter(t.adapter||xl.adapter)(t).then(function(s){return oh(t),s.data=ih.call(t,t.transformResponse,s),s.headers=ln.from(s.headers),s},function(s){return A1(s)||(oh(t),s&&s.response&&(s.response.data=ih.call(t,t.transformResponse,s.response),s.response.headers=ln.from(s.response.headers))),Promise.reject(s)})}const D1="1.11.0",Ou={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Ou[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});const hy={};Ou.transitional=function(e,r,s){function o(l,u){return"[Axios v"+D1+"] Transitional option '"+l+"'"+u+(s?". "+s:"")}return(l,u,d)=>{if(e===!1)throw new Te(o(u," has been removed"+(r?" in "+r:"")),Te.ERR_DEPRECATED);return r&&!hy[u]&&(hy[u]=!0,console.warn(o(u," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(l,u,d):!0}};Ou.spelling=function(e){return(r,s)=>(console.warn(`${s} is likely a misspelling of ${e}
145`),!0)};function JA(t,e,r){if(typeof t!="object")throw new Te("options must be an object",Te.ERR_BAD_OPTION_VALUE);const s=Object.keys(t);let o=s.length;for(;o-- >0;){const l=s[o],u=e[l];if(u){const d=t[l],m=d===void 0||u(d,l,t);if(m!==!0)throw new Te("option "+l+" must be "+m,Te.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new Te("Unknown option "+l,Te.ERR_BAD_OPTION)}}const au={assertOptions:JA,validators:Ou},cr=au.validators;let ms=class{constructor(e){this.defaults=e||{},this.interceptors={request:new ay,response:new ay}}async request(e,r){try{return await this._request(e,r)}catch(s){if(s instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const l=o.stack?o.stack.replace(/^.+\n/,""):"";try{s.stack?l&&!String(s.stack).endsWith(l.replace(/^.+\n.+\n/,""))&&(s.stack+=` 146`+l):s.stack=l}catch{}}throw s}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=gs(this.defaults,r);const{transitional:s,paramsSerializer:o,headers:l}=r;s!==void 0&&au.assertOptions(s,{silentJSONParsing:cr.transitional(cr.boolean),forcedJSONParsing:cr.transitional(cr.boolean),clarifyTimeoutError:cr.transitional(cr.boolean)},!1),o!=null&&(H.isFunction(o)?r.paramsSerializer={serialize:o}:au.assertOptions(o,{encode:cr.function,serialize:cr.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),au.assertOptions(r,{baseUrl:cr.spelling("baseURL"),withXsrfToken:cr.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();
vendor: 2,565 bytes, line 146
146let u=l&&H.merge(l.common,l[r.method]);l&&H.forEach(["delete","get","head","post","put","patch","common"],x=>{delete l[x]}),r.headers=ln.concat(u,l);const d=[];let m=!0;this.interceptors.request.forEach(function(E){typeof E.runWhen=="function"&&E.runWhen(r)===!1||(m=m&&E.synchronous,d.unshift(E.fulfilled,E.rejected))});const h=[];this.interceptors.response.forEach(function(E){h.push(E.fulfilled,E.rejected)});let g,v=0,b;if(!m){const x=[dy.bind(this),void 0];for(x.unshift(...d),x.push(...h),b=x.length,g=Promise.resolve(r);v<b;)g=g.then(x[v++],x[v++]);return g}b=d.length;let C=r;for(v=0;v<b;){const x=d[v++],E=d[v++];try{C=x(C)}catch(T){E.call(this,T);break}}try{g=dy.call(this,C)}catch(x){return Promise.reject(x)}for(v=0,b=h.length;v<b;)g=g.then(h[v++],h[v++]);return g}getUri(e){e=gs(this.defaults,e);const r=j1(e.baseURL,e.url,e.allowAbsoluteUrls);return E1(r,e.params,e.paramsSerializer)}};H.forEach(["delete","get","head","options"],function(e){ms.prototype[e]=function(r,s){return this.request(gs(s||{},{method:e,url:r,data:(s||{}).data}))}});H.forEach(["post","put","patch"],function(e){function r(s){return function(l,u,d){return this.request(gs(d||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:l,data:u}))}}ms.prototype[e]=r(),ms.prototype[e+"Form"]=r(!0)});let e4=class L1{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(l){r=l});const s=this;this.promise.then(o=>{if(!s._listeners)return;let l=s._listeners.length;for(;l-- >0;)s._listeners[l](o);s._listeners=null}),this.promise.then=o=>{let l;const u=new Promise(d=>{s.subscribe(d),l=d}).then(o);return u.cancel=function(){s.unsubscribe(l)},u},e(function(l,u,d){s.reason||(s.reason=new Hi(l,u,d),r(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const r=this._listeners.indexOf(e);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const e=new AbortController,r=s=>{e.abort(s)};return this.subscribe(r),e.signal.unsubscribe=()=>this.unsubscribe(r),e.signal}static source(){let e;return{token:new L1(function(o){e=o}),cancel:e}}};function t4(t){return function(r){return t.apply(null,r)}}function n4(t){return H.isObject(t)&&t.isAxiosError===!0}const Wh={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,Parti
146alContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Wh).forEach(([t,e])=>{Wh[e]=t});function U1(t){const e=new ms(t),r=d1(ms.prototype.request,e);return H.extend(r,ms.prototype,e,{allOwnKeys:!0}),H.extend(r,e,null,{allOwnKeys:!0}),r.create=function(o){return U1(gs(t,o))},r}const mt=U1(xl);mt.Axios=ms;mt.CanceledError=Hi;mt.CancelToken=e4;mt.isCancel=A1;mt.VERSION=D1;mt.toFormData=Ru;mt.AxiosError=Te;mt.Cancel=mt.CanceledError;mt.all=function(e){return Promise.all(e)};mt.spread=t4;mt.isAxiosError=n4;mt.mergeConfig=gs;mt.AxiosHeaders=ln;mt.formToJSON=t=>T1(H.isHTMLForm(t)?new FormData(t):t);mt.getAdapter=M1.getAdapter;mt.HttpStatusCode=Wh;mt.default=mt;const{Axios:CO,AxiosError:TO,CanceledError:AO,isCancel:kO,CancelToken:jO,VERSION:RO,all:NO,Cancel:OO,isAxiosError:MO,spread:DO,toFormData:LO,AxiosHeaders:UO,HttpStatusCode:zO,formToJSON:PO,getAdapter:BO,mergeConfig:$O}=mt,my=()=>localStorage.getItem("auth_token"),r4=t=>localStorage.setItem("auth_token",t),py=()=>localStorage.removeItem("auth_token");class a4{constructor(){nt(this,"client");this.client=mt.create({baseURL:Db,headers:{"Content-Type":"application/json"},timeout:29e3}),this.setupInterceptors()}setupInterceptors(){this.client.interceptors.request.use(e=>{const r=my();return r&&(e.headers.Authorization=`Bearer ${r}`),e},e=>Promise.reject(e)),this.client.interceptors.response.use(e=>e,e=>{if(e.response){const{status:r}=e.response;r===401?(console.error("Unauthorized access"),py(),window.location.href="/"):r===404?console.error("Resource not found"):r>=500&&console.error("Server error")}else e.request?console.error("Network error - no response received"):console.error("Error setting up request:",e.message);return Promise.reject(e)})}async get(e,r){return(await this.client.get(e,r)).data}async post(e,r,s){return(await this.client.post(e,r,s)).data}async put(e,r,s){return(await this.client.put(e,r,s)).data}async delete(e,r){return(await this.client.delete(e,r)).data}async patch(e,r,s){return(await this.client.patch(e,r,s)).data}setAuthToken(e){r4(e)}clearAuthToken(){py()}isAuthenticated(){return!!my()}}const Yn=new a4,s4=()=>async e=>Yn.post("/chess/create-game",{players:e}),i4={openai:"/avatars/openai-white.png",gemini:"/avatars/gemini-white.png",claude:"/avatars/claude.png",grok:"/avatars/grok-white.png"},o4=({color:t})=>y.jsx("svg",{width:"24",height:"24",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:y.jsx("path",{d:"M18.5684 8.18423C18.792 7.51079 18.8693 6.79739 18.7952 6.09168C18.7211 5.38596 18.4973 4.70419 18.1386 4.0919C17.6069 3.16642 16.7951 2.43369 15.8201 1.99936C14.8451 1.56503 13.7574 1.45153 12.7138 1.67523C12.1209 1.0157 11.3649 0.523789 10.5217 0.248906C9.67848 -0.0259764 8.7778 -0.0741542 7.9101 0.109212C7.0424 0.292578 6.23822 0.701031 5.57834 1.29355C4.91845 1.88607 4.42609 2.64179 4.1507 3.48481C3.45542 3.62739 2.79858 3.91672 2.22408 4.33347C1.64958 4.75023 1.17064 5.28481 0.819284 5.90148C0.281813 6.82542 0.0521017 7.89634 0.16336 8.95943C0.274618 10.0225 0.721081 11.0227 1.4382 11.8153C1.21375 12.4884 1.13564 13.2017 1.20908 13.9074C1.28251 14.6132 1.50581 15.2951 1.86403 15.9076C2.3964 16.8334 3.20897 17.5663 4.18463 18.0006C5.16028 18.4349 6.24865 18.5483 7.29287 18.3243C7.76392 18.8548 8.34272 19.2786 8.99062 19.5676C9.63853 19.8566 10.3406 20.004 11.05 20C12.1197 20.001 13.1621 19.662 14.0266 19.032C14.8911 18.4021 15.5331 17.5137 15.8599 16.4951C16.5551 16.3523 17.2118 16.0629 17.7863 15.6461C18.3607 15.2294 18.8397 14.6949 19.1913 14.0784C19.7224 13.1558 19.9482 12.0889 19.8363 11.0303C19.7244 9.97163 19.2806 8.9754 18.5684 8.18423ZM11.05 18.691C10.174 18.6924 9.32537 18.3853 8.65303 17.8236L8.77128 17.7566L12.7532 15.4581C12.8523 15.4 12.9346 15.3171 12.992 15.2176C13.0493 15.118 13.0798 15.0053 13.0805 14.8904V9.27631L14.7638 10.2501C14.7721 10.2544 14.7793 10.2605 14.7848 10.268C14.7903 10.2755 14.794 10.2843 14.7955 10.2935V14.9456C14.7933 15.9383 14.3981 16.8898 13.6961 17.5917C12.9942 18.2936 12.0427 18.6889 11.05 18.691ZM2.99945 15.2531C2.56009 14.4945 2.40234 13.6052 2.55395 12.7417L2.67228 12.8127L6.65812 15.1112C6.75674 15.1691 6.86902 15.1996 6.98337 15.1996C7.09772 15.1996 7.20999 15.1691 7.30862 15.1112L12.1776 12.3041V14.2478C12.1772 14.2579 12.1744 14.2677 12.1696 14.2766C12.1649 14.2855 12.1581 14.2932 12.15 14.2991L8.11678 16.6251C7.25606 17.121 6.23374 17.255 5.27429 16.9978C4.31484 16.7405 3.49669 16.1131 2.99945 15.2531ZM1.95078 6.57965C2.39319 5.81612 3.09148 5.23375 3.92203 4.93565V9.66665C3.92054 9.78094 3.94974 9.89355 4.0066 9.99271C4.06346 10.0919 4.14589 10.174 4.24528 10.2304L9.09062 13.0256L7.4072 13.9994C7.39809 14.0042 7.38793 14.0068 7.37762 14.0068C7.3673 14.0068 7.35714 14.0042 7.34803 13.9994L3.32278 11.6773C2.46367 11.1793 1.83691 10.3612 1.57976 9.40204C1.3226 8.44291 1.45602 7.42095 1.95078 6.55998V6.57965ZM15.781 9.79281L10.92 6.96998L12.5995 5.99998C12.6086 5.99514 12.6187 5.99261 12.629 5.99261C12.6393 5.99261 12.6495 5.99514 12.6586 5.99998L16.6839 8.32606C17.2993 8.68119
14617.8011 9.20407 18.1305 9.83365C18.4599 10.4632 18.6035 11.1735 18.5444 11.8816C18.4853 12.5898 18.2259 13.2664 17.7967 13.8327C17.3674 14.3989 16.7859 14.8314 16.1201 15.0796V10.3486C16.1166 10.2345 16.0835 10.1232 16.0241 10.0258C15.9646 9.92833 15.8809 9.8481 15.781 9.79281ZM17.4566 7.27356L17.3383 7.20256L13.3604 4.8844C13.2611 4.82617 13.1482 4.79547 13.0331 4.79547C12.9181 4.79547 12.8051 4.82617 12.7059 4.8844L7.84095 7.6914V5.74781C7.83992 5.73793 7.84157 5.72795 7.84573 5.71893C7.8499 5.70991 7.85642 5.70218 7.86462 5.69656L11.8899 3.3744C12.5068 3.01899 13.2122 2.84659 13.9235 2.87736C14.6348 2.90813 15.3226 3.14079 15.9066 3.54813C16.4905 3.95548 16.9464 4.52066 17.2209 5.17759C17.4954 5.83452 17.5772 6.55602 17.4567 7.25773L17.4566 7.27356ZM6.9222 10.7191L5.23887 9.74931C5.23045 9.74424 5.22324 9.73738 5.21777 9.72921C5.2123 9.72105 5.20869 9.71178 5.2072 9.70206V5.06181C5.20813 4.34996 5.41169 3.65307 5.79408 3.05264C6.17647 2.45222 6.72189 1.97305 7.36657 1.67118C8.01125 1.3693 8.72854 1.2572 9.43459 1.34796C10.1406 1.43873 10.8063 1.72861 11.3536 2.18373L11.2353 2.25081L7.25345 4.54915C7.15435 4.60727 7.07207 4.69017 7.01469 4.78971C6.95732 4.88925 6.92682 5.00201 6.9262 5.1169L6.9222 10.7191ZM7.83687 8.74798L10.0052 7.49815L12.1776 8.74798V11.2475L10.0131 12.4972L7.84087 11.2475L7.83687 8.74798Z",fill:t})}),Ni=({ai:t,color:e})=>t==="openai"?y.jsx("div",{className:"w-[24px] h-[24px] flex items-center justify-center",children:y.jsx(o4,{color:e})}):y.jsx("img",{src:i4[t],alt:t,className:"w-[24px] h-[24px] rounded-full"}),vs=({size:t=40,color:e="white",style:r,transparent:s=!1})=>s?y.jsx("svg",{width:t,height:t,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:y.jsx("path",{d:"M6.66699 0.833008C8.25717 0.833035 10.8823 1.62431 11.7734 4.29785H11.7744C12.1806 5.51738 12.007 6.57119 11.8574 7.52051L11.8564 7.52539C11.8436 7.60235 11.8319 7.67992 11.8203 7.75781L11.8193 7.75977C11.6916 8.59178 11.5721 9.53348 11.6924 10.833H12C12.3094 10.833 12.6064 10.956 12.8252 11.1748C13.044 11.3936 13.167 11.6906 13.167 12V14C13.1669 14.3092 13.0438 14.6055 12.8252 14.8242C12.6064 15.043 12.3094 15.166 12 15.166H4C3.69067 15.166 3.39354 15.043 3.1748 14.8242C2.95637 14.6055 2.83407 14.3091 2.83398 14V12C2.83398 11.6907 2.95619 11.3936 3.1748 11.1748C3.39354 10.9561 3.69067 10.8331 4 10.833H4.34961C4.46724 10.4356 4.65022 9.99497 4.92969 9.53125C4.84176 9.57118 4.75463 9.61292 4.66602 9.65137C4.39139 9.77046 4.0869 9.80468 3.79297 9.74805C3.4999 9.69157 3.23095 9.54752 3.02051 9.33594L2.03516 8.35156C1.78985 8.10643 1.63779 7.78357 1.60352 7.43848C1.56924 7.09333 1.65531 6.74662 1.84766 6.45801L3.9873 3.24902L3.62402 2.52246L3.56543 2.38574C3.5164 2.24585 3.4944 2.09724 3.50098 1.94824C3.50978 1.74954 3.56936 1.55597 3.67383 1.38672C3.77835 1.21743 3.92489 1.07739 4.09863 0.980469C4.27232 0.88362 4.46812 0.833014 4.66699 0.833008H6.66699ZM6 5.16602C5.95606 5.16608 5.91398 5.18387 5.88281 5.21484C5.85156 5.2461 5.83398 5.28881 5.83398 5.33301C5.83398 5.37721 5.85156 5.41992 5.88281 5.45117C5.91398 5.48214 5.95606 5.49994 6 5.5C6.04415 5.5 6.08692 5.48235 6.11816 5.45117C6.14942 5.41992 6.16699 5.37721 6.16699 5.33301C6.16699 5.28881 6.14942 5.2461 6.11816 5.21484C6.08692 5.18366 6.04415 5.16602 6 5.16602Z",fill:s?"transparent":e,stroke:s?e==="white"?"black":"white":"transparent"})}):y.jsx("svg",{style:r,width:t,height:t,viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:y.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.6668 3.3335H16.6668C20.3701 3.3335 26.2618 5.18016 28.2485 11.1402C29.1568 13.8668 28.7851 16.2185 28.4085 18.6085C28.3751 18.8085 28.3435 19.0096 28.3135 19.2118C27.9518 21.5685 27.5968 24.3418 28.1051 28.3335H30.0001C30.4421 28.3335 30.8661 28.5091 31.1786 28.8216C31.4912 29.1342 31.6668 29.5581 31.6668 30.0002V35.0002C31.6668 35.4422 31.4912 35.8661 31.1786 36.1787C30.8661 36.4912 30.4421 36.6668 30.0001 36.6668H10.0001C9.55809 36.6668 9.13417 36.4912 8.82161 36.1787C8.50905 35.8661 8.33345 35.4422 8.33345 35.0002V30.0002C8.33345 29.5581 8.50905 29.1342 8.82161 28.8216C9.13417 28.5091 9.55809 28.3335 10.0001 28.3335H11.8435C12.2301 26.4268 13.3435 23.8035 16.1168 21.0735C16.4201 20.7735 16.6001 20.4285 16.6751 20.0868C14.9138 21.1884 13.0725 22.1566 11.1668 22.9835C10.7111 23.1811 10.2064 23.2365 9.71873 23.1426C9.23104 23.0486 8.78307 22.8096 8.43345 22.4568L5.97178 19.9952C5.56285 19.5866 5.30814 19.0489 5.25101 18.4737C5.19388 17.8984 5.33787 17.3212 5.65845 16.8402L11.4101 8.2135L10.1768 5.74683C10.0495 5.49273 9.98922 5.2103 10.0018 4.92636C10.0144 4.64243 10.0994 4.36643 10.2487 4.12459C10.398 3.88276 10.6067 3.68312 10.8549 3.54466C11.1031 3.4062 11.3826 3.33351 11.6668 3.3335ZM15.0001 15.0002C15.4421 15.0002 15.8661 14.8246 16.1786 14.512C16.4912 14.1994 16.6668 13.7755 16.6668 13.3335C16.6668 12.8915 16.4912 12.4675 16.1786 12.155C15.8661 11.8424 15.4421 11.6668 15.0001 11.6668C14.5581 11.6668 14.1342 11.8424 13.8216 12.155C13.509 12.4675 13.3335 12.8915 13.3335 13.3335C13.3335 13.7755 13.509 14.1994 13.8216 14.512C14.1342 14.8246 14.5581 15.0002 15.0001 15.0002Z",fill:e})}),lh=({isSelected:t,className:e,children:r,onClick:s})=>y.jsx("div",{onClick:s,className:ke("flex flex-row gap-2 items-center justify-center rounded-md border-[2px] p-6 font-semibold text-md cursor-pointer",!t&&" bg-transparent hover:bg-white/5",t&&"bg-white/10 border-white/40",!s&&"cursor-default border-white/5",e),children:r}),l4=()=>{const[t,e]=_.useState({openai:[],gemini:[],claude:[],grok:[]}),r=_.useCallback(async()=>{var l;const s=await fetch(`${Db}/chess/models`);if(!s.ok)return;const o=(l=await s.json())==null?void 0:l.models;e(o)},[]);return _.useEffect(()=>{r().catch(()=>console.error("Failed to get AI models"))},[r]),{models:t}};function z1({className:t,...e}){return y.jsx("button",{className:ke(t,`inline-flex items-center justify-center gap-2 whitespace-nowrap 147 text-lg font-extrabold transition-all 148 h-[64px] w-full rounded-md 149 px-6 bg-gradient-to-b from-[#3B6AD7] to-[#1F2B71] text-white 150 hover:opacity-90 cursor-pointer 151 shadow-[0_0_0_2px_#394FF740] 152 disabled:opacity-50 disabled:cursor-not-allowed 153 border border-white/10 border-solid 154 `),...e})}function gy(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function P1(...t){return e=>{let r=!1;const s=t.map(o=>{const l=gy(o,e);return!r&&typeof l=="function"&&(r=!0),l});if(r)return()=>{for(let o=0;o<s.length;o++){const l=s[o];typeof l=="function"?l():gy(t[o],null)}}}}function ws(...t){return _.useCallback(P1(...t),t)}function Rm(t){const e=u4(t),r=_.forwardRef((s,o)=>{const{children:l,...u}=s,d=_.Children.toArray(l),m=d.find(d4);if(m){const h=m.props.children,g=d.map(v=>v===m?_.Children.count(h)>1?_.Children.only(null):_.isValidElement(h)?h.props.children:null:v);return y.jsx(e,{...u,ref:o,children:_.isValidElement(h)?_.cloneElement(h,void 0,g):null})}return y.jsx(e,{...u,ref:o,children:l})});return r.displayName=`${t}.Slot`,r}var c4=Rm("Slot");function u4(t){const e=_.forwardRef((r,s)=>{const{children:o,...l}=r;if(_.isValidElement(o)){const u=m4(o),d=h4(l,o.props);return o.type!==_.Fragment&&(d.ref=s?P1(s,u):u),_.cloneElement(o,d)}return _.Children.count(o)>1?_.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var f4=Symbol("radix.slottable");function d4(t){return _.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===f4}function h4(t,e){const r={...e};for(const s in e){const o=t[s],l=e[s];/^on[A-Z]/.test(s)?o&&l?r[s]=(...d)=>{const m=l(...d);return o(...d),m}:o&&(r[s]=o):s==="style"?r[s]={...o,...l}
154:s==="className"&&(r[s]=[o,l].filter(Boolean).join(" "))}return{...t,...r}}function m4(t){var s,o;let e=(s=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:s.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var p4=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Tn=p4.reduce((t,e)=>{const r=Rm(`Primitive.${e}`),s=_.forwardRef((o,l)=>{const{asChild:u,...d}=o,m=u?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(m,{...d,ref:l})});return s.displayName=`Primitive.${e}`,{...t,[e]:s}},{});function g4(t,e){t&&Nb.flushSync(()=>t.dispatchEvent(e))}var v4="Separator",vy="horizontal",y4=["horizontal","vertical"],B1=_.forwardRef((t,e)=>{const{decorative:r,orientation:s=vy,...o}=t,l=b4(s)?s:vy,d=r?{role:"none"}:{"aria-orientation":l==="vertical"?l:void 0,role:"separator"};return y.jsx(Tn.div,{"data-orientation":l,...d,...o,ref:e})});B1.displayName=v4;function b4(t){return y4.includes(t)}var w4=B1;const ch=({className:t,orientation:e="horizontal",decorative:r=!0,...s})=>y.jsx(w4,{"data-slot":"separator",decorative:r,orientation:e,className:ke("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...s}),x4=({player:t,color:e,onSubmit:r,isAiEnabled:s,isLoading:o})=>{const[l,u]=_.useState(t.ai),[d,m]=_.useState(t.model??""),{models:h}=l4(),g=v=>{u(v),m("")};return _.useEffect(()=>{u(t.ai),m(t.model??"")},[t]),y.jsxs("div",{className:"flex flex-col flex-1 gap-4 items-center w-full",children:[y.jsxs("div",{className:"shrink-0 space-y-2",children:[y.jsx(vs,{color:e,size:80,style:e==="black"?{stroke:"#fff",strokeWidth:.5}:void 0}),y.jsx("h2",{className:"text-center text-2xl font-bold capitalize",children:e})]}),y.jsxs(lh,{isSelected:!l,className:"w-full",onClick:()=>u(void 0),children:["Play as ",e]}),s&&y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"flex flex-row gap-2 shrink-0 items-center justify-center w-full text-muted-foreground text-md font-semibold",children:[y.jsx(ch,{className:"shrink"}),y.jsx("span",{className:"min-w-fit",children:"Or set model"}),y.jsx(ch,{className:"shrink"})]}),y.jsx("div",{className:"flex shrink grow max-h-[106px] flex-row gap-2 w-full overflow-x-auto",children:Object.keys(h).map(v=>y.jsxs(lh,{isSelected:l===v,className:"flex flex-col flex-1 w-full min-w-[102px] min-h-[102px] p-2 capitalize",onClick:()=>g(v),children:[y.jsx(Ni,{ai:v,color:"white"}),v]},v))})]}),y.jsxs("div",{className:"flex flex-col flex-1 gap-4 w-full",children:[y.jsx("div",{className:"flex flex-col flex-1 min-h-[147px] gap-4",children:l&&y.jsxs(y.Fragment,{children:[y.jsx(ch,{}),y.jsx("div",{className:"flex-1 min-h-[130px] max-h-[calc(100dvh-615px)] md:max-h-[calc(100dvh-643px)] space-y-2 overflow-y-auto",children:h[l].map(v=>y.jsx(lh,{className:"w-full",isSelected:v===d,onClick:()=>m(v),children:v},v))})]})}),y.jsx("div",{className:"shrink-0 w-full",children:o?y.jsxs("div",{className:"flex flex-row gap-2 items-center justify-center w-full h-[64px] font-medium text-sm text-muted-foreground",children:[y.jsx(bs,{className:"size-4 animate-spin"})," Your match is loading..."]}):y.jsx(z1,{className:"w-full",onClick:()=>r({...t,ai:l,model:d},e),children:e==="white"?"Continue":"Start match"})})]})]})},_4=({onGameCreated:t,onCancel:e})=>{const r=s4(),[s,o]=_.useState({}),[l,u]=_.useState({}),[d,m]=_.useState(!1),[h,g]=_.useState(s),v=h===s?"white":"black",b=async(E,T)=>{m(!0);try{const k=await r({white:{ai:E.ai,model:E.model},black:{ai:T.ai,model:T.model}});t(k.id)}finally{m(!1)}},C=(E,T)=>{if(E.ai&&!E.model){Mb("An ai model is required",{description:"You must select an ai model to continue",position:"bottom-center"});return}T==="white"?(o(E),g(l)):(u(E),b(s,E))},x=()=>{d||(h===l?g(s):e())};return y.jsxs("div",{className:"flex flex-col flex-1 gap-14 items-center justify-between w-full",children:[y.jsx($i,{onBack:x}),y.jsx(x4,{player:h,color:v,onSubmit:C,isAiEnabled:!0,isLoading:d})]})},Ii=({children:t,className:e})=>y.jsx("div",{className:ke("grid grid-cols-1 md:grid-cols-[minmax(50%,1fr)_minmax(auto,500px)] h-dvh bg-image-landing",e),children:t}),Gi=({children:t,className:e})=>y.jsx("div",{className:ke("flex flex-col w-full h-full p-6 gap-10 md:col-start-2 md:border-l-2 md:border-white/5 bg-background/60 md:bg-background/35 backdrop-blur-lg overflow-y-auto",e),children:t}),$1=()=>_.useCallback((e,r)=>{typeof window.gtag=="function"&&window.gtag("event",e,r)},[]),Da=t=>{const e=$1();_.useEffect(()=>{document.title=`ChessArena.ai - ${t}`,e("page_view",{page_title:t})},[t])},q1=_.createContext(void 0),xs=()=>{const t=_.useContext(q1);if(t===void 0)throw new Error("useAuth must be used within an AuthProvider");return t},S4=({children:t})=>{const e=xs();return!e.isAuthenticated&&!e.isLoading?y.jsx(DE,{to:"/login"}):t},E4=()=>{const t=fn(),e=r=>t(`/game/${r}`);return Da("Create Game"),y.jsx(S4,{children:y.jsx(Ii,{children:y.jsx(Gi,{children:y.jsx(_4,{onGameCreated:e,onCancel:()=>t("/")})})})})},yy=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,by=t1,Nm=(t,e)=>r=>{var s;if((e==null?void 0:e.variants)==null)return by(t,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:o,defaultVariants:l}=e,u=Object.keys(o).map(h=>{const g=r==null?void 0:r[h],v=l==null?void 0:l[h];if(g===null)return null;const b=yy(g)||yy(v);return o[h][b]}),d=r&&Object.entries(r).reduce((h,g)=>{let[v,b]=g;return b===void 0||(h[v]=b),h},{}),m=e==null||(s=e.compoundVariants)===null||s===void 0?void 0:s.reduce((h,g)=>{let{class:v,className:b,...C}=g;return Object.entries(C).every(x=>{let[E,T]=x;return Array.isArray(T)?T.includes({...l,...d}[E]):{...l,...d}[E]===T})?[...h,v,b]:h},[]);return by(t,u,m,r==null?void 0:r.class,r==null?void 0:r.className)},C4=Nm("cursor-pointer inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-white/5 hover:bg-white/10 active:bg-white/20 text-white rounded-full",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function dr({className:t,variant:e,size:r,asChild:s=!1,...o}){const l=s?c4:"button";return y.jsx(l,{"data-slot":"button",className:ke(C4({variant:e,size:r,className:t})),...o})}const Ki=ae.forwardRef(({children:t,className:e,onClick:r},s)=>y.jsx("div",{className:ke("font-medium p-4 rounded-sm bg-white/5",e),onClick:r,ref:s,children:t})),Jo=({children:t,className:e})=>y.jsx("div",{className:ke("flex flex-col gap-4 items-center justify-between w-full backdrop-blur-lg bg-black/40",e),children:t}),T4=()=>{const[t,e]=_.useState(window.innerWidth);return _.useEffect(()=>{const r=()=>e(window.innerWidth);return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),t},A4=(t,e)=>{const{user:r}=xs(),[s,o]=_.useState(),l=_.useCallback(async g=>{const v=await Yn.get(`/chess/game/${g}`);o(v)},[]),[u,d]=_.useState([]),m=g=>{d(v=>v.filter(b=>b.user.id!==g))},h=_.useCallback(()=>
vendor: 3,257 bytes, lines 154-162
154{l(t).catch(()=>{})},[t,l]);return _.useEffect(h,[h]),Iv({event:e,type:"on-access-requested",listener:g=>d(v=>[...v,g])},[]),Iv({event:e,type:"on-access-accepted",listener:g=>{g.userId===(r==null?void 0:r.id)&&h()}},[h,r==null?void 0:r.id]),{game:s,accessRequest:u,onCancel:m}},wy=({isSelected:t,className:e,children:r,onClick:s})=>y.jsx("div",{onClick:s,className:ke("flex flex-row gap-2 items-center justify-center py-3 px-4 font-semibold text-sm transition-all duration-200 border-b-2 border-transparent whitespace-nowrap",!t&&"hover:border-white/50",t&&"border-white",!!s&&"cursor-pointer",e),children:r});function k4(t,e){const r=_.createContext(e),s=l=>{const{children:u,...d}=l,m=_.useMemo(()=>d,Object.values(d));return y.jsx(r.Provider,{value:m,children:u})};s.displayName=t+"Provider";function o(l){const u=_.useContext(r);if(u)return u;if(e!==void 0)return e;throw new Error(`\`${l}\` must be used within \`${t}\``)}return[s,o]}function H1(t,e=[]){let r=[];function s(l,u){const d=_.createContext(u),m=r.length;r=[...r,u];const h=v=>{var k;const{scope:b,children:C,...x}=v,E=((k=b==null?void 0:b[t])==null?void 0:k[m])||d,T=_.useMemo(()=>x,Object.values(x));return y.jsx(E.Provider,{value:T,children:C})};h.displayName=l+"Provider";function g(v,b){var E;const C=((E=b==null?void 0:b[t])==null?void 0:E[m])||d,x=_.useContext(C);if(x)return x;if(u!==void 0)return u;throw new Error(`\`${v}\` must be used within \`${l}\``)}return[h,g]}const o=()=>{const l=r.map(u=>_.createContext(u));return function(d){const m=(d==null?void 0:d[t])||l;return _.useMemo(()=>({[`__scope${t}`]:{...d,[t]:m}}),[d,m])}};return o.scopeName=t,[s,j4(o,...e)]}function j4(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const s=t.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(l){const u=s.reduce((d,{useScope:m,scopeName:h})=>{const v=m(l)[`__scope${h}`];return{...d,...v}},{});return _.useMemo(()=>({[`__scope${e.scopeName}`]:u}),[u])}};return r.scopeName=e.scopeName,r}function Oi(t){const e=_.useRef(t);return _.useEffect(()=>{e.current=t}),_.useMemo(()=>(...r)=>{var s;return(s=e.current)==null?void 0:s.call(e,...r)},[])}var Oa=globalThis!=null&&globalThis.document?_.useLayoutEffect:()=>{},uh={exports:{}},fh={};/** 155 * @license React 156 * use-sync-external-store-shim.production.js 157 * 158 * Copyright (c) Meta Platforms, Inc. and affiliates. 159 * 160 * This source code is licensed under the MIT license found in the 161 * LICENSE file in the root directory of this source tree. 162 */var xy;function R4(){if(xy)return fh;xy=1;var t=Su();function e(v,b){return v===b&&(v!==0||1/v===1/b)||v!==v&&b!==b}var r=typeof Object.is=="function"?Object.is:e,s=t.useState,o=t.useEffect,l=t.useLayoutEffect,u=t.useDebugValue;function d(v,b){var C=b(),x=s({inst:{value:C,getSnapshot:b}}),E=x[0].inst,T=x[1];return l(function(){E.value=C,E.getSnapshot=b,m(E)&&T({inst:E})},[v,C,b]),o(function(){return m(E)&&T({inst:E}),v(function(){m(E)&&T({inst:E})})},[v]),u(C),C}function m(v){var b=v.getSnapshot;v=v.value;try{var C=b();return!r(v,C)}catch{return!0}}function h(v,b){return b()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:d;return fh.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:g,fh}
162var _y;function N4(){return _y||(_y=1,uh.exports=R4()),uh.exports}var O4=N4();function M4(){return O4.useSyncExternalStore(D4,()=>!0,()=>!1)}function D4(){return()=>{}}var Om="Avatar",[L4,qO]=H1(Om),[U4,I1]=L4(Om),G1=_.forwardRef((t,e)=>{const{__scopeAvatar:r,...s}=t,[o,l]=_.useState("idle");return y.jsx(U4,{scope:r,imageLoadingStatus:o,onImageLoadingStatusChange:l,children:y.jsx(Tn.span,{...s,ref:e})})});G1.displayName=Om;var K1="AvatarImage",V1=_.forwardRef((t,e)=>{const{__scopeAvatar:r,src:s,onLoadingStatusChange:o=()=>{},...l}=t,u=I1(K1,r),d=z4(s,l),m=Oi(h=>{o(h),u.onImageLoadingStatusChange(h)});return Oa(()=>{d!=="idle"&&m(d)},[d,m]),d==="loaded"?y.jsx(Tn.img,{...l,ref:e,src:s}):null});V1.displayName=K1;var Y1="AvatarFallback",F1=_.forwardRef((t,e)=>{const{__scopeAvatar:r,delayMs:s,...o}=t,l=I1(Y1,r),[u,d]=_.useState(s===void 0);return _.useEffect(()=>{if(s!==void 0){const m=window.setTimeout(()=>d(!0),s);return()=>window.clearTimeout(m)}},[s]),u&&l.imageLoadingStatus!=="loaded"?y.jsx(Tn.span,{...o,ref:e}):null});F1.displayName=Y1;function Sy(t,e){return t?e?(t.src!==e&&(t.src=e),t.complete&&t.naturalWidth>0?"loaded":"loading"):"error":"idle"}function z4(t,{referrerPolicy:e,crossOrigin:r}){const s=M4(),o=_.useRef(null),l=s?(o.current||(o.current=new window.Image),o.current):null,[u,d]=_.useState(()=>Sy(l,t));return Oa(()=>{d(Sy(l,t))},[l,t]),Oa(()=>{const m=v=>()=>{d(v)};if(!l)return;const h=m("loaded"),g=m("error");return l.addEventListener("load",h),l.addEventListener("error",g),e&&(l.referrerPolicy=e),typeof r=="string"&&(l.crossOrigin=r),()=>{l.removeEventListener("load",h),l.removeEventListener("error",g)}},[l,r,e]),u}var P4=G1,B4=V1,$4=F1;function q4({className:t,...e}){return y.jsx(P4,{"data-slot":"avatar",className:ke("relative flex size-8 shrink-0 overflow-hidden rounded-full",t),...e})}function H4({className:t,...e}){return y.jsx(B4,{"data-slot":"avatar-image",className:ke("aspect-square size-full",t),...e})}function I4({className:t,color:e,...r}){return y.jsx($4,{"data-slot":"avatar-fallback",className:ke("font-bold flex size-full items-center justify-center rounded-full",e==="white"&&"bg-white text-black",e==="black"&&"bg-black text-white",t),...r})}function G4(){return y.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:"text-foreground",children:[y.jsx("circle",{cx:"4",cy:"12",r:"2",fill:"currentColor",children:y.jsx("animate",{id:"spinner_qFRN",begin:"0;spinner_OcgL.end+0.25s",attributeName:"cy",calcMode:"spline",dur:"0.6s",values:"12;6;12",keySplines:".33,.66,.66,1;.33,0,.66,.33"})}),y.jsx("circle",{cx:"12",cy:"12",r:"2",fill:"currentColor",children:y.jsx("animate",{begin:"spinner_qFRN.begin+0.1s",attributeName:"cy",calcMode:"spline",dur:"0.6s",values:"12;6;12",keySplines:".33,.66,.66,1;.33,0,.66,.33"})}),y.jsx("circle",{cx:"20",cy:"12",r:"2",fill:"currentColor",children:y.jsx("animate",{id:"spinner_OcgL",begin:"spinner_qFRN.begin+0.2s",attributeName:"cy",calcMode:"spline",dur:"0.6s",values:"12;6;12",keySplines:".33,.66,.66,1;.33,0,.66,.33"})})]})}const K4=Nm("flex gap-2 items-start relative group",{variants:{variant:{received:"flex-row",sent:"flex-row-reverse",white:"flex-row",black:"flex-row-reverse"},layout:{default:"",ai:"max-w-full w-full items-center"}},defaultVariants:{variant:"received",layout:"default"}}),Q1=_.forwardRef(({className:t,variant:e,layout:r,children:s,...o},l)=>y.jsx("div",{className:K4({variant:e,layout:r,className:t}),ref:l,...o,children:_.Children.map(s,u=>_.isValidElement(u)&&typeof u.type!="string"?_.cloneElement(u,{variant:e,layout:r}):u)}));Q1.displayName="ChatBubble";const Mm=({src:t,fallback:e,className:r,color:s})=>y.jsxs(q4,{className:r,children:[y.jsx(H4,{src:t,alt:"Avatar"}),y.jsx(I4,{color:s,children:e})]}),V4=Nm("w-full break-words p-4",{variants:{variant:{received:"backdrop-blur-lg bg-white/5 rounded-r-2xl rounded-bl-2xl",sent:"backdrop-blur-lg bg-white/5 rounded-r-2xl rounded-l-lg rounded-br-lg",white:"backdrop-blur-lg bg-white/60 text-black rounded-r-2xl rounded-bl-2xl",black:"backdrop-blur-lg bg-black/40 text-white rounded-l-2xl rounded-br-2xl"},layout:{default:"",ai:"border-t w-full rounded-none bg-transparent"}},defaultVariants:{variant:"received",layout:"default"}}),X1=_.forwardRef(({className:t,variant:e,layout:r,isLoading:s=!1,children:o,...l},u)=>y.jsx("div",{className:V4({variant:e,layout:r,className:t}),ref:u,...l,children:s?y.jsx("div",{className:"flex items-center space-x-2",children:y.jsx(G4,{})}):o}));X1.displayName="ChatBubbleMessage";const Y4=_.forwardRef(({variant:t,className:e,children:r,...s},o)=>y.jsx("div",{ref:o,className:ke("absolute top-1/2 -translate-y-1/2 flex opacity-0 group-hover:opacity-100 transition-opacity duration-200",t==="sent"?"-left-1 -translate-x-full flex-row-reverse":"-right-1 translate-x-full",e),...s,children:r}));Y4.displayName="ChatBubbleActionWrapper";const F4=()=>async(t,e)=>{await Yn.post(`/request-access/${t}/accept`,{userId:e})},Q4=({gameId:t,user:e,onCancel:r})=>{var l;const s=F4(),o=()=>{s(t,e.id),r()};return y.jsx(Ki,{className:"bg-black/20 rounded-xl mt-4 p-0",children:y.jsx("div",{className:"p-4",children:y.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[y.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[y.jsx(Mm,{color:"white",fallback:(l=e.name)==null?void 0:l.slice(0,2).toUpperCase(),src:e.profilePic,className:"size-10 rounded-full"}),y.jsx("span",{className:"text-2xl text-white font-bold mx-auto text-center w-full",children:e.name})]}),y.jsxs("div",{className:"text-md mx-auto text-center w-full text-muted-foreground",children:[e.name," just requested access to play this game."]}),y.jsxs("div",{className:"flex flex-row gap-2",children:[y.jsx(dr,{variant:"outline",className:"p-4",onClick:o,children:"Accept"}),y.jsx(dr,{variant:"destructive",className:"p-4",onClick:r,children:"Reject"})]})]})})})},Gr=({className:t,children:e,isLoading:r,...s})=>y.jsx("button",{className:ke("base-button flex items-center justify-center h-16 py-2 px-4 gap-2 rounded-md select-none relative font-extrabold border border-transparent cursor-pointer whitespace-nowrap",t),...s,children:r?y.jsx(bs,{className:"size-4 animate-spin"}):e}),X4=()=>async t=>{await Yn.post(`/request-access/${t}`)},Z4=({gameId:t})=>{const{isAuthenticated:e}=xs(),r=fn(),s=()=>{r(`/login?redirect=/game/${t}`)},[o,l]=_.useState(!1),u=X4(),d=()=>{l(!0),u(t).catch(()=>{})};return y.jsx(Ki,{className:"bg-black/20 rounded-xl mt-4 p-0",children:y.jsx("div",{className:"p-4",children:y.jsxs("div",{className:"flex flex-col items-center justify-center gap-2",children:[y.jsx("div",{className:"text-2xl text-white font-bold mx-auto text-center w-full",children:"Request acesss"}),y.jsx("div",{className:"text-md mx-auto text-center w-full text-muted-foreground",children:"You're currently spectating this game. Request access to play."}),y.jsx("div",{children:o?y.jsx(bs,{className:"w-8 h-8 mx-auto animate-spin text-muted-foreground"}):e?y.jsx(Gr,{className:"p-4",onClick:d,children:"Request access"}):y.jsx(Gr,{className:"p-4",onClick:s,children:"Sign in to request access"})})]})})})};function W4(t){return t!==null?{comment:t,variations:[]}:{variations:[]}}function J4(t,e,r,s,o){const l={move:t,variations:o};return e&&(l.suffix=e),r&&(l.nag=r),s!==null&&(l.comment=s),l}function ek(...t){const[e,...r]=t;let s=e;for(const o of r)o!==null&&(s.variations=[o,...o.variations],o.variations=[],s=o);return e}function tk(t,e){if(e.marker&&e.marker.comment){let r=e.root;for(;;){const s=r.variations[0];if(!s){r.comment=e.marker.comment;break}r=s}}return{headers:t,root:e.root,result:(e.marker&&e.marker.result)??void 0}}function nk(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function Mi(t,e,r,s){var o=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(o,Mi.prototype),o.expected=e,o.found=r,o.location=s,o.name="SyntaxError",o}nk(Mi,Error);function dh(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,r+=r.repeat(e),t+r.slice(0,e))}Mi.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var r=null,s;for(s=0;s<t.length;s++)if(t[s].source===this.location.source){r=t[s].text.split(/\r\n|\n|\r/g);break}var o=this.location.start,l=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(o):o,u=this.location.source+":"+l.line+":"+l.column;if(r){var d=this.location.end,m=dh("",l.line.toString().length," "),h=r[o.line-1],g=o.line===d.line?d.column:h.length+1,v=g-o.column||1;e+=` 163 --> `+u+` 164`+m+` | 165`+l.line+" | "+h+` 166`+m+" | "+dh("",o.column-1," ")+dh("",v,"^")}else e+=` 167 at `+u}return e};Mi.buildMessage=function(t,e){var r={literal:function(h){return'"'+o(h.text)+'"'},class:function(h){var g=h.parts.map(function(v){return Array.isArray(v)?l(v[0])+"-"+l(v[1]):l(v)});return"["+(h.inverted?"^":"")+g.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(h){return h.description}};function s(h){return h.charCodeAt(0).toString(16).toUpperCase()}function o(h){return h.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(g){return"\\x0"+s(g)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(g){return"\\x"+s(g)})}function l(h){return h.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(g){return"\\x0"+s(g)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(g){return"\\x"+s(g)})}
167function u(h){return r[h.type](h)}function d(h){var g=h.map(u),v,b;if(g.sort(),g.length>0){for(v=1,b=1;v<g.length;v++)g[v-1]!==g[v]&&(g[b]=g[v],b++);g.length=b}switch(g.length){case 1:return g[0];case 2:return g[0]+" or "+g[1];default:return g.slice(0,-1).join(", ")+", or "+g[g.length-1]}}function m(h){return h?'"'+o(h)+'"':"end of input"}return"Expected "+d(t)+" but "+m(e)+" found."};function rk(t,e){e=e!==void 0?e:{};var r={},s=e.grammarSource,o={pgn:yr},l=yr,u="[",d='"',m="]",h=".",g="O-O-O",v="O-O",b="0-0-0",C="0-0",x="$",E="{",T="}",k=";",z="(",O=")",Y="1-0",K="0-1",re="1/2-1/2",J="*",Z=/^[a-zA-Z]/,de=/^[^"]/,Ee=/^[0-9]/,je=/^[.]/,ze=/^[a-zA-Z1-8\-=]/,At=/^[+#]/,kt=/^[!?]/,Me=/^[^}]/,M=/^[^\r\n]/,ne=/^[ \t\r\n]/,W=Nt("tag pair"),_e=Qe("[",!1),j=Qe('"',!1),G=Qe("]",!1),ee=Nt("tag name"),F=gn([["a","z"],["A","Z"]],!1,!1),se=Nt("tag value"),ve=gn(['"'],!0,!1),ie=Nt("move number"),Se=gn([["0","9"]],!1,!1),Pe=Qe(".",!1),ot=gn(["."],!1,!1),Kt=Nt("standard algebraic notation"),An=Qe("O-O-O",!1),hn=Qe("O-O",!1),Pa=Qe("0-0-0",!1),mr=Qe("0-0",!1),Cs=gn([["a","z"],["A","Z"],["1","8"],"-","="],!1,!1),Ts=gn(["+","#"],!1,!1),jt=Nt("suffix annotation"),Ba=gn(["!","?"],!1,!1),Wt=Nt("NAG"),As=Qe("$",!1),Vr=Nt("brace comment"),Pt=Qe("{",!1),kn=gn(["}"],!0,!1),Fi=Qe("}",!1),Qi=Nt("rest of line comment"),jn=Qe(";",!1),Rt=gn(["\r",` 168`],!0,!1),mn=Nt("variation"),bt=Qe("(",!1),Wn=Qe(")",!1),ks=Nt("game termination marker"),Jn=Qe("1-0",!1),Yr=Qe("0-1",!1),Fr=Qe("1/2-1/2",!1),Rn=Qe("*",!1),pr=Nt("whitespace"),er=gn([" "," ","\r",` 169`],!1,!1),$a=function(D,I){return tk(D,I)},pn=function(D){return Object.fromEntries(D)},js=function(D,I){return[D,I]},qa=function(D,I){return{root:D,marker:I}},tr=function(D,I){return ek(W4(D),...I.flat())},Rs=function(D,I,q,he,me){return J4(D,I,q,he,me)},xe=function(D){return D},st=function(D){return D.replace(/[\r\n]+/g," ")},lt=function(D){return D.trim()},wt=function(D){return D},gr=function(D,I){return{result:D,comment:I}},P=e.peg$currPos|0,Fe=[{line:1,column:1}],qe=P,Ge=e.peg$maxFailExpected||[],te=e.peg$silentFails|0,Nn;if(e.startRule){if(!(e.startRule in o))throw new Error(`Can't start parsing from rule "`+e.startRule+'".');l=o[e.startRule]}function Qe(D,I){return{type:"literal",text:D,ignoreCase:I}}function gn(D,I,q){return{type:"class",parts:D,inverted:I,ignoreCase:q}}function Cl(){return{type:"end"}}function Nt(D){return{type:"other",description:D}}function Ns(D){var I=Fe[D],q;if(I)return I;if(D>=Fe.length)q=Fe.length-1;else for(q=D;!Fe[--q];);for(I=Fe[q],I={line:I.line,column:I.column};q<D;)t.charCodeAt(q)===10?(I.line++,I.column=1):I.column++,q++;return Fe[D]=I,I}function vr(D,I,q){var he=Ns(D),me=Ns(I),Be={source:s,start:{offset:D,line:he.line,column:he.column},end:{offset:I,line:me.line,column:me.column}};return Be}function ue(D){P<qe||(P>qe&&(qe=P,Ge=[]),Ge.push(D))}function Ha(D,I,q){return new Mi(Mi.buildMessage(D,I),D,I,q)}function yr(){var D,I,q;return D=P,I=pt(),q=Qr(),D=$a(I,q),D}function pt(){var D,I,q;for(D=P,I=[],q=Xi();q!==r;)I.push(q),q=Xi();return q=xt(),D=pn(I),D}function Xi(){var D,I,q,he,me,Be,nr;return te++,D=P,xt(),t.charCodeAt(P)===91?(I=u,P++):(I=r,te===0&&ue(_e)),I!==r?(xt(),q=Tl(),q!==r?(xt(),t.charCodeAt(P)===34?(he=d,P++):(he=r,te===0&&ue(j)),he!==r?(me=br(),t.charCodeAt(P)===34?(Be=d,P++):(Be=r,te===0&&ue(j)),Be!==r?(xt(),t.charCodeAt(P)===93?(nr=m,P++):(nr=r,te===0&&ue(G)),nr!==r?D=js(q,me):(P=D,D=r)):(P=D,D=r)):(P=D,D=r)):(P=D,D=r)):(P=D,D=r),te--,D===r&&te===0&&ue(W),D}function Tl(){var D,I,q;if(te++,D=P,I=[],q=t.charAt(P),Z.test(q)?P++:(q=r,te===0&&ue(F)),q!==r)for(;q!==r;)I.push(q),q=t.charAt(P),Z.test(q)?P++:(q=r,te===0&&ue(F));else I=r;return I!==r?D=t.substring(D,P):D=I,te--,D===r&&(I=r,te===0&&ue(ee)),D}function br(){var D,I,q;for(te++,D=P,I=[],q=t.charAt(P),de.test(q)?P++:(q=r,te===0&&ue(ve));q!==r;)I.push(q),q=t.charAt(P),de.test(q)?P++:(q=r,te===0&&ue(ve));return D=t.substring(D,P),te--,I=r,te===0&&ue(se),D}function Qr(){var D,I,q;return D=P,I=Al(),xt(),q=Ji(),q===r&&(q=null),xt(),D=qa(I,q),D}function Al(){var D,I,q,he;for(D=P,I=vn(),I===r&&(I=null),q=[],he=Zi();he!==r;)q.push(he),he=Zi();return D=tr(I,q),D}function Zi(){var D,I,q,he,me,Be,nr,xr;if(D=P,xt(),kl(),xt(),I=Iu(),I!==r){for(q=Os(),q===r&&(q=null),he=[],me=Ia();me!==r;)he.push(me),me=Ia();for(me=xt(),Be=vn(),Be===r&&(Be=null),nr=[],xr=wr();xr!==r;)nr.push(xr),xr=wr();D=Rs(I,q,he,Be,nr)}else P=D,D=r;return D}function kl(){var D,I,q,he,me,Be;for(te++,D=P,I=[],q=t.charAt(P),Ee.test(q)?P++:(q=r,te===0&&ue(Se));q!==r;)I.push(q),q=t.charAt(P),Ee.test(q)?P++:(q=r,te===0&&ue(Se));if(t.charCodeAt(P)===46?(q=h,P++):(q=r,te===0&&ue(Pe)),q!==r){for(he=xt(),me=[],Be=t.charAt(P),je.test(Be)?P++:(Be=r,te===0&&ue(ot));Be!==r;)me.push(Be),Be=t.charAt(P),je.test(Be)?P++:(Be=r,te===0&&ue(ot));I=[I,q,he,me],D=I}else P=D,D=r;return te--,D===r&&(I=r,te===0&&ue(ie)),D}function Iu(){var D,I,q,he,me,Be;if(te++,D=P,I=P,t.substr(P,5)===g?(q=g,P+=5):(q=r,te===0&&ue(An)),q===r&&(t.substr(P,3)===v?(q
169=v,P+=3):(q=r,te===0&&ue(hn)),q===r&&(t.substr(P,5)===b?(q=b,P+=5):(q=r,te===0&&ue(Pa)),q===r&&(t.substr(P,3)===C?(q=C,P+=3):(q=r,te===0&&ue(mr)),q===r))))if(q=P,he=t.charAt(P),Z.test(he)?P++:(he=r,te===0&&ue(F)),he!==r){if(me=[],Be=t.charAt(P),ze.test(Be)?P++:(Be=r,te===0&&ue(Cs)),Be!==r)for(;Be!==r;)me.push(Be),Be=t.charAt(P),ze.test(Be)?P++:(Be=r,te===0&&ue(Cs));else me=r;me!==r?(he=[he,me],q=he):(P=q,q=r)}else P=q,q=r;return q!==r?(he=t.charAt(P),At.test(he)?P++:(he=r,te===0&&ue(Ts)),he===r&&(he=null),q=[q,he],I=q):(P=I,I=r),I!==r?D=t.substring(D,P):D=I,te--,D===r&&(I=r,te===0&&ue(Kt)),D}function Os(){var D,I,q;for(te++,D=P,I=[],q=t.charAt(P),kt.test(q)?P++:(q=r,te===0&&ue(Ba));q!==r;)I.push(q),I.length>=2?q=r:(q=t.charAt(P),kt.test(q)?P++:(q=r,te===0&&ue(Ba)));return I.length<1?(P=D,D=r):D=I,te--,D===r&&(I=r,te===0&&ue(jt)),D}function Ia(){var D,I,q,he,me;if(te++,D=P,xt(),t.charCodeAt(P)===36?(I=x,P++):(I=r,te===0&&ue(As)),I!==r){if(q=P,he=[],me=t.charAt(P),Ee.test(me)?P++:(me=r,te===0&&ue(Se)),me!==r)for(;me!==r;)he.push(me),me=t.charAt(P),Ee.test(me)?P++:(me=r,te===0&&ue(Se));else he=r;he!==r?q=t.substring(q,P):q=he,q!==r?D=xe(q):(P=D,D=r)}else P=D,D=r;return te--,D===r&&te===0&&ue(Wt),D}function vn(){var D;return D=Wi(),D===r&&(D=jl()),D}function Wi(){var D,I,q,he,me;if(te++,D=P,t.charCodeAt(P)===123?(I=E,P++):(I=r,te===0&&ue(Pt)),I!==r){for(q=P,he=[],me=t.charAt(P),Me.test(me)?P++:(me=r,te===0&&ue(kn));me!==r;)he.push(me),me=t.charAt(P),Me.test(me)?P++:(me=r,te===0&&ue(kn));q=t.substring(q,P),t.charCodeAt(P)===125?(he=T,P++):(he=r,te===0&&ue(Fi)),he!==r?D=st(q):(P=D,D=r)}else P=D,D=r;return te--,D===r&&(I=r,te===0&&ue(Vr)),D}function jl(){var D,I,q,he,me;if(te++,D=P,t.charCodeAt(P)===59?(I=k,P++):(I=r,te===0&&ue(jn)),I!==r){for(q=P,he=[],me=t.charAt(P),M.test(me)?P++:(me=r,te===0&&ue(Rt));me!==r;)he.push(me),me=t.charAt(P),M.test(me)?P++:(me=r,te===0&&ue(Rt));q=t.substring(q,P),D=lt(q)}else P=D,D=r;return te--,D===r&&(I=r,te===0&&ue(Qi)),D}function wr(){var D,I,q,he;return te++,D=P,xt(),t.charCodeAt(P)===40?(I=z,P++):(I=r,te===0&&ue(bt)),I!==r?(q=Al(),q!==r?(xt(),t.charCodeAt(P)===41?(he=O,P++):(he=r,te===0&&ue(Wn)),he!==r?D=wt(q):(P=D,D=r)):(P=D,D=r)):(P=D,D=r),te--,D===r&&te===0&&ue(mn),D}function Ji(){var D,I,q;return te++,D=P,t.substr(P,3)===Y?(I=Y,P+=3):(I=r,te===0&&ue(Jn)),I===r&&(t.substr(P,3)===K?(I=K,P+=3):(I=r,te===0&&ue(Yr)),I===r&&(t.substr(P,7)===re?(I=re,P+=7):(I=r,te===0&&ue(Fr)),I===r&&(t.charCodeAt(P)===42?(I=J,P++):(I=r,te===0&&ue(Rn))))),I!==r?(xt(),q=vn(),q===r&&(q=null),D=gr(I,q)):(P=D,D=r),te--,D===r&&(I=r,te===0&&ue(ks)),D}function xt(){var D,I;for(te++,D=[],I=t.charAt(P),ne.test(I)?P++:(I=r,te===0&&ue(er));I!==r;)D.push(I),I=t.charAt(P),ne.test(I)?P++:(I=r,te===0&&ue(er));return te--,I=r,te===0&&ue(pr),D}if(Nn=l(),e.peg$library)return{peg$result:Nn,peg$currPos:P,peg$FAILED:r,peg$maxFailExpected:Ge,peg$maxFailPos:qe};if(Nn!==r&&P===t.length)return Nn;throw Nn!==r&&P<t.length&&ue(Cl()),Ha(Ge,qe<t.length?t.charAt(qe):null,qe<t.length?vr(qe,qe+1):vr(qe,qe))}/** 170 * @license 171 * Copyright (c) 2025, Jeff Hlywa ([email protected]) 172 * All rights reserved. 173 * 174 * Redistribution and use in source and binary forms, with or without 175 * modification, are permitted provided that the following conditions are met: 176 * 177 * 1. Redistributions of source code must retain the above copyright notice, 178 * this list of conditions and the following disclaimer. 179 * 2. Redistributions in binary form must reproduce the above copyright notice, 180 * this list of conditions and the following disclaimer in the documentation 181 * and/or other materials provided with the distribution. 182 * 183 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 184 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 185 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 186 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 187 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 188 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 189 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 190 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 191 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 192 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 193 * POSSIBILITY OF SUCH DAMAGE. 194 */const su=0xffffffffffffffffn;function hh(t,e){return(t<<e|t>>64n-e)&0xffffffffffffffffn}function Ey(t,e){return t*e&su}function ak(t){return function(){let e=BigInt(t&su),r=BigInt(t>>64n&su);const s=Ey(hh(Ey(e,5n),7n),9n);return r^=e,e=(hh(e,24n)^r^r<<16n)&su,r=hh(r,37n),t=r<<64n|e,s}}const Mu=ak(0xa187eb39cdcaed8f31c4b365b102e01en),sk=Array.from({length:2},()=>Array.from({length:6},()=>Array.from({length:128}
194,()=>Mu()))),ik=Array.from({length:8},()=>Mu()),ok=Array.from({length:16},()=>Mu()),mh=Mu(),Ft="w",Cn="b",yt="p",Jh="n",iu="b",il="r",ja="q",Ct="k",ph="rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1";class $c{constructor(e,r){nt(this,"color");nt(this,"from");nt(this,"to");nt(this,"piece");nt(this,"captured");nt(this,"promotion");nt(this,"flags");nt(this,"san");nt(this,"lan");nt(this,"before");nt(this,"after");const{color:s,piece:o,from:l,to:u,flags:d,captured:m,promotion:h}=r,g=Ut(l),v=Ut(u);this.color=s,this.piece=o,this.from=g,this.to=v,this.san=e._moveToSan(r,e._moves({legal:!0})),this.lan=g+v,this.before=e.fen(),e._makeMove(r),this.after=e.fen(),e._undoMove(),this.flags="";for(const b in we)we[b]&d&&(this.flags+=os[b]);m&&(this.captured=m),h&&(this.promotion=h,this.lan+=h)}isCapture(){return this.flags.indexOf(os.CAPTURE)>-1}isPromotion(){return this.flags.indexOf(os.PROMOTION)>-1}isEnPassant(){return this.flags.indexOf(os.EP_CAPTURE)>-1}isKingsideCastle(){return this.flags.indexOf(os.KSIDE_CASTLE)>-1}isQueensideCastle(){return this.flags.indexOf(os.QSIDE_CASTLE)>-1}isBigPawn(){return this.flags.indexOf(os.BIG_PAWN)>-1}}const Ht=-1,os={NORMAL:"n",CAPTURE:"c",BIG_PAWN:"b",EP_CAPTURE:"e",PROMOTION:"p",KSIDE_CASTLE:"k",QSIDE_CASTLE:"q",NULL_MOVE:"-"},lk=["a8","b8","c8","d8","e8","f8","g8","h8","a7","b7","c7","d7","e7","f7","g7","h7","a6","b6","c6","d6","e6","f6","g6","h6","a5","b5","c5","d5","e5","f5","g5","h5","a4","b4","c4","d4","e4","f4","g4","h4","a3","b3","c3","d3","e3","f3","g3","h3","a2","b2","c2","d2","e2","f2","g2","h2","a1","b1","c1","d1","e1","f1","g1","h1"],we={NORMAL:1,CAPTURE:2,BIG_PAWN:4,EP_CAPTURE:8,PROMOTION:16,KSIDE_CASTLE:32,QSIDE_CASTLE:64,NULL_MOVE:128},em={Event:"?",Site:"?",Date:"????.??.??",Round:"?",White:"?",Black:"?",Result:"*"},ck={WhiteTitle:null,BlackTitle:null,WhiteElo:null,BlackElo:null,WhiteUSCF:null,BlackUSCF:null,WhiteNA:null,BlackNA:null,WhiteType:null,BlackType:null,EventDate:null,EventSponsor:null,Section:null,Stage:null,Board:null,Opening:null,Variation:null,SubVariation:null,ECO:null,NIC:null,Time:null,UTCTime:null,UTCDate:null,TimeControl:null,SetUp:null,FEN:null,Termination:null,Annotator:null,Mode:null,PlyCount:null},uk={...em,...ck},be={a8:0,b8:1,c8:2,d8:3,e8:4,f8:5,g8:6,h8:7,a7:16,b7:17,c7:18,d7:19,e7:20,f7:21,g7:22,h7:23,a6:32,b6:33,c6:34,d6:35,e6:36,f6:37,g6:38,h6:39,a5:48,b5:49,c5:50,d5:51,e5:52,f5:53,g5:54,h5:55,a4:64,b4:65,c4:66,d4:67,e4:68,f4:69,g4:70,h4:71,a3:80,b3:81,c3:82,d3:83,e3:84,f3:85,g3:86,h3:87,a2:96,b2:97,c2:98,d2:99,e2:100,f2:101,g2:102,h2:103,a1:112,b1:113,c1:114,d1:115,e1:116,f1:117,g1:118,h1:119},gh={b:[16,32,17,15],w:[-16,-32,-17,-15]},Cy={n:[-18,-33,-31,-14,18,33,31,14],b:[-17,-15,17,15],r:[-16,1,16,-1],q:[-17,-16,-15,1,17,16,15,-1],k:[-17,-16,-15,1,17,16,15,-1]},fk=[20,0,0,0,0,0,0,24,0,0,0,0,0,0,20,0,0,20,0,0,0,0,0,24,0,0,0,0,0,20,0,0,0,0,20,0,0,0,0,24,0,0,0,0,20,0,0,0,0,0,0,20,0,0,0,24,0,0,0,20,0,0,0,0,0,0,0,0,20,0,0,24,0,0,20,0,0,0,0,0,0,0,0,0,0,20,2,24,2,20,0,0,0,0,0,0,0,0,0,0,0,2,53,56,53,2,0,0,0,0,0,0,24,24,24,24,24,24,56,0,56,24,24,24,24,24,24,0,0,0,0,0,0,2,53,56,53,2,0,0,0,0,0,0,0,0,0,0,0,20,2,24,2,20,0,0,0,0,0,0,0,0,0,0,20,0,0,24,0,0,20,0,0,0,0,0,0,0,0,20,0,0,0,24,0,0,0,20,0,0,0,0,0,0,20,0,0,0,0,24,0,0,0,0,20,0,0,0,0,20,0,0,0,0,0,24,0,0,0,0,0,20,0,0,20,0,0,0,0,0,0,24,0,0,0,0,0,0,20],dk=[17,0,0,0,0,0,0,16,0,0,0,0,0,0,15,0,0,17,0,0,0,0,0,16,0,0,0,0,0,15,0,0,0,0,17,0,0,0,0,16,0,0,0,0,15,0,0,0,0,0,0,17,0,0,0,16,0,0,0,15,0,0,0,0,0,0,0,0,17,0,0,16,0,0,15,0,0,0,0,0,0,0,0,0,0,17,0,16,0,15,0,0,0,0,0,0,0,0,0,0,0,0,17,16,15,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,-15,-16,-17,0,0,0,0,0,0,0,0,0,0,0,0,-15,0,-16,0,-17,0,0,0,0,0,0,0,0,0,0,-15,0,0,-16,0,0,-17,0,0,0,0,0,0,0,0,-15,0,0,0,-16,0,0,0,-17,0,0,0,0,0,0,-15,0,0,0,0,-16,0,0,0,0,-17,0,0,0,0,-15,0,0,0,0,0,-16,0,0,0,0,0,-17,0,0,-15,0,0,0,0,0,0,-16,0,0,0,0,0,0,-17],hk={p:1,n:2,b:4,r:8,q:16,k:32},mk="pnbrqkPNBRQK",Ty=[Jh,iu,il,ja],pk=7,gk=6,vk=1,yk=0,qc={[Ct]:we.KSIDE_CASTLE,[ja]:we.QSIDE_CASTLE},ba={w:[{square:be.a1,flag:we.QSIDE_CASTLE},{square:be.h1,flag:we.KSIDE_CASTLE}],b:[{square:be.a8,flag:we.QSIDE_CASTLE},{square:be.h8,flag:we.KSIDE_CASTLE}]},bk={b:vk,w:gk},vh="--";function ps(t){return t>>4}function hl(t){return t&15}function Z1(t){return"0123456789".indexOf(t)!==-1}function Ut(t){const e=hl(t),r=ps(t);return"abcdefgh".substring(e,e+1)+"87654321".substring(r,r+1)}function el(t){return t===Ft?Cn:Ft}function wk(t){const e=t.split(/\s+/);if(e.length!==6)return{ok:!1,error:"Invalid FEN: must contain six space-delimited fields"};const r=parseInt(e[5],10);if(isNaN(r)||r<=0)return{ok:!1,error:"Invalid FEN: move number must be a positive integer"};const s=parseInt(e[4],10);if(isNaN(s)||s<0)return{ok:!1,error:"Invalid FEN: half move counter number must be a non-negative integer"};if(!/^(-|[abcdefgh][36])$/.test(e[3]))return{ok:!1,error:"Invalid FEN: en-passant square is invali
194d"};if(/[^kKqQ-]/.test(e[2]))return{ok:!1,error:"Invalid FEN: castling availability is invalid"};if(!/^(w|b)$/.test(e[1]))return{ok:!1,error:"Invalid FEN: side-to-move is invalid"};const o=e[0].split("/");if(o.length!==8)return{ok:!1,error:"Invalid FEN: piece data does not contain 8 '/'-delimited rows"};for(let u=0;u<o.length;u++){let d=0,m=!1;for(let h=0;h<o[u].length;h++)if(Z1(o[u][h])){if(m)return{ok:!1,error:"Invalid FEN: piece data is invalid (consecutive number)"};d+=parseInt(o[u][h],10),m=!0}else{if(!/^[prnbqkPRNBQK]$/.test(o[u][h]))return{ok:!1,error:"Invalid FEN: piece data is invalid (invalid piece)"};d+=1,m=!1}if(d!==8)return{ok:!1,error:"Invalid FEN: piece data is invalid (too many squares in rank)"}}if(e[3][1]=="3"&&e[1]=="w"||e[3][1]=="6"&&e[1]=="b")return{ok:!1,error:"Invalid FEN: illegal en-passant square"};const l=[{color:"white",regex:/K/g},{color:"black",regex:/k/g}];for(const{color:u,regex:d}of l){if(!d.test(e[0]))return{ok:!1,error:`Invalid FEN: missing ${u} king`};if((e[0].match(d)||[]).length>1)return{ok:!1,error:`Invalid FEN: too many ${u} kings`}}return Array.from(o[0]+o[7]).some(u=>u.toUpperCase()==="P")?{ok:!1,error:"Invalid FEN: some pawns are on the edge rows"}:{ok:!0}}function xk(t,e){const r=t.from,s=t.to,o=t.piece;let l=0,u=0,d=0;for(let m=0,h=e.length;m<h;m++){const g=e[m].from,v=e[m].to,b=e[m].piece;o===b&&r!==g&&s===v&&(l++,ps(r)===ps(g)&&u++,hl(r)===hl(g)&&d++)}return l>0?u>0&&d>0?Ut(r):d>0?Ut(r).charAt(1):Ut(r).charAt(0):""}function wa(t,e,r,s,o,l=void 0,u=we.NORMAL){const d=ps(s);if(o===yt&&(d===pk||d===yk))for(let m=0;m<Ty.length;m++){const h=Ty[m];t.push({color:e,from:r,to:s,piece:o,captured:l,promotion:h,flags:u|we.PROMOTION})}else t.push({color:e,from:r,to:s,piece:o,captured:l,flags:u})}function Ay(t){let e=t.charAt(0);return e>="a"&&e<="h"?t.match(/[a-h]\d.*[a-h]\d/)?void 0:yt:(e=e.toLowerCase(),e==="o"?Ct:e)}function yh(t){return t.replace(/=/,"").replace(/[+#]?[?!]*$/,"")}class _k{constructor(e=ph,{skipValidation:r=!1}={}){nt(this,"_board",new Array(128));nt(this,"_turn",Ft);nt(this,"_header",{});nt(this,"_kings",{w:Ht,b:Ht});nt(this,"_epSquare",-1);nt(this,"_halfMoves",0);nt(this,"_moveNumber",0);nt(this,"_history",[]);nt(this,"_comments",{});nt(this,"_castling",{w:0,b:0});nt(this,"_hash",0n);nt(this,"_positionCount",new Map);this.load(e,{skipValidation:r})}clear({preserveHeaders:e=!1}={}){this._board=new Array(128),this._kings={w:Ht,b:Ht},this._turn=Ft,this._castling={w:0,b:0},this._epSquare=Ht,this._halfMoves=0,this._moveNumber=1,this._history=[],this._comments={},this._header=e?this._header:{...uk},this._hash=this._computeHash(),this._positionCount=new Map,this._header.SetUp=null,this._header.FEN=null}load(e,{skipValidation:r=!1,preserveHeaders:s=!1}={}){let o=e.split(/\s+/);if(o.length>=2&&o.length<6){const d=["-","-","0","1"];e=o.concat(d.slice(-(6-o.length))).join(" ")}if(o=e.split(/\s+/),!r){const{ok:d,error:m}=wk(e);if(!d)throw new Error(m)}const l=o[0];let u=0;this.clear({preserveHeaders:s});for(let d=0;d<l.length;d++){const m=l.charAt(d);if(m==="/")u+=8;else if(Z1(m))u+=parseInt(m,10);else{const h=m<"a"?Ft:Cn;this._put({type:m.toLowerCase(),color:h},Ut(u)),u++}}this._turn=o[1],o[2].indexOf("K")>-1&&(this._castling.w|=we.KSIDE_CASTLE),o[2].indexOf("Q")>-1&&(this._castling.w|=we.QSIDE_CASTLE),o[2].indexOf("k")>-1&&(this._castling.b|=we.KSIDE_CASTLE),o[2].indexOf("q")>-1&&(this._castling.b|=we.QSIDE_CASTLE),this._epSquare=o[3]==="-"?Ht:be[o[3]],this._halfMoves=parseInt(o[4],10),this._moveNumber=parseInt(o[5],10),this._hash=this._computeHash(),this._updateSetup(e),this._incPositionCount()}fen({forceEnpassantSquare:e=!1}={}){var u,d;let r=0,s="";for(let m=be.a8;m<=be.h1;m++){if(this._board[m]){r>0&&(s+=r,r=0);const{color:h,type:g}=this._board[m];s+=h===Ft?g.toUpperCase():g.toLowerCase()}else r++;m+1&136&&(r>0&&(s+=r),m!==be.h1&&(s+="/"),r=0,m+=8)}let o="";this._castling[Ft]&we.KSIDE_CASTLE&&(o+="K"),this._castling[Ft]&we.QSIDE_CASTLE&&(o+="Q"),this._castling[Cn]&we.KSIDE_CASTLE&&(o+="k"),this._castling[Cn]&we.QSIDE_CASTLE&&(o+="q"),o=o||"-";let l="-";if(this._epSquare!==Ht)if(e)l=Ut(this._epSquare);else{const m=this._epSquare+(this._turn===Ft?16:-16),h=[m+1,m-1];for(const g of h){if(g&136)continue;const v=this._turn;if(((u=this._board[g])==null?void 0:u.color)===v&&((d=this._board[g])==null?void 0:d.type)===yt){this._makeMove({color:v,from:g,to:this._epSquare,piece:yt,captured:yt,flags:we.EP_CAPTURE});const b=!this._isKingAttacked(v);
194if(this._undoMove(),b){l=Ut(this._epSquare);break}}}}return[s,this._turn,o,l,this._halfMoves,this._moveNumber].join(" ")}_pieceKey(e){if(!this._board[e])return 0n;const{color:r,type:s}=this._board[e],o={w:0,b:1}[r],l={p:0,n:1,b:2,r:3,q:4,k:5}[s];return sk[o][l][e]}_epKey(){return this._epSquare===Ht?0n:ik[this._epSquare&7]}_castlingKey(){const e=this._castling.w>>5|this._castling.b>>3;return ok[e]}_computeHash(){let e=0n;for(let r=be.a8;r<=be.h1;r++){if(r&136){r+=7;continue}this._board[r]&&(e^=this._pieceKey(r))}return e^=this._epKey(),e^=this._castlingKey(),this._turn==="b"&&(e^=mh),e}_updateSetup(e){this._history.length>0||(e!==ph?(this._header.SetUp="1",this._header.FEN=e):(this._header.SetUp=null,this._header.FEN=null))}reset(){this.load(ph)}get(e){return this._board[be[e]]}findPiece(e){var s;const r=[];for(let o=be.a8;o<=be.h1;o++){if(o&136){o+=7;continue}!this._board[o]||((s=this._board[o])==null?void 0:s.color)!==e.color||this._board[o].color===e.color&&this._board[o].type===e.type&&r.push(Ut(o))}return r}put({type:e,color:r},s){return this._put({type:e,color:r},s)?(this._updateCastlingRights(),this._updateEnPassantSquare(),this._updateSetup(this.fen()),!0):!1}_set(e,r){this._hash^=this._pieceKey(e),this._board[e]=r,this._hash^=this._pieceKey(e)}_put({type:e,color:r},s){if(mk.indexOf(e.toLowerCase())===-1||!(s in be))return!1;const o=be[s];if(e==Ct&&!(this._kings[r]==Ht||this._kings[r]==o))return!1;const l=this._board[o];return l&&l.type===Ct&&(this._kings[l.color]=Ht),this._set(o,{type:e,color:r}),e===Ct&&(this._kings[r]=o),!0}_clear(e){this._hash^=this._pieceKey(e),delete this._board[e]}remove(e){const r=this.get(e);return this._clear(be[e]),r&&r.type===Ct&&(this._kings[r.color]=Ht),this._updateCastlingRights(),this._updateEnPassantSquare(),this._updateSetup(this.fen()),r}_updateCastlingRights(){var s,o,l,u,d,m,h,g,v,b,C,x;this._hash^=this._castlingKey();const e=((s=this._board[be.e1])==null?void 0:s.type)===Ct&&((o=this._board[be.e1])==null?void 0:o.color)===Ft,r=((l=this._board[be.e8])==null?void 0:l.type)===Ct&&((u=this._board[be.e8])==null?void 0:u.color)===Cn;(!e||((d=this._board[be.a1])==null?void 0:d.type)!==il||((m=this._board[be.a1])==null?void 0:m.color)!==Ft)&&(this._castling.w&=-65),(!e||((h=this._board[be.h1])==null?void 0:h.type)!==il||((g=this._board[be.h1])==null?void 0:g.color)!==Ft)&&(this._castling.w&=-33),(!r||((v=this._board[be.a8])==null?void 0:v.type)!==il||((b=this._board[be.a8])==null?void 0:b.color)!==Cn)&&(this._castling.b&=-65),(!r||((C=this._board[be.h8])==null?void 0:C.type)!==il||((x=this._board[be.h8])==null?void 0:x.color)!==Cn)&&(this._castling.b&=-33),this._hash^=this._castlingKey()}_updateEnPassantSquare(){var l,u;if(this._epSquare===Ht)return;const e=this._epSquare+(this._turn===Ft?-16:16),r=this._epSquare+(this._turn===Ft?16:-16),s=[r+1,r-1];if(this._board[e]!==null||this._board[this._epSquare]!==null||((l=this._board[r])==null?void 0:l.color)!==el(this._turn)||((u=this._board[r])==null?void 0:u.type)!==yt){this._hash^=this._epKey(),this._epSquare=Ht;return}const o=d=>{var m,h;return!(d&136)&&((m=this._board[d])==null?void 0:m.color)===this._turn&&((h=this._board[d])==null?void 0:h.type)===yt};s.some(o)||(this._hash^=this._epKey(),this._epSquare=Ht)}_attacked(e,r,s){const o=[];for(let l=be.a8;l<=be.h1;l++){if(l&136){l+=7;continue}if(this._board[l]===void 0||this._board[l].color!==e)continue;const u=this._board[l],d=l-r;if(d===0)continue;const m=d+119;if(fk[m]&hk[u.type]){if(u.type===yt){if(d>0&&u.color===Ft||d<=0&&u.color===Cn)if(s)o.push(Ut(l));else return!0;continue}if(u.type==="n"||u.type==="k")if(s){o.push(Ut(l));continue}else return!0;const h=dk[m];let g=l+h,v=!1;for(;g!==r;){if(this._board[g]!=null){v=!0;break}g+=h}if(!v)if(s){o.push(Ut(l));continue}else return!0}}return s?o:!1}attackers(e,r){return r?this._attacked(r,be[e],!0):this._attacked(this._turn,be[e],!0)}_isKingAttacked(e){const r=this._kings[e];return r===-1?!1:this._attacked(el(e),r)}hash(){return this._hash.toString(16)}isAttacked(e,r){return this._attacked(r,be[e])}isCheck(){return this._isKingAttacked(this._turn)}inCheck(){return this.isCheck()}isCheckmate(){return this.isCheck()&&this._moves().length===0}isStalemate(){return!this.isCheck()&&this._moves().length===0}isInsufficientMaterial(){const e={b:0,n:0,r:0,q:0,k:0,p:0},r=[];let s=0,o=0;for(let l=be.a8;l<=be.h1;l++){if(o=(o+1)%2,l&136){l+=7;continue}const u=this._board[l];u&&(e[u.type]=u.type in e?e[u.type]+1:1,u.type===iu&&r.push(o),s++)}if(s===2)return!0;
194if(s===3&&(e[iu]===1||e[Jh]===1))return!0;if(s===e[iu]+2){let l=0;const u=r.length;for(let d=0;d<u;d++)l+=r[d];if(l===0||l===u)return!0}return!1}isThreefoldRepetition(){return this._getPositionCount(this._hash)>=3}isDrawByFiftyMoves(){return this._halfMoves>=100}isDraw(){return this.isDrawByFiftyMoves()||this.isStalemate()||this.isInsufficientMaterial()||this.isThreefoldRepetition()}isGameOver(){return this.isCheckmate()||this.isDraw()}moves({verbose:e=!1,square:r=void 0,piece:s=void 0}={}){const o=this._moves({square:r,piece:s});return e?o.map(l=>new $c(this,l)):o.map(l=>this._moveToSan(l,o))}_moves({legal:e=!0,piece:r=void 0,square:s=void 0}={}){var C;const o=s?s.toLowerCase():void 0,l=r==null?void 0:r.toLowerCase(),u=[],d=this._turn,m=el(d);let h=be.a8,g=be.h1,v=!1;if(o)if(o in be)h=g=be[o],v=!0;else return[];for(let x=h;x<=g;x++){if(x&136){x+=7;continue}if(!this._board[x]||this._board[x].color===m)continue;const{type:E}=this._board[x];let T;if(E===yt){if(l&&l!==E)continue;T=x+gh[d][0],this._board[T]||(wa(u,d,x,T,yt),T=x+gh[d][1],bk[d]===ps(x)&&!this._board[T]&&wa(u,d,x,T,yt,void 0,we.BIG_PAWN));for(let k=2;k<4;k++)T=x+gh[d][k],!(T&136)&&(((C=this._board[T])==null?void 0:C.color)===m?wa(u,d,x,T,yt,this._board[T].type,we.CAPTURE):T===this._epSquare&&wa(u,d,x,T,yt,yt,we.EP_CAPTURE))}else{if(l&&l!==E)continue;for(let k=0,z=Cy[E].length;k<z;k++){const O=Cy[E][k];for(T=x;T+=O,!(T&136);){if(!this._board[T])wa(u,d,x,T,E);else{if(this._board[T].color===d)break;wa(u,d,x,T,E,this._board[T].type,we.CAPTURE);break}if(E===Jh||E===Ct)break}}}}if((l===void 0||l===Ct)&&(!v||g===this._kings[d])){if(this._castling[d]&we.KSIDE_CASTLE){const x=this._kings[d],E=x+2;!this._board[x+1]&&!this._board[E]&&!this._attacked(m,this._kings[d])&&!this._attacked(m,x+1)&&!this._attacked(m,E)&&wa(u,d,this._kings[d],E,Ct,void 0,we.KSIDE_CASTLE)}if(this._castling[d]&we.QSIDE_CASTLE){const x=this._kings[d],E=x-2;!this._board[x-1]&&!this._board[x-2]&&!this._board[x-3]&&!this._attacked(m,this._kings[d])&&!this._attacked(m,x-1)&&!this._attacked(m,E)&&wa(u,d,this._kings[d],E,Ct,void 0,we.QSIDE_CASTLE)}}if(!e||this._kings[d]===-1)return u;const b=[];for(let x=0,E=u.length;x<E;x++)this._makeMove(u[x]),this._isKingAttacked(d)||b.push(u[x]),this._undoMove();return b}move(e,{strict:r=!1}={}){let s=null;if(typeof e=="string")s=this._moveFromSan(e,r);else if(e===null)s=this._moveFromSan(vh,r);else if(typeof e=="object"){const l=this._moves();for(let u=0,d=l.length;u<d;u++)if(e.from===Ut(l[u].from)&&e.to===Ut(l[u].to)&&(!("promotion"in l[u])||e.promotion===l[u].promotion)){s=l[u];break}}if(!s)throw typeof e=="string"?new Error(`Invalid move: ${e}`):new Error(`Invalid move: ${JSON.stringify(e)}`);if(this.isCheck()&&s.flags&we.NULL_MOVE)throw new Error("Null move not allowed when in check");const o=new $c(this,s);return this._makeMove(s),this._incPositionCount(),o}_push(e){this._history.push({move:e,kings:{b:this._kings.b,w:this._kings.w},turn:this._turn,castling:{b:this._castling.b,w:this._castling.w},epSquare:this._epSquare,halfMoves:this._halfMoves,moveNumber:this._moveNumber})}_movePiece(e,r){this._hash^=this._pieceKey(e),this._board[r]=this._board[e],delete this._board[e],this._hash^=this._pieceKey(r)}_makeMove(e){var o,l,u,d;const r=this._turn,s=el(r);if(this._push(e),e.flags&we.NULL_MOVE){r===Cn&&this._moveNumber++,this._halfMoves++,this._turn=s,this._epSquare=Ht;return}if(this._hash^=this._epKey(),this._hash^=this._castlingKey(),e.captured&&(this._hash^=this._pieceKey(e.to)),this._movePiece(e.from,e.to),e.flags&we.EP_CAPTURE&&(this._turn===Cn?this._clear(e.to-16):this._clear(e.to+16)),e.promotion&&(this._clear(e.to),this._set(e.to,{type:e.promotion,color:r})),this._board[e.to].type===Ct){if(this._kings[r]=e.to,e.flags&we.KSIDE_CASTLE){const m=e.to-1,h=e.to+1;this._movePiece(h,m)}else if(e.flags&we.QSIDE_CASTLE){const m=e.to+1,h=e.to-2;this._movePiece(h,m)}this._castling[r]=0}if(this._castling[r]){for(let m=0,h=ba[r].length;m<h;m++)if(e.from===ba[r][m].square&&this._castling[r]&ba[r][m].flag){this._castling[r]^=ba[r][m].flag;break}}if(this._castling[s]){for(let m=0,h=ba[s].length;m<h;m++)if(e.to===ba[s][m].square&&this._castling[s]&ba[s][m].flag){this._castling[s]^=ba[s][m].flag;break}}if(this._hash^=this._castlingKey(),e.flags&we.BIG_PAWN){let m;r===Cn?m=e.to-16:m=e.to+16,!(e.to-1&136)&&((o=this._board[e.to-1])==null?void 0:o.type)===yt&&((l=this._board[e.to-1])==null?void 0:l.color)===s||!(e.to+1&136)&&((u=this._board[e.to+1])==null?void 0:u.type)===yt&&((d=this._board[e.to+1])==null?void 0:d.color)===s?(this._epSquare=m,this._hash^=this._epKey()):this._epSquare=Ht}else this._epSquare=Ht;e.piece===yt?this._halfMoves=0:e.flags&(we.CAPTURE|we.EP_CAPTURE)?this._halfMoves=0:this._halfMoves++,r===Cn&&this._moveNumber++,this._turn=s,this._hash^=mh}
194undo(){const e=this._hash,r=this._undoMove();if(r){const s=new $c(this,r);return this._decPositionCount(e),s}return null}_undoMove(){const e=this._history.pop();if(e===void 0)return null;this._hash^=this._epKey(),this._hash^=this._castlingKey();const r=e.move;this._kings=e.kings,this._turn=e.turn,this._castling=e.castling,this._epSquare=e.epSquare,this._halfMoves=e.halfMoves,this._moveNumber=e.moveNumber,this._hash^=this._epKey(),this._hash^=this._castlingKey(),this._hash^=mh;const s=this._turn,o=el(s);if(r.flags&we.NULL_MOVE)return r;if(this._movePiece(r.to,r.from),r.piece&&(this._clear(r.from),this._set(r.from,{type:r.piece,color:s})),r.captured)if(r.flags&we.EP_CAPTURE){let l;s===Cn?l=r.to-16:l=r.to+16,this._set(l,{type:yt,color:o})}else this._set(r.to,{type:r.captured,color:o});if(r.flags&(we.KSIDE_CASTLE|we.QSIDE_CASTLE)){let l,u;r.flags&we.KSIDE_CASTLE?(l=r.to+1,u=r.to-1):(l=r.to-2,u=r.to+1),this._movePiece(u,l)}return r}pgn({newline:e=` 195`,maxWidth:r=0}={}){const s=[];let o=!1;for(const b in this._header)this._header[b]&&s.push(`[${b} "${this._header[b]}"]`+e),o=!0;o&&this._history.length&&s.push(e);const l=b=>{const C=this._comments[this.fen()];if(typeof C<"u"){const x=b.length>0?" ":"";b=`${b}${x}{${C}}`}return b},u=[];for(;this._history.length>0;)u.push(this._undoMove());const d=[];let m="";for(u.length===0&&d.push(l(""));u.length>0;){m=l(m);const b=u.pop();if(!b)break;if(!this._history.length&&b.color==="b"){const C=`${this._moveNumber}. ...`;m=m?`${m} ${C}`:C}else b.color==="w"&&(m.length&&d.push(m),m=this._moveNumber+".");m=m+" "+this._moveToSan(b,this._moves({legal:!0})),this._makeMove(b)}if(m.length&&d.push(l(m)),d.push(this._header.Result||"*"),r===0)return s.join("")+d.join(" ");const h=function(){return s.length>0&&s[s.length-1]===" "?(s.pop(),!0):!1},g=function(b,C){for(const x of C.split(" "))if(x){if(b+x.length>r){for(;h();)b--;s.push(e),b=0}s.push(x),b+=x.length,s.push(" "),b++}return h()&&b--,b};let v=0;for(let b=0;b<d.length;b++){if(v+d[b].length>r&&d[b].includes("{")){v=g(v,d[b]);continue}v+d[b].length>r&&b!==0?(s[s.length-1]===" "&&s.pop(),s.push(e),v=0):b!==0&&(s.push(" "),v++),s.push(d[b]),v+=d[b].length}return s.join("")}header(...e){for(let r=0;r<e.length;r+=2)typeof e[r]=="string"&&typeof e[r+1]=="string"&&(this._header[e[r]]=e[r+1]);return this._header}setHeader(e,r){return this._header[e]=r??em[e]??null,this.getHeaders()}removeHeader(e){return e in this._header?(this._header[e]=em[e]||null,!0):!1}getHeaders(){const e={};for(const[r,s]of Object.entries(this._header))s!==null&&(e[r]=s);return e}loadPgn(e,{strict:r=!1,newlineChar:s=`\r? 196`}={}){s!==`\r? 197`&&(e=e.replace(new RegExp(s,"g"),` 198`));const o=rk(e);this.reset();const l=o.headers;let u="";for(const h in l)h.toLowerCase()==="fen"&&(u=l[h]),this.header(h,l[h]
198);if(!r)u&&this.load(u,{preserveHeaders:!0});else if(l.SetUp==="1"){if(!("FEN"in l))throw new Error("Invalid PGN: FEN tag must be supplied with SetUp tag");this.load(l.FEN,{preserveHeaders:!0})}let d=o.root;for(;d;){if(d.move){const h=this._moveFromSan(d.move,r);if(h==null)throw new Error(`Invalid move in PGN: ${d.move}`);this._makeMove(h),this._incPositionCount()}d.comment!==void 0&&(this._comments[this.fen()]=d.comment),d=d.variations[0]}const m=o.result;m&&Object.keys(this._header).length&&this._header.Result!==m&&this.setHeader("Result",m)}_moveToSan(e,r){let s="";if(e.flags&we.KSIDE_CASTLE)s="O-O";else if(e.flags&we.QSIDE_CASTLE)s="O-O-O";else{if(e.flags&we.NULL_MOVE)return vh;if(e.piece!==yt){const o=xk(e,r);s+=e.piece.toUpperCase()+o}e.flags&(we.CAPTURE|we.EP_CAPTURE)&&(e.piece===yt&&(s+=Ut(e.from)[0]),s+="x"),s+=Ut(e.to),e.promotion&&(s+="="+e.promotion.toUpperCase())}return this._makeMove(e),this.isCheck()&&(this.isCheckmate()?s+="#":s+="+"),this._undoMove(),s}_moveFromSan(e,r=!1){let s=yh(e);if(r||(s==="0-0"?s="O-O":s==="0-0-0"&&(s="O-O-O")),s==vh)return{color:this._turn,from:0,to:0,piece:"k",flags:we.NULL_MOVE};let o=Ay(s),l=this._moves({legal:!0,piece:o});for(let b=0,C=l.length;b<C;b++)if(s===yh(this._moveToSan(l[b],l)))return l[b];if(r)return null;let u,d,m,h,g,v=!1;if(d=s.match(/([pnbrqkPNBRQK])?([a-h][1-8])x?-?([a-h][1-8])([qrbnQRBN])?/),d?(u=d[1],m=d[2],h=d[3],g=d[4],m.length==1&&(v=!0)):(d=s.match(/([pnbrqkPNBRQK])?([a-h]?[1-8]?)x?-?([a-h][1-8])([qrbnQRBN])?/),d&&(u=d[1],m=d[2],h=d[3],g=d[4],m.length==1&&(v=!0))),o=Ay(s),l=this._moves({legal:!0,piece:u||o}),!h)return null;for(let b=0,C=l.length;b<C;b++)if(m){if((!u||u.toLowerCase()==l[b].piece)&&be[m]==l[b].from&&be[h]==l[b].to&&(!g||g.toLowerCase()==l[b].promotion))return l[b];if(v){const x=Ut(l[b].from);if((!u||u.toLowerCase()==l[b].piece)&&be[h]==l[b].to&&(m==x[0]||m==x[1])&&(!g||g.toLowerCase()==l[b].promotion))return l[b]}}else if(s===yh(this._moveToSan(l[b],l)).replace("x",""))return l[b];return null}ascii(){let e=` +------------------------+ 199`;for(let r=be.a8;r<=be.h1;r++){if(hl(r)===0&&(e+=" "+"87654321"[ps(r)]+" |"),this._board[r]){const s=this._board[r].type,l=this._board[r].color===Ft?s.toUpperCase():s.toLowerCase();e+=" "+l+" "}else e+=" . ";r+1&136&&(e+=`| 200`,r+=8)}return e+=` +------------------------+ 201`,e+=" a b c d e f g h",e}perft(e){const r=this._moves({legal:!1});let s=0;const o=this._turn;for(let l=0,u=r.length;l<u;l++)this._makeMove(r[l]),this._isKingAttacked(o)||(e-1>0?s+=this.perft(e-1):s++),this._undoMove();return s}setTurn(e){return this._turn==e?!1:(this.move("--"),!0)}turn(){return this._turn}board(){const e=[];let r=[];for(let s=be.a8;s<=be.h1;s++)this._board[s]==null?r.push(null):r.push({square:Ut(s),type:this._board[s].type,color:this._board[s].color}),s+1&136&&(e.push(r),r=[],s+=8);return e}squareColor(e){if(e in be){const r=be[e];return(ps(r)+hl(r))%2===0?"light":"dark"}return null}history({verbose:e=!1}={}){const r=[],s=[];for(;this._history.length>0;)r.push(this._undoMove());for(;;){const o=r.pop();if(!o)break;e?s.push(new $c(this,o)):s.push(this._moveToSan(o,this._moves())),this._makeMove(o)}return s}_getPositionCount(e){return this._positionCount.get(e)??0}_incPositionCount(){this._positionCount.set(this._hash,(this._positionCount.get(this._hash)??0)+1)}_decPositionCount(e){const r=this._positionCount.get(e)??0;r===1?this._positionCount.delete(e):this._positionCount.set(e,r-1)}_pruneComments(){const e=[],r={},s=o=>{o in this._comments&&(r[o]=this._comments[o])};for(;this._history.length>0;)e.push(this._undoMove());for(s(this.fen());;){const o=e.pop();if(!o)break;this._makeMove(o),s(this.fen())}this._comments=r}getComment(){return this._comments[this.fen()]}setComment(e){this._comments[this.fen()]=e.replace("{","[").replace("}","]")}deleteComment(){return this.removeComment()}removeComment(){const e=this._comments[this.fen()];return delete this._comments[this.fen()],e}getComments(){return this._pruneComments(),Object.keys(this._comments).map(e=>({fen:e,comment:this._comments[e]}))}deleteComments(){return this.removeComments()}
201removeComments(){return this._pruneComments(),Object.keys(this._comments).map(e=>{const r=this._comments[e];return delete this._comments[e],{fen:e,comment:r}})}setCastlingRights(e,r){for(const o of[Ct,ja])r[o]!==void 0&&(r[o]?this._castling[e]|=qc[o]:this._castling[e]&=~qc[o]);this._updateCastlingRights();const s=this.getCastlingRights(e);return(r[Ct]===void 0||r[Ct]===s[Ct])&&(r[ja]===void 0||r[ja]===s[ja])}getCastlingRights(e){return{[Ct]:(this._castling[e]&qc[Ct])!==0,[ja]:(this._castling[e]&qc[ja])!==0}}moveNumber(){return this._moveNumber}}const Sk=()=>{const t=_.useRef(void 0);return{getInstance:_.useCallback(()=>(t.current||(t.current=new _k),t.current),[])}},Ek=({gameId:t})=>async r=>{await Yn.post(`/chess/game/${t}/move`,{moveSan:r})},Ck=["white","black"],hu=["a","b","c","d","e","f","g","h"],mu=["1","2","3","4","5","6","7","8"],Tk=[...mu].reverse(),Dm=hu.flatMap(t=>mu.map(e=>t+e)),ft=t=>Dm[8*t[0]+t[1]],Ie=t=>[t.charCodeAt(0)-97,t.charCodeAt(1)-49],W1=Dm.map(Ie);function Ak(t){let e;const r=()=>(e===void 0&&(e=t()),e);return r.clear=()=>{e=void 0},r}const kk=()=>{let t;return{start(){t=performance.now()},cancel(){t=void 0},stop(){if(!t)return 0;const e=performance.now()-t;return t=void 0,e}}},Du=t=>t==="white"?"black":"white",ml=(t,e)=>(t[0]-e[0])**2+(t[1]-e[1])**2,pu=(t,e)=>t.role===e.role&&t.color===e.color,jk=(t,e)=>t[0]===e[0]&&t[1]===e[1],_l=t=>(e,r)=>[(r?e[0]:7-e[0])*t.width/8,(r?7-e[1]:e[1])*t.height/8],ur=(t,e)=>{t.style.transform=`translate(${e[0]}px,${e[1]}px)`},J1=(t,e,r=1)=>{t.style.transform=`translate(${e[0]}px,${e[1]}px) scale(${r})`},Lm=(t,e)=>{t.style.visibility=e?"visible":"hidden"},_s=t=>{var e;if(t.clientX||t.clientX===0)return[t.clientX,t.clientY];if((e=t.targetTouches)!=null&&e[0])return[t.targetTouches[0].clientX,t.targetTouches[0].clientY]},ew=t=>t.button===2,Hr=(t,e)=>{const r=document.createElement(t);return e&&(r.className=e),r};function tw(t,e,r){const s=Ie(t);return e||(s[0]=7-s[0],s[1]=7-s[1]),[r.left+r.width*s[0]/8+r.width/16,r.top+r.height*(7-s[1])/8+r.height/16]}const hr=(t,e)=>Math.abs(t-e),Um=(t,e,r,s)=>hr(t,r)*hr(e,s)===2,zm=(t,e,r,s)=>t===r!=(e===s),Pm=(t,e,r,s)=>hr(t,r)===hr(e,s)&&t!==r,nw=(t,e,r,s)=>zm(t,e,r,s)||Pm(t,e,r,s),rw=(t,e,r,s)=>Math.max(hr(t,r),hr(e,s))===1,aw=(t,e,r,s,o)=>hr(t,r)===1&&s===e+(o?1:-1),sw=(t,e,r,s,o)=>{const l=o?1:-1;return t===r&&(s===e+l||s===e+2*l&&(o?e<=1:e>=6))},Lu=(t,e,r,s)=>{const o=r-t,l=s-e;if(o&&l&&Math.abs(o)!==Math.abs(l))return[];const u=Math.sign(o),d=Math.sign(l),m=[];let h=t+u,g=e+d;for(;h!==r||g!==s;)m.push([h,g]),h+=u,g+=d;return m.map(v=>ft(v))},Rk=t=>{const e=Ie(t),r=[];return e[0]>0&&r.push([e[0]-1,e[1]]),e[0]<7&&r.push([e[0]+1,e[1]]),r.map(ft)},gu=(t,e)=>{const r=Ie(t);return r[1]+=e,ft(r)},Vi=t=>t.friendlies.has(ft(t.pos2)),Nk=t=>t.enemies.has(ft(t.pos2)),iw=(t,e,r)=>Lu(...t,...e).some(s=>r.has(s)),ow=(t,e,r)=>{const s=r.enemies.get(t);if((s==null?void 0:s.role)!=="pawn")return!1;const o=s.color==="white"?1:-1,l=Ie(t),u=Ie(e);return sw(...l,...u,s.color==="white")&&!iw(l,[u[0],u[1]+o],r.allPieces)},Ok=(t,e,r)=>{const s=r.enemies.get(t);return(s==null?void 0:s.role)==="pawn"&&aw(...Ie(t),...Ie(e),s.color==="white")&&(r.friendlies.has(e)||zu(gu(e,s.color==="white"?-1:1),r.friendlies,r.enemies,r.lastMove))},Mk=t=>[...t.enemies.keys()].some(e=>ow(e,ft(t.pos2),t)),tm=(t,e)=>{const r=t.pos2;return[...t.enemies].some(([s,o])=>{const l=Ie(s);return!(e!=null&&e.includes(o.role))&&(o.role==="pawn"&&aw(...l,...r,o.color==="white")||o.role==="knight"&&Um(...l,...r)||o.role==="bishop"&&Pm(...l,...r)||o.role==="rook"&&zm(...l,...r)||o.role==="queen"&&nw(...l,...r)||o.role==="king"&&rw(...l,...r))&&(!["bishop","rook","queen"].includes(o.role)||!iw(l,r,t.allPieces))})},Uu=t=>Vi(t)&&(zu(ft(t.pos2),t.friendlies,t.enemies,t.lastMove)||tm(t)),zu=(t,e,r,s)=>{if(!t||s&&t!==s[1])return!1;const o=Ie(t),l=e.get(t);return(l==null?void 0:l.role)==="pawn"&&o[1]===(l.color==="white"?3:4)&&(!s||hr(Ie(s[0])[1],o[1])===2)&&[1,-1].some(u=>{var d;return((d=r.get(ft([o[0]+u,o[1]])))==null?void 0:d.role)==="pawn"})},Dk=t=>{if(t.unrestrictedPremoves)return!0;const e=Lu(...t.pos1,...t.pos2),r=e.filter(s=>t.friendlies.has(s));return!r.length||r.length===1&&zu(r[0],t.friendlies,t.enemies,t.lastMove)&&!e.includes(gu(r[0],t.color==="white"?-1:1))},Lk=t=>{if(t.unrestrictedPremoves)return!0;const e=Lu(...t.pos1,...t.pos2),r=e.filter(h=>t.enemies.has(h));if(r.length>1)return!1;if(!r.length)return!0;const s=r[0],o=t.enemies.get(s);if(!o||o.role!=="pawn")return!0;const l=o.color==="white"?1:-1,u=gu(s,l),d=[...Rk(u).filter(h=>Ok(s,h,t)),...[u,gu(u,l)].filter(h=>h&&ow(s,h,t))],m=[...e,ft(t.pos1)];return d.some(h=>!m.includes(h))},Bm=t=>Dk(t)&&Lk(t),Uk=t=>{const e=t.color==="white"?1:-1;return hr(t.pos1[0],t.pos2[0])>1?!1:hr(t.pos1[0],t.pos2[0])?t.pos2[1]!==t.pos1[1]+e?!1:t.unrestrictedPremoves||Nk(t)?!0:Vi(t)?tm(t):Mk(t)||zu(ft([t.pos2[0],t.pos2[1]+e]),t.friendlies,t.enemies,t.lastMove)||tm(t,["pawn"]):sw(...t.pos1,...t.pos2,t.color==="white")&&Bm({...t,pos2:[t.pos2[0],t.pos2[1]+e]})},zk=t=>Um(...t.pos1,...t.pos2)&&(t.unrestrictedPremoves||!Vi(t)||Uu(t)),lw=t=>Pm(...t.pos1,...t.pos2)&&Bm(t)&&(t.unrestrictedPremoves||!Vi(t)||Uu(t)),cw=t=>zm(...t.pos1,...t.pos2)&&Bm(t)&&(t.unrestrictedPremoves||!Vi(t)||Uu(t)),Pk=t=>lw(t)||cw(t),Bk=t=>rw(...t.pos1,...t.pos2)&&(t.unrestrictedPremoves||!Vi(t)||Uu(t))||t.canCastle&&t.pos1[1]===t.pos2[1]&&t.pos1[1]===(t.color==="white"?0:7)&&(t.pos1[0]===4&&(t.pos2[0]===2&&t.rookFilesFriendlies.includes(0)||t.pos2[0]===6&&t.rookFilesFriendlies.includes(7))||t.rookFilesFriendlies.includes(t.pos2[0]))&&(t.unrestrictedPremoves||Lu(...t.pos1,t.pos2[0]>t.pos1[0]?7:1,t.pos2[1]).map(e=>t.allPieces.get(e)).every(e=>!e||pu(e,{role:"rook",color:t.color}))),$k={pawn:Uk,knight:zk,bishop:lw,rook:cw,queen:Pk,king:Bk};function uw(t,e){const r=t.pieces,s=t.premovable.castle,o=!!t.premovable.unrestrictedPremoves,l=r.get(e);if(!l||l.color===t.turnColor)return[];const u=l.color,d=new Map([...r].filter(([b,C])=>C.color===u)),m=new Map([...r].filter(([b,C])=>C.color===Du(u))),h=Ie(e),g=$k[l.role],v={pos1:h,allPieces:r,friendlies:d,enemies:m,unrestrictedPremoves:o,color:u,canCastle:s,rookFilesFriendlies:Array.from(r).filter(([b,C])=>b[1]===(u==="white"?"1":"8")&&C.color===u&&C.role==="rook").map(([b])=>Ie(b)[0]),lastMove:t.lastMove};return W1.filter(b=>g({...v,pos2:b})).map(ft)}function cn(t,...e){t&&setTimeout(()=>t(...e),1)}function qk(t){t.orientation=Du(t.orientation),t.animation.current=t.draggable.current=t.selected=void 0}function Hk(t,e){for(const[r,s]of e)s?t.pieces.set(r,s):t.pieces.delete(r)}function Ik(t,e){if(t.check=void 0,e===!0&&(e=t.turnColor),e)for(const[r,s]of t.pieces)s.role==="king"&&s.color===e&&(t.check=r)}function Gk(t,e,r,s){Ua(t),t.premovable.current=[e,r],cn(t.premovable.events.set,e,r,s)}function La(t){t.premovable.current&&(t.premovable.current=void 0,cn(t.premovable.events.unset))}function Kk(t,e,r){La(t),t.predroppable.current={role:e,key:r},cn(t.predroppable.events.set,e,r)}function Ua(t){const e=t.predroppable;e.current&&(e.current=void 0,cn(e.events.unset))}function Vk(t,e,r){if(!t.autoCastle)return!1;const s=t.pieces.get(e);if(!s||s.role!=="king")return!1;const o=Ie(e),l=Ie(r);if(o[1]!==0&&o[1]!==7||o[1]!==l[1])return!1;o[0]===4&&!t.pieces.has(r)&&(l[0]===6?r=ft([7,l[1]]):l[0]===2&&(r=ft([0,l[1]])));const u=t.pieces.get(r);return!u||u.color!==s.color||u.role!=="rook"?!1:(t.pieces.delete(e),t.pieces.delete(r),o[0]<l[0]?(t.pieces.set(ft([6,l[1]]),s),t.pieces.set(ft([5,l[1]]),u)):(t.pieces.set(ft([2,l[1]]),s),t.pieces.set(ft([3,l[1]]),u)),!0)}function fw(t,e,r){const s=t.pieces.get(e),o=t.pieces.get(r);if(e===r||!s)return!1;const l=o&&o.color!==s.color?o:void 0;return r===t.selected&&$n(t),cn(t.events.move,e,r,l),Vk(t,e,r)||(t.pieces.set(r,s),t.pieces.delete(e)),t.lastMove=[e,r],t.check=void 0,cn(t.events.change),l||!0}function $m(t,e,r,s){if(t.pieces.has(r))if(s)t.pieces.delete(r);else return!1;return cn(t.events.dropNewPiece,e,r),t.pieces.set(r,e),t.lastMove=[r],t.check=void 0,cn(t.events.change),t.movable.dests=void 0,t.turnColor=Du(t.turnColor),!0}function dw(t,e,r){const s=fw(t,e,r);return s&&(t.movable.dests=void 0,t.turnColor=Du(t.turnColor),t.animation.current=void 0),s}function hw(t,e,r){if(qm(t,e,r)){const s=dw(t,e,r);
201if(s){const o=t.hold.stop();$n(t);const l={premove:!1,ctrlKey:t.stats.ctrlKey,holdTime:o};return s!==!0&&(l.captured=s),cn(t.movable.events.after,e,r,l),!0}}else if(Fk(t,e,r))return Gk(t,e,r,{ctrlKey:t.stats.ctrlKey}),$n(t),!0;return $n(t),!1}function mw(t,e,r,s){const o=t.pieces.get(e);o&&(Yk(t,e,r)||s)?(t.pieces.delete(e),$m(t,o,r,s),cn(t.movable.events.afterNewPiece,o.role,r,{premove:!1,predrop:!1})):o&&Qk(t,e,r)?Kk(t,o.role,r):(La(t),Ua(t)),t.pieces.delete(e),$n(t)}function nm(t,e,r){if(cn(t.events.select,e),t.selected){if(t.selected===e&&!t.draggable.enabled){$n(t),t.hold.cancel();return}else if((t.selectable.enabled||r)&&t.selected!==e&&hw(t,t.selected,e)){t.stats.dragged=!1;return}}(t.selectable.enabled||t.draggable.enabled)&&(gw(t,e)||Hm(t,e))&&(pw(t,e),t.hold.start())}function pw(t,e){t.selected=e,Hm(t,e)?t.premovable.customDests||(t.premovable.dests=uw(t,e)):t.premovable.dests=void 0}function $n(t){t.selected=void 0,t.premovable.dests=void 0,t.hold.cancel()}function gw(t,e){const r=t.pieces.get(e);return!!r&&(t.movable.color==="both"||t.movable.color===r.color&&t.turnColor===r.color)}const qm=(t,e,r)=>{var s,o;return e!==r&&gw(t,e)&&(t.movable.free||!!((o=(s=t.movable.dests)==null?void 0:s.get(e))!=null&&o.includes(r)))};function Yk(t,e,r){const s=t.pieces.get(e);return!!s&&(e===r||!t.pieces.has(r))&&(t.movable.color==="both"||t.movable.color===s.color&&t.turnColor===s.color)}function Hm(t,e){const r=t.pieces.get(e);return!!r&&t.premovable.enabled&&t.movable.color===r.color&&t.turnColor!==r.color}const Fk=(t,e,r)=>{var s;return e!==r&&Hm(t,e)&&(((s=t.premovable.customDests)==null?void 0:s.get(e))??uw(t,e)).includes(r)};function Qk(t,e,r){const s=t.pieces.get(e),o=t.pieces.get(r);return!!s&&(!o||o.color!==t.movable.color)&&t.predroppable.enabled&&(s.role!=="pawn"||r[1]!=="1"&&r[1]!=="8")&&t.movable.color===s.color&&t.turnColor!==s.color}function Xk(t,e){const r=t.pieces.get(e);return!!r&&t.draggable.enabled&&(t.movable.color==="both"||t.movable.color===r.color&&(t.turnColor===r.color||t.premovable.enabled))}function Zk(t){const e=t.premovable.current;if(!e)return!1;const r=e[0],s=e[1];let o=!1;if(qm(t,r,s)){const l=dw(t,r,s);if(l){const u={premove:!0};l!==!0&&(u.captured=l),cn(t.movable.events.after,r,s,u),o=!0}}return La(t),o}function Wk(t,e){const r=t.predroppable.current;let s=!1;if(!r)return!1;if(e(r)){const o={role:r.role,color:t.movable.color};$m(t,o,r.key)&&(cn(t.movable.events.afterNewPiece,r.role,r.key,{premove:!1,predrop:!0}),s=!0)}return Ua(t),s}function Im(t){La(t),Ua(t),$n(t)}function ky(t){t.movable.color=t.movable.dests=t.animation.current=void 0,Im(t)}function Ss(t,e,r){let s=Math.floor(8*(t[0]-r.left)/r.width);e||(s=7-s);let o=7-Math.floor(8*(t[1]-r.top)/r.height);return e||(o=7-o),s>=0&&s<8&&o>=0&&o<8?ft([s,o]):void 0}function Jk(t,e,r,s){const o=Ie(t),l=W1.filter(h=>jk(o,h)||nw(o[0],o[1],h[0],h[1])||Um(o[0],o[1],h[0],h[1])),d=l.map(h=>tw(ft(h),r,s)).map(h=>ml(e,h)),[,m]=d.reduce((h,g,v)=>h[0]<g?h:[g,v],[d[0],0]);return ft(l[m])}const un=t=>t.orientation==="white",vw="rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR",e3={p:"pawn",r:"rook",n:"knight",b:"bishop",q:"queen",k:"king"},t3={pawn:"p",rook:"r",knight:"n",bishop:"b",queen:"q",king:"k"};function yw(t){t==="start"&&(t=vw);const e=new Map;let r=7,s=0;for(const o of t)switch(o){case" ":case"[":return e;case"/":if(--r,r<0)return e;s=0;break;case"~":{const l=e.get(ft([s-1,r]));l&&(l.promoted=!0);break}default:{const l=o.charCodeAt(0);if(l<57)s+=l-48;else{const u=o.toLowerCase(),d=ft([s,r]);d&&e.set(d,{role:e3[u],color:o===u?"black":"white"}),++s}}}return e}function n3(t){return Tk.map(e=>hu.map(r=>{const s=t.get(r+e);if(s){let o=t3[s.role];return s.color==="white"&&(o=o.toUpperCase()),s.promoted&&(o+="~"),o}else return"1"}).join("")).join("/").replace(/1{2,}/g,e=>e.length.toString())}function bw(t,e){e.animation&&(Gm(t.animation,e.animation),(t.animation.duration||0)<70&&(t.animation.enabled=!1))}function ww(t,e){var r,s,o;if((r=e.movable)!=null&&r.dests&&(t.movable.dests=void 0),(s=e.drawable)!=null&&s.autoShapes&&(t.drawable.autoShapes=[]),Gm(t,e),e.fen&&(t.pieces=yw(e.fen),t.drawable.shapes=((o=e.drawable)==null?void 0:o.shapes)||[]),"check"in e&&Ik(t,e.check||!1),"lastMove"in e&&!e.lastMove?t.lastMove=void 0:e.lastMove&&(t.lastMove=e.lastMove),t.selected&&pw(t,t.selected),bw(t,e),!t.movable.rookCastle&&t.movable.dests){const l=t.movable.color==="white"?"1":"8",u="e"+l,d=t.movable.dests.get(u),m=t.pieces.get(u);if(!d||!m||m.role!=="king")return;t.movable.dests.set(u,d.filter(h=>!(h==="a"+l&&d.includes("c"+l))&&!(h==="h"+l&&d.includes("g"+l))))}}function Gm(t,e){for(const r in e)r==="__proto__"||r==="constructor"||!Object.prototype.hasOwnProperty.call(e,r)||(Object.prototype.hasOwnProperty.call(t,r)&&jy(t[r])&&jy(e[r])?Gm(t[r],e[r]):t[r]=e[r])}function jy(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null}const us=(t,e)=>e.animation.enabled?s3(t,e):Ta(t,e);function Ta(t,e){const r=t(e);return e.dom.redraw(),r}const bh=(t,e)=>
201({key:t,pos:Ie(t),piece:e}),r3=(t,e)=>e.sort((r,s)=>ml(t.pos,r.pos)-ml(t.pos,s.pos))[0];function a3(t,e){const r=new Map,s=[],o=new Map,l=[],u=[],d=new Map;let m,h,g;for(const[v,b]of t)d.set(v,bh(v,b));for(const v of Dm)m=e.pieces.get(v),h=d.get(v),m?h?pu(m,h.piece)||(l.push(h),u.push(bh(v,m))):u.push(bh(v,m)):h&&l.push(h);for(const v of u)h=r3(v,l.filter(b=>pu(v.piece,b.piece))),h&&(g=[h.pos[0]-v.pos[0],h.pos[1]-v.pos[1]],r.set(v.key,g.concat(g)),s.push(h.key));for(const v of l)s.includes(v.key)||o.set(v.key,v.piece);return{anims:r,fadings:o}}function xw(t,e){const r=t.animation.current;if(r===void 0){t.dom.destroyed||t.dom.redrawNow();return}const s=1-(e-r.start)*r.frequency;if(s<=0)t.animation.current=void 0,t.dom.redrawNow();else{const o=i3(s);for(const l of r.plan.anims.values())l[2]=l[0]*o,l[3]=l[1]*o;t.dom.redrawNow(!0),requestAnimationFrame((l=performance.now())=>xw(t,l))}}function s3(t,e){const r=new Map(e.pieces),s=t(e),o=a3(r,e);if(o.anims.size||o.fadings.size){const l=e.animation.current&&e.animation.current.start;e.animation.current={start:performance.now(),frequency:1/e.animation.duration,plan:o},l||xw(e,performance.now())}else e.dom.redraw();return s}const i3=t=>t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1,o3=["green","red","blue","yellow"];function l3(t,e){if(e.touches&&e.touches.length>1)return;e.stopPropagation(),e.preventDefault(),e.ctrlKey?$n(t):Im(t);const r=_s(e),s=Ss(r,un(t),t.dom.bounds());s&&(t.drawable.current={orig:s,pos:r,brush:d3(e),snapToValidMove:t.drawable.defaultSnapToValidMove},_w(t))}function _w(t){requestAnimationFrame(()=>{const e=t.drawable.current;if(e){const r=Ss(e.pos,un(t),t.dom.bounds());r||(e.snapToValidMove=!1);const s=e.snapToValidMove?Jk(e.orig,e.pos,un(t),t.dom.bounds()):r;s!==e.mouseSq&&(e.mouseSq=s,e.dest=s!==e.orig?s:void 0,t.dom.redrawNow()),_w(t)}})}function c3(t,e){t.drawable.current&&(t.drawable.current.pos=_s(e))}function u3(t){const e=t.drawable.current;e&&(e.mouseSq&&h3(t.drawable,e),Sw(t))}function Sw(t){t.drawable.current&&(t.drawable.current=void 0,t.dom.redraw())}function f3(t){t.drawable.shapes.length&&(t.drawable.shapes=[],t.dom.redraw(),Ew(t.drawable))}function d3(t){var s;const e=(t.shiftKey||t.ctrlKey)&&ew(t),r=t.altKey||t.metaKey||((s=t.getModifierState)==null?void 0:s.call(t,"AltGraph"));return o3[(e?1:0)+(r?2:0)]}function h3(t,e){const r=o=>o.orig===e.orig&&o.dest===e.dest,s=t.shapes.find(r);s&&(t.shapes=t.shapes.filter(o=>!r(o))),(!s||s.brush!==e.brush)&&t.shapes.push({orig:e.orig,dest:e.dest,brush:e.brush}),Ew(t)}function Ew(t){t.onChange&&t.onChange(t.shapes)}function m3(t,e){if(!(t.trustAllEvents||e.isTrusted)||e.buttons!==void 0&&e.buttons>1||e.touches&&e.touches.length>1)return;const r=t.dom.bounds(),s=_s(e),o=Ss(s,un(t),r);if(!o)return;const l=t.pieces.get(o),u=t.selected;if(!u&&t.drawable.enabled&&(t.drawable.eraseOnClick||!l||l.color!==t.turnColor)&&f3(t),e.cancelable!==!1&&(!e.touches||t.blockTouchScroll||l||u||p3(t,s)))e.preventDefault();else if(e.touches)return;const d=!!t.premovable.current,m=!!t.predroppable.current;t.stats.ctrlKey=e.ctrlKey,t.selected&&qm(t,t.selected,o)?us(v=>nm(v,o),t):nm(t,o);const h=t.selected===o,g=Tw(t,o);if(l&&g&&h&&Xk(t,o)){t.draggable.current={orig:o,piece:l,origPos:s,pos:s,started:t.draggable.autoDistance&&t.stats.dragged,element:g,previouslySelected:u,originTarget:e.target,keyHasChanged:!1},g.cgDragging=!0,g.classList.add("dragging");const v=t.dom.elements.ghost;v&&(v.className=`ghost ${l.color} ${l.role}`,ur(v,_l(r)(Ie(o),un(t))),Lm(v,!0)),Km(t)}else d&&La(t),m&&Ua(t);t.dom.redraw()}function p3(t,e){const r=un(t),s=t.dom.bounds(),o=Math.pow(t.touchIgnoreRadius*s.width/16,2)*2;for(const l of t.pieces.keys()){const u=tw(l,r,s);if(ml(u,e)<=o)return!0}return!1}function g3(t,e,r,s){const o="a0";t.pieces.set(o,e),t.dom.redraw();const l=_s(r);t.draggable.current={orig:o,piece:e,origPos:l,pos:l,started:!0,element:()=>Tw(t,o),originTarget:r.target,newPiece:!0,force:!!s,keyHasChanged:!1},Km(t)}function Km(t){requestAnimationFrame(()=>{var s;const e=t.draggable.current;if(!e)return;(s=t.animation.current)!=null&&s.plan.anims.has(e.orig)&&(t.animation.current=void 0);const r=t.pieces.get(e.orig);if(!r||!pu(r,e.piece))vu(t);else if(!e.started&&ml(e.pos,e.origPos)>=Math.pow(t.draggable.distance,2)&&(e.started=!0),e.started){if(typeof e.element=="function"){const l=e.element();if(!l)return;l.cgDragging=!0,l.classList.add("dragging"),e.element=l}const o=t.dom.bounds();ur(e.element,[e.pos[0]-o.left-o.width/16,e.pos[1]-o.top-o.height/16]),e.keyHasChanged||(e.keyHasChanged=e.orig!==Ss(e.pos,un(t),o))}Km(t)})}function v3(t,e){t.draggable.current&&(!e.touches||e.touches.length<2)&&(t.draggable.current.pos=_s(e))}function y3(t,e){const r=t.draggable.current;if(!r)return;if(e.type==="touchend"&&e.cancelable!==!1&&e.preventDefault(),e.type==="touchend"&&r.originTarget!==e.target&&!r.newPiece){t.draggable.current=void 0;return}La(t),Ua(t);const s=_s(e)||r.pos,o=Ss(s,un(t),t.dom.bounds());o&&r.started&&r.orig!==o?r.newPiece?mw(t,r.orig,o,r.force):(t.stats.ctrlKey=e.ctrlKey,hw(t,r.orig,o)&&(t.stats.dragged=!0)):r.newPiece?t.pieces.delete(r.orig):t.draggable.deleteOnDropOff&&!o&&(t.pieces.delete(r.orig),cn(t.events.change)),(r.orig===r.previouslySelected||r.keyHasChanged)&&(r.orig===o||!o)?$n(t):t.selectable.enabled||$n(t),Cw(t),t.draggable.current=void 0,t.dom.redraw()}function vu(t){const e=t.draggable.current;e&&(e.newPiece&&t.pieces.delete(e.orig),t.draggable.current=void 0,$n(t),Cw(t),t.dom.redraw())}function Cw(t){const e=t.dom.elements;e.ghost&&Lm(e.ghost,!1)}function Tw(t,e){let r=t.dom.elements.board.firstChild;for(;r;){if(r.cgKey===e&&r.tagName==="PIECE")return r;r=r.nextSibling}}function b3(t,e){t.exploding={stage:1,keys:e},t.dom.redraw(),setTimeout(()=>{Ry(t,2),setTimeout(()=>Ry(t,void 0),120)},120)}function Ry(t,e){t.exploding&&(e?t.exploding.stage=e:t.exploding=void 0,t.dom.redraw())}function w3(t,e){function r(){qk(t),e()}return{set(s){s.orientation&&s.orientation!==t.orientation&&r(),bw(t,s),(s.fen?us:Ta)(o=>ww(o,s),t)},state:t,getFen:()=>
vendor: 1,911 bytes, line 201
201n3(t.pieces),toggleOrientation:r,setPieces(s){us(o=>Hk(o,s),t)},selectSquare(s,o){s?us(l=>nm(l,s,o),t):t.selected&&($n(t),t.dom.redraw())},move(s,o){us(l=>fw(l,s,o),t)},newPiece(s,o){us(l=>$m(l,s,o),t)},playPremove(){if(t.premovable.current){if(us(Zk,t))return!0;t.dom.redraw()}return!1},playPredrop(s){if(t.predroppable.current){const o=Wk(t,s);return t.dom.redraw(),o}return!1},cancelPremove(){Ta(La,t)},cancelPredrop(){Ta(Ua,t)},cancelMove(){Ta(s=>{Im(s),vu(s)},t)},stop(){Ta(s=>{ky(s),vu(s)},t)},explode(s){b3(t,s)},setAutoShapes(s){Ta(o=>o.drawable.autoShapes=s,t)},setShapes(s){Ta(o=>o.drawable.shapes=s.slice(),t)},getKeyAtDomPos(s){return Ss(s,un(t),t.dom.bounds())},redrawAll:e,dragNewPiece(s,o,l){g3(t,s,o,l)},destroy(){ky(t),t.dom.unbind&&t.dom.unbind(),t.dom.destroyed=!0}}}function x3(){return{pieces:yw(vw),orientation:"white",turnColor:"white",coordinates:!0,coordinatesOnSquares:!1,ranksPosition:"right",autoCastle:!0,viewOnly:!1,disableContextMenu:!1,addPieceZIndex:!1,blockTouchScroll:!1,touchIgnoreRadius:1,pieceKey:!1,trustAllEvents:!1,highlight:{lastMove:!0,check:!0},animation:{enabled:!0,duration:200},movable:{free:!0,color:"both",showDests:!0,events:{},rookCastle:!0},premovable:{enabled:!0,showDests:!0,castle:!0,events:{}},predroppable:{enabled:!1,events:{}},draggable:{enabled:!0,distance:3,autoDistance:!0,showGhost:!0,deleteOnDropOff:!1},dropmode:{active:!1},selectable:{enabled:!0},stats:{dragged:!("ontouchstart"in window)},events:{},drawable:{enabled:!0,visible:!0,defaultSnapToValidMove:!0,eraseOnClick:!0,shapes:[],autoShapes:[],brushes:{green:{key:"g",color:"#15781B",opacity:1,lineWidth:10},red:{key:"r",color:"#882020",opacity:1,lineWidth:10},blue:{key:"b",color:"#003088",opacity:1,lineWidth:10},yellow:{key:"y",color:"#e68f00",opacity:1,lineWidth:10},paleBlue:{key:"pb",color:"#003088",opacity:.4,lineWidth:15},paleGreen:{key:"pg",color:"#15781B",opacity:.4,lineWidth:15}
201,paleRed:{key:"pr",color:"#882020",opacity:.4,lineWidth:15},paleGrey:{key:"pgr",color:"#4a4a4a",opacity:.35,lineWidth:15},purple:{key:"purple",color:"#68217a",opacity:.65,lineWidth:10},pink:{key:"pink",color:"#ee2080",opacity:.5,lineWidth:10},white:{key:"white",color:"white",opacity:1,lineWidth:10},paleWhite:{key:"pwhite",color:"white",opacity:.6,lineWidth:10}},prevSvgHash:""},hold:kk()}}function _3(){const t=Gt("defs"),e=Zt(Gt("filter"),{id:"cg-filter-blur"});return e.appendChild(Zt(Gt("feGaussianBlur"),{stdDeviation:"0.013"})),t.appendChild(e),t}function S3(t,e){const r=t.drawable,s=r.current,o=s&&s.mouseSq?s:void 0,l=new Map,u=t.dom.bounds(),d=r.autoShapes.filter(g=>!g.piece);for(const g of r.shapes.concat(d).concat(o?[o]:[])){if(!g.dest)continue;const v=l.get(g.dest)??new Set,b=bu(yu(Ie(g.orig),t.orientation),u),C=bu(yu(Ie(g.dest),t.orientation),u);v.add(am(b,C)),l.set(g.dest,v)}const m=[];for(const g of r.shapes.concat(d))m.push({shape:g,current:!1,hash:Ny(g,rm(g.dest,l),!1,u)});o&&m.push({shape:o,current:!0,hash:Ny(o,rm(o.dest,l),!0,u)});const h=m.map(g=>g.hash).join(";");h!==t.drawable.prevSvgHash&&(t.drawable.prevSvgHash=h,E3(r,m,e),C3(m,e,g=>k3(t,g,r.brushes,l,u)))}function E3(t,e,r){for(const s of[r.shapes,r.shapesBelow]){const o=s.querySelector("defs"),l=e.filter(h=>s===r.shapesBelow==!!h.shape.below),u=new Map;for(const h of l.filter(g=>g.shape.dest&&g.shape.brush)){const g=Aw(t.brushes[h.shape.brush],h.shape.modifiers),{key:v,color:b}=kw(h.shape);v&&b&&u.set(v,{key:v,color:b,opacity:1,lineWidth:1}),u.set(g.key,g)}const d=new Set;let m=o.firstElementChild;for(;m;)d.add(m.getAttribute("cgKey")),m=m.nextElementSibling;for(const[h,g]of u.entries())d.has(h)||o.appendChild(N3(g))}}function C3(t,e,r){for(const[s,o]of[[e.shapes,e.custom],[e.shapesBelow,e.customBelow]]){const[l,u]=[s,o].map(h=>h.querySelector("g")),d=t.filter(h=>s===e.shapesBelow==!!h.shape.below),m=new Map;for(const h of d)m.set(h.hash,!1);for(const h of[l,u]){const g=[];let v=h.firstElementChild,b;for(;v;)b=v.getAttribute("cgHash"),m.has(b)?m.set(b,!0):g.push(v),v=v.nextElementSibling;for(const C of g)h.removeChild(C)}for(const h of d.filter(g=>!m.get(g.hash)))for(const g of r(h))g.isCustom?u.appendChild(g.el):l.appendChild(g.el)}}function Ny({orig:t,dest:e,brush:r,piece:s,modifiers:o,customSvg:l,label:u,below:d},m,h,g){var v;return[g.width,g.height,h,t,e,r,m&&"-",s&&T3(s),o&&A3(o),l&&`custom-${Oy(l.html)},${((v=l.center)==null?void 0:v[0])??"o"}`,u&&`label-${Oy(u.text)}`,d&&"below"].filter(b=>b).join(",")}function T3(t){return[t.color,t.role,t.scale].filter(e=>e).join(",")}function A3(t){return[t.lineWidth,t.hilite].filter(e=>e).join(",")}function Oy(t){let e=0;for(let r=0;r<t.length;r++)e=(e<<5)-e+t.charCodeAt(r)>>>0;return e.toString()}function k3(t,{shape:e,current:r,hash:s},o,l,u){const d=bu(yu(Ie(e.orig),t.orientation),u),m=e.dest?bu(yu(Ie(e.dest),t.orientation),u):d,h=e.brush&&Aw(o[e.brush],e.modifiers),g=l.get(e.dest),v=[];
201if(h){const b=Zt(Gt("g"),{cgHash:s});v.push({el:b}),d[0]!==m[0]||d[1]!==m[1]?b.appendChild(R3(e,h,d,m,r,rm(e.dest,l))):b.appendChild(j3(o[e.brush],d,r,u))}if(e.label){const b=e.label;b.fill??(b.fill=e.brush&&o[e.brush].color);const C=e.brush?void 0:"tr";v.push({el:O3(b,s,d,m,g,C),isCustom:!0})}if(e.customSvg){const b=e.customSvg.center??"orig",[C,x]=b==="label"?Rw(d,m,g).map(T=>T-.5):b==="dest"?m:d,E=Zt(Gt("g"),{transform:`translate(${C},${x})`,cgHash:s});E.innerHTML=`<svg width="1" height="1" viewBox="0 0 100 100">${e.customSvg.html}</svg>`,v.push({el:E,isCustom:!0})}return v}function j3(t,e,r,s){const o=M3(),l=(s.width+s.height)/(4*Math.max(s.width,s.height));return Zt(Gt("circle"),{stroke:t.color,"stroke-width":o[r?0:1],fill:"none",opacity:jw(t,r),cx:e[0],cy:e[1],r:l-o[1]/2})}function R3(t,e,r,s,o,l){var h;function u(g){var z;const v=L3(l&&!o),b=s[0]-r[0],C=s[1]-r[1],x=Math.atan2(C,b),E=Math.cos(x)*v,T=Math.sin(x)*v,k=kw(t);return Zt(Gt("line"),{stroke:g?k.color:e.color,"stroke-width":D3(e,o)*(g?1.14:1),"stroke-linecap":"round","marker-end":`url(#arrowhead-${g?k.key:e.key})`,opacity:(z=t.modifiers)!=null&&z.hilite?1:jw(e,o),x1:r[0],y1:r[1],x2:s[0]-E,y2:s[1]-T})}if(!((h=t.modifiers)!=null&&h.hilite))return u(!1);const d=Zt(Gt("g"),{opacity:e.opacity}),m=Zt(Gt("g"),{filter:"url(#cg-filter-blur)"});return m.appendChild(U3(r,s)),m.appendChild(u(!0)),d.appendChild(m),d.appendChild(u(!1)),d}function N3(t){const e=Zt(Gt("marker"),{id:"arrowhead-"+t.key,orient:"auto",overflow:"visible",markerWidth:4,markerHeight:4,refX:t.key.startsWith("hilite")?1.86:2.05,refY:2});return e.appendChild(Zt(Gt("path"),{d:"M0,0 V4 L3,2 Z",fill:t.color})),e.setAttribute("cgKey",t.key),e}function O3(t,e,r,s,o,l){const d=.4*.75**t.text.length,m=Rw(r,s,o),h=l==="tr"?.4:0,g=Zt(Gt("g"),{transform:`translate(${m[0]+h},${m[1]-h})`,cgHash:e});g.appendChild(Zt(Gt("circle"),{r:.4/2,"fill-opacity":l?1:.8,"stroke-opacity":l?1:.7,"stroke-width":.03,fill:t.fill??"#666",stroke:"white"}));const v=Zt(Gt("text"),{"font-size":d,"font-family":"Noto Sans","text-anchor":"middle",fill:"white",y:.13*.75**t.text.length});return v.innerHTML=t.text,g.appendChild(v),g}function yu(t,e){return e==="white"?t:[7-t[0],7-t[1]]}function rm(t,e){return(t&&e.has(t)&&e.get(t).size>1)===!0}function Gt(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Zt(t,e){for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.setAttribute(r,e[r]);return t}function Aw(t,e){return e?{color:t.color,opacity:Math.round(t.opacity*10)/10,lineWidth:Math.round(e.lineWidth||t.lineWidth),key:[t.key,e.lineWidth].filter(r=>r).join("")}:t}function M3(){return[3/64,4/64]}function D3(t,e){return(t.lineWidth||10)*(e?.85:1)/64}function kw(t){var r;const e=(r=t.modifiers)==null?void 0:r.hilite;return{key:e&&`hilite-${e.replace("#","")}`,color:e}}function jw(t,e){return(t.opacity||1)*(e?.9:1)}function L3(t){return(t?20:10)/64}function bu(t,e){const r=Math.min(1,e.width/e.height),s=Math.min(1,e.height/e.width);return[(t[0]-3.5)*r,(3.5-t[1])*s]}function U3(t,e){const r={from:[Math.floor(Math.min(t[0],e[0])),Math.floor(Math.min(t[1],e[1]))],to:[Math.ceil(Math.max(t[0],e[0])),Math.ceil(Math.max(t[1],e[1]))]};return Zt(Gt("rect"),{x:r.from[0],y:r.from[1],width:r.to[0]-r.from[0],height:r.to[1]-r.from[1],fill:"none",stroke:"none"})}function am(t,e,r=!0){const s=Math.atan2(e[1]-t[1],e[0]-t[0])+Math.PI;return r?(Math.round(s*8/Math.PI)+16)%16:s}function z3(t,e){return Math.sqrt([t[0]-e[0],t[1]-e[1]].reduce((r,s)=>r+s*s,0))}function Rw(t,e,r){let s=z3(t,e);const o=am(t,e,!1);if(r&&(s-=33/64,r.size>1)){s-=10/64;const l=am(t,e);(r.has((l+1)%16)||r.has((l+15)%16))&&l&1&&(s-=.4)}return[t[0]-Math.cos(o)*s,t[1]-Math.sin(o)*s].map(l=>l+.5)}function P3(t,e){t.innerHTML="",t.classList.add("cg-wrap");for(const g of Ck)t.classList.toggle("orientation-"+g,e.orientation===g);t.classList.toggle("manipulable",!e.viewOnly);const r=Hr("cg-container");t.appendChild(r);const s=Hr("cg-board");r.appendChild(s);let o,l,u,d,m;if(e.drawable.visible&&([o,l]=["cg-shapes-below","cg-shapes"].map(g=>My(g,!0)),[u,d]=["cg-custom-below","cg-custom-svgs"].map(g=>My(g,!1)),m=Hr("cg-auto-pieces"),r.appendChild(o),r.appendChild(u),r.appendChild(l),r.appendChild(d),r.appendChild(m)),e.coordinates){const g=e.orientation==="black"?" black":"",v=e.ranksPosition==="left"?" left":"";if(e.coordinatesOnSquares){const b=e.orientation==="white"?C=>C+1:C=>8-C;hu.forEach((C,x)=>r.appendChild(wh(mu.map(E=>C+E),"squares rank"+b(x)+g+v)))}else r.appendChild(wh(mu,"ranks"+g+v)),r.appendChild(wh(hu,"files"+g))}let h;return e.draggable.enabled&&e.draggable.showGhost&&(h=Hr("piece","ghost"),Lm(h,!1),r.appendChild(h)),{board:s,container:r,wrap:t,ghost:h,shapes:l,shapesBelow:o,custom:d,customBelow:u,autoPieces:m}}function My(t,e){const r=Zt(Gt("svg"),{class:t,viewBox:e?"-4 -4 8 8":"-3.5 -3.5 8 8",preserveAspectRatio:"xMidYMid slice"});return e&&r.appendChild(_3()),r.appendChild(Gt("g")),r}function wh(t,e){const r=Hr("coords",e);let s;for(const o of t)s=Hr("coord"),s.textContent=o,r.appendChild(s);return r}function B3(t,e){if(!t.dropmode.active)return;La(t),Ua(t);const r=t.dropmode.piece;if(r){t.pieces.set("a0",r);const s=_s(e),o=s&&Ss(s,un(t),t.dom.bounds());o&&mw(t,"a0",o)}t.dom.redraw()}function $3(t,e){const r=t.dom.elements.board;if("ResizeObserver"in window&&new ResizeObserver(e).observe(t.dom.elements.wrap),(t.disableContextMenu||t.drawable.enabled)&&r.addEventListener("contextmenu",o=>o.preventDefault()),t.viewOnly)return;const s=H3(t);r.addEventListener("touchstart",s,{passive:!1}),r.addEventListener("mousedown",s,{passive:!1})}function q3(t,e){const r=[];if("ResizeObserver"in window||r.push(tl(document.body,"chessgroun
201d.resize",e)),!t.viewOnly){const s=Dy(t,v3,c3),o=Dy(t,y3,u3);for(const u of["touchmove","mousemove"])r.push(tl(document,u,s));for(const u of["touchend","mouseup"])r.push(tl(document,u,o));const l=()=>t.dom.bounds.clear();r.push(tl(document,"scroll",l,{capture:!0,passive:!0})),r.push(tl(window,"resize",l,{passive:!0}))}return()=>r.forEach(s=>s())}function tl(t,e,r,s){return t.addEventListener(e,r,s),()=>t.removeEventListener(e,r,s)}const H3=t=>e=>{t.draggable.current?vu(t):t.drawable.current?Sw(t):e.shiftKey||ew(e)?t.drawable.enabled&&l3(t,e):t.viewOnly||(t.dropmode.active?B3(t,e):m3(t,e))},Dy=(t,e,r)=>s=>{t.drawable.current?t.drawable.enabled&&r(t,s):t.viewOnly||e(t,s)};function I3(t){const e=un(t),r=_l(t.dom.bounds()),s=t.dom.elements.board,o=t.pieces,l=t.animation.current,u=l?l.plan.anims:new Map,d=l?l.plan.fadings:new Map,m=t.draggable.current,h=K3(t),g=new Set,v=new Set,b=new Map,C=new Map;let x,E,T,k,z,O,Y,K,re,J;for(E=s.firstChild;E;){if(x=E.cgKey,Nw(E))if(T=o.get(x),z=u.get(x),O=d.get(x),k=E.cgPiece,E.cgDragging&&(!m||m.orig!==x)&&(E.classList.remove("dragging"),ur(E,r(Ie(x),e)),E.cgDragging=!1),!O&&E.cgFading&&(E.cgFading=!1,E.classList.remove("fading")),T){if(z&&E.cgAnimating&&k===nl(T)){const Z=Ie(x);Z[0]+=z[2],Z[1]+=z[3],E.classList.add("anim"),ur(E,r(Z,e))}else E.cgAnimating&&(E.cgAnimating=!1,E.classList.remove("anim"),ur(E,r(Ie(x),e)),t.addPieceZIndex&&(E.style.zIndex=xh(Ie(x),e)));k===nl(T)&&(!O||!E.cgFading)?g.add(x):O&&k===nl(O)?(E.classList.add("fading"),E.cgFading=!0):_h(b,k,E)}else _h(b,k,E);else if(Ow(E)){const Z=E.className;h.get(x)===Z?v.add(x):_h(C,Z,E)}E=E.nextSibling}for(const[Z,de]of h)if(!v.has(Z)){re=C.get(de),J=re&&re.pop();const Ee=r(Ie(Z),e);if(J)J.cgKey=Z,ur(J,Ee);else{const je=Hr("square",de);je.cgKey=Z,ur(je,Ee),s.insertBefore(je,s.firstChild)}}for(const[Z,de]of o)if(z=u.get(Z),!g.has(Z))if(Y=b.get(nl(de)),K=Y&&Y.pop(),K){K.cgKey=Z,K.cgFading&&(K.classList.remove("fading"),K.cgFading=!1);const Ee=Ie(Z);t.addPieceZIndex&&(K.style.zIndex=xh(Ee,e)),z&&(K.cgAnimating=!0,K.classList.add("anim"),Ee[0]+=z[2],Ee[1]+=z[3]),ur(K,r(Ee,e))}else{const Ee=nl(de),je=Hr("piece",Ee),ze=Ie(Z);je.cgPiece=Ee,je.cgKey=Z,z&&(je.cgAnimating=!0,ze[0]+=z[2],ze[1]+=z[3]),ur(je,r(ze,e)),t.addPieceZIndex&&(je.style.zIndex=xh(ze,e)),s.appendChild(je)}for(const Z of b.values())Uy(t,Z);for(const Z of C.values())Uy(t,Z)}function G3(t){const e=un(t),r=_l(t.dom.bounds());let s=t.dom.elements.board.firstChild;for(;s;)(Nw(s)&&!s.cgAnimating||Ow(s))&&ur(s,r(Ie(s.cgKey),e)),s=s.nextSibling}function Ly(t){var u,d;const e=t.dom.elements.wrap.getBoundingClientRect(),r=t.dom.elements.container,s=e.height/e.width,o=Math.floor(e.width*window.devicePixelRatio/8)*8/window.devicePixelRatio,l=o*s;r.style.width=o+"px",r.style.height=l+"px",t.dom.bounds.clear(),(u=t.addDimensionsCssVarsTo)==null||u.style.setProperty("---cg-width",o+"px"),(d=t.addDimensionsCssVarsTo)==null||d.style.setProperty("---cg-height",l+"px")}const Nw=t=>t.tagName==="PIECE",Ow=t=>t.tagName==="SQUARE";function Uy(t,e){for(const r of e)t.dom.elements.board.removeChild(r)}function xh(t,e){const s=t[1];return`${e?10-s:3+s}`}const nl=t=>`${t.color} ${t.role}`;function K3(t){var o,l;const e=new Map;if(t.lastMove&&t.highlight.lastMove)for(const u of t.lastMove)zr(e,u,"last-move");if(t.check&&t.highlight.check&&zr(e,t.check,"check"),t.selected&&(zr(e,t.selected,"selected"),t.movable.showDests)){const u=(o=t.movable.dests)==null?void 0:o.get(t.selected);if(u)for(const m of u)zr(e,m,"move-dest"+(t.pieces.has(m)?" oc":""));const d=((l=t.premovable.customDests)==null?void 0:l.get(t.selected))??t.premovable.dests;if(d)for(const m of d)zr(e,m,"premove-dest"+(t.pieces.has(m)?" oc":""))}const r=t.premovable.current;if(r)for(const u of r)zr(e,u,"current-premove");else t.predroppable.current&&zr(e,t.predroppable.current.key,"current-premove");const s=t.exploding;if(s)for(const u of s.keys)zr(e,u,"exploding"+s.stage);return t.highlight.custom&&t.highlight.custom.forEach((u,d)=>{zr(e,d,u)}),e}function zr(t,e,r){const s=t.get(e);s?t.set(e,`${s} ${r}`):t.set(e,r)}function _h(t,e,r){const s=t.get(e);s?s.push(r):t.set(e,[r])}function V3(t,e,r){const s=new Map,o=[];for(const d of t)s.set(d.hash,!1);let l=e.firstElementChild,u;
vendor: 21,422 bytes, lines 201-241
201for(;l;)u=l.getAttribute("cgHash"),s.has(u)?s.set(u,!0):o.push(l),l=l.nextElementSibling;for(const d of o)e.removeChild(d);for(const d of t)s.get(d.hash)||e.appendChild(r(d))}function Y3(t,e){const s=t.drawable.autoShapes.filter(o=>o.piece).map(o=>({shape:o,hash:X3(o),current:!1}));V3(s,e,o=>Q3(t,o,t.dom.bounds()))}function F3(t){var o;const e=un(t),r=_l(t.dom.bounds());let s=(o=t.dom.elements.autoPieces)==null?void 0:o.firstChild;for(;s;)J1(s,r(Ie(s.cgKey),e),s.cgScale),s=s.nextSibling}function Q3(t,{shape:e,hash:r},s){var h,g,v;const o=e.orig,l=(h=e.piece)==null?void 0:h.role,u=(g=e.piece)==null?void 0:g.color,d=(v=e.piece)==null?void 0:v.scale,m=Hr("piece",`${l} ${u}`);return m.setAttribute("cgHash",r),m.cgKey=o,m.cgScale=d,J1(m,_l(s)(Ie(o),un(t)),d),m}const X3=t=>{var e,r,s;return[t.orig,(e=t.piece)==null?void 0:e.role,(r=t.piece)==null?void 0:r.color,(s=t.piece)==null?void 0:s.scale].join(",")};function Z3(t,e){const r=x3();ww(r,e||{});function s(){const o="dom"in r?r.dom.unbind:void 0,l=P3(t,r),u=Ak(()=>l.board.getBoundingClientRect()),d=g=>{I3(h),l.autoPieces&&Y3(h,l.autoPieces),!g&&l.shapes&&S3(h,l)},m=()=>{Ly(h),G3(h),l.autoPieces&&F3(h)},h=r;return h.dom={elements:l,bounds:u,redraw:W3(d),redrawNow:d,unbind:o},h.drawable.prevSvgHash="",Ly(h),d(!1),$3(h,m),o||(h.dom.unbind=q3(h,m)),h.events.insert&&h.events.insert(l),h}return w3(s(),s)}function W3(t){let e=!1;return()=>{e||(e=!0,requestAnimationFrame(()=>{t(),e=!1}))}}const zy=({config:t={}})=>{const[e,r]=_.useState(null),s=_.useRef(null);return _.useEffect(()=>{if(s&&s.current&&!e){const o=Z3(s.current,{animation:{enabled:!0,duration:200},...t});r(o)}else s&&s.current&&e&&e.set(t)},[s,e,t]),y.jsx("div",{ref:s,className:"relative max-h-[550px] xl:max-h-[calc(100dvh-32px)] 2xl:max-h-[calc(100dvh-64px)] mx-auto aspect-square overflow-x-clip"})};function Na(t,e,{checkForDefaultPrevented:r=!0}={}){return function(o){if(t==null||t(o),r===!1||!o.defaultPrevented)return e==null?void 0:e(o)}}var J3=jb[" useId ".trim().toString()]||(()=>{}),e6=0;function Sh(t){const[e,r]=_.useState(J3());return Oa(()=>{r(s=>s??String(e6++))},[t]),t||(e?`radix-${e}`:"")}var t6=jb[" useInsertionEffect ".trim().toString()]||Oa;function n6({prop:t,defaultProp:e,onChange:r=()=>{},caller:s}){const[o,l,u]=r6({defaultProp:e,onChange:r}),d=t!==void 0,m=d?t:o;{const g=_.useRef(t!==void 0);_.useEffect(()=>{const v=g.current;v!==d&&console.warn(`${s} is changing from ${v?"controlled":"uncontrolled"} to ${d?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),g.current=d},[d,s])}const h=_.useCallback(g=>{var v;if(d){const b=a6(g)?g(t):g;b!==t&&((v=u.current)==null||v.call(u,b))}else l(g)},[d,t,l,u]);return[m,h]}function r6({defaultProp:t,onChange:e}){const[r,s]=_.useState(t),o=_.useRef(r),l=_.useRef(e);return t6(()=>{l.current=e},[e]),_.useEffect(()=>{var u;o.current!==r&&((u=l.current)==null||u.call(l,r),o.current=r)},[r,o]),[r,s,l]}function a6(t){return typeof t=="function"}function s6(t,e=globalThis==null?void 0:globalThis.document){const r=Oi(t);_.useEffect(()=>{const s=o=>{o.key==="Escape"&&r(o)};return e.addEventListener("keydown",s,{capture:!0}),()=>e.removeEventListener("keydown",s,{capture:!0})},[r,e])}var i6="DismissableLayer",sm="dismissableLayer.update",o6="dismissableLayer.pointerDownOutside",l6="dismissableLayer.focusOutside",Py,Mw=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Dw=_.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:u,onDismiss:d,...m}=t,h=_.useContext(Mw),[g,v]=_.useState(null),b=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,C]=_.useState({}),x=ws(e,J=>v(J)),E=Array.from(h.layers),[T]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),k=E.indexOf(T),z=g?E.indexOf(g):-1,O=h.layersWithOutsidePointerEventsDisabled.size>0,Y=z>=k,K=f6(J=>{const Z=J.target,de=[...h.branches].some(Ee=>Ee.contains(Z));!Y||de||(o==null||o(J),u==null||u(J),J.defaultPrevented||d==null||d())},b),re=d6(J=>{const Z=J.target;[...h.branches].some(Ee=>Ee.contains(Z))||(l==null||l(J),u==null||u(J),J.defaultPrevented||d==null||d())},b);return s6(J=>{z===h.layers.size-1&&(s==null||s(J),!J.defaultPrevented&&d&&(J.preventDefault(),d()))},b),_.useEffect(()=>{if(g)return r&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(Py=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(g)),h.layers.add(g),By(),()=>{r&&h.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=Py)}},[g,b,r,h]),_.useEffect(()=>()=>{g&&(h.layers.delete(g),h.layersWithOutsidePointerEventsDisabled.delete(g),By())},[g,h]),_.useEffect(()=>{const J=()=>C({});return document.addEventListener(sm,J),()=>document.removeEventListener(sm,J)},[]),y.jsx(Tn.div,{...m,ref:x,style:{pointerEvents:O?Y?"auto":"none":void 0,...t.style},onFocusCapture:Na(t.onFocusCapture,re.onFocusCapture),onBlurCapture:Na(t.onBlurCapture,re.onBlurCapture),onPointerDownCapture:Na(t.onPointerDownCapture,K.onPointerDownCapture)})});Dw.displayName=i6;var c6="DismissableLayerBranch",u6=_.forwardRef((t,e)=>{const r=_.useContext(Mw),s=_.useRef(null),o=ws(e,s);return _.useEffect(()=>{const l=s.current;if(l)return r.branches.add(l),()=>{r.branches.delete(l)}},[r.branches]),y.jsx(Tn.div,{...t,ref:o})});u6.displayName=c6;function f6(t,e=globalThis==null?void 0:globalThis.document){const r=Oi(t),s=_.useRef(!1),o=_.useRef(()=>{});return _.useEffect(()=>{const l=d=>{if(d.target&&!s.current){let m=function(){Lw(o6,r,h,{discrete:!0})};const h={originalEvent:d};d.pointerType==="touch"?(e.removeEventListener("click",o.current),o.current=m,e.addEventListener("click",o.current,{once:!0})):m()}else e.removeEventListener("click",o.current);s.current=!1},u=window.setTimeout(()=>{e.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(u),e.removeEventListener("pointerdown",l),e.removeEventListener("click",o.current)}},[e,r]),{onPointerDownCapture:()=>s.current=!0}}function d6(t,e=globalThis==null?void 0:globalThis.document){const r=Oi(t),s=_.useRef(!1);return _.useEffect(()=>{const o=l=>{l.target&&!s.current&&Lw(l6,r,{originalEvent:l},{discrete:!1})};return e.addEventListener("focusin",o),()=>e.removeEventListener("focusin",o)},[e,r]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function By(){const t=new CustomEvent(sm);document.dispatchEvent(t)}function Lw(t,e,r,{discrete:s}){const o=r.originalEvent.target,l=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&o.addEventListener(t,e,{once:!0}),s?g4(o,l):o.dispatchEvent(l)}var Eh="focusScope.autoFocusOnMount",Ch="focusScope.autoFocusOnUnmount",$y={bubbles:!1,cancelable:!0},h6="FocusScope",Uw=_.forwardRef((t,e)=>{const{loop:r=!1,trapped:s=!1,onMountAutoFocus:o,onUnmountAutoFocus:l,...u}=t,[d,m]=_.useState(null),h=Oi(o),g=Oi(l),v=_.useRef(null),b=ws(e,E=>m(E)),C=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(s){let E=function(O){if(C.paused||!d)return;const Y=O.target;d.contains(Y)?v.current=Y:Aa(v.current,{select:!0})},T=function(O){if(C.paused||!d)return;const Y=O.relatedTarget;Y!==null&&(d.contains(Y)||Aa(v.current,{select:!0}))},k=function(O){if(document.activeElement===document.body)for(const K of O)K.removedNodes.length>0&&Aa(d)};document.addEventListener("focusin",E),document.addEventListener("focusout",T);const z=new MutationObserver(k);return d&&z.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",E),document.removeEventListener("focusout",T),z.disconnect()}}},[s,d,C.paused]),_.useEffect(()=>{if(d){Hy.add(C);const E=document.activeElement;if(!d.contains(E)){const k=new CustomEvent(Eh,$y);d.addEventListener(Eh,h),d.dispatchEvent(k),k.defaultPrevented||(m6(b6(zw(d)),{select:!0}),document.activeElement===E&&Aa(d))}return()=>{d.removeEventListener(Eh,h),setTimeout(()=>{const k=new CustomEvent(Ch,$y);d.addEventListener(Ch,g),d.dispatchEvent(k),k.defaultPrevented||Aa(E??document.body,{select:!0}),d.removeEventListener(Ch,g),Hy.remove(C)},0)}}},[d,h,g,C]);const x=_.useCallback(E=>{if(!r&&!s||C.paused)return;const T=E.key==="Tab"&&!E.altKey&&!E.ctrlKey&&!E.metaKey,k=document.activeElement;if(T&&k){const z=E.currentTarget,[O,Y]=p6(z);O&&Y?!E.shiftKey&&k===Y?(E.preventDefault(),r&&Aa(O,{select:!0})):E.shiftKey&&k===O&&(E.preventDefault(),r&&Aa(Y,{select:!0})):k===z&&E.preventDefault()}},[r,s,C.paused]);return y.jsx(Tn.div,{tabIndex:-1,...u,ref:b,onKeyDown:x})});Uw.displayName=h6;function m6(t,{select:e=!1}={}){const r=document.activeElement;for(const s of t)if(Aa(s,{select:e}),document.activeElement!==r)return}function p6(t){const e=zw(t),r=qy(e,t),s=qy(e.reverse(),t);return[r,s]}function zw(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const o=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||o?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function qy(t,e){for(const r of t)if(!g6(r,{upTo:e}))return r}function g6(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function v6(t){return t instanceof HTMLInputElement&&"select"in t}function Aa(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&v6(t)&&e&&t.select()}}var Hy=y6();function y6(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=Iy(t,e),t.unshift(e)},remove(e){var r;t=Iy(t,e),(r=t[0])==null||r.resume()}}}function Iy(t,e){const r=[...t],s=r.indexOf(e);return s!==-1&&r.splice(s,1),r}function b6(t){return t.filter(e=>e.tagName!=="A")}var w6="Portal",Pw=_.forwardRef((t,e)=>{var d;const{container:r,...s}=t,[o,l]=_.useState(!1);Oa(()=>l(!0),[]);const u=r||o&&((d=globalThis==null?void 0:globalThis.document)==null?void 0:d.body);return u?Ob.createPortal(y.jsx(Tn.div,{...s,ref:e}),u):null});Pw.displayName=w6;function x6(t,e){return _.useReducer((r,s)=>e[r][s]??r,t)}var Pu=t=>{const{present:e,children:r}=t,s=_6(e),o=typeof r=="function"?r({present:s.isPresent}):_.Children.only(r),l=ws(s.ref,S6(o));return typeof r=="function"||s.isPresent?_.cloneElement(o,{ref:l}):null};Pu.displayName="Presence";function _6(t){const[e,r]=_.useState(),s=_.useRef(null),o=_.useRef(t),l=_.useRef("none"),u=t?"mounted":"unmounted",[d,m]=x6(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const h=Hc(s.current);l.current=d==="mounted"?h:"none"},[d]),Oa(()=>{const h=s.current,g=o.current;if(g!==t){const b=l.current,C=Hc(h);t?m("MOUNT"):C==="none"||(h==null?void 0:h.display)==="none"?m("UNMOUNT"):m(g&&b!==C?"ANIMATION_OUT":"UNMOUNT"),o.current=t}},[t,m]),Oa(()=>{if(e){let h;const g=e.ownerDocument.defaultView??window,v=C=>{const E=Hc(s.current).includes(C.animationName);if(C.target===e&&E&&(m("ANIMATION_END"),!o.current)){const T=e.style.animationFillMode;e.style.animationFillMode="forwards",h=g.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=T)})}},b=C=>{C.target===e&&(l.current=Hc(s.current))};return e.addEventListener("animationstart",b),e.addEventListener("animationcancel",v),e.addEventListener("animationend",v),()=>{g.clearTimeout(h),e.removeEventListener("animationstart",b),e.removeEventListener("animationcancel",v),e.removeEventListener("animationend",v)}}else m("ANIMATION_END")},[e,m]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:_.useCallback(h=>{s.current=h?getComputedStyle(h):null,r(h)},[])}}function Hc(t){return(t==null?void 0:t.animationName)||"none"}function S6(t){var s,o;let e=(s=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:s.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(o=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:o.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var Th=0;function E6(){_.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??Gy()),document.body.insertAdjacentElement("beforeend",t[1]??Gy()),Th++,()=>{Th===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Th--}},[])}function Gy(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var fr=function(){return fr=Object.assign||function(e){for(var r,s=1,o=arguments.length;s<o;s++){r=arguments[s];for(var l in r)Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l])}return e},fr.apply(this,arguments)};function Bw(t,e){var r={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(r[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,s=Object.getOwnPropertySymbols(t);o<s.length;o++)e.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(t,s[o])&&(r[s[o]]=t[s[o]]);return r}function C6(t,e,r){if(r||arguments.length===2)for(var s=0,o=e.length,l;s<o;s++)(l||!(s in e))&&(l||(l=Array.prototype.slice.call(e,0,s)),l[s]=e[s]);return t.concat(l||Array.prototype.slice.call(e))}var ou="right-scroll-bar-position",lu="width-before-scroll-bar",T6="with-scroll-bars-hidden",A6="--removed-body-scroll-bar-size";function Ah(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function k6(t,e){var r=_.useState(function(){return{value:t,callback:e,facade:{get current(){return r.value},set current(s){var o=r.value;o!==s&&(r.value=s,r.callback(s,o))}}}})[0];return r.callback=e,r.facade}var j6=typeof window<"u"?_.useLayoutEffect:_.useEffect,Ky=new WeakMap;function R6(t,e){var r=k6(null,function(s){return t.forEach(function(o){return Ah(o,s)})});return j6(function(){var s=Ky.get(r);if(s){var o=new Set(s),l=new Set(t),u=r.current;o.forEach(function(d){l.has(d)||Ah(d,null)}),l.forEach(function(d){o.has(d)||Ah(d,u)})}Ky.set(r,t)},[t]),r}function N6(t){return t}function O6(t,e){e===void 0&&(e=N6);var r=[],s=!1,o={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:t},useMedium:function(l){var u=e(l,s);return r.push(u),function(){r=r.filter(function(d){return d!==u})}},assignSyncMedium:function(l){for(s=!0;r.length;){var u=r;r=[],u.forEach(l)}r={push:function(d){return l(d)},filter:function(){return r}}},assignMedium:function(l){s=!0;var u=[];if(r.length){var d=r;r=[],d.forEach(l),u=r}var m=function(){var g=u;u=[],g.forEach(l)},h=function(){return Promise.resolve().then(m)};h(),r={push:function(g){u.push(g),h()},filter:function(g){return u=u.filter(g),r}}}};return o}function M6(t){t===void 0&&(t={});var e=O6(null);return e.options=fr({async:!0,ssr:!1},t),e}var $w=function(t){var e=t.sideCar,r=Bw(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=e.read();if(!s)throw new Error("Sidecar medium not found");return _.createElement(s,fr({},r))};$w.isSideCarExport=!0;function D6(t,e){return t.useMedium(e),$w}var qw=M6(),kh=function(){},Bu=_.forwardRef(function(t,e){var r=_.useRef(null),s=_.useState({onScrollCapture:kh,onWheelCapture:kh,onTouchMoveCapture:kh}),o=s[0],l=s[1],u=t.forwardProps,d=t.children,m=t.className,h=t.removeScrollBar,g=t.enabled,v=t.shards,b=t.sideCar,C=t.noRelative,x=t.noIsolation,E=t.inert,T=t.allowPinchZoom,k=t.as,z=k===void 0?"div":k,O=t.gapMode,Y=Bw(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),K=b,re=R6([r,e]),J=fr(fr({},Y),o);return _.createElement(_.Fragment,null,g&&_.createElement(K,{sideCar:qw,removeScrollBar:h,shards:v,noRelative:C,noIsolation:x,inert:E,setCallbacks:l,allowPinchZoom:!!T,lockRef:r,gapMode:O}),u?_.cloneElement(_.Children.only(d),fr(fr({},J),{ref:re})):_.createElement(z,fr({},J,{className:m,ref:re}),d))});Bu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Bu.classNames={fullWidth:lu,zeroRight:ou};var L6=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function U6(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=L6();return e&&t.setAttribute("nonce",e),t}function z6(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function P6(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var B6=function(){var t=0,e=null;return{add:function(r){t==0&&(e=U6())&&(z6(e,r),P6(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},$6=function(){var t=B6();return function(e,r){_.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&r])}},Hw=function(){var t=$6(),e=function(r){var s=r.styles,o=r.dynamic;return t(s,o),null};return e},q6={left:0,top:0,right:0,gap:0},jh=function(t){return parseInt(t||"",10)||0},H6=function(t){var e=window.getComputedStyle(document.body),r=e[t==="padding"?"paddingLeft":"marginLeft"],s=e[t==="padding"?"paddingTop":"marginTop"],o=e[t==="padding"?"paddingRight":"marginRight"];return[jh(r),jh(s),jh(o)]},I6=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return q6;var e=H6(t),r=document.documentElement.clientWidth,s=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,s-r+e[2]-e[0])}},G6=Hw(),Ri="data-scroll-locked",K6=function(t,e,r,s){var o=t.left,l=t.top,u=t.right,d=t.gap;return r===void 0&&(r="margin"),` 202 .`.concat(T6,` { 203 overflow: hidden `).concat(s,`; 204 padding-right: `).concat(d,"px ").concat(s,`; 205 } 206 body[`).concat(Ri,`] { 207 overflow: hidden `).concat(s,`; 208 overscroll-behavior: contain; 209 `).concat([e&&"position: relative ".concat(s,";"),r==="margin"&&` 210 padding-left: `.concat(o,`px; 211 padding-top: `).concat(l,`px; 212 padding-right: `).concat(u,`px; 213 margin-left:0; 214 margin-top:0; 215 margin-right: `).concat(d,"px ").concat(s,`; 216 `),r==="padding"&&"padding-right: ".concat(d,"px ").concat(s,";")].filter(Boolean).join(""),` 217 } 218 219 .`).concat(ou,` { 220 right: `).concat(d,"px ").concat(s,`; 221 } 222 223 .`).concat(lu,` { 224 margin-right: `).concat(d,"px ").concat(s,`; 225 } 226 227 .`).concat(ou," .").concat(ou,` { 228 right: 0 `).concat(s,`; 229 } 230 231 .`).concat(lu," .").concat(lu,` { 232 margin-right: 0 `).concat(s,`; 233 } 234 235 body[`).concat(Ri,`] { 236 `).concat(A6,": ").concat(d,`px; 237 } 238`)},Vy=function(){var t=parseInt(document.body.getAttribute(Ri)||"0",10);return isFinite(t)?t:0},V6=function(){_.useEffect(function(){return document.body.setAttribute(Ri,(Vy()+1).toString()),function(){var t=Vy()-1;t<=0?document.body.removeAttribute(Ri):document.body.setAttribute(Ri,t.toString())}},[])},Y6=function(t){var e=t.noRelative,r=t.noImportant,s=t.gapMode,o=s===void 0?"margin":s;V6();var l=_.useMemo(function(){return I6(o)},[o]);return _.createElement(G6,{styles:K6(l,!e,o,r?"":"!important")})},im=!1;if(typeof window<"u")try{var Ic=Object.defineProperty({},"passive",{get:function(){return im=!0,!0}});window.addEventListener("test",Ic,Ic),window.removeEventListener("test",Ic,Ic)}catch{im=!1}var hi=im?{passive:!1}:!1,F6=function(t){return t.tagName==="TEXTAREA"},Iw=function(t,e){if(!(t instanceof Element))return!1;var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!F6(t)&&r[e]==="visible")},Q6=function(t){return Iw(t,"overflowY")},X6=function(t){return Iw(t,"overflowX")},Yy=function(t,e){var r=e.ownerDocument,s=e;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var o=Gw(t,s);if(o){var l=Kw(t,s),u=l[1],d=l[2];if(u>d)return!0}s=s.parentNode}while(s&&s!==r.body);return!1},Z6=function(t){var e=t.scrollTop,r=t.scrollHeight,s=t.clientHeight;return[e,r,s]},W6=function(t){var e=t.scrollLeft,r=t.scrollWidth,s=t.clientWidth;return[e,r,s]},Gw=function(t,e){return t==="v"?Q6(e):X6(e)},Kw=function(t,e){return t==="v"?Z6(e):W6(e)},J6=function(t,e){return t==="h"&&e==="rtl"?-1:1},ej=function(t,e,r,s,o){var l=J6(t,window.getComputedStyle(e).direction),u=l*s,d=r.target,m=e.contains(d),h=!1,g=u>0,v=0,b=0;do{var C=Kw(t,d),x=C[0],E=C[1],T=C[2],k=E-T-l*x;(x||k)&&Gw(t,d)&&(v+=k,b+=x),d=d.parentNode.host||d.parentNode}while(!m&&d!==document.body||m&&(e.contains(d)||e===d));return(g&&Math.abs(v)<1||!g&&Math.abs(b)<1)&&(h=!0),h},Gc=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Fy=function(t){return[t.deltaX,t.deltaY]},Qy=function(t){return t&&"current"in t?t.current:t},tj=function(t,e){return t[0]===e[0]&&t[1]===e[1]},nj=function(t){return` 239 .block-interactivity-`.concat(t,` {pointer-events: none;} 240 .allow-interactivity-`).concat(t,` {pointer-events: all;} 241`)},rj=0,mi=[];function aj(t){var e=_.useRef([]),r=_.useRef([0,0]),s=_.useRef(),o=_.useState(rj++)[0],l=_.useState(Hw)[0],u=_.useRef(t);_.useEffect(function(){u.current=t},[t]),_.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(o));
vendor: 4,165 bytes, line 241
241var E=C6([t.lockRef.current],(t.shards||[]).map(Qy),!0).filter(Boolean);return E.forEach(function(T){return T.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),E.forEach(function(T){return T.classList.remove("allow-interactivity-".concat(o))})}}},[t.inert,t.lockRef.current,t.shards]);var d=_.useCallback(function(E,T){if("touches"in E&&E.touches.length===2||E.type==="wheel"&&E.ctrlKey)return!u.current.allowPinchZoom;var k=Gc(E),z=r.current,O="deltaX"in E?E.deltaX:z[0]-k[0],Y="deltaY"in E?E.deltaY:z[1]-k[1],K,re=E.target,J=Math.abs(O)>Math.abs(Y)?"h":"v";if("touches"in E&&J==="h"&&re.type==="range")return!1;var Z=Yy(J,re);if(!Z)return!0;if(Z?K=J:(K=J==="v"?"h":"v",Z=Yy(J,re)),!Z)return!1;if(!s.current&&"changedTouches"in E&&(O||Y)&&(s.current=K),!K)return!0;var de=s.current||K;return ej(de,T,E,de==="h"?O:Y)},[]),m=_.useCallback(function(E){var T=E;if(!(!mi.length||mi[mi.length-1]!==l)){var k="deltaY"in T?Fy(T):Gc(T),z=e.current.filter(function(K){return K.name===T.type&&(K.target===T.target||T.target===K.shadowParent)&&tj(K.delta,k)})[0];if(z&&z.should){T.cancelable&&T.preventDefault();return}if(!z){var O=(u.current.shards||[]).map(Qy).filter(Boolean).filter(function(K){return K.contains(T.target)}),Y=O.length>0?d(T,O[0]):!u.current.noIsolation;Y&&T.cancelable&&T.preventDefault()}}},[]),h=_.useCallback(function(E,T,k,z){var O={name:E,delta:T,target:k,should:z,shadowParent:sj(k)};e.current.push(O),setTimeout(function(){e.current=e.current.filter(function(Y){return Y!==O})},1)},[]),g=_.useCallback(function(E){r.current=Gc(E),s.current=void 0},[]),v=_.useCallback(function(E){h(E.type,Fy(E),E.target,d(E,t.lockRef.current))},[]),b=_.useCallback(function(E){h(E.type,Gc(E),E.target,d(E,t.lockRef.current))},[]);_.useEffect(function(){return mi.push(l),t.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:b}),document.addEventListener("wheel",m,hi),document.addEventListener("touchmove",m,hi),document.addEventListener("touchstart",g,hi),function(){mi=mi.filter(function(E){return E!==l}),document.removeEventListener("wheel",m,hi),document.removeEventListener("touchmove",m,hi),document.removeEventListener("touchstart",g,hi)}},[]);var C=t.removeScrollBar,x=t.inert;return _.createElement(_.Fragment,null,x?_.createElement(l,{styles:nj(o)}):null,C?_.createElement(Y6,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function sj(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const ij=D6(qw,aj);var Vw=_.forwardRef(function(t,e){return _.createElement(Bu,fr({},t,{ref:e,sideCar:ij}))});Vw.classNames=Bu.classNames;var oj=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},pi=new WeakMap,Kc=new WeakMap,Vc={},Rh=0,Yw=function(t){return t&&(t.host||Yw(t.parentNode))},lj=function(t,e){return e.map(function(r){if(t.contains(r))return r;var s=Yw(r);return s&&t.contains(s)?s:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},cj=function(t,e,r,s){var o=lj(e,Array.isArray(t)?t:[t]);Vc[r]||(Vc[r]=new WeakMap);var l=Vc[r],u=[],d=new Set,m=new Set(o),h=function(v){!v||d.has(v)||(d.add(v),h(v.parentNode))};o.forEach(h);var g=function(v){!v||m.has(v)||Array.prototype.forEach.call(v.children,function(b){if(d.has(b))g(b);else try{var C=b.getAttribute(s),x=C!==null&&C!=="false",E=(pi.get(b)||0)+1,T=(l.get(b)||0)+1;pi.set(b,E),l.set(b,T),u.push(b),E===1&&x&&Kc.set(b,!0),T===1&&b.setAttribute(r,"true"),x||b.setAttribute(s,"true")}catch(k){console.error("aria-hidden: cannot operate on ",b,k)}})};return g(e),d.clear(),Rh++,function(){u.forEach(function(v){var b=pi.get(v)-1,C=l.get(v)-1;pi.set(v,b),l.set(v,C),b||(Kc.has(v)||v.removeAttribute(s),Kc.delete(v)),C||v.removeAttribute(r)}),Rh--,Rh||(pi=new WeakMap,pi=new WeakMap,Kc=new WeakMap,Vc={})}},uj=function(t,e,r){r===void 0&&(r="data-aria-hidden");var s=Array.from(Array.isArray(t)?t:[t]),o=oj(t);return o?(s.push.apply(s,Array.from(o.querySelectorAll("[aria-live], script"))),cj(s,o,r,"aria-hidden")):function(){return null}}
vendor: 6,047 bytes, lines 241-245
241,$u="Dialog",[Fw,HO]=H1($u),[fj,Zn]=Fw($u),Qw=t=>{const{__scopeDialog:e,children:r,open:s,defaultOpen:o,onOpenChange:l,modal:u=!0}=t,d=_.useRef(null),m=_.useRef(null),[h,g]=n6({prop:s,defaultProp:o??!1,onChange:l,caller:$u});return y.jsx(fj,{scope:e,triggerRef:d,contentRef:m,contentId:Sh(),titleId:Sh(),descriptionId:Sh(),open:h,onOpenChange:g,onOpenToggle:_.useCallback(()=>g(v=>!v),[g]),modal:u,children:r})};Qw.displayName=$u;var Xw="DialogTrigger",Zw=_.forwardRef((t,e)=>{const{__scopeDialog:r,...s}=t,o=Zn(Xw,r),l=ws(e,o.triggerRef);return y.jsx(Tn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Fm(o.open),...s,ref:l,onClick:Na(t.onClick,o.onOpenToggle)})});Zw.displayName=Xw;var Vm="DialogPortal",[dj,Ww]=Fw(Vm,{forceMount:void 0}),Jw=t=>{const{__scopeDialog:e,forceMount:r,children:s,container:o}=t,l=Zn(Vm,e);return y.jsx(dj,{scope:e,forceMount:r,children:_.Children.map(s,u=>y.jsx(Pu,{present:r||l.open,children:y.jsx(Pw,{asChild:!0,container:o,children:u})}))})};Jw.displayName=Vm;var wu="DialogOverlay",ex=_.forwardRef((t,e)=>{const r=Ww(wu,t.__scopeDialog),{forceMount:s=r.forceMount,...o}=t,l=Zn(wu,t.__scopeDialog);return l.modal?y.jsx(Pu,{present:s||l.open,children:y.jsx(mj,{...o,ref:e})}):null});ex.displayName=wu;var hj=Rm("DialogOverlay.RemoveScroll"),mj=_.forwardRef((t,e)=>{const{__scopeDialog:r,...s}=t,o=Zn(wu,r);return y.jsx(Vw,{as:hj,allowPinchZoom:!0,shards:[o.contentRef],children:y.jsx(Tn.div,{"data-state":Fm(o.open),...s,ref:e,style:{pointerEvents:"auto",...s.style}})})}),ys="DialogContent",tx=_.forwardRef((t,e)=>{const r=Ww(ys,t.__scopeDialog),{forceMount:s=r.forceMount,...o}=t,l=Zn(ys,t.__scopeDialog);return y.jsx(Pu,{present:s||l.open,children:l.modal?y.jsx(pj,{...o,ref:e}):y.jsx(gj,{...o,ref:e})})});tx.displayName=ys;var pj=_.forwardRef((t,e)=>{const r=Zn(ys,t.__scopeDialog),s=_.useRef(null),o=ws(e,r.contentRef,s);return _.useEffect(()=>{const l=s.current;if(l)return uj(l)},[]),y.jsx(nx,{...t,ref:o,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Na(t.onCloseAutoFocus,l=>{var u;l.preventDefault(),(u=r.triggerRef.current)==null||u.focus()}),onPointerDownOutside:Na(t.onPointerDownOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0;(u.button===2||d)&&l.preventDefault()}),onFocusOutside:Na(t.onFocusOutside,l=>l.preventDefault())})}),gj=_.forwardRef((t,e)=>{const r=Zn(ys,t.__scopeDialog),s=_.useRef(!1),o=_.useRef(!1);return y.jsx(nx,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var u,d;(u=t.onCloseAutoFocus)==null||u.call(t,l),l.defaultPrevented||(s.current||(d=r.triggerRef.current)==null||d.focus(),l.preventDefault()),s.current=!1,o.current=!1},onInteractOutside:l=>{var m,h;(m=t.onInteractOutside)==null||m.call(t,l),l.defaultPrevented||(s.current=!0,l.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const u=l.target;((h=r.triggerRef.current)==null?void 0:h.contains(u))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&o.current&&l.preventDefault()}})}),nx=_.forwardRef((t,e)=>{const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:l,...u}=t,d=Zn(ys,r),m=_.useRef(null),h=ws(e,m);return E6(),y.jsxs(y.Fragment,{children:[y.jsx(Uw,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:l,children:y.jsx(Dw,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":Fm(d.open),...u,ref:h,onDismiss:()=>d.onOpenChange(!1)})}),y.jsxs(y.Fragment,{children:[y.jsx(yj,{titleId:d.titleId}),y.jsx(wj,{contentRef:m,descriptionId:d.descriptionId})]})]})}),Ym="DialogTitle",rx=_.forwardRef((t,e)=>{const{__scopeDialog:r,...s}=t,o=Zn(Ym,r);return y.jsx(Tn.h2,{id:o.titleId,...s,ref:e})});rx.displayName=Ym;var ax="DialogDescription",vj=_.forwardRef((t,e)=>{const{__scopeDialog:r,...s}=t,o=Zn(ax,r);return y.jsx(Tn.p,{id:o.descriptionId,...s,ref:e})});vj.displayName=ax;var sx="DialogClose",ix=_.forwardRef((t,e)=>{const{__scopeDialog:r,...s}=t,o=Zn(sx,r);return y.jsx(Tn.button,{type:"button",...s,ref:e,onClick:Na(t.onClick,()=>o.onOpenChange(!1))})});ix.displayName=sx;function Fm(t){return t?"open":"closed"}var ox="DialogTitleWarning",[IO,lx]=k4(ox,{contentName:ys,titleName:Ym,docsSlug:"dialog"}),yj=({titleId:t})=>{const e=lx(ox),r=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. 242 243If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component. 244 245For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return _.useEffect(()=>{t&&(document.getElementById(t)||console.error(r))},[r,t]),null},bj="DialogDescriptionWarning",wj=({contentRef:t,descriptionId:e})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${lx(bj).contentName}}.`;return _.useEffect(()=>{var l;const o=(l=t.current)==null?void 0:l.getAttribute("aria-describedby");e&&o&&(document.getElementById(e)||console.warn(s))},[s,t,e]),null},xj=Qw,_j=Zw,Sj=Jw,Ej=ex,Cj=tx,Tj=rx,Aj=ix;function cx({...t}){return y.jsx(xj,{"data-slot":"dialog",...t})}function kj({...t}){return y.jsx(_j,{"data-slot":"dialog-trigger",...t})}function jj({...t}){return y.jsx(Sj,{"data-slot":"dialog-portal",...t})}function Rj({className:t,...e}){return y.jsx(Ej,{"data-slot":"dialog-overlay",className:ke("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...e})}function ux({className:t,children:e,showCloseButton:r=!0,...s}){return y.jsxs(jj,{"data-slot":"dialog-portal",children:[y.jsx(Rj,{}),y.jsxs(Cj,{"data-slot":"dialog-content",className:ke("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 roun
245ded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...s,children:[e,r&&y.jsxs(Aj,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[y.jsx(VC,{}),y.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function fx({className:t,...e}){return y.jsx("div",{"data-slot":"dialog-header",className:ke("flex flex-col gap-2 text-center sm:text-left",t),...e})}function dx({className:t,...e}){return y.jsx(Tj,{"data-slot":"dialog-title",className:ke("text-lg leading-none font-semibold",t),...e})}const Nj={queen:{name:"Queen",image:"/chess/pieces/wQ.png"},rook:{name:"Rook",image:"/chess/pieces/wR.png"},bishop:{name:"Bishop",image:"/chess/pieces/wB.png"},knight:{name:"Knight",image:"/chess/pieces/wN.png"}},Oj={queen:{name:"Queen",image:"/chess/pieces/bQ.png"},rook:{name:"Rook",image:"/chess/pieces/bR.png"},bishop:{name:"Bishop",image:"/chess/pieces/bB.png"},knight:{name:"Knight",image:"/chess/pieces/bN.png"}},Yc=({color:t,piece:e,onPromote:r})=>{const o=(t==="white"?Nj:Oj)[e];return y.jsxs("div",{className:"flex flex-col items-center justify-center cursor-pointer hover:bg-white/10 rounded-lg py-2 px-4",onClick:()=>r(e),children:[y.jsx("img",{src:o.image,alt:o.name,className:"w-24 h-24"}),y.jsx("p",{className:"text-sm font-semibold",children:o.name})]})},Mj=({color:t,isOpen:e,onPromote:r})=>y.jsx(cx,{open:e,children:y.jsxs(ux,{className:ke("rounded-2xl backdrop-blur-lg border-none outline-none",t==="white"?"bg-black/50 text-white":"bg-white/50 text-black"),showCloseButton:!1,children:[y.jsx(fx,{children:y.jsx(dx,{className:"text-lg font-semibold text-center",children:"Choose your piece"})}),y.jsxs("div",{className:"flex flex-col gap-2 w-full items-center justify-between",children:[y.jsxs("div",{className:"flex flex-row gap-2",children:[y.jsx(Yc,{color:t,piece:"bishop",onPromote:r}),y.jsx(Yc,{color:t,piece:"knight",onPromote:r})]}),y.jsxs("div",{className:"flex flex-row gap-2",children:[y.jsx(Yc,{color:t,piece:"rook",onPromote:r}),y.jsx(Yc,{color:t,piece:"queen",onPromote:r})]})]})]})}),Dj=({game:t})=>{const e=_.useRef(null),r=()=>{var s;return(s=e.current)==null?void 0:s.play()};return _.useEffect(()=>{t.lastMove&&r()},[t.fen]),y.jsx("audio",{ref:e,children:y.jsx("source",{src:"/sounds/chess-move.mp3",type:"audio/mpeg"})})};function Lj(t){const e=new Map;return lk.forEach(r=>{const s=t.moves({square:r,verbose:!0});s.length&&e.set(r,s.map(o=>o.to))}),e}const Uj=({role:t,game:e})=>{const{getInstance:r}=Sk(),s=Ek({gameId:e.id}),[o,l]=_.useState(new Map),[u,d]=_.useState();if(_.useEffect(()=>{if(e!=null&&e.fen){const v=r();v.load(e.fen);const b=Lj(v);l(b)}},[e==null?void 0:e.fen,r]),!e)return y.jsx(zy,{});const m=v=>{if(!u)return;const b={queen:"q",rook:"r",bishop:"b",knight:"n"},x=r().move({from:u.from,to:u.to,promotion:b[v]});s(x.san),d(void 0)},h=t==="white"?"white":t==="black"?"black":t==="root"?e.turn:void 0,g={fen:e.fen,orientation:t==="black"?"black":"white",turnColor:e.turn,coordinates:!0,lastMove:e.lastMove,movable:{color:h,free:!1,showDests:!0,dests:o},events:{move:(v,b)=>{const C=r(),x=C.get(v),E=(x==null?void 0:x.color)==="w"?"white":"black",T=b[1];x&&x.type==="p"&&E==="white"&&T==="8"||E==="black"&&T==="1"?d({from:v,to:b,color:E}):s(C.move({from:v,to:b}).san)}}};return y.jsxs(y.Fragment,{children:[y.jsx(zy,{config:g}),y.jsx(Dj,{game:e}),y.jsx(Mj,{color:e.turn,isOpen:!!u,onPromote:m})]})},zj=({className:t,...e})=>y.jsx("input",{autoComplete:"off",type:"text",name:"message",className:ke("bg-white/5 text-white hover:bg-white/10 font-medium rounded-full resize-none outline-0 px-4 py-3 flex-1 placeholder:text-white/50",t),...e}),Pj=t=>{const e=$1(),r=xs();return _.useCallback(async o=>{var l;await Yn.post(`/chess/game/${t}/send-message`,o),e("send_message",{game_id:t,message:o.message,name:((l=r.user)==null?void 0:l.name)??o.name??""})},[e,t,r])},Nh=({game:t})=>{const[e,r]=_.useState(!1),[s,o]=_.useState(""),l=Pj(t.id),u=async()=>
245{if(t&&s.trim().length>0&&!e){r(!0);try{await l({message:s,name:t.username}),o("")}finally{r(!1)}}},d=m=>{m.key==="Enter"&&!m.shiftKey&&(m.preventDefault(),m.stopPropagation(),u())};return y.jsxs("div",{className:"w-full flex flex-row gap-2 items-center",children:[y.jsx(zj,{placeholder:"Chat something",value:s,onChange:m=>o(m.target.value),onKeyDown:d}),y.jsx(dr,{"data-testid":"send-message-button",variant:"default",className:"h-12 w-12",onClick:u,disabled:s.trim().length===0||e,children:e?y.jsx(bs,{className:"size-5 animate-spin"}):y.jsx(SC,{className:"size-5"})})]})},hx=({move:t,color:e})=>y.jsx("div",{className:ke("flex flex-row gap-2 items-center font-bold text-lg",e==="white"?"text-black":"text-white"),children:t}),Xy=({game:t})=>{const e=t.lastMoveSan,r=t.status==="completed",s=t.status==="draw",o=t.turn==="white"?"black":"white";return y.jsxs("div",{className:ke("font-medium p-2 md:p-4 rounded-sm flex flex-row justify-between w-full",o==="white"?"bg-white/60 text-black":"bg-black/40 text-white",!e&&"text-muted-foreground",(r||s)&&"bg-green-500/20 text-green-100"),children:[s?y.jsx("div",{className:"flex flex-row gap-2 items-center font-semibold text-lg",children:"Draw"}):r?y.jsxs("div",{className:"flex flex-row gap-2 items-center font-semibold text-lg",children:[y.jsx(vs,{size:24,color:t.turn==="white"?"black":"white",transparent:!0}),t.winner==="white"?"White wins":"Black wins"]}):e?y.jsxs("div",{className:"flex flex-row gap-2 items-center",children:[y.jsx(vs,{size:24,color:t.turn==="white"?"black":"white",transparent:!0}),y.jsx("span",{children:t.turn==="white"?"Black move":"White move"})]}):y.jsx("div",{children:"No moves have been made"}),e&&y.jsx(hx,{move:e,color:o})]})},mx=(t=!0)=>{const e=_.useRef(null);return _.useEffect(()=>{t&&e.current&&e.current.scrollIntoView({behavior:"instant",block:"end"})},[t]),e},Bj={black:{openai:"/avatars/openai-black.png",gemini:"/avatars/gemini-black.png",claude:"/avatars/claude.webp",grok:"/avatars/grok-white.png"},white:{openai:"/avatars/openai-white.png",gemini:"/avatars/gemini-white.png",claude:"/avatars/claude.webp",grok:"/avatars/grok-white.png"}},$j=_.memo(({message:t,game:e,isLast:r})=>{var m;const s=mx(!!r);if(t.role==="spectator")return null;const o=t.role==="root"?"white":t.role,l=t.profilePic??((m=Bj[o])==null?void 0:m[t.sender]),u=e.players[o],d=u==null?void 0:u.model;return y.jsxs(Q1,{variant:o,ref:s,children:[y.jsx(Mm,{color:t.role==="white"?"white":"black",fallback:t.sender.slice(0,1).toUpperCase(),src:l}),y.jsxs(X1,{className:"max-w-[calc(100%-40px)]",children:[y.jsxs("div",{className:"flex flex-col mb-3",children:[y.jsx("span",{className:"capitalize text-lg font-bold",children:t.sender}),d&&y.jsx("span",{className:ke("text-sm font-medium",t.role==="white"?"text-gray-800":"text-gray-300"),children:d})]}),y.jsx("p",{className:"text-md font-medium",children:t.message}),t.isIllegalMove&&y.jsxs("div",{className:"mt-3 bg-[#FDCFE0] border-2 rounded-md p-3 text-[#F40D62] flex flex-row gap-2 items-start font-semibold",children:[y.jsx(UC,{className:"size-5 mt-0.5"}),"This move is illegal"]}),t.moveSan&&y.jsxs("div",{className:ke("flex flex-row justify-between w-full p-4 rounded-sm font-medium items-center mt-3",t.role==="white"?"bg-white":"bg-black"),children:[t.role==="white"?"White move":"Black move",y.jsx(hx,{move:t.moveSan,color:o})]})]})]})}),qj=({gameId:t,game:e})=>{const{data:r}=Eu({streamName:"chessGameMessage",groupId:t});return y.jsx("div",{className:"flex flex-col gap-4 items-center justify-center w-full",children:y.jsx("div",{className:"flex flex-1 flex-col gap-2 w-full",children:r.map((s,o)=>y.jsx($j,{message:s,game:e,isLast:o===r.length-1},s.id||o))})})},Zy=()=>{const[t,e]=_.useState(!1),r=()=>{e(!1),navigator.clipboard.writeText(window.location.href),Mb("Link copied to clipboard",{description:"Share this link with your friends",position:"bottom-center"})};return y.jsxs(cx,{open:t,onOpenChange:e,children:[y.jsx(kj,{asChild:!0,children:y.jsx(dr,{variant:"default",className:"h-8 w-8 md:h-12 md:w-12",children:y.jsx(PC,{className:"size-3 md:size-5",onClick:()=>e(!0)})})}),y.jsxs(ux,{className:"sm:max-w-[425px] rounded-2xl bg-gradient-to-b from-gray-900/20 to-black/80 backdrop-blur-lg border-1 border-white/10 border-solid",children:[y.jsx(fx,{children:y.jsx(dx,{className:"text-md font-semibold text-center",children:"Share match"})}),y.jsx("div",{className:"flex flex-col gap-2 w-full",children:y.jsx(Gr,{className:"w-full",onClick:()=>r(),children:"Invite to watch"})})]})]})},Wy=["text-lime-400","text-purple-400","text-pink-400","text-red-400","text-teal-400","text-orange-400","text-amber-400","text-emerald-400","text-cyan-400","text-sky-400","text-violet-400","text-fuchsia-400","text-rose-400"],Hj=t=>{const e=t.split("").reduce((s,o)=>
245o.charCodeAt(0)+((s<<5)-s),0),r=Math.abs(e)%Wy.length;return Wy[r]},Ij=_.memo(({message:t,isLast:e})=>{const r=_.useRef(null),s=Hj(t.sender);return _.useEffect(()=>{e&&r.current&&r.current.scrollIntoView({behavior:"instant",block:"end"})},[e,t.message]),y.jsxs("div",{ref:r,children:[y.jsx("span",{className:ke("capitalize font-bold",s),children:t.sender}),y.jsxs("span",{className:"text-md font-medium whitespace-pre-wrap text-white",children:[" ",t.message]})]})}),Jy=({gameId:t})=>{const{data:e}=Eu({streamName:"chessSidechatMessage",groupId:t});return y.jsx("div",{className:"flex flex-col flex-1 gap-2 w-full",children:e.map((r,s)=>y.jsx(Ij,{message:r,isLast:s===e.length-1},r.id))})},Gj=({white:t,black:e})=>y.jsxs("div",{className:"flex w-full rounded-md overflow-hidden relative",children:[y.jsxs("div",{className:"flex items-start gap-2 justify-start bg-white text-black px-4 py-3 w-48 relative flex-1",children:[t.ai&&y.jsx(Ni,{ai:t.ai,color:"black"}),y.jsxs("div",{className:"flex flex-col self-stretch",children:[t.ai&&y.jsx("span",{className:"font-bold capitalize",children:t.ai??"White"}),t.model&&y.jsx("span",{className:"grow pr-2 break-words text-xs text-gray-600",children:t.model}),y.jsxs("div",{className:"flex gap-2 mt-2",children:[y.jsx(vs,{color:"white",size:20,transparent:!0}),y.jsx("span",{className:"font-semibold",children:"White"})]})]})]}),y.jsxs("div",{className:"flex items-start gap-2 justify-end bg-black text-white px-4 py-3 w-48 relative flex-1",children:[y.jsxs("div",{className:"flex flex-col self-stretch items-end",children:[e.ai&&y.jsx("span",{className:"font-bold text-right capitalize",children:e.ai??"Black"}),e.model&&y.jsx("span",{className:"grow pl-2 break-words text-xs text-gray-400 text-right",children:e.model}),y.jsxs("div",{className:"flex gap-2 mt-2 text-right",children:[y.jsx("span",{className:"font-semibold",children:"Black"}),y.jsx(vs,{color:"black",size:20,transparent:!0})]})]}),e.ai&&y.jsx(Ni,{ai:e.ai,color:"white"})]}),y.jsx("div",{className:"w-10 h-[30px] absolute left-[50%] top-[50%] -translate-x-1/2 -translate-y-1/2 flex items-center justify-center bg-gray-400/80 backdrop-blur-sm text-white font-medium rounded-md",children:"vs"})]}),xa=({white:t,label:e,black:r,size:s="md"})=>y.jsxs("tr",{className:"text-md font-semibold",children:[y.jsx("td",{className:ke("py-1 text-left text-muted-foreground",s==="lg"&&"pt-3"),children:t}),y.jsx("td",{className:ke("py-1 text-center text-white",s==="lg"&&"pt-3 text-lg font-bold"),children:e}),y.jsx("td",{className:ke("py-1 text-right text-muted-foreground",s==="lg"&&"pt-3"),children:r})]}),Kj=({game:t})=>{const e=t.scoreboard;return y.jsx("table",{className:"w-full",children:y.jsxs("tbody",{children:[y.jsx(xa,{white:e.white.averageSwing,label:"Avg. Swing",black:e.black.averageSwing}),y.jsx(xa,{white:e.white.highestSwing,label:"Highest Swing",black:e.black.highestSwing}),y.jsx(xa,{white:e.white.blunders,label:"Blunders",black:e.black.blunders}),y.jsx(xa,{white:e.white.illegalMoveAttempts,label:"Illegal Moves",black:e.black.illegalMoveAttempts}),y.jsx(xa,{white:e.white.captures.length,label:"Captures",black:e.black.captures.length}),y.jsx(xa,{white:e.white.promotions,label:"Promotions",black:e.black.promotions}),y.jsx(xa,{white:e.white.checks,label:"Checks",black:e.black.checks}),y.jsx(xa,{white:e.white.finalCentipawnScore,label:"Centipawn Score",black:e.black.finalCentipawnScore})]})})},Vj=({game:t})=>{const e=t.scoreboard,r=mx();return y.jsx(Ki,{className:"bg-black/20 rounded-xl mt-4 p-0",ref:r,children:e?y.jsxs(y.Fragment,{children:[y.jsxs("div",{className:"p-4",children:[t.endGameReason==="Checkmate"&&y.jsxs("div",{className:"flex flex-col",children:[y.jsx("div",{className:"text-2xl text-white font-bold mx-auto text-center w-full",children:"Checkmate!"}),y.jsxs("div",{className:"text-md mx-auto text-center w-full text-muted-foreground",children:[y.jsx("span",{className:"capitalize",children:t.winner})," wins the match in ",e.totalMoves," moves"]})]}),t.endGameReason==="Draw"&&y.jsxs("div",{className:"flex flex-col",children:[y.jsx("div",{className:"text-2xl text-white font-bold mx-auto text-center w-full",children:"Draw"}),y.jsxs("div",{className:"text-md mx-auto text-center w-full text-muted-foreground",children:["The match ended in a draw after ",e.totalMoves," moves"]})]}),t.endGameReason==="Ended Early"&&y.jsxs("div",{className:"flex flex-col",children:[y.jsx("div",{className:"text-2xl text-white font-bold mx-auto text-center w-full",children:"Ended Early"}),y.jsx("div",{className:"text-md mx-auto text-center w-full text-muted-foreground",children:"The match ended early after 65 moves"})]}),y.jsxs("div",{className:"flex flex-col mt-3 gap-2",children:[y.jsx("div",{className:"text-lg text-white font-bold mx-auto text-center w-full",children:"Evaluation"}),y.jsx(Gj,{white:t.players.white,black:t.players.black}),y.jsx(Kj,{game:t})]})]}),t.players.black.ai&&t.players.white.ai&&y.jsxs("div",{className:"text-sm flex items-start gap-2 mx-auto w-full text-muted-foreground bg-white/10 rounded-b-xl p-4",children:[y.jsx(AC,{className:"w-12"}),y.jsxs("span",{children:["LLMs rarely complete matches. To evaluate them, we end matches at 65 moves and check scores, number of blunders, etc."," ",y.jsx("a",{href:"/about",className:"text-white font-bold",target:"_blank",children:"Click here"})," ","to learn more."]})]})]}):y.jsx("div",{className:"p-4",children:y.jsxs("div",{className:"flex flex-col",children:[y.jsx(bs,{className:"w-8 h-8 mx-auto animate-spin text-muted-foreground"}),y.jsx("div",{className:"text-2xl text-white font-bold mx-auto text-center w-full my-2",children:"Loading scoreboard..."}),y.jsx("div",{className:"text-md mx-auto text-center w-full text-muted-foreground",children:"The scoreboard should be ready in a few seconds."})]})})})},Yj=({gameId:t,onClose:e})=>{const r=T4()<1280,[s,o]=_.useState(!r),{user:l}=xs(),{data:u,event:d}=I2({streamName:"chessGame",groupId:"game",id:t}),{game:m,accessRequest:h,onCancel:g}=A4(t,d);if(!u)return y.jsx("div",{className:"w-screen h-dvh flex items-center justify-center",children:y.jsx(bs,{className:"size-10 animate-spin"})});const v=(m==null?void 0:m.role)??"spectator",b=v==="spectator",C=!!u.players.black.userId||
245!!u.players.black.ai,x=u.players.white.userId===(l==null?void 0:l.id),E=y.jsxs(y.Fragment,{children:[y.jsx(qj,{gameId:t,game:u}),["completed","draw","endedEarly"].includes(u.status)&&y.jsx(Vj,{game:u}),!C&&!x&&y.jsx(Z4,{gameId:t}),x&&h.map((T,k)=>y.jsx(Q4,{user:T.user,gameId:t,onCancel:()=>g(T.user.id)},k))]});return y.jsx("div",{className:"flex flex-col items-center mx-auto w-full flex-1 justify-between",children:y.jsxs("div",{className:"flex flex-col xl:flex-row items-center justify-between w-full h-dvh xl:max-h-dvh overflow-y-auto xl:overflow-y-hidden",children:[y.jsxs("header",{className:"xl:hidden flex flex-row gap-2 items-center justify-between p-2 xl:p-4 w-full xl:border-b-2 xl:border-white/5 backdrop-blur-lg bg-black/20",children:[y.jsx(dr,{variant:"default",className:"h-8 w-8 xl:h-12 xl:w-12",onClick:e,children:y.jsx(uu,{className:"size-4"})}),y.jsx(Vh,{size:"sm",githubLogo:!0}),y.jsx("div",{className:"flex flex-row gap-2 items-center justify-end",children:y.jsx(Zy,{})})]}),!r&&y.jsxs(Jo,{className:"flex-1 gap-0 w-full h-dvh min-h-[200px] min-w-[300px] max-w-[400px] border-l-2 border-white/5",children:[y.jsxs("header",{className:"hidden xl:flex flex-row gap-2 items-center justify-between p-6 w-full xl:border-b-2 xl:border-white/5",children:[y.jsx(dr,{variant:"default",className:"h-12 w-12",onClick:e,children:y.jsx(uu,{className:"size-5"})}),y.jsx(Vh,{size:"sm",githubLogo:!0}),y.jsx(Zy,{})]}),u.status==="pending"&&y.jsx("div",{className:"p-4 w-full border-b-2 border-white/5 pb-4 pt-4",children:y.jsx(Xy,{game:u})}),y.jsx("div",{className:"p-4 flex flex-col flex-1 w-full overflow-y-auto",children:E}),!b&&m&&y.jsx("div",{className:"p-4 w-full",children:y.jsx(Nh,{game:m})})]}),y.jsx("div",{className:"xl:flex-1 content-center w-full xl:p-4 2xl:p-8",children:y.jsx(Uj,{game:u,role:v})}),r?y.jsxs(y.Fragment,{children:[y.jsxs(Jo,{className:ke("gap-0 px-2 w-full border-b-2 border-white/5",u.status==="pending"&&"pt-2"),children:[u.status==="pending"&&y.jsx(Xy,{game:u}),y.jsxs("div",{className:"flex flex-row gap-2 items-center justify-center",children:[y.jsxs(wy,{isSelected:!s,onClick:()=>o(!1),children:[y.jsx(GC,{className:"size-4"}),"Gameplay"]}),y.jsxs(wy,{isSelected:s,onClick:()=>o(!0),children:[y.jsx(OC,{className:"size-4"}),"Sidechat"]})]})]}),y.jsx(Jo,{className:"min-h-[200px] flex flex-col flex-1 gap-4 items-center justify-between w-full overflow-y-auto p-4",children:s?y.jsx(Jy,{gameId:t}):E}),(s||!b)&&m&&y.jsx(Jo,{className:"p-2 w-full",children:y.jsx(Nh,{game:m})})]}):s?y.jsxs(Jo,{className:ke("flex flex-col flex-1 gap-4 items-center justify-between w-full","min-h-[200px] h-dvh min-w-[300px] max-w-[400px] border-l-2 border-white/5"),children:[y.jsxs("header",{className:"border-b-2 border-white/5 w-full p-4",children:[y.jsx(dr,{variant:"default",className:"h-12 w-12 absolute top-[16px] left-[16px]",onClick:()=>o(!1),children:y.jsx(CC,{className:"size-6"})}),y.jsxs("div",{className:"flex flex-col gap-0 items-center justify-center text-lg font-bold",children:[y.jsx("div",{className:"text-lg font-bold",children:"Sidechat"}),y.jsx("div",{className:"text-sm text-muted-foreground",children:"Chat with other spectators"})]})]}),y.jsx("div",{className:"px-4 flex flex-col flex-1 w-full overflow-y-auto",children:y.jsx(Jy,{gameId:t})}),b&&m&&y.jsx("div",{className:"p-4 w-full",children:y.jsx(Nh,{game:m})})]}):y.jsx(Ki,{className:"flex flex-row gap-2 items-center z-50 cursor-pointer bg-black/40 hover:bg-white/10 transition-colors text-white fixed top-6 right-6 backdrop-blur-lg",onClick:()=>o(!s),children:y.jsx(DC,{})})]})})},Fj=({children:t,className:e})=>y.jsx("div",{className:"flex flex-col flex-1 gap-4 items-center justify-center w-screen h-dvh bg-image-landing",children:y.jsx("div",{className:ke("flex flex-col flex-1 gap-4 items-center justify-between w-full h-dvh",e),children:t})}),Qj=()=>{const t=fn(),{gameId:e}=wE();return Da("Game"),y.jsx(Fj,{className:"w-screen",children:y.jsx(Yj,{gameId:e,onClose:()=>t("/")})})},Xj=()=>{var o;const{user:t,isLoading:e,logout:r}=xs(),s=fn();return t?y.jsxs("div",{className:"flex items-center justify-between w-full gap-2 rounded-xl backdrop-blur-lg bg-white/10 px-4 py-4 shadow-lg",children:[y.jsxs("div",{className:"flex items-center min-w-0 gap-3",children:[y.jsx("div",{className:"w-10 h-10 shrink-0 rounded-full bg-black/50 flex items-center justify-center",children:y.jsx(Mm,{color:"white",fallback:(o=t.name)==null?void 0:o.slice(0,2).toUpperCase(),src:t.profilePic})}),y.jsxs("div",{className:"min-w-0",children:[y.jsx("span",{className:"block text-white font-medium text-lg truncate",children:t.name}),y.jsx("span",{className:"block text-gray-400 text-sm truncate",children:t.email})]})]}),y.jsx(dr,{variant:"outline",onClick:r,children:"Sign Out"})]}):y.jsxs("div",{className:"flex items-center justify-between w-full gap-2 rounded-xl backdrop-blur-lg bg-white/10 px-4 py-4 shadow-lg",children:[y.jsxs("div",{className:"flex items-center min-w-0 gap-3",children:[y.jsx("div",{className:"p-3 rounded-full bg-white",children:y.jsx(RC,{className:"size-4 text-black"})}),y.jsxs("div",{className:"min-w-0",children:[y.jsx("span",{className:"block text-white font-medium text-lg truncate",children:"Sign In"}),y.jsx("span",{className:"block sm:hidden text-gray-400 text-sm truncate",children:"Sign In to play"}),y.jsx("span",{className:"hidden sm:block text-gray-400 text-sm truncate",children:"You need an account to play"})]})]}),y.jsx("div",{className:"flex items-center gap-2",children:e?y.jsx(dr,{variant:"outline",children:y.jsx(bs,{className:"size-4 animate-spin"})}):y.jsx(dr,{variant:"outline",onClick:()=>
245s("/login"),children:"Log in"})})]})},_a=({value:t})=>y.jsx("div",{className:"flex flex-col gap-1 items-center w-[120px] max-w-[120px] min-w-[120px] text-center",children:y.jsx("div",{className:"font-bold text-white",children:t})}),Zj=({leaderboard:t})=>{var l;const e=Number.isInteger(t.winRate)?t.winRate:(l=t.winRate)==null?void 0:l.toFixed(1),r=t.sumCentipawnScores/t.gamesPlayed,s=t.sumHighestSwing/t.gamesPlayed,o=t.illegalMoves/t.gamesPlayed;return y.jsx("div",{className:"flex flex-col gap-2 w-full text-sm h-[52px]",children:y.jsxs("div",{className:"flex flex-row gap-2 items-center justify-between py-4",children:[y.jsx(_a,{value:`${e}%`}),y.jsx(_a,{value:sl(t.victories)}),y.jsx(_a,{value:sl(t.checkmates)}),y.jsx(_a,{value:sl(t.endedEarly)}),y.jsx(_a,{value:sl(t.gamesPlayed)}),y.jsx(_a,{value:r.toFixed(0)}),y.jsx(_a,{value:`${o.toFixed(0)}`}),y.jsx(_a,{value:s.toFixed(0)})]})})},Oh=()=>y.jsx("div",{className:"flex flex-col gap-2 w-full text-sm",children:y.jsxs(Ki,{className:"flex flex-row gap-2 items-center justify-between w-full p-4 rounded-none",children:[y.jsx("div",{className:"font-bold text-white/20 animate-pulse",children:"1"}),y.jsxs("div",{className:"flex flex-row gap-2 items-center flex-1",children:[y.jsx("div",{className:"w-5 h-5 rounded-full bg-white/20 animate-pulse"}),y.jsx("div",{className:"w-32 h-4 rounded bg-white/20 animate-pulse"})]}),y.jsxs("div",{className:"flex flex-col gap-1 items-start",children:[y.jsx("div",{className:"font-semibold text-white/60",children:"G"}),y.jsx("div",{className:"w-8 h-4 rounded bg-white/20 animate-pulse"})]}),y.jsxs("div",{className:"flex flex-col gap-1 items-start",children:[y.jsx("div",{className:"font-semibold text-white/60",children:"W"}),y.jsx("div",{className:"w-6 h-4 rounded bg-white/20 animate-pulse"})]}),y.jsxs("div",{className:"flex flex-col gap-1 items-start",children:[y.jsx("div",{className:"font-semibold text-white/60",children:"W%"}),y.jsx("div",{className:"w-12 h-4 rounded bg-white/20 animate-pulse"})]})]})}),Sa=({label:t})=>y.jsx("div",{className:"flex flex-col gap-1 items-center w-[120px] max-w-[120px] min-w-[120px] text-center",children:y.jsx("div",{className:"font-semibold text-white/60",children:t})}),px=({showBackButton:t=!1,className:e})=>{const r=fn(),s=()=>r("/"),{data:o}=Eu({groupId:"global",streamName:"chessLeaderboard"}),u=((o==null?void 0:o.map(d=>({...d,winRate:d.gamesPlayed>0?d.victories/d.gamesPlayed*100:0})))??[]).sort((d,m)=>m.winRate-d.winRate);return y.jsxs("div",{className:ke("flex flex-col grow min-h-[288px] bg-white/5 backdrop-blur-lg md:rounded-lg md:border-2 md:border-white/5",u.length>0?"max-w-full":"w-full max-w-[1215px]",e),children:[y.jsxs("div",{className:"flex flex-row items-center w-full p-4 border-b border-white/10",children:[t&&y.jsx(uu,{className:"shrink-0 size-6 cursor-pointer",onClick:s}),y.jsx("h1",{className:"grow mr-6 text-center text-lg font-semibold text-white",children:"Leaderboard"})]}),y.jsx("div",{className:"flex flex-col grow gap-6 w-full overflow-y-auto",children:!u||u.length===0?y.jsxs(y.Fragment,{children:[y.jsx(Oh,{}),y.jsx(Oh,{}),y.jsx(Oh,{})]}):y.jsxs("div",{className:"flex flex-row grow",children:[y.jsx("div",{className:"border-r border-white/10 flex flex-col gap-6 pt-20 grow pb-4",children:u.map((d,m)=>y.jsxs("div",{className:"flex flex-row gap-2 items-center w-[230px] h-[52px]",children:[y.jsx("div",{className:"font-bold text-white w-[40px] text-center",children:m+1}),y.jsx("div",{className:"bg-white rounded-full p-1",children:y.jsx(Ni,{ai:d.provider,color:"black"})}),y.jsxs("div",{className:"flex flex-col gap-1 items-start",children:[y.jsx("div",{className:"font-semibold text-white",children:d.provider}),y.jsx("div",{className:"font-semibold text-white/60 ellipsis-1",children:d.model})]})]},m))}),y.jsxs("div",{className:"flex flex-col overflow-x-auto grow",children:[y.jsx("div",{className:"flex flex-row gap-2",children:y.jsxs("div",{className:"flex flex-row gap-2 items-center justify-between w-full py-4",children:[y.jsx(Sa,{label:"Win %"}),y.jsx(Sa,{label:"Wins"}),y.jsx(Sa,{label:"Checkmates"}),y.jsx(Sa,{label:"Ended Early"}),y.jsx(Sa,{label:"Matches"}),y.jsx(Sa,{label:"Avg. Centipawn Score"}),y.jsx(Sa,{label:"Avg. Illegal Moves"}),y.jsx(Sa,{label:"Avg. Swing"})]})}),y.jsx("div",{className:"flex flex-col gap-6 pb-4",children:u.map(d=>y.jsx(Zj,{leaderboard:d},d.model))})]})]})})]})},qu=({className:t})=>y.jsxs("div",{className:ke("space-y-1",t),children:[y.jsx("img",{src:"/horse.png",alt:"ChessArena.ai",width:160,height:160,className:"max-w-[160px] mx-auto ratio-1/1"}),y.jsx("h1",{className:"text-center text-6xl font-title text-white",children:"ChessArena.ai"})]}),Wj=()=>{const t=fn(),e=r=>{r.preventDefault(),t("/about")};return Da("Powered by Motia"),y.jsxs(Ii,{children:[y.jsx("div",{className:"hidden md:flex md:flex-col p-4 overflow-y-auto",children:y.jsx(px,{className:"max-h-[min(calc(100dvh-32px),1280px)] my-auto mx-auto"})}),y.jsxs(Gi,{className:"backdrop-blur-none md:backdrop-blur-lg",children:[y.jsx($i,{}),y.jsxs("div",{className:"flex flex-col justify-center grow gap-2 text-center",children:[y.jsx(qu,{}),y.jsx("p",{className:"font-medium text-center text-muted-foreground",children:"Welcome to ChessArena.ai powered by Motia!"}),y.jsxs("p",{className:"font-medium text-center text-muted-foreground",children:["ChessArena.ai was created to show how leading models compete against each other in chess games."," ",y.jsx("a",{href:"/about",className:"text-white underline",onClick:e,children:"Click here to learn more."})]})]}),y.jsxs("div",{className:"flex flex-col gap-4 items-center justify-center w-full",children:[y.jsx(Xj,{}),y.jsx(z1,{onClick:()=>t("/new"),children:"Create Game"}),y.jsxs("div",{className:"flex flex-row flex-wrap gap-2 items-center justify-center w-full",children:[y.jsx(Gr,{className:"flex-1",onClick:()=>t("/live-matches"),children:"View Live Matches"}),y.jsxs(Gr,{className:"min-w-[64px] shrink-0 md:flex-1",onClick:()=>t("/leaderboard"),children:[y.jsx(HC,{className:"shrink-0"})," ",y.jsx("span",{className:"hidden sm:block",children:"Leaderboard"})]})]}),y.jsxs("p",{className:"font-medium text-sm text-center text-muted-foreground",children:["This project is open-source, click"," ",y.jsx("a",{href:"/about",className:"text-white underline",onClick:e,children:"here"})," ","to read more about the project."]})]})]})]})},Jj=({children:t,className:e})=>y.jsx("div",{className:"h-dvh bg-image-landing overflow-y-auto",children:y.jsx("div",{className:ke("flex flex-col min-h-full md:p-8",e),children:t})}),eR=()=>(Da("Leaderboard"),y.jsx(Jj,{children:y.jsx(px,{showBackButton:!0,className:"md:h-fit md:max-h-[min(calc(100dvh-64px),1280px)] my-auto mx-auto"})})),tR=({white:t,black:e,onClick:r})=>y.jsxs(Ki,{className:"flex flex-row gap-2 items-center justify-between w-full px-8 py-6 bg-white/10 hover:bg-white/15 cursor-pointer",onClick:r,children:[y.jsxs("div",{className:"flex flex-col gap-4 items-start",children:[y.jsxs("div",{className:"flex flex-row gap-2 items-center",children:[y.jsx(vs,{size:32,color:"white"}),y.jsx("div",{className:"text-md font-bold text-white capitalize",children:t.provider})]}),y.jsxs("div",{className:"flex flex-row gap-2 items-center",children:[y.jsx(Ni,{ai:t.provider,color:"white"}),y.jsx("div",{className:"text-sm font-bold text-white/70 ellipsis-1",children:t.model})]})]}),y.jsx("div",{className:"text-md font-semibold text-muted-foreground",children:"vs."}),y.jsxs("div",{className:"flex flex-col gap-4 items-end",children:[y.jsxs("div",{className:"flex flex-row gap-2 items-center",children:[y.jsx("div",{className:"text-md font-bold text-white capitalize",children:e.provider}),y.jsx(vs,{size:32,color:"black",style:{stroke:"#fff",strokeWidth:1}})]}),y.jsxs("div",{className:"flex flex-row gap-2 items-center",children:[y.jsx("div",{className:"text-sm font-bold text-white/70 ellipsis-1",children:e.model}),y.jsx(Ni,{ai:e.provider,color:"white"})]})]})]}),nR=()=>{const t=fn(),e=()=>t("/"),{data:r}=Eu({streamName:"chessLiveAiGames",groupId:"game"});return Da("Live Matches"),y.jsx(Ii,{children:y.jsxs(Gi,{children:[y.jsx($i,{onBack:e}),y.jsxs("div",{className:"overflow-y-auto flex flex-col gap-4 w-full h-full",children:[y.jsx("div",{className:"flex-1"}),y.jsx("div",{className:"text-lg font-bold text-white text-center",children:"Live Matches"}),r.map(s=>y.jsx(tR,{white:s.players.white,black:s.players.black,onClick:()=>t(`/game/${s.id}`)},s.id)),r.length===0&&y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"text-white/50 text-center",children:"Currently there are no live matches going on. Click the button below to create a new game."}),y.jsx(Gr,{onClick:()=>t("/new"),children:"Create Game"})]}),y.jsx("div",{className:"flex-1"})]})]})})},rR=(t,e=1900)=>{const[r,s]=_.useState(e);return _.useEffect(()=>{fetch(`https://api.github.com/repos/MotiaDev/${t}`).then(o=>o.json()).then(o=>s((o==null?void 0:o.stargazers_count)??e)).catch(o=>console.error("Error fetching GitHub stars:",o))},[]),sl(r)},eb=({repo:t,defaultStars:e})=>{const r=rR(t,e);return y.jsxs("a",{href:`https://github.com/MotiaDev/${t}`,target:"_blank",className:"flex cursor-pointer items-center p-3 text-white font-semibold border-2 border-white/15 rounded-md w-full hover:bg-white/5 transition-all duration-300",children:[y.jsxs("div",{className:"flex items-center gap-1 text-white flex-1 text-sm",children:[y.jsx("img",{src:"/github-white.svg",alt:"GitHub",className:"size-5"})," ",t]}),y.jsxs("div",{className:"flex flex-row items-center gap-1 text-white justify-end text-sm",children:[y.jsx($C,{className:"size-5"})," ",r]})]})},gi=({children:t,className:e})=>y.jsx("p",{className:ke("font-medium text-white/90 w-full text-ju
245stify",e),children:t}),aR="https://discord.com/invite/nJFfsH5d6v",sR=()=>{const t=fn(),e=()=>t("/");return Da("About"),y.jsx(Ii,{children:y.jsxs(Gi,{children:[y.jsx($i,{onBack:e}),y.jsxs("div",{className:"flex flex-col gap-2 items-center justify-center",children:[y.jsx(qu,{className:"mb-6"}),y.jsx(gi,{children:"Welcome to ChessArena.ai â a platform built to explore how large language models (LLMs) perform in chess games."}),y.jsxs(gi,{children:["We created this platform using"," ",y.jsx("a",{href:"https://motia.dev",target:"_blank",className:"text-white underline",children:"Motia"})," ","to have a leaderboard of the best models in chess, but after researching and validating LLMs to play chess, we found that they can't really win games. This is because they don't have a good understanding of the game."]}),y.jsxs(gi,{children:["In fact, the majority of the matches end in draws. So instead of tracking wins and losses, we focus on move quality and game insight. Each game is evaluated using"," ",y.jsx("a",{href:"https://stockfishchess.org/",target:"_blank",className:"text-white underline",children:"Stockfish"}),", the world's strongest open-source chess engine."]}),y.jsx("h2",{className:"text-2xl font-title text-white my-4",children:"How's it evaluated?"}),y.jsx(gi,{children:"On each move, we get what would be the best move using Stockfish to get the difference between the best move and the move made by the LLM, that's called move swing. If move swing is higher than 100 centipawns, we consider it a blunder."}),y.jsx("h2",{className:"text-2xl font-title text-white my-4",children:"Is this project Open-Source?"}),y.jsxs(gi,{children:["Yes! This platform is built using"," ",y.jsx("a",{href:"https://motia.dev",target:"_blank",className:"text-white underline",children:"Motia Framework"})," ","to showcase how simple it is to build a real-time application with Motia Streams. You can find the source code of this project on"," ",y.jsx("a",{href:"https://github.com/MotiaDev/chessarena-ai",target:"_blank",className:"text-white underline",children:"GitHub"}),"."]}),y.jsxs(gi,{children:["Motia is opensource under MIT license code-first framework designed to empower developers to build robust, scalable, and observable event-driven systems with unparalleled ease. We handle the infrastructure complexities, so you can focus on your business logic. Read our manifesto"," ",y.jsx("a",{href:"https://motia.dev/manifesto",target:"_blank",className:"text-white underline",children:"here"})," ","and make sure to join our"," ",y.jsx("a",{href:aR,target:"_blank",className:"text-white underline",children:"Discord"})," ","server."]})]}),y.jsxs("div",{className:"flex flex-col gap-2 items-center justify-center w-full",children:[y.jsx("p",{className:"text-white font-semibold pb-2 text-center",children:"Give our projects a star on GitHub!"}),y.jsxs("div",{className:"flex flex-row flex-wrap gap-2 items-center justify-center w-full",children:[y.jsx(eb,{repo:"motia",defaultStars:1900}),y.jsx(eb,{repo:"chessarena-ai",defaultStars:10})]})]})]})})};function gx({className:t,type:e,...r}){return y.jsx("input",{type:e,"data-slot":"input",className:ke("font-bold text-white bg-black/20 p-4 text-center rounded-md border-2 border-white/10","outline-0 focus:border-[#3B6AD7]",t),autoComplete:"off","data-1p-ignore":!0,...r})}const iR=({value:t,onChange:e})=>{const r=_.useRef(null),s=_.useRef(null),o=_.useRef(null),l=_.useRef(null),u=_.useRef(null),d=_.useRef(null),m=[r,s,o,l,u,d],h=(b,C)=>{var T,k;const x=C.target.value.replace(/[^0-9]/g,"");if(x.length>1)return;const E=t.split("");E[b]=x,e(E.join("")),x&&b<5&&((k=(T=m[b+1])==null?void 0:T.current)==null||k.focus())},g=(b,C)=>{var x,E;C.key==="Backspace"&&!t[b]&&b>0&&((E=(x=m[b-1])==null?void 0:x.current)==null||E.focus())},v=b=>{b.preventDefault();const C=b.clipboardData.getData("text").replace(/[^0-9]/g,"").slice(0,6);e(C.padEnd(6,""))};return y.jsx("div",{className:"flex flex-row gap-2 items-center justify-center",children:Array(6).fill(null).map((b,C)=>y.jsx(gx,{type:"text",ref:m[C],className:"max-w-1/6 w-[50px] text-4xl p-2 text-center",value:t[C]||"",onChange:x=>h(C,x),onKeyDown:x=>g(C,x),onPaste:v,maxLength:1,inputMode:"numeric"},C))})},oR={error:null,success:null},lR=t=>t.error_code==="signup_disabled"?"Sign up is not allowed for this instance. Please contact your administrator.":t.error_description||t.error||"Authentication failed",cR=()=>{const{loginWithOAuth:t,loginWithOtp:e,verifyOtp:r,authError:s,isAuthenticated:o,isLoading:l}=xs(),[u,d]=_.useState(oR),m=fn();return _.useEffect(()=>{s&&d(g=>({...g,error:lR(s)}))},[s]),_.useEffect(()=>{o&&m("/")},[o,m]),{handleLogin:async(g,v={})=>{var b;try{if(d(C=>({...C,error:null,success:null})),g==="email"){if(!((b=v.email)!=null&&b.trim()))throw new Error("Email is required");await e(v.email),d(C=>({...C,success:{title:"Email sent",description:"Check your email for a magic link to sign in."}}))}else await t(g),d(C=>({...C,success:{title:"Please wait",description:"Redirecting to your provider..."}}))}catch(C){d(x=>({...x,error:C instanceof Error?C.message:"Error logging in"}))}},verifyOtp:r,isAuthenticating:l,error:u.error,successMessage:u.success}};function uR(t){const[e,r]=_.useState(()=>new URL(window.location.href).searchParams.get(t)??void 0);_.useEffect(()=>{const o=()=>{const l=new URL(window.location.href);r(l.searchParams.get(t)??void 0)};return window.addEventListener("popstate",o),()=>window.removeEventListener("popstate",o)},[t]);const s=_.useCallback(o=>{const l=new URL(window.location.href);o===void 0?l.searchParams.delete(t):l.searchParams.set(t,o),r(o),window.history.pushState({},"",l.toString())},[]);return[e,s]}const fR=()=>{const[t,e]=_.useState(!1),[r,s]=_.useState(""),[o,l]=_.useState(""),[u]=uR("redirect"),{handleLogin:d,verifyOtp:m,isAuthenticating:h,error:g,successMessage:v}=cR(),b=()=>(e(!0),d("email",{email:r}));_.useEffect(()=>{localStorage.setItem("chessarena-redirect",u??"")},[u]);const C=fn(),x=()=>C("/");return Da("Login"),y.jsx(Ii,{children:y.jsxs(Gi,{children:[y.jsx($i,{onBack:x}),y.jsx("div",{className:"flex flex-col gap-4 items-center justify-center grow",children:y.jsx(qu,{})}),v?y.jsxs("div",{className:"flex flex-col justify-center h-[348px] gap-6",children:[y.jsxs("div",{className:"space-y-1",children:[y.jsx("p",{className:"text-center text-2xl font-semibold",children:v.title}),y.jsx("p",{className:"text-muted-foreground text-center",children:v.description})]}),t&&y.jsxs("div",{className:"space-y-4",children:[y.jsx(iR,{value:o,onChange:l}),y.jsx(Gr,{className:"w-full",onClick:()=>m(r,o),isLoading:h,children:"Verify"})]})]}):y.jsxs("div",{className:"flex flex-col gap-4",children:[g&&y.jsx("p",{className:"text-red-500 text-center font-semibold first-letter:uppercase",children:g}),!h&&y.jsxs(y.Fragment,{children:[y.jsxs(Gr,{className:"w-full",onClick:()=>d("google"),children:[y.jsx("img",{src:"/login/google-logo.svg",alt:"Google",className:"size-6"}),"Continue with Google"]}),y.jsxs("div",{className:"flex flex-row gap-2 items-center justify-center w-full text-muted-foreground text-md font-semibold",children:[y.jsx("div",{className:"h-[1px] flex-1 bg-white/10"}),"Or",y.jsx("div",{className:"h-[1px] flex-1 bg-white/10"})]})]}),y.jsx(gx,{type:"email",placeholder:"Enter your email",className:"w-full",value:r,onChange:E=>s(E.target.value)}),y.jsx(Gr,{className:"w-full",onClick:b,isLoading:h,children:"Continue"}),y.jsxs("p",{className:"text-muted-foreground text-center",children:["If no accounts are found under this email, we'll create an account for you. By creating an account you agree with the"," ",
245y.jsx("a",{href:"/privacy-policy",target:"_blank",className:"font-semibold underline",children:"Privacy Policy"}),"."]})]})]})})},tb={auth:async t=>{const e=await Yn.post("/auth",{authToken:t});return Yn.setAuthToken(e.accessToken),e}},dR="modulepreload",hR=function(t){return"/"+t},nb={},Sl=function(e,r,s){let o=Promise.resolve();if(r&&r.length>0){let u=function(h){return Promise.all(h.map(g=>Promise.resolve(g).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),m=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));o=u(r.map(h=>{if(h=hR(h),h in nb)return;nb[h]=!0;const g=h.endsWith(".css"),v=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${v}`))return;const b=document.createElement("link");if(b.rel=g?"stylesheet":dR,g||(b.as="script"),b.crossOrigin="",b.href=h,m&&b.setAttribute("nonce",m),document.head.appendChild(b),g)return new Promise((C,x)=>{b.addEventListener("load",C),b.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${h}`)))})}))}function l(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return o.then(u=>{for(const d of u||[])d.status==="rejected"&&l(d.reason);return e().catch(l)})},mR=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Sl(async()=>{const{default:s}=await Promise.resolve().then(()=>Yi);return{default:s}},[]).then(({default:s})=>s(...r)):e=fetch,(...r)=>e(...r)};class Qm extends Error{constructor(e,r="FunctionsError",s){super(e),this.name=r,this.context=s}}class pR extends Qm{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class rb extends Qm{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class ab extends Qm{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var om;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(om||(om={}));var gR=function(t,e,r,s){function o(l){return l instanceof r?l:new r(function(u){u(l)})}return new(r||(r=Promise))(function(l,u){function d(g){try{h(s.next(g))}catch(v){u(v)}}function m(g){try{h(s.throw(g))}catch(v){u(v)}}function h(g){g.done?l(g.value):o(g.value).then(d,m)}h((s=s.apply(t,e||[])).next())})};class vR{constructor(e,{headers:r={},customFetch:s,region:o=om.Any}={}){this.url=e,this.headers=r,this.region=o,this.fetch=mR(s)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,r={}){var s;return gR(this,void 0,void 0,function*(){try{const{headers:o,method:l,body:u}=r;let d={},{region:m}=r;m||(m=this.region);const h=new URL(`${this.url}/${e}`);m&&m!=="any"&&(d["x-region"]=m,h.searchParams.set("forceFunctionRegion",m));let g;u&&(o&&!Object.prototype.hasOwnProperty.call(o,"Content-Type")||!o)&&(typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(d["Content-Type"]="application/octet-stream",g=u):typeof u=="string"?(d["Content-Type"]="text/plain",g=u):typeof FormData<"u"&&u instanceof FormData?g=u:(d["Content-Type"]="application/json",g=JSON.stringify(u)));const v=yield this.fetch(h.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},d),this.headers),o),body:g}).catch(E=>{throw new pR(E)}),b=v.headers.get("x-relay-error");if(b&&b==="true")throw new rb(v);if(!v.ok)throw new ab(v);let C=((s=v.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),x;return C==="application/json"?x=yield v.json():C==="application/octet-stream"?x=yield v.blob():C==="text/event-stream"?x=v:C==="multipart/form-data"?x=yield v.formData():x=yield v.text(),{data:x,error:null,response:v}}catch(o){return{data:null,error:o,response:o instanceof ab||o instanceof rb?o.context:void 0}}})}}var Lt={},vi={},yi={},bi={},wi={},xi={},yR=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},Di=yR();const bR=Di.fetch,vx=Di.fetch.bind(Di),yx=Di.Headers,wR=Di.Request,xR=Di.Response,Yi=Object.freeze(Object.defineProperty({__proto__:null,Headers:yx,Request:wR,Response:xR,default:vx,fetch:bR},Symbol.toStringTag,{value:"Module"})),_R=HS(Yi);var Fc={},sb;function bx(){if(sb)return Fc;sb=1,Object.defineProperty(Fc,"__esModule",{value:!0});
245class t extends Error{constructor(r){super(r.message),this.name="PostgrestError",this.details=r.details,this.hint=r.hint,this.code=r.code}}return Fc.default=t,Fc}var ib;function wx(){if(ib)return xi;ib=1;var t=xi&&xi.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(xi,"__esModule",{value:!0});const e=t(_R),r=t(bx());class s{constructor(l){this.shouldThrowOnError=!1,this.method=l.method,this.url=l.url,this.headers=l.headers,this.schema=l.schema,this.body=l.body,this.shouldThrowOnError=l.shouldThrowOnError,this.signal=l.signal,this.isMaybeSingle=l.isMaybeSingle,l.fetch?this.fetch=l.fetch:typeof fetch>"u"?this.fetch=e.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(l,u){return this.headers=Object.assign({},this.headers),this.headers[l]=u,this}then(l,u){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");const d=this.fetch;let m=d(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async h=>{var g,v,b;let C=null,x=null,E=null,T=h.status,k=h.statusText;if(h.ok){if(this.method!=="HEAD"){const K=await h.text();K===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?x=K:x=JSON.parse(K))}const O=(g=this.headers.Prefer)===null||g===void 0?void 0:g.match(/count=(exact|planned|estimated)/),Y=(v=h.headers.get("content-range"))===null||v===void 0?void 0:v.split("/");O&&Y&&Y.length>1&&(E=parseInt(Y[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(x)&&(x.length>1?(C={code:"PGRST116",details:`Results contain ${x.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},x=null,E=null,T=406,k="Not Acceptable"):x.length===1?x=x[0]:x=null)}else{const O=await h.text();try{C=JSON.parse(O),Array.isArray(C)&&h.status===404&&(x=[],C=null,T=200,k="OK")}catch{h.status===404&&O===""?(T=204,k="No Content"):C={message:O}}if(C&&this.isMaybeSingle&&(!((b=C==null?void 0:C.details)===null||b===void 0)&&b.includes("0 rows"))&&(C=null,T=200,k="OK"),C&&this.shouldThrowOnError)throw new r.default(C)}return{error:C,data:x,count:E,status:T,statusText:k}});return this.shouldThrowOnError||(m=m.catch(h=>{var g,v,b;return{error:{message:`${(g=h==null?void 0:h.name)!==null&&g!==void 0?g:"FetchError"}: ${h==null?void 0:h.message}`,details:`${(v=h==null?void 0:h.stack)!==null&&v!==void 0?v:""}`,hint:"",code:`${(b=h==null?void 0:h.code)!==null&&b!==void 0?b:""}`},data:null,count:null,status:0,statusText:""}})),m.then(l,u)}returns(){return this}overrideTypes(){return this}}return xi.default=s,xi}var ob;function xx(){if(ob)return wi;ob=1;var t=wi&&wi.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(wi,"__esModule",{value:!0});const e=t(wx());class r extends e.default{select(o){let l=!1;const u=(o??"*").split("").map(d=>/\s/.test(d)&&!l?"":(d==='"'&&(l=!l),d)).join("");return this.url.searchParams.set("select",u),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(o,{ascending:l=!0,nullsFirst:u,foreignTable:d,referencedTable:m=d}={}){const h=m?`${m}.order`:"order",g=this.url.searchParams.get(h);return this.url.searchParams.set(h,`${g?`${g},`:""}${o}.${l?"asc":"desc"}${u===void 0?"":u?".nullsfirst":".nullslast"}`),this}limit(o,{foreignTable:l,referencedTable:u=l}={}){const d=typeof u>"u"?"limit":`${u}.limit`;return this.url.searchParams.set(d,`${o}`),this}range(o,l,{foreignTable:u,referencedTable:d=u}={}){const m=typeof d>"u"?"offset":`${d}.offset`,h=typeof d>"u"?"limit":`${d}.limit`;return this.url.searchParams.set(m,`${o}`),this.url.searchParams.set(h,`${l-o+1}`),this}abortSignal(o){return this.signal=o,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}
245explain({analyze:o=!1,verbose:l=!1,settings:u=!1,buffers:d=!1,wal:m=!1,format:h="text"}={}){var g;const v=[o?"analyze":null,l?"verbose":null,u?"settings":null,d?"buffers":null,m?"wal":null].filter(Boolean).join("|"),b=(g=this.headers.Accept)!==null&&g!==void 0?g:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${h}; for="${b}"; options=${v};`,h==="json"?this:this}rollback(){var o;return((o=this.headers.Prefer)!==null&&o!==void 0?o:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}}return wi.default=r,wi}var lb;function Xm(){if(lb)return bi;lb=1;var t=bi&&bi.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(bi,"__esModule",{value:!0});const e=t(xx());class r extends e.default{eq(o,l){return this.url.searchParams.append(o,`eq.${l}`),this}neq(o,l){return this.url.searchParams.append(o,`neq.${l}`),this}gt(o,l){return this.url.searchParams.append(o,`gt.${l}`),this}gte(o,l){return this.url.searchParams.append(o,`gte.${l}`),this}lt(o,l){return this.url.searchParams.append(o,`lt.${l}`),this}lte(o,l){return this.url.searchParams.append(o,`lte.${l}`),this}like(o,l){return this.url.searchParams.append(o,`like.${l}`),this}likeAllOf(o,l){return this.url.searchParams.append(o,`like(all).{${l.join(",")}}`),this}likeAnyOf(o,l){return this.url.searchParams.append(o,`like(any).{${l.join(",")}}`),this}ilike(o,l){return this.url.searchParams.append(o,`ilike.${l}`),this}ilikeAllOf(o,l){return this.url.searchParams.append(o,`ilike(all).{${l.join(",")}}`),this}ilikeAnyOf(o,l){return this.url.searchParams.append(o,`ilike(any).{${l.join(",")}}`),this}is(o,l){return this.url.searchParams.append(o,`is.${l}`),this}in(o,l){const u=Array.from(new Set(l)).map(d=>typeof d=="string"&&new RegExp("[,()]").test(d)?`"${d}"`:`${d}`).join(",");return this.url.searchParams.append(o,`in.(${u})`),this}contains(o,l){return typeof l=="string"?this.url.searchParams.append(o,`cs.${l}`):Array.isArray(l)?this.url.searchParams.append(o,`cs.{${l.join(",")}}`):this.url.searchParams.append(o,`cs.${JSON.stringify(l)}`),this}containedBy(o,l){return typeof l=="string"?this.url.searchParams.append(o,`cd.${l}`):Array.isArray(l)?this.url.searchParams.append(o,`cd.{${l.join(",")}}`):this.url.searchParams.append(o,`cd.${JSON.stringify(l)}`),this}rangeGt(o,l){return this.url.searchParams.append(o,`sr.${l}`),this}rangeGte(o,l){return this.url.searchParams.append(o,`nxl.${l}`),this}rangeLt(o,l){return this.url.searchParams.append(o,`sl.${l}`),this}rangeLte(o,l){return this.url.searchParams.append(o,`nxr.${l}`),this}rangeAdjacent(o,l){return this.url.searchParams.append(o,`adj.${l}`),this}overlaps(o,l){return typeof l=="string"?this.url.searchParams.append(o,`ov.${l}`):this.url.searchParams.append(o,`ov.{${l.join(",")}}`),this}textSearch(o,l,{config:u,type:d}={}){let m="";d==="plain"?m="pl":d==="phrase"?m="ph":d==="websearch"&&(m="w");const h=u===void 0?"":`(${u})`;return this.url.searchParams.append(o,`${m}fts${h}.${l}`),this}match(o){return Object.entries(o).forEach(([l,u])=>{this.url.searchParams.append(l,`eq.${u}`)}),this}not(o,l,u){return this.url.searchParams.append(o,`not.${l}.${u}`),this}or(o,{foreignTable:l,referencedTable:u=l}={}){const d=u?`${u}.or`:"or";return this.url.searchParams.append(d,`(${o})`),this}filter(o,l,u){return this.url.searchParams.append(o,`${l}.${u}`),this}}return bi.default=r,bi}var cb;function _x(){if(cb)return yi;cb=1;var t=yi&&yi.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(yi,"__esModule",{value:!0});const e=t(Xm());class r{constructor(o,{headers:l={},schema:u,fetch:d}){this.url=o,this.headers=l,this.schema=u,this.fetch=d}select(o,{head:l=!1,count:u}={}){const d=l?"HEAD":"GET";let m=!1;const h=(o??"*").split("").map(g=>/\s/.test(g)&&!m?"":(g==='"'&&(m=!m),g)).join("");return this.url.searchParams.set("select",h),u&&(this.headers.Prefer=`count=${u}`),new e.default({method:d,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(o,{count:l,defaultToNull:u=!0}={}){const d="POST",m=[];if(this.headers.Prefer&&m.push(this.headers.Prefer),l&&m.push(`count=${l}`),u||m.push("missing=default"),this.headers.Prefer=m.join(","),Array.isArray(o)){const h=o.reduce((g,v)=>g.concat(Object.keys(v)),[]);if(h.length>0){const g=[...new Set(h)].map(v=>`"${v}"`);this.url.searchParams.set("columns",g.join(","))}}return new e.default({method:d,url:this.url,headers:this.headers,schema:this.schema,body:o,fetch:this.fetch,allowEmpty:!1})}upsert(o,{onConflict:l,ignoreDuplicates:u=!1,count:d,defaultToNull:m=!0}={}){const h="POST",g=[`resolution=${u?"ignore":"merge"}-duplicates`];if(l!==void 0&&this.url.searchParams.set("on_conflict",l),this.headers.Prefer&&g.push(this.headers.Prefer),d&&g.push(`count=${d}`),m||g.push("missing=default"),this.headers.Prefer=g.join(","),Array.isArray(o)){const v=o.reduce((b,C)=>b.concat(Object.keys(C)),[]);if(v.length>0){const b=[...new Set(v)].map(C=>`"${C}"`);this.url.searchParams.set("columns",b.join(","))}}return new e.default({method:h,url:this.url,headers:this.headers,schema:this.schema,body:o,fetch:this.fetch,allowEmpty:!1})}update(o,{count:l}={}){const u="PATCH",d=[];return this.headers.Prefer&&d.push(this.headers.Prefer),l&&d.push(`count=${l}`),this.headers.Prefer=d.join(","),new e.default({method:u,url:this.url,headers:this.headers,schema:this.schema,body:o,fetch:this.fetch,allowEmpty:!1})}delete({count:o}={}){const l="DELETE",u=[];return o&&u.push(`count=${o}`),this.headers.Prefer&&u.unshift(this.headers.Prefer),this.headers.Prefer=u.join(","),new e.default({method:l,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}}return yi.default=r,yi}
245var rl={},al={},ub;function SR(){return ub||(ub=1,Object.defineProperty(al,"__esModule",{value:!0}),al.version=void 0,al.version="0.0.0-automated"),al}var fb;function ER(){if(fb)return rl;fb=1,Object.defineProperty(rl,"__esModule",{value:!0}),rl.DEFAULT_HEADERS=void 0;const t=SR();return rl.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${t.version}`},rl}var db;function CR(){if(db)return vi;db=1;var t=vi&&vi.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(vi,"__esModule",{value:!0});const e=t(_x()),r=t(Xm()),s=ER();class o{constructor(u,{headers:d={},schema:m,fetch:h}={}){this.url=u,this.headers=Object.assign(Object.assign({},s.DEFAULT_HEADERS),d),this.schemaName=m,this.fetch=h}from(u){const d=new URL(`${this.url}/${u}`);return new e.default(d,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(u){return new o(this.url,{headers:this.headers,schema:u,fetch:this.fetch})}rpc(u,d={},{head:m=!1,get:h=!1,count:g}={}){let v;const b=new URL(`${this.url}/rpc/${u}`);let C;m||h?(v=m?"HEAD":"GET",Object.entries(d).filter(([E,T])=>T!==void 0).map(([E,T])=>[E,Array.isArray(T)?`{${T.join(",")}}`:`${T}`]).forEach(([E,T])=>{b.searchParams.append(E,T)})):(v="POST",C=d);const x=Object.assign({},this.headers);return g&&(x.Prefer=`count=${g}`),new r.default({method:v,url:b,headers:x,schema:this.schemaName,body:C,fetch:this.fetch,allowEmpty:!1})}}return vi.default=o,vi}var hb;function TR(){if(hb)return Lt;hb=1;var t=Lt&&Lt.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.PostgrestError=Lt.PostgrestBuilder=Lt.PostgrestTransformBuilder=Lt.PostgrestFilterBuilder=Lt.PostgrestQueryBuilder=Lt.PostgrestClient=void 0;const e=t(CR());Lt.PostgrestClient=e.default;const r=t(_x());Lt.PostgrestQueryBuilder=r.default;const s=t(Xm());Lt.PostgrestFilterBuilder=s.default;const o=t(xx());Lt.PostgrestTransformBuilder=o.default;const l=t(wx());Lt.PostgrestBuilder=l.default;const u=t(bx());return Lt.PostgrestError=u.default,Lt.default={PostgrestClient:e.default,PostgrestQueryBuilder:r.default,PostgrestFilterBuilder:s.default,PostgrestTransformBuilder:o.default,PostgrestBuilder:l.default,PostgrestError:u.default},Lt}var AR=TR();const kR=ym(AR),{PostgrestClient:jR,PostgrestQueryBuilder:GO,PostgrestFilterBuilder:KO,PostgrestTransformBuilder:VO,PostgrestBuilder:YO,PostgrestError:FO}=kR;class RR{static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};if(typeof process<"u"&&process.versions&&process.versions.node){const r=parseInt(process.versions.node.split(".")[0]);return r>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${r} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${r} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option: 246import ws from "ws" 247new RealtimeClient(url, { transport: ws })`}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const e=this.detectEnvironment();if(e.constructor)return e.constructor;let r=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(r+=` 248 249Suggested solution: ${e.workaround}`),new Error(r)}static createWebSocket(e,r){const s=this.getWebSocketConstructor();return new s(e,r)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const NR="2.15.1",OR=`realtime-js/${NR}`,MR="1.0.0",lm=1e4,DR=1e3,LR=100;var ll;(function(t){t[t.connecting=0]="connecting",t[t.open=1]="open",t[t.closing=2]="closing",t[t.closed=3]="closed"})(ll||(ll={}));var Tt;(function(t){t.closed="closed",t.errored="errored",t.joined="joined",t.joining="joining",t.leaving="leaving"})(Tt||(Tt={}));var Kn;(function(t){t.close="phx_close",t.error="phx_error",t.join="phx_join",t.reply="phx_reply",t.leave="phx_leave",t.access_token="access_token"})(Kn||(Kn={}));var cm;(function(t){t.websocket="websocket"})(cm||(cm={}));var ds;(function(t){t.Connecting="connecting",t.Open="open",t.Closing="closing",t.Closed="closed"})(ds||(ds={}));class UR{constructor(){this.HEADER_LENGTH=1}decode(e,r){return e.constructor===ArrayBuffer?r(this._binaryDecode(e)):r(typeof e=="string"?JSON.parse(e):{})}_binaryDecode(e){const r=new DataView(e),s=new TextDecoder;return this._decodeBroadcast(e,r,s)}_decodeBroadcast(e,r,s){const o=r.getUint8(1),l=r.getUint8(2);let u=this.HEADER_LENGTH+2;const d=s.decode(e.slice(u,u+o));u=u+o;const m=s.decode(e.slice(u,u+l));u=u+l;const h=JSON.parse(s.decode(e.slice(u,e.byteLength)));return{ref:null,topic:d,event:m,payload:h}}}class Sx{constructor(e,r){this.callback=e,this.timerCalc=r,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=r}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var tt;(function(t){t.abstime="abstime",t.bool="bool",t.date="date",t.daterange="daterange",t.float4="float4",t.float8="float8",t.int2="int2",t.int4="int4",t.int4range="int4range",t.int8="int8",t.int8range="int8range",t.json="json",t.jsonb="jsonb",t.money="money",t.numeric="numeric",t.oid="oid",t.reltime="reltime",t.text="text",t.time="time",t.timestamp="timestamp",t.timestamptz="timestamptz",t.timetz="timetz",t.t
vendor: 5,741 bytes, line 249
249srange="tsrange",t.tstzrange="tstzrange"})(tt||(tt={}));const mb=(t,e,r={})=>{var s;const o=(s=r.skipTypes)!==null&&s!==void 0?s:[];return Object.keys(e).reduce((l,u)=>(l[u]=zR(u,t,e,o),l),{})},zR=(t,e,r,s)=>{const o=e.find(d=>d.name===t),l=o==null?void 0:o.type,u=r[t];return l&&!s.includes(l)?Ex(l,u):um(u)},Ex=(t,e)=>{if(t.charAt(0)==="_"){const r=t.slice(1,t.length);return qR(e,r)}switch(t){case tt.bool:return PR(e);case tt.float4:case tt.float8:case tt.int2:case tt.int4:case tt.int8:case tt.numeric:case tt.oid:return BR(e);case tt.json:case tt.jsonb:return $R(e);case tt.timestamp:return HR(e);case tt.abstime:case tt.date:case tt.daterange:case tt.int4range:case tt.int8range:case tt.money:case tt.reltime:case tt.text:case tt.time:case tt.timestamptz:case tt.timetz:case tt.tsrange:case tt.tstzrange:return um(e);default:return um(e)}},um=t=>t,PR=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},BR=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},$R=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch(e){return console.log(`JSON parse error: ${e}`),t}return t},qR=(t,e)=>{if(typeof t!="string")return t;const r=t.length-1,s=t[r];if(t[0]==="{"&&s==="}"){let l;const u=t.slice(1,r);try{l=JSON.parse("["+u+"]")}catch{l=u?u.split(","):[]}return l.map(d=>Ex(e,d))}return t},HR=t=>typeof t=="string"?t.replace(" ","T"):t,Cx=t=>{let e=t;return e=e.replace(/^ws/i,"http"),e=e.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),e.replace(/\/+$/,"")+"/api/broadcast"};class Mh{constructor(e,r,s={},o=lm){this.channel=e,this.event=r,this.payload=s,this.timeout=o,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,r){var s;return this._hasReceived(e)&&r((s=this.receivedResp)===null||s===void 0?void 0:s.response),this.recHooks.push({status:e,callback:r}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const e=r=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=r,this._matchReceive(r)};this.channel._on(this.refEvent,{},e),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,r){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:r})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:r}){this.recHooks.filter(s=>s.status===e).forEach(s=>s.callback(r))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}var pb;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(pb||(pb={}));class cl{constructor(e,r){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const s=(r==null?void 0:r.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(s.state,{},o=>{const{onJoin:l,onLeave:u,onSync:d}=this.caller;this.joinRef=this.channel._joinRef(),this.state=cl.syncState(this.state,o,l,u),this.pendingDiffs.forEach(m=>{this.state=cl.syncDiff(this.state,m,l,u)}),this.pendingDiffs=[],d()}),this.channel._on(s.diff,{},o=>{const{onJoin:l,onLeave:u,onSync:d}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(o):(this.state=cl.syncDiff(this.state,o,l,u),d())}),this.onJoin((o,l,u)=>{this.channel._trigger("presence",{event:"join",key:o,currentPresences:l,newPresences:u})}),this.onLeave((o,l,u)=>{this.channel._trigger("presence",{event:"leave",key:o,currentPresences:l,leftPresences:u})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,r,s,o){const l=this.cloneDeep(e),u=this.transformState(r),d={},m={};return this.map(l,(h,g)=>{u[h]||(m[h]=g)}),this.map(u,(h,g)=>{const v=l[h];if(v){const b=g.map(T=>T.presence_ref),C=v.map(T=>T.presence_ref),x=g.filter(T=>C.indexOf(T.presence_ref)<0),E=v.filter(T=>b.indexOf(T.presence_ref)<0);x.length>0&&(d[h]=x),E.length>0&&(m[h]=E)}else d[h]=g}),this.syncDiff(l,{joins:d,leaves:m},s,o)}static syncDiff(e,r,s,o){const{joins:l,leaves:u}={joins:this.transformState(r.joins),leaves:this.transformState(r.leaves)};return s||(s=()=>{}),o||(o=()=>{}),this.map(l,(d,m)=>{var h;const g=(h=e[d])!==null&&h!==void 0?h:[];if(e[d]=this.cloneDeep(m),g.length>0){const v=e[d].map(C=>C.presence_ref),b=g.filter(C=>v.indexOf(C.presence_ref)<0);e[d].unshift(...b)}s(d,g,m)}),this.map(u,(d,m)=>{let h=e[d];if(!h)return;const g=m.map(v=>v.presence_ref);h=h.filter(v=>g.indexOf(v.presence_ref)<0),e[d]=h,o(d,h,m),h.length===0&&delete e[d]}),e}static map(e,r){return Object.getOwnPropertyNames(e).map(s=>r(s,e[s]))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce((r,s)=>{const o=e[s];return"metas"in o?r[s]=o.metas.map(l=>(l.presence_ref=l.phx_ref,delete l.phx_ref,delete l.phx_ref_prev,l)):r[s]=o,r},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var gb;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELET
249E="DELETE"})(gb||(gb={}));var ul;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(ul||(ul={}));var $r;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})($r||($r={}));class Zm{constructor(e,r={config:{}},s){this.topic=e,this.params=r,this.socket=s,this.bindings={},this.state=Tt.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.timeout=this.socket.timeout,this.joinPush=new Mh(this,Kn.join,this.params,this.timeout),this.rejoinTimer=new Sx(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Tt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(o=>o.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Tt.closed,this.socket._remove(this)}),this._onError(o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=Tt.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Tt.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=Tt.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Kn.reply,{},(o,l)=>{this._trigger(this._replyEventName(l),o)}),this.presence=new cl(this),this.broadcastEndpointURL=Cx(this.socket.endPoint),this.private=this.params.config.private||!1}subscribe(e,r=this.timeout){var s,o;if(this.socket.isConnected()||this.socket.connect(),this.state==Tt.closed){const{config:{broadcast:l,presence:u,private:d}}=this.params,m=(o=(s=this.bindings.postgres_changes)===null||s===void 0?void 0:s.map(b=>b.filter))!==null&&o!==void 0?o:[],h=!!this.bindings[ul.PRESENCE]&&this.bindings[ul.PRESENCE].length>0,g={},v={broadcast:l,presence:Object.assign(Object.assign({},u),{enabled:h}),postgres_changes:m,private:d};this.socket.accessTokenValue&&(g.access_token=this.socket.accessTokenValue),this._onError(b=>e==null?void 0:e($r.CHANNEL_ERROR,b)),this._onClose(()=>e==null?void 0:e($r.CLOSED)),this.updateJoinPayload(Object.assign({config:v},g)),this.joinedOnce=!0,this._rejoin(r),this.joinPush.receive("ok",async({postgres_changes:b})=>{var C;if(this.socket.setAuth(),b===void 0){e==null||e($r.SUBSCRIBED);return}else{const x=this.bindings.postgres_changes,E=(C=x==null?void 0:x.length)!==null&&C!==void 0?C:0,T=[];for(let k=0;k<E;k++){const z=x[k],{filter:{event:O,schema:Y,table:K,filter:re}}=z,J=b&&b[k];if(J&&J.event===O&&J.schema===Y&&J.table===K&&J.filter===re)T.push(Object.assign(Object.assign({},z),{id:J.id}));else{this.unsubscribe(),this.state=Tt.errored,e==null||e($r.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=T,e&&e($r.SUBSCRIBED);return}}).receive("error",b=>{this.state=Tt.errored,e==null||e($r.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(b).join(", ")||"error")))}).receive("timeout",()=>{e==null||e($r.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(e,r={}){return await this.send({type:"presence",event:"track",payload:e},r.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,r,s){return this.state===Tt.joined&&e===ul.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(()=>this.subscribe())),this._on(e,r,s)}async send(e,r={}){var s,o;if(!this._canPush()&&e.type==="broadcast"){const{event:l,payload:u}=e,m={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:l,payload:u,private:this.private}]})};try{const h=await this._fetchWithTimeout(this.broadcastEndpointURL,m,(s=r.timeout)!==null&&s!==void 0?s:this.timeout);return await((o=h.body)===null||o===void 0?void 0:o.cancel()),h.ok?"ok":"error"}catch(h){return h.name==="AbortError"?"timed out":"error"}}else return new Promise(l=>{var u,d,m;const h=this._push(e.type,e,r.timeout||this.timeout);e.type==="broadcast"&&!(!((m=(d=(u=this.params)===null||u===void 0?void 0:u.config)===null||d===void 0?void 0:d.broadcast)===null||m===void 0)&&m.ack)&&l("ok"),h.receive("ok",()=>l("ok")),h.receive("error",()=>l("error")),h.receive("timeout",()=>l("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=Tt.leaving;const r=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Kn.close,"leave",this._joinRef())};this.joinPush.destroy();let s=null;return new Promise(o=>{s=new Mh(this,Kn.leave,{},e),s.receive("ok",()=>{r(),o("ok")}).receive("timeout",()=>{r(),o("timed out")}).receive("error",()=>{o("error")}),s.send(),this._canPush()||s.trigger("ok",{})}).finally(()=>{s==null||s.destroy()})}
249teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Tt.closed,this.bindings={}}async _fetchWithTimeout(e,r,s){const o=new AbortController,l=setTimeout(()=>o.abort(),s),u=await this.socket.fetch(e,Object.assign(Object.assign({},r),{signal:o.signal}));return clearTimeout(l),u}_push(e,r,s=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let o=new Mh(this,e,r,s);return this._canPush()?o.send():this._addToPushBuffer(o),o}_addToPushBuffer(e){if(e.startTimeout(),this.pushBuffer.push(e),this.pushBuffer.length>LR){const r=this.pushBuffer.shift();r&&(r.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${r.event}`,r.payload))}}_onMessage(e,r,s){return r}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,r,s){var o,l;const u=e.toLocaleLowerCase(),{close:d,error:m,leave:h,join:g}=Kn;if(s&&[d,m,h,g].indexOf(u)>=0&&s!==this._joinRef())return;let b=this._onMessage(u,r,s);if(r&&!b)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(u)?(o=this.bindings.postgres_changes)===null||o===void 0||o.filter(C=>{var x,E,T;return((x=C.filter)===null||x===void 0?void 0:x.event)==="*"||((T=(E=C.filter)===null||E===void 0?void 0:E.event)===null||T===void 0?void 0:T.toLocaleLowerCase())===u}).map(C=>C.callback(b,s)):(l=this.bindings[u])===null||l===void 0||l.filter(C=>{var x,E,T,k,z,O;if(["broadcast","presence","postgres_changes"].includes(u))if("id"in C){const Y=C.id,K=(x=C.filter)===null||x===void 0?void 0:x.event;return Y&&((E=r.ids)===null||E===void 0?void 0:E.includes(Y))&&(K==="*"||(K==null?void 0:K.toLocaleLowerCase())===((T=r.data)===null||T===void 0?void 0:T.type.toLocaleLowerCase()))}else{const Y=(z=(k=C==null?void 0:C.filter)===null||k===void 0?void 0:k.event)===null||z===void 0?void 0:z.toLocaleLowerCase();return Y==="*"||Y===((O=r==null?void 0:r.event)===null||O===void 0?void 0:O.toLocaleLowerCase())}else return C.type.toLocaleLowerCase()===u}).map(C=>{if(typeof b=="object"&&"ids"in b){const x=b.data,{schema:E,table:T,commit_timestamp:k,type:z,errors:O}=x;b=Object.assign(Object.assign({},{schema:E,table:T,commit_timestamp:k,eventType:z,new:{},old:{},errors:O}),this._getPayloadRecords(x))}C.callback(b,s)})}_isClosed(){return this.state===Tt.closed}_isJoined(){return this.state===Tt.joined}_isJoining(){return this.state===Tt.joining}_isLeaving(){return this.state===Tt.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,r,s){const o=e.toLocaleLowerCase(),l={type:o,filter:r,callback:s};return this.bindings[o]?this.bindings[o].push(l):this.bindings[o]=[l],this}_off(e,r){const s=e.toLocaleLowerCase();return this.bindings[s]&&(this.bindings[s]=this.bindings[s].filter(o=>{var l;return!(((l=o.type)===null||l===void 0?void 0:l.toLocaleLowerCase())===s&&Zm.isEqual(o.filter,r))})),this}static isEqual(e,r){if(Object.keys(e).length!==Object.keys(r).length)return!1;for(const s in e)if(e[s]!==r[s])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(Kn.close,{},e)}_onError(e){this._on(Kn.error,{},r=>e(r))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Tt.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const r={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(r.new=mb(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(r.old=mb(e.columns,e.old_record)),r}}const vb=()=>{},Qc={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},IR=[1e3,2e3,5e3,1e4],GR=1e4,KR=` 250 addEventListener("message", (e) => { 251 if (e.data.event === "start") { 252 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 253 } 254 });`;class VR{constructor(e,r){var s;if(this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=lm,this.transport=null,this.heartbeatIntervalMs=Qc.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=vb,this.ref=0,this.reconnectTimer=null,this.logger=vb,this.conn=null,this.sendBuffer=[],this.serializer
254=new UR,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._resolveFetch=o=>{let l;return o?l=o:typeof fetch>"u"?l=(...u)=>Sl(async()=>{const{default:d}=await Promise.resolve().then(()=>Yi);return{default:d}},void 0).then(({default:d})=>d(...u)).catch(d=>{throw new Error(`Failed to load @supabase/node-fetch: ${d.message}. This is required for HTTP requests in Node.js environments without native fetch.`)}):l=fetch,(...u)=>l(...u)},!(!((s=r==null?void 0:r.params)===null||s===void 0)&&s.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey,this.endPoint=`${e}/${cm.websocket}`,this.httpEndpoint=Cx(e),this._initializeOptions(r),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=RR.createWebSocket(this.endpointURL())}catch(e){this._setConnectionState("disconnected");const r=e.message;throw r.includes("Node.js")?new Error(`${r} 255 256To use Realtime in Node.js, you need to provide a WebSocket implementation: 257 258Option 1: Use Node.js 22+ which has native WebSocket support 259Option 2: Install and provide the "ws" package: 260 261 npm install ws 262 263 import ws from "ws" 264 const client = new RealtimeClient(url, { 265 ...options, 266 transport: ws 267 })`):new Error(`WebSocket not available: ${r}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:MR}))}disconnect(e,r){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const s=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(s),this._setConnectionState("disconnected")},e?this.conn.close(e,r??""):this.conn.close(),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(e){const r=await e.unsubscribe();return this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){const e=await Promise.all(this.channels.map(r=>r.unsubscribe()));return this.channels=[],this.disconnect(),e}log(e,r,s){this.logger(e,r,s)}connectionState(){switch(this.conn&&this.conn.readyState){case ll.connecting:return ds.Connecting;case ll.open:return ds.Open;case ll.closing:return ds.Closing;default:return ds.Closed}}isConnected(){return this.connectionState()===ds.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(e,r={config:{}}){const s=`realtime:${e}`,o=this.getChannels().find(l=>l.topic===s);if(o)return o;{const l=new Zm(`realtime:${e}`,r,this);return this.channels.push(l),l}}push(e){const{topic:r,event:s,payload:o,ref:l}=e,u=()=>{this.encode(e,d=>{var m;(m=this.conn)===null||m===void 0||m.send(d)})};this.log("push",`${r} ${s} (${l})`,o),this.isConnected()?u():this.sendBuffer.push(u)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}async sendHeartbeat(){var e;if(!this.isConnected()){this.heartbeatCallback("disconnected");return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.heartbeatCallback("timeout"),this._wasManualDisconnect=!1,(e=this.conn)===null||e===void 0||e.close(DR,"heartbeat timeout"),setTimeout(()=>{var r;this.isConnected()||(r=this.reconnectTimer)===null||r===void 0||r.sc
267heduleTimeout()},Qc.HEARTBEAT_TIMEOUT_FALLBACK);return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatCallback("sent"),this._setAuthSafely("heartbeat")}onHeartbeat(e){this.heartbeatCallback=e}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let r=this.channels.find(s=>s.topic===e&&(s._isJoined()||s._isJoining()));r&&(this.log("transport",`leaving duplicate topic "${e}"`),r.unsubscribe())}_remove(e){this.channels=this.channels.filter(r=>r.topic!==e.topic)}_onConnMessage(e){this.decode(e.data,r=>{r.topic==="phoenix"&&r.event==="phx_reply"&&this.heartbeatCallback(r.payload.status==="ok"?"ok":"error"),r.ref&&r.ref===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null);const{topic:s,event:o,payload:l,ref:u}=r,d=u?`(${u})`:"",m=l.status||"";this.log("receive",`${m} ${s} ${o} ${d}`.trim(),l),this.channels.filter(h=>h._isMember(s)).forEach(h=>h._trigger(o,l,u)),this._triggerStateCallbacks("message",r)})}_clearTimer(e){var r;e==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):e==="reconnect"&&((r=this.reconnectTimer)===null||r===void 0||r.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e))}_teardownConnection(){this.conn&&(this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null),this._clearAllTimers(),this.channels.forEach(e=>e.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this.workerRef.terminate()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_onConnClose(e){var r;this._setConnectionState("disconnected"),this.log("transport","close",e),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(r=this.reconnectTimer)===null||r===void 0||r.sc
267heduleTimeout(),this._triggerStateCallbacks("close",e)}_onConnError(e){this._setConnectionState("disconnected"),this.log("transport",`${e}`),this._triggerChanError(),this._triggerStateCallbacks("error",e)}_triggerChanError(){this.channels.forEach(e=>e._trigger(Kn.error))}_appendParams(e,r){if(Object.keys(r).length===0)return e;const s=e.match(/\?/)?"&":"?",o=new URLSearchParams(r);return`${e}${s}${o}`}_workerObjectUrl(e){let r;if(e)r=e;else{const s=new Blob([KR],{type:"application/javascript"});r=URL.createObjectURL(s)}return r}_setConnectionState(e,r=!1){this._connectionState=e,e==="connecting"?this._wasManualDisconnect=!1:e==="disconnecting"&&(this._wasManualDisconnect=r)}async _performAuth(e=null){let r;e?r=e:this.accessToken?r=await this.accessToken():r=this.accessTokenValue,this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(s=>{const o={access_token:r,version:OR};r&&s.updateJoinPayload(o),s.joinedOnce&&s._isJoined()&&s._push(Kn.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this.setAuth().catch(r=>{this.log("error",`error setting auth in ${e}`,r)})}_triggerStateCallbacks(e,r){try{this.stateChangeCallbacks[e].forEach(s=>{try{s(r)}catch(o){this.log("error",`error in ${e} callback`,o)}})}catch(s){this.log("error",`error triggering ${e} callbacks`,s)}}_setupReconnectionTimer(){this.reconnectTimer=new Sx(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},Qc.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(e){var r,s,o,l,u,d,m,h;if(this.transport=(r=e==null?void 0:e.transport)!==null&&r!==void 0?r:null,this.timeout=(s=e==null?void 0:e.timeout)!==null&&s!==void 0?s:lm,this.heartbeatIntervalMs=(o=e==null?void 0:e.heartbeatIntervalMs)!==null&&o!==void 0?o:Qc.HEARTBEAT_INTERVAL,this.worker=(l=e==null?void 0:e.worker)!==null&&l!==void 0?l:!1,this.accessToken=(u=e==null?void 0:e.accessToken)!==null&&u!==void 0?u:null,e!=null&&e.params&&(this.params=e.params),e!=null&&e.logger&&(this.logger=e.logger),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(d=e==null?void 0:e.reconnectAfterMs)!==null&&d!==void 0?d:g=>IR[g-1]||GR,this.encode=(m=e==null?void 0:e.encode)!==null&&m!==void 0?m:(g,v)=>v(JSON.stringify(g)),this.decode=(h=e==null?void 0:e.decode)!==null&&h!==void 0?h:this.serializer.decode.bind(this.serializer),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl}}}class Wm extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function zt(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}class YR extends Wm{constructor(e,r,s){super(e),this.name="StorageApiError",this.status=r,this.statusCode=s}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class fm extends Wm{constructor(e,r){super(e),this.name="StorageUnknownError",this.originalError=r}}var FR=function(t,e,r,s){function o(l){return l instanceof r?l:new r(function(u){u(l)})}return new(r||(r=Promise))(function(l,u){function d(g){try{h(s.next(g))}catch(v){u(v)}}function m(g){try{h(s.throw(g))}catch(v){u(v)}}function h(g){g.done?l(g.value):o(g.value).then(d,m)}h((s=s.apply(t,e||[])).next())})};const Tx=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Sl(async()=>{const{default:s}=await Promise.resolve().then(()=>Yi);return{default:s}},void 0).then(({default:s})=>s(...r)):e=fetch,(...r)=>e(...r)},QR=()=>FR(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Sl(()=>Promise.resolve().then(()=>Yi),void 0)).Response:Response}),dm=t=>{if(Array.isArray(t))return t.map(r=>dm(r));if(typeof t=="function"||t!==Object(t))return t;const e={};return Object.entries(t).forEach(([r,s])=>{const o=r.replace(/([-_][a-z])/gi,l=>l.toUpperCase().replace(/[-_]/g,""));e[o]=dm(s)}),e},XR=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);
267return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)};var Es=function(t,e,r,s){function o(l){return l instanceof r?l:new r(function(u){u(l)})}return new(r||(r=Promise))(function(l,u){function d(g){try{h(s.next(g))}catch(v){u(v)}}function m(g){try{h(s.throw(g))}catch(v){u(v)}}function h(g){g.done?l(g.value):o(g.value).then(d,m)}h((s=s.apply(t,e||[])).next())})};const Dh=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),ZR=(t,e,r)=>Es(void 0,void 0,void 0,function*(){const s=yield QR();t instanceof s&&!(r!=null&&r.noResolveJson)?t.json().then(o=>{const l=t.status||500,u=(o==null?void 0:o.statusCode)||l+"";e(new YR(Dh(o),l,u))}).catch(o=>{e(new fm(Dh(o),o))}):e(new fm(Dh(t),t))}),WR=(t,e,r,s)=>{const o={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"||!s?o:(XR(s)?(o.headers=Object.assign({"Content-Type":"application/json"},e==null?void 0:e.headers),o.body=JSON.stringify(s)):o.body=s,e!=null&&e.duplex&&(o.duplex=e.duplex),Object.assign(Object.assign({},o),r))};function El(t,e,r,s,o,l){return Es(this,void 0,void 0,function*(){return new Promise((u,d)=>{t(r,WR(e,s,o,l)).then(m=>{if(!m.ok)throw m;return s!=null&&s.noResolveJson?m:m.json()}).then(m=>u(m)).catch(m=>ZR(m,d,s))})})}function xu(t,e,r,s){return Es(this,void 0,void 0,function*(){return El(t,"GET",e,r,s)})}function qr(t,e,r,s,o){return Es(this,void 0,void 0,function*(){return El(t,"POST",e,s,o,r)})}function hm(t,e,r,s,o){return Es(this,void 0,void 0,function*(){return El(t,"PUT",e,s,o,r)})}function JR(t,e,r,s){return Es(this,void 0,void 0,function*(){return El(t,"HEAD",e,Object.assign(Object.assign({},r),{noResolveJson:!0}),s)})}function Ax(t,e,r,s,o){return Es(this,void 0,void 0,function*(){return El(t,"DELETE",e,s,o,r)})}var rn=function(t,e,r,s){function o(l){return l instanceof r?l:new r(function(u){u(l)})}return new(r||(r=Promise))(function(l,u){function d(g){try{h(s.next(g))}catch(v){u(v)}}function m(g){try{h(s.throw(g))}catch(v){u(v)}}function h(g){g.done?l(g.value):o(g.value).then(d,m)}h((s=s.apply(t,e||[])).next())})};const eN={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},yb={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class tN{constructor(e,r={},s,o){this.url=e,this.headers=r,this.bucketId=s,this.fetch=Tx(o)}uploadOrUpdate(e,r,s,o){return rn(this,void 0,void 0,function*(){try{let l;const u=Object.assign(Object.assign({},yb),o);let d=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(u.upsert)});const m=u.metadata;typeof Blob<"u"&&s instanceof Blob?(l=new FormData,l.append("cacheControl",u.cacheControl),m&&l.append("metadata",this.encodeMetadata(m)),l.append("",s)):typeof FormData<"u"&&s instanceof FormData?(l=s,l.append("cacheControl",u.cacheControl),m&&l.append("metadata",this.encodeMetadata(m))):(l=s,d["cache-control"]=`max-age=${u.cacheControl}`,d["content-type"]=u.contentType,m&&(d["x-metadata"]=this.toBase64(this.encodeMetadata(m)))),o!=null&&o.headers&&(d=Object.assign(Object.assign({},d),o.headers));const h=this._removeEmptyFolders(r),g=this._getFinalPath(h),v=yield(e=="PUT"?hm:qr)(this.fetch,`${this.url}/object/${g}`,l,Object.assign({headers:d},u!=null&&u.duplex?{duplex:u.duplex}:{}));return{data:{path:h,id:v.Id,fullPath:v.Key},error:null}}catch(l){if(zt(l))return{data:null,error:l};throw l}})}upload(e,r,s){return rn(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,r,s)})}uploadToSignedUrl(e,r,s,o){return rn(this,void 0,void 0,function*(){const l=this._removeEmptyFolders(e),u=this._getFinalPath(l),d=new URL(this.url+`/object/upload/sign/${u}`);d.searchParams.set("token",r);try{let m;const h=Object.assign({upsert:yb.upsert},o),g=Object.assign(Object.assign({},this.headers),{"x-upsert":String(h.upsert)});typeof Blob<"u"&&s instanceof Blob?(m=new FormData,m.append("cacheControl",h.cacheControl),m.append("",s)):typeof FormData<"u"&&s instanceof FormData?(m=s,m.append("cacheControl",h.cacheControl)):(m=s,g["cache-control"]=`max-age=${h.cacheControl}`,g["content-type"]=h.contentType);const v=yield hm(this.fetch,d.toString(),m,{headers:g});return{data:{path:l,fullPath:v.Key},error:null}}catch(m){if(zt(m))return{data:null,error:m};throw m}})}createSignedUploadUrl(e,r){return rn(this,void 0,void 0,function*(){try{let s=this._getFinalPath(e);const o=Object.assign({},this.headers);r!=null&&r.upsert&&(o["x-upsert"]="true");const l=yield qr(this.fetch,`${this.url}/object/upload/sign/${s}`,{},{headers:o}),u=new URL(this.url+l.url),d=u.searchParams.get("token");if(!d)throw new Wm("No token returned by API");return{data:{signedUrl:u.toString(),path:e,token:d},error:null}}catch(s){if(zt(s))return{data:null,error:s};throw s}})}update(e,r,s){return rn(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,r,s)})}move(e,r,s){return rn(this,void 0,void 0,function*(){try{return{data:yield qr(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:s==null?void 0:s.destinationBucket},{headers:this.headers}),error:null}}catch(o){if(zt(o))return{data:null,error:o};throw o}})}copy(e,r,s){return rn(this,void 0,void 0,function*(){try{return{data:{path:(yield qr(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:s==null?void 0:s.destinationBucket},{headers:this.headers})).Key},error:null}}catch(o){if(zt(o))return{data:null,error:o};throw o}})}createSignedUrl(e,r,s){return rn(this,void 0,void 0,function*(){try{let o=this._getFinalPath(e),l=yield qr(this.fetch,`${this.url}/object/sign/${o}
267`,Object.assign({expiresIn:r},s!=null&&s.transform?{transform:s.transform}:{}),{headers:this.headers});const u=s!=null&&s.download?`&download=${s.download===!0?"":s.download}`:"";return l={signedUrl:encodeURI(`${this.url}${l.signedURL}${u}`)},{data:l,error:null}}catch(o){if(zt(o))return{data:null,error:o};throw o}})}createSignedUrls(e,r,s){return rn(this,void 0,void 0,function*(){try{const o=yield qr(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:r,paths:e},{headers:this.headers}),l=s!=null&&s.download?`&download=${s.download===!0?"":s.download}`:"";return{data:o.map(u=>Object.assign(Object.assign({},u),{signedUrl:u.signedURL?encodeURI(`${this.url}${u.signedURL}${l}`):null})),error:null}}catch(o){if(zt(o))return{data:null,error:o};throw o}})}download(e,r){return rn(this,void 0,void 0,function*(){const o=typeof(r==null?void 0:r.transform)<"u"?"render/image/authenticated":"object",l=this.transformOptsToQueryString((r==null?void 0:r.transform)||{}),u=l?`?${l}`:"";try{const d=this._getFinalPath(e);return{data:yield(yield xu(this.fetch,`${this.url}/${o}/${d}${u}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(d){if(zt(d))return{data:null,error:d};throw d}})}info(e){return rn(this,void 0,void 0,function*(){const r=this._getFinalPath(e);try{const s=yield xu(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:dm(s),error:null}}catch(s){if(zt(s))return{data:null,error:s};throw s}})}exists(e){return rn(this,void 0,void 0,function*(){const r=this._getFinalPath(e);try{return yield JR(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(s){if(zt(s)&&s instanceof fm){const o=s.originalError;if([400,404].includes(o==null?void 0:o.status))return{data:!1,error:s}}throw s}})}getPublicUrl(e,r){const s=this._getFinalPath(e),o=[],l=r!=null&&r.download?`download=${r.download===!0?"":r.download}`:"";l!==""&&o.push(l);const d=typeof(r==null?void 0:r.transform)<"u"?"render/image":"object",m=this.transformOptsToQueryString((r==null?void 0:r.transform)||{});m!==""&&o.push(m);let h=o.join("&");return h!==""&&(h=`?${h}`),{data:{publicUrl:encodeURI(`${this.url}/${d}/public/${s}${h}`)}}}remove(e){return rn(this,void 0,void 0,function*(){try{return{data:yield Ax(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(r){if(zt(r))return{data:null,error:r};throw r}})}list(e,r,s){return rn(this,void 0,void 0,function*(){try{const o=Object.assign(Object.assign(Object.assign({},eN),r),{prefix:e||""});return{data:yield qr(this.fetch,`${this.url}/object/list/${this.bucketId}`,o,{headers:this.headers},s),error:null}}catch(o){if(zt(o))return{data:null,error:o};throw o}})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const r=[];return e.width&&r.push(`width=${e.width}`),e.height&&r.push(`height=${e.height}`),e.resize&&r.push(`resize=${e.resize}`),e.format&&r.push(`format=${e.format}`),e.quality&&r.push(`quality=${e.quality}`),r.join("&")}}const nN="2.10.5",rN={"X-Client-Info":`storage-js/${nN}`};var _i=function(t,e,r,s){function o(l){return l instanceof r?l:new r(function(u){u(l)})}return new(r||(r=Promise))(function(l,u){function d(g){try{h(s.next(g))}catch(v){u(v)}}function m(g){try{h(s.throw(g))}catch(v){u(v)}}function h(g){g.done?l(g.value):o(g.value).then(d,m)}h((s=s.apply(t,e||[])).next())})};class aN{constructor(e,r={},s,o){const l=new URL(e);o!=null&&o.useNewHostname&&/supabase\.(co|in|red)$/.test(l.hostname)&&!l.hostname.includes("storage.supabase.")&&(l.hostname=l.hostname.replace("supabase.","storage.supabase.")),this.url=l.href,this.headers=Object.assign(Object.assign({},rN),r),this.fetch=Tx(s)}listBuckets(){return _i(this,void 0,void 0,function*(){try{return{data:yield xu(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if(zt(e))return{data:null,error:e};throw e}})}getBucket(e){return _i(this,void 0,void 0,function*(){try{return{data:yield xu(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(r){if(zt(r))return{data:null,error:r};throw r}})}createBucket(e,r={public:!1}){return _i(this,void 0,void 0,function*(){try{return{data:yield qr(this.fetch,`${this.url}/bucket`,{id:e,name:e,type:r.type,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(s){if(zt(s))return{data:null,error:s};throw s}})}updateBucket(e,r){return _i(this,void 0,void 0,function*(){try{return{data:yield hm(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(s){if(zt(s))return{data:null,error:s};throw s}})}emptyBucket(e){return _i(this,void 0,void 0,function*(){try{return{data:yield qr(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(r){if(zt(r))return{data:null,error:r};throw r}})}deleteBucket(e){return _i(this,void 0,void 0,function*(){try{return{data:yield Ax(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if(zt(r))return{data:null,error:r};throw r}})}}class sN extends aN{constructor(e,r={},s,o){super(e,r,s,o)}from(e){return new tN(this.url,this.headers,e,this.fetch)}}const iN="2.55.0";let ol="";typeof Deno<"u"?ol="deno":typeof document<"u"?ol="web":typeof navigator<"u"&&navigator.product==="ReactNative"?ol="react-native":ol="node";const oN={"X-Client-Info":`supabase-js-${ol}/${iN}`},lN={headers:oN},cN={schema:"public"},uN={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"}
267,fN={};var dN=function(t,e,r,s){function o(l){return l instanceof r?l:new r(function(u){u(l)})}return new(r||(r=Promise))(function(l,u){function d(g){try{h(s.next(g))}catch(v){u(v)}}function m(g){try{h(s.throw(g))}catch(v){u(v)}}function h(g){g.done?l(g.value):o(g.value).then(d,m)}h((s=s.apply(t,e||[])).next())})};const hN=t=>{let e;return t?e=t:typeof fetch>"u"?e=vx:e=fetch,(...r)=>e(...r)},mN=()=>typeof Headers>"u"?yx:Headers,pN=(t,e,r)=>{const s=hN(r),o=mN();return(l,u)=>dN(void 0,void 0,void 0,function*(){var d;const m=(d=yield e())!==null&&d!==void 0?d:t;let h=new o(u==null?void 0:u.headers);return h.has("apikey")||h.set("apikey",t),h.has("Authorization")||h.set("Authorization",`Bearer ${m}`),s(l,Object.assign(Object.assign({},u),{headers:h}))})};var gN=function(t,e,r,s){function o(l){return l instanceof r?l:new r(function(u){u(l)})}return new(r||(r=Promise))(function(l,u){function d(g){try{h(s.next(g))}catch(v){u(v)}}function m(g){try{h(s.throw(g))}catch(v){u(v)}}function h(g){g.done?l(g.value):o(g.value).then(d,m)}h((s=s.apply(t,e||[])).next())})};function vN(t){return t.endsWith("/")?t:t+"/"}function yN(t,e){var r,s;const{db:o,auth:l,realtime:u,global:d}=t,{db:m,auth:h,realtime:g,global:v}=e,b={db:Object.assign(Object.assign({},m),o),auth:Object.assign(Object.assign({},h),l),realtime:Object.assign(Object.assign({},g),u),storage:{},global:Object.assign(Object.assign(Object.assign({},v),d),{headers:Object.assign(Object.assign({},(r=v==null?void 0:v.headers)!==null&&r!==void 0?r:{}),(s=d==null?void 0:d.headers)!==null&&s!==void 0?s:{})}),accessToken:()=>gN(this,void 0,void 0,function*(){return""})};return t.accessToken?b.accessToken=t.accessToken:delete b.accessToken,b}const kx="2.71.1",ki=30*1e3,mm=3,Lh=mm*ki,bN="http://localhost:9999",wN="supabase.auth.token",xN={"X-Client-Info":`gotrue-js/${kx}`},pm="X-Supabase-Api-Version",jx={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},_N=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,SN=10*60*1e3;class Jm extends Error{constructor(e,r,s){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=s}}function Ce(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class EN extends Jm{constructor(e,r,s){super(e,r,s),this.name="AuthApiError",this.status=r,this.code=s}}function CN(t){return Ce(t)&&t.name==="AuthApiError"}class Rx extends Jm{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}}class za extends Jm{constructor(e,r,s,o){super(e,s,o),this.name=r,this.status=s}}class ka extends za{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function TN(t){return Ce(t)&&t.name==="AuthSessionMissingError"}class Xc extends za{constructor(){super("Auth session or user missing","AuthInvalidToken
267ResponseError",500,void 0)}}class Zc extends za{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class Wc extends za{constructor(e,r=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function AN(t){return Ce(t)&&t.name==="AuthImplicitGrantRedirectError"}class bb extends za{constructor(e,r=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class gm extends za{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}}function Uh(t){return Ce(t)&&t.name==="AuthRetryableFetchError"}class wb extends za{constructor(e,r,s){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=s}}class vm extends za{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const _u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),xb=` 268\r=`.split(""),kN=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<xb.length;e+=1)t[xb[e].charCodeAt(0)]=-2;for(let e=0;e<_u.length;e+=1)t[_u[e].charCodeAt(0)]=e;return t})();function _b(t,e,r){if(t!==null)for(e.queue=e.queue<<8|t,e.queuedBits+=8;e.queuedBits>=6;){const s=e.queue>>e.queuedBits-6&63;r(_u[s]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const s=e.queue>>e.queuedBits-6&63;r(_u[s]),e.queuedBits-=6}}function Nx(t,e,r){const s=kN[t];if(s>-1)for(e.queue=e.queue<<6|s,e.queuedBits+=6;e.queuedBits>=8;)r(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(s===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(t)}"`)}}function Sb(t){const e=[],r=u=>{e.push(String.fromCodePoint(u))},s={utf8seq:0,codepoint:0},o={queue:0,queuedBits:0},l=u=>{NN(u,s,r)};for(let u=0;u<t.length;u+=1)Nx(t.charCodeAt(u),o,l);return e.join("")}function jN(t,e){if(t<=127){e(t);return}else if(t<=2047){e(192|t>>6),e(128|t&63);return}else if(t<=65535){e(224|t>>12),e(128|t>>6&63),e(128|t&63);return}else if(t<=1114111){e(240|t>>18),e(128|t>>12&63),e(128|t>>6&63),e(128|t&63);return}throw new Error(`Unrecognized Unicode codepoint: ${t.toString(16)}`)}function RN(t,e){for(let r=0;r<t.length;r+=1){let s=t.charCodeAt(r);if(s>55295&&s<=56319){const o=(s-55296)*1024&65535;s=(t.charCodeAt(r+1)-56320&65535|o)+65536,r+=1}jN(s,e)}}function NN(t,e,r){if(e.utf8seq===0){if(t<=127){r(t);return}for(let s=1;s<6;s+=1)if((t>>7-s&1)===0){e.utf8seq=s;break}if(e.utf8seq===2)e.codepoint=t&31;else if(e.utf8seq===3)e.codepoint=t&15;else if(e.utf8seq===4)e.codepoint=t&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(t<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|t&63,e.utf8seq-=1,e.utf8seq===0&&r(e.codepoint)}}function ON(t){const e=[],r={queue:0,queuedBits:0},s=o=>{e.push(o)};for(let o=0;o<t.length;o+=1)Nx(t.charCodeAt(o),r,s);return new Uint8Array(e)}function MN(t){const e=[];return RN(t,r=>e.push(r)),new Uint8Array(e)}function DN(t){const e=[],r={queue:0,queuedBits:0},s=o=>{e.push(o)};return t.forEach(o=>_b(o,r,s)),_b(null,r,s),e.join("")}function LN(t){return Math.round(Date.now()/1e3)+t}function UN(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){const e=Math.random()*16|0;return(t=="x"?e:e&3|8).toString(16)})}const Gn=()=>typeof window<"u"&&typeof document<"u",ls={tested:!1,writable:!1},Ox=()=>{if(!Gn())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(ls.tested)return ls.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),ls.tested=!0,ls.writable=!0}catch{ls.tested=!0,ls.writable=!1}return ls.writable};function zN(t){const e={},r=new URL(t);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((o,l)=>{e[l]=o})}catch{}return r.searchParams.forEach((s,o)=>{e[o]=s}),e}const Mx=t=>{let e;return t?e=t:typeof fetch>"u"?e=(...r)=>Sl(async()=>{const{default:s}=await Promise.resolve().then(()=>Yi);return{default:s}},void 0).then(({default:s})=>s(...r)):e=fetch,(...r)=>e(...r)},PN=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",ji=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))},cs=async(t,e)=>{const r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return r}},Ea=async(t,e)=>{await t.removeItem(e)};class Hu{constructor(){this.promise=new Hu.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}}Hu.promiseConstructor=Promise;function zh(t){const e=t.split(".");if(e.length!==3)throw new vm("Invalid JWT structure");for(let s=0;s<e.length;s++)if(!_N.test(e[s]))throw new vm("JWT not in base64url format");return{header:JSON.parse(Sb(e[0])),payload:JSON.parse(Sb(e[1])),signature:ON(e[2]),raw:{header:e[0],payload:e[1]}}}async function BN(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function $N(t,e){return new Promise((s,o)=>{(async()=>{for(let l=0;l<1/0;l++)try{const u=await t(l);if(!e(l,null,u)){s(u);return}}catch(u){if(!e(l,u)){o(u);return}}})()})}function qN(t){return("0"+t.toString(16)).substr(-2)}function HN(){const e=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",s=r.length;let o="";for(let l=0;l<56;l++)o+=r.charAt(Math.floor(Math.random()*s));return o}return crypto.getRandomValues(e),Array.from(e,qN).join("")}async function IN(t){const r=new TextEncoder().encode(t),s=await crypto.subtle.digest("SHA-256",r),o=new Uint8Array(s);return Array.from(o).map(l=>String.fromCharCode(l)).join("")}async function GN(t){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code
268challenge method will default to use plain instead of sha256."),t;const r=await IN(t);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Si(t,e,r=!1){const s=HN();let o=s;r&&(o+="/PASSWORD_RECOVERY"),await ji(t,`${e}-code-verifier`,o);const l=await GN(s);return[l,s===l?"plain":"s256"]}const KN=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function VN(t){const e=t.headers.get(pm);if(!e||!e.match(KN))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function YN(t){if(!t)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(t<=e)throw new Error("JWT has expired")}function FN(t){switch(t){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const QN=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Ei(t){if(!QN.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Ph(){const t={};return new Proxy(t,{get:(e,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const s=r.toString();if(s==="Symbol(Symbol.toPrimitive)"||s==="Symbol(Symbol.toStringTag)"||s==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function Eb(t){return JSON.parse(JSON.stringify(t))}var XN=function(t,e){var r={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(r[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,s=Object.getOwnPropertySymbols(t);o<s.length;o++)e.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(t,s[o])&&(r[s[o]]=t[s[o]]);return r};const fs=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),ZN=[502,503,504];async function Cb(t){var e;if(!PN(t))throw new gm(fs(t),0);if(ZN.includes(t.status))throw new gm(fs(t),t.status);let r;try{r=await t.json()}catch(l){throw new Rx(fs(l),l)}let s;const o=VN(t);if(o&&o.getTime()>=jx["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?s=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(s=r.error_code),s){if(s==="weak_password")throw new wb(fs(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(s==="session_not_found")throw new ka}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((l,u)=>l&&typeof u=="string",!0))throw new wb(fs(r),t.status,r.weak_password.reasons);throw new EN(fs(r),t.status||500,s)}const WN=(t,e,r,s)=>{const o={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"?o:(o.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),o.body=JSON.stringify(s),Object.assign(Object.assign({},o),r))};async function Ue(t,e,r,s){var o;const l=Object.assign({},s==null?void 0:s.headers);l[pm]||(l[pm]=jx["2024-01-01"].name),s!=null&&s.jwt&&(l.Authorization=`Bearer ${s.jwt}`);const u=(o=s==null?void 0:s.query)!==null&&o!==void 0?o:{};s!=null&&s.redirectTo&&(u.redirect_to=s.redirectTo);const d=Object.keys(u).length?"?"+new URLSearchParams(u).toString():"",m=await JN(t,e,r+d,{headers:l,noResolveJson:s==null?void 0:s.noResolveJson},{},s==null?void 0:s.body);return s!=null&&s.xform?s==null?void 0:s.xform(m):{data:Object.assign({},m),error:null}}async function JN(t,e,r,s,o,l){const u=WN(e,s,o,l);let d;try{d=await t(r,Object.assign({},u))}catch(m){throw console.error(m),new gm(fs(m),0)}
268if(d.ok||await Cb(d),s!=null&&s.noResolveJson)return d;try{return await d.json()}catch(m){await Cb(m)}}function Br(t){var e;let r=null;rO(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=LN(t.expires_in)));const s=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:r,user:s},error:null}}function Tb(t){const e=Br(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((r,s)=>r&&typeof s=="string",!0)&&(e.data.weak_password=t.weak_password),e}function Ra(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function eO(t){return{data:t,error:null}}function tO(t){const{action_link:e,email_otp:r,hashed_token:s,redirect_to:o,verification_type:l}=t,u=XN(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),d={action_link:e,email_otp:r,hashed_token:s,redirect_to:o,verification_type:l},m=Object.assign({},u);return{data:{properties:d,user:m},error:null}}function nO(t){return t}function rO(t){return t.access_token&&t.refresh_token&&t.expires_in}const Bh=["global","local","others"];var aO=function(t,e){var r={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(r[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,s=Object.getOwnPropertySymbols(t);o<s.length;o++)e.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(t,s[o])&&(r[s[o]]=t[s[o]]);return r};class sO{constructor({url:e="",headers:r={},fetch:s}){this.url=e,this.headers=r,this.fetch=Mx(s),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(e,r=Bh[0]){if(Bh.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Bh.join(", ")}`);try{return await Ue(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(s){if(Ce(s))return{data:null,error:s};throw s}}async inviteUserByEmail(e,r={}){try{return await Ue(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:Ra})}catch(s){if(Ce(s))return{data:{user:null},error:s};throw s}}async generateLink(e){try{const{options:r}=e,s=aO(e,["options"]),o=Object.assign(Object.assign({},s),r);return"newEmail"in s&&(o.new_email=s==null?void 0:s.newEmail,delete o.newEmail),await Ue(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:o,headers:this.headers,xform:tO,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(Ce(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await Ue(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:Ra})}catch(r){if(Ce(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,s,o,l,u,d,m;try{const h={nextPage:null,lastPage:0,total:0},g=await Ue(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(s=(r=e==null?void 0:e.page)===null||r===void 0?void 0:r.toString())!==null&&s!==void 0?s:"",per_page:(l=(o=e==null?void 0:e.perPage)===null||o===void 0?void 0:o.toString())!==null&&l!==void 0?l:""},xform:nO});if(g.error)throw g.error;const v=await g.json(),b=(u=g.headers.get("x-total-count"))!==null&&u!==void 0?u:0,C=(m=(d=g.headers.get("link"))===null||d===void 0?void 0:d.split(","))!==null&&m!==void 0?m:[];return C.length>0&&(C.forEach(x=>{const E=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),T=JSON.parse(x.split(";")[1].split("=")[1]);h[`${T}Page`]=E}),h.total=parseInt(b)),{data:Object.assign(Object.assign({},v),h),error:null}}catch(h){if(Ce(h))return{data:{users:[]},error:h};throw h}}async getUserById(e){Ei(e);try{return await Ue(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Ra})}catch(r){if(Ce(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){Ei(e);try{return await Ue(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:Ra})}catch(s){if(Ce(s))return{data:{user:null},error:s};throw s}}async deleteUser(e,r=!1){Ei(e);
268try{return await Ue(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:Ra})}catch(s){if(Ce(s))return{data:{user:null},error:s};throw s}}async _listFactors(e){Ei(e.userId);try{const{data:r,error:s}=await Ue(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:o=>({data:{factors:o},error:null})});return{data:r,error:s}}catch(r){if(Ce(r))return{data:null,error:r};throw r}}async _deleteFactor(e){Ei(e.userId),Ei(e.id);try{return{data:await Ue(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if(Ce(r))return{data:null,error:r};throw r}}}function Ab(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}function iO(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}const Ci={debug:!!(globalThis&&Ox()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class Dx extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class oO extends Dx{}async function lO(t,e,r){Ci.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const s=new globalThis.AbortController;return e>0&&setTimeout(()=>{s.abort(),Ci.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:s.signal},async o=>{if(o){Ci.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,o.name);try{return await r()}finally{Ci.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,o.name)}}else{if(e===0)throw Ci.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new oO(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(Ci.debug)try{const l=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(l,null," "))}catch(l){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",l)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await r()}}))}iO();const cO={url:bN,storageKey:wN,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:xN,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function kb(t,e,r){return await r()}const Ti={};class pl{constructor(e){var r,s;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=pl.nextInstanceID,pl.nextInstanceID+=1,this.instanceID>0&&Gn()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");const o=Object.assign(Object.assign({},cO),e);if(this.logDebugMessages=!!o.debug,typeof o.debug=="function"&&(this.logger=o.debug),this.persistSession=o.persistSession,this.storageKey=o.storageKey,this.autoRefreshToken=o.autoRefreshToken,this.admin=new sO({url:o.url,headers:o.headers,fetch:o.fetch}),this.url=o.url,this.headers=o.headers,this.fetch=Mx(o.fetch),this.lock=o.lock||kb,this.detectSessionInUrl=o.detectSessionInUrl,this.flowType=o.flowType,this.hasCustomAuthorizationHeader=o.hasCustomAuthorizationHeader,o.lock?this.lock=o.lock:Gn()&&(!((r=globalThis==null?void 0:globalThis.navigator)===null||r===void 0)&&r.locks)?this.lock=lO:this.lock=kb,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?(o.storage?this.storage=o.storage:Ox()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Ab(this.memoryStorage)),o.userStorage&&(this.userStorage=o.userStorage)):(this.memoryStorage={},this.storage=Ab(this.memoryStorage)),Gn()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(l){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",l)}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async l=>{this._debug("received broadcast notification from other tab or client",l),await this._notifyAllSubscribers(l.data.event,l.data.session,!1)})}this.initialize()}get jwks(){var e,r;return(r=(e=Ti[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(e){Ti[this.storageKey]=Object.assign(Object.assign({},Ti[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,r;return(r=(e=Ti[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){Ti[this.storageKey]=Object.assign(Object.assign({},Ti[this.storageKey]),{cachedAt:e})}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${kx}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{const r=zN(window.location.href);let s="none";if(this._isImplicitGrantCallback(r)?s="implicit":await this._isPKCECallback(r)&&(s="pkce"),Gn()&&this.detectSessionInUrl&&s!=="none"){const{data:o,error:l}=await this._getSessionFromURL(r,s);if(l){if(this._debug("#_initialize()","error detecting session from URL",l),AN(l)){const m=(e=l.details)===null||e===void 0?void 0:e.code;if(m==="identity_already_exists"||m==="identity_not_found"||m==="single_identity_not_deletable")return{error:l}}return await this._removeSession(),{error:l}}const{session:u,redirectType:d}=o;return this._debug("#_initialize()","detected session in URL",u,"redirect type",d),await this._saveSession(u),setTimeout(async()=>{d==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",u):await this._notifyAllSubscribers("SIGNED_IN",u)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return Ce(r)?{error:r}:{error:new Rx("Unexpected error during initialization",r)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,s,o;try{const l=await Ue(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(s=(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.data)!==null&&s!==void 0?s:{},gotrue_meta_security:{captcha_token:(o=e==null?void 0:e.options)===null||o===void 0?void 0:o.captchaToken}},xform:Br}),{data:u,error:d}=l;if(d||!u)return{data:{user:null,session:null},error:d};const m=u.session,h=u.user;return u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",m)),{data:{user:h,session:m},error:null}}catch(l){if(Ce(l))return{data:{user:null,session:null},error:l};throw l}}async signUp(e){var r,s,o;try{let l;if("email"in e){const{email:g,password:v,options:b}=e;let C=null,x=null;this.flowType==="pkce"&&([C,x]=await Si(this.storage,this.storageKey)),l=await Ue(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:b==null?void 0:b.emailRedirectTo,body:{email:g,password:v,data:(r=b==null?void 0:b.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:b==null?void 0:b.captchaToken},code_challenge:C,code_challenge_method:x},xform:Br})}else if("phone"in e){const{phone:g,password:v,options:b}=e;l=await Ue(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:g,password:v,data:(s=b==null?void 0:b.data)!==null&&s!==void 0?s:{},channel:(o=b==null?void 0:b.channel)!==null&&o!==void 0?o:"sms",gotrue_meta_security:{captcha_token:b==null?void 0:b.captchaToken}},xform:Br})}else throw new Zc("You must provide either an email or phone number and a password");const{data:u,error:d}=l;if(d||!u)return{data:{user:null,session:null},error:d};const m=u.session,h=u.user;return u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",m)),{data:{user:h,session:m},error:null}}catch(l){if(Ce(l))return{data:{user:null,session:null},error:l};throw l}}async signInWithPassword(e){try{let r;if("email"in e){const{email:l,password:u,options:d}=e;r=await Ue(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:l,password:u,gotrue_meta_security:{captcha_token:d==null?void 0:d.captchaToken}},xform:Tb})}else if("phone"in e){const{phone:l,password:u,options:d}=e;r=await Ue(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:l,password:u,gotrue_meta_security:{captcha_token:d==null?void 0:d.captchaToken}},xform:Tb})}else throw new Zc("You must provide either an email or phone number and a password");const{data:s,error:o}=r;return o?{data:{user:null,session:null},error:o}:!s||!s.session||!s.user?{data:{user:null,session:null},error:new Xc}:(s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),{data:Object.assign({user:s.user,session:s.session},s.weak_password?{weakPassword:s.weak_password}:null),error:o})}catch(r){if(Ce(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOAuth(e){var r,s,o,l;return await this._handleProviderSignIn(e.provider,{redirectTo:(r=e.options)===null||r===void 0?void 0:r.redirectTo,scopes:(s=e.options)===null||s===void 0?void 0:s.scopes,queryParams:(o=e.options)===null||o===void 0?void 0:o.queryParams,skipBrowserRedirect:(l=e.options)===null||l===void 0?void 0:l.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){const{chain:r}=e;if(r==="solana")return await this.signInWithSolana(e);throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}async signInWithSolana(e){var r,s,o,l,u,d,m,h,g,v,b,C;let x,E;if("message"in e)x=e.message,E=e.signature;else{const{chain:T,wallet:k,statement:z,options:O}=e;let Y;if(Gn())if(typeof k=="object")Y=k;else{const re=window;if("solana"in re&&typeof re.solana=="object"&&("signIn"in re.solana&&typeof re.solana.signIn=="function"||"signMessage"in re.solana&&typeof re.solana.signMessage=="function"))Y
268=re.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof k!="object"||!(O!=null&&O.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");Y=k}const K=new URL((r=O==null?void 0:O.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in Y&&Y.signIn){const re=await Y.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},O==null?void 0:O.signInWithSolana),{version:"1",domain:K.host,uri:K.href}),z?{statement:z}:null));let J;if(Array.isArray(re)&&re[0]&&typeof re[0]=="object")J=re[0];else if(re&&typeof re=="object"&&"signedMessage"in re&&"signature"in re)J=re;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in J&&"signature"in J&&(typeof J.signedMessage=="string"||J.signedMessage instanceof Uint8Array)&&J.signature instanceof Uint8Array)x=typeof J.signedMessage=="string"?J.signedMessage:new TextDecoder().decode(J.signedMessage),E=J.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in Y)||typeof Y.signMessage!="function"||!("publicKey"in Y)||typeof Y!="object"||!Y.publicKey||!("toBase58"in Y.publicKey)||typeof Y.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");x=[`${K.host} wants you to sign in with your Solana account:`,Y.publicKey.toBase58(),...z?["",z,""]:[""],"Version: 1",`URI: ${K.href}`,`Issued At: ${(o=(s=O==null?void 0:O.signInWithSolana)===null||s===void 0?void 0:s.issuedAt)!==null&&o!==void 0?o:new Date().toISOString()}`,...!((l=O==null?void 0:O.signInWithSolana)===null||l===void 0)&&l.notBefore?[`Not Before: ${O.signInWithSolana.notBefore}`]:[],...!((u=O==null?void 0:O.signInWithSolana)===null||u===void 0)&&u.expirationTime?[`Expiration Time: ${O.signInWithSolana.expirationTime}`]:[],...!((d=O==null?void 0:O.signInWithSolana)===null||d===void 0)&&d.chainId?[`Chain ID: ${O.signInWithSolana.chainId}`]:[],...!((m=O==null?void 0:O.signInWithSolana)===null||m===void 0)&&m.nonce?[`Nonce: ${O.signInWithSolana.nonce}`]:[],...!((h=O==null?void 0:O.signInWithSolana)===null||h===void 0)&&h.requestId?[`Request ID: ${O.signInWithSolana.requestId}`]:[],...!((v=(g=O==null?void 0:O.signInWithSolana)===null||g===void 0?void 0:g.resources)===null||v===void 0)&&v.length?["Resources",...O.signInWithSolana.resources.map(J=>`- ${J}`)]:[]].join(` 269`);const re=await Y.signMessage(new TextEncoder().encode(x),"utf8");if(!re||!(re instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");E=re}}try{const{data:T,error:k}=await Ue(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:x,signature:DN(E)},!((b=e.options)===null||b===void 0)&&b.captchaToken?{gotrue_meta_security:{captcha_token:(C=e.options)===null||C===void 0?void 0:C.captchaToken}}:null),xform:Br});if(k)throw k;return!T||!T.session||!T.user?{data:{user:null,session:null},error:new Xc}:(T.session&&(await this._saveSession(T.session),await this._notifyAllSubscribers("SIGNED_IN",T.session)),{data:Object.assign({},T),error:k})}catch(T){if(Ce(T))return{data:{user:null,session:null},error:T};throw T}}async _exchangeCodeForSession(e){const r=await cs(this.storage,`${this.storageKey}-code-verifier`),[s,o]=(r??"").split("/");try{const{data:l,error:u}=await Ue(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:s},xform:Br});if(await Ea(this.storage,`${this.storageKey}-code-verifier`),u)throw u;return!l||!l.session||!l.user?{data:{user:null,session:null,redirectType:null},error:new Xc}:(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),{data:Object.assign(Object.assign({},l),{redirectType:o??null}),error:u})}catch(l){if(Ce(l))return{data:{user:null,session:null,redirectType:null},error:l};throw l}}async signInWithIdToken(e){try{const{options:r,provider:s,token:o,access_token:l,nonce:u}=e,d=await Ue(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:s,id_token:o,access_token:l,nonce:u,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:Br}),{data:m,error:h}=d;return h?{data:{user:null,session:null},error:h}:!m||!m.session||!m.user?{data:{user:null,session:null},error:new Xc}:(m.session&&(await this._saveSession(m.session),await this._notifyAllSubscribers("SIGNED_IN",m.session)),{data:m,error:h})}catch(r){if(Ce(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithOtp(e){var r,s,o,l,u;try{if("email"in e){const{email:d,options:m}=e;let h=null,g=null;this.flowType==="pkce"&&([h,g]=await Si(this.storage,this.storageKey));const{error:v}=await Ue(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:d,data:(r=m==null?void 0:m.data)!==null&&r!==void 0?r:{},create_user:(s=m==null?void 0:m.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:m==null?void 0:m.captchaToken},code_challenge:h,code_challenge_method:g},redirectTo:m==null?void 0:m.emailRedirectTo});return{data:{user:null,session:null},error:v}}if("phone"in e){const{phone:d,options:m}=e,{data:h,error:g}=await Ue(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:d,data:(o=m==null?void 0:m.data)!==null&&o!==void 0?o:{},create_user:(l=m==null?void 0:m.shouldCreateUser)!==null&&l!==void 0?l:!0,gotrue_meta_security:{captcha_token:m==null?void 0:m.captchaToken},channel:(u=m==null?void 0:m.channel)!==null&&u!==void 0?u:"sms"}});return{data:{user:null,session:null,messageId:h==null?void 0:h.message_id},error:g}}throw new Zc("You must provide either an email or phone number.")}catch(d){if(Ce(d))return{data:{user:null,session:null},error:d};throw d}}async verifyOtp(e){var r,s;try{let o,l;"options"in e&&(o=(r=e.options)===null||r===void 0?void 0:r.redirectTo,l=(s=e.options)===null||s===void 0?void 0:s.captchaToken);const{data:u,error:d}=await Ue(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:l}}),redirectTo:o,xform:Br});if(d)throw d;if(!u)throw new Error("An error occurred on token verification.");const m=u.session,h=u.user;return m!=null&&m.access_token&&(await this._saveSession(m),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",m)),{data:{user:h,session:m},error:null}}catch(o){if(Ce(o))return{data:{user:null,session:null},error:o};throw o}}async signInWithSSO(e){var r,s,o;try{let l=null,u=null;return this.flowType==="pkce"&&([l,u]=await Si(this.storage,this.storageKey)),await Ue(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(s=(r=e.options)===null||r===void 0?void 0:r.redirectTo)!==null&&s!==void 0?s:void 0}),!((o=e==null?void 0:e.options)===null||o===void 0)&&o.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:l,code_challenge_method:u}),headers:this.headers,xform:eO})}catch(l){if(Ce(l))return{data:null,error:l};throw l}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:r},error:s}=e;if(s)throw s;if(!r)throw new ka;const{error:o}=await Ue(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return{data:{user:null,session:null},error:o}})}catch(e){if(Ce(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{const r=`${this.url}/resend`;if("email"in e){const{email:s,type:o,options:l}=e,{error:u}=await Ue(this.fetch,"POST",r,{headers:this.headers,body:{email:s,type:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},redirectTo:l==null?void 0:l.emailRedirectTo});return{data:{user:null,session:null},error:u}}else if("phone"in e){const{phone:s,type:o,options:l}=e,{data:u,error:d}=await Ue(this.fetch,"POST",r,{headers:this.headers,body:{phone:s,type:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}}});return{data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:d}}throw new Zc("You must provide either an email or phone number and a type")}catch(r){if(Ce(r))return{data:{user:null,session:null},error:r};throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async r=>r))}async _acquireLock(e,r){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const s=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),o=(async()=>(await s,await r()))();return this.pendingInLock.push((async()=>{try{await o}catch{}})()),o}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const s=r();for(this.pendingInLock.push((async()=>{try{await s}catch{}})()),await s;this.pendingInLock.length;){const o=[...this.pendingInLock];await Promise.all(o),this.pendingInLock.splice(0,o.length)}return await s}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await e(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const r=await cs(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?e=r:(this._debug("#getSession()","session from storage is not val
269id"),await this._removeSession())),!e)return{data:{session:null},error:null};const s=e.expires_at?e.expires_at*1e3-Date.now()<Lh:!1;if(this._debug("#__loadSession()",`session has${s?"":" not"} expired`,"expires_at",e.expires_at),!s){if(this.userStorage){const u=await cs(this.userStorage,this.storageKey+"-user");u!=null&&u.user?e.user=u.user:e.user=Ph()}if(this.storage.isServer&&e.user){let u=this.suppressGetSessionWarning;e=new Proxy(e,{get:(m,h,g)=>(!u&&h==="user"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),u=!0,this.suppressGetSessionWarning=!0),Reflect.get(m,h,g))})}return{data:{session:e},error:null}}const{session:o,error:l}=await this._callRefreshToken(e.refresh_token);return l?{data:{session:null},error:l}:{data:{session:o},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await Ue(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:Ra}):await this._useSession(async r=>{var s,o,l;const{data:u,error:d}=r;if(d)throw d;return!(!((s=u.session)===null||s===void 0)&&s.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new ka}:await Ue(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(l=(o=u.session)===null||o===void 0?void 0:o.access_token)!==null&&l!==void 0?l:void 0,xform:Ra})})}catch(r){if(Ce(r))return TN(r)&&(await this._removeSession(),await Ea(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:r};throw r}}async updateUser(e,r={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,r))}async _updateUser(e,r={}){try{return await this._useSession(async s=>{const{data:o,error:l}=s;if(l)throw l;if(!o.session)throw new ka;const u=o.session;let d=null,m=null;this.flowType==="pkce"&&e.email!=null&&([d,m]=await Si(this.storage,this.storageKey));const{data:h,error:g}=await Ue(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:d,code_challenge_method:m}),jwt:u.access_token,xform:Ra});if(g)throw g;return u.user=h.user,await this._saveSession(u),await this._notifyAllSubscribers("USER_UPDATED",u),{data:{user:u.user},error:null}})}catch(s){if(Ce(s))return{data:{user:null},error:s};throw s}}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new ka;const r=Date.now()/1e3;let s=r,o=!0,l=null;const{payload:u}=zh(e.access_token);if(u.exp&&(s=u.exp,o=s<=r),o){const{session:d,error:m}=await this._callRefreshToken(e.refresh_token);if(m)return{data:{user:null,session:null},error:m};if(!d)return{data:{user:null,session:null},error:null};l=d}else{const{data:d,error:m}=await this._getUser(e.access_token);if(m)throw m;l={access_token:e.access_token,refresh_token:e.refresh_token,user:d.user,token_type:"bearer",expires_in:s-r,expires_at:s},await this._saveSession(l),await this._notifyAllSubscribers("SIGNED_IN",l)}return{data:{user:l.user,session:l},error:null}}catch(r){if(Ce(r))return{data:{session:null,user:null},error:r};throw r}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async r=>{var s;if(!e){const{data:u,error:d}=r;if(d)throw d;e=(s=u.session)!==null&&s!==void 0?s:void 0}if(!(e!=null&&e.refresh_token))throw new ka;const{session:o,error:l}=await this._callRefreshToken(e.refresh_token);return l?{data:{user:null,session:null},error:l}:o?{data:{user:o.user,session:o},error:null}:{data:{user:null,session:null},error:null}})}catch(r){if(Ce(r))return{data:{user:null,session:null},error:r};throw r}}async _getSessionFromURL(e,r){try{if(!Gn())throw new Wc("No browser detected.");
269if(e.error||e.error_description||e.error_code)throw new Wc(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new bb("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Wc("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new bb("No code detected.");const{data:z,error:O}=await this._exchangeCodeForSession(e.code);if(O)throw O;const Y=new URL(window.location.href);return Y.searchParams.delete("code"),window.history.replaceState(window.history.state,"",Y.toString()),{data:{session:z.session,redirectType:null},error:null}}const{provider_token:s,provider_refresh_token:o,access_token:l,refresh_token:u,expires_in:d,expires_at:m,token_type:h}=e;if(!l||!d||!u||!h)throw new Wc("No session defined in URL");const g=Math.round(Date.now()/1e3),v=parseInt(d);let b=g+v;m&&(b=parseInt(m));const C=b-g;C*1e3<=ki&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${C}s, should have been closer to ${v}s`);const x=b-v;g-x>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",x,b,g):g-x<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",x,b,g);const{data:E,error:T}=await this._getUser(l);if(T)throw T;const k={provider_token:s,provider_refresh_token:o,access_token:l,expires_in:v,expires_at:b,refresh_token:u,token_type:h,user:E.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:k,redirectType:e.type},error:null}}catch(s){if(Ce(s))return{data:{session:null,redirectType:null},error:s};throw s}}_isImplicitGrantCallback(e){return!!(e.access_token||e.error_description)}async _isPKCECallback(e){const r=await cs(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async r=>{var s;const{data:o,error:l}=r;if(l)return{error:l};const u=(s=o.session)===null||s===void 0?void 0:s.access_token;if(u){const{error:d}=await this.admin.signOut(u,e);if(d&&!(CN(d)&&(d.status===404||d.status===401||d.status===403)))return{error:d}}return e!=="others"&&(await this._removeSession(),await Ea(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(e){const r=UN(),s={id:r,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,s),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:s}}}async _emitInitialSession(e){return await this._useSession(async r=>{var s,o;try{const{data:{session:l},error:u}=r;if(u)throw u;await((s=this.stateChangeEmitters.get(e))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",l)),this._debug("INITIAL_SESSION","callback id",e,"session",l)}catch(l){await((o=this.stateChangeEmitters.get(e))===null||o===void 0?void 0:o.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",l),console.error(l)}})}async resetPasswordForEmail(e,r={}){let s=null,o=null;this.flowType==="pkce"&&([s,o]=await Si(this.storage,this.storageKey,!0));try{return await Ue(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:s,code_challenge_method:o,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(l){if(Ce(l))return{data:null,error:l};throw l}}async getUserIdentities(){var e;try{const{data:r,error:s}=await this.getUser();if(s)throw s;return{data:{identities:(e=r.user.identities)!==null&&e!==void 0?e:[]},error:null}}catch(r){if(Ce(r))return{data:null,error:r};throw r}}async linkIdentity(e){var r;try{const{data:s,error:o}=await this._useSession(async l=>{var u,d,m,h,g;const{data:v,error:b}=l;if(b)throw b;const C=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(u=e.options)===null||u===void 0?void 0:u.redirectTo,scopes:(d=e.options)===null||d===void 0?void 0:d.scopes,queryParams:(m=e.options)===null||m===void 0?void 0:m.queryParams,skipBrowserRedirect:!0});return await Ue(this.fetch,"GET",C,{headers:this.headers,jwt:(g=(h=v.session)===null||h===void 0?void 0:h.access_token)!==null&&g!==void 0?g:void 0})});if(o)throw o;return Gn()&&!(!((r=e.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(s==null?void 0:s.url),{data:{provider:e.provider,url:s==null?void 0:s.url},error:null}}catch(s){if(Ce(s))return{data:{provider:e.provider,url:null},error:s};throw s}}async unlinkIdentity(e){try{return await this._useSession(async r=>{var s,o;const{data:l,error:u}=r;if(u)throw u;
269return await Ue(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(o=(s=l.session)===null||s===void 0?void 0:s.access_token)!==null&&o!==void 0?o:void 0})})}catch(r){if(Ce(r))return{data:null,error:r};throw r}}async _refreshAccessToken(e){const r=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(r,"begin");try{const s=Date.now();return await $N(async o=>(o>0&&await BN(200*Math.pow(2,o-1)),this._debug(r,"refreshing attempt",o),await Ue(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:Br})),(o,l)=>{const u=200*Math.pow(2,o);return l&&Uh(l)&&Date.now()+u-s<ki})}catch(s){if(this._debug(r,"error",s),Ce(s))return{data:{session:null,user:null},error:s};throw s}finally{this._debug(r,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,r){const s=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",r,"url",s),Gn()&&!r.skipBrowserRedirect&&window.location.assign(s),{data:{provider:e,url:s},error:null}}async _recoverAndRefresh(){var e,r;const s="#_recoverAndRefresh()";this._debug(s,"begin");try{const o=await cs(this.storage,this.storageKey);if(o&&this.userStorage){let u=await cs(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!u&&(u={user:o.user},await ji(this.userStorage,this.storageKey+"-user",u)),o.user=(e=u==null?void 0:u.user)!==null&&e!==void 0?e:Ph()}else if(o&&!o.user&&!o.user){const u=await cs(this.storage,this.storageKey+"-user");u&&(u!=null&&u.user)?(o.user=u.user,await Ea(this.storage,this.storageKey+"-user"),await ji(this.storage,this.storageKey,o)):o.user=Ph()}if(this._debug(s,"session from storage",o),!this._isValidSession(o)){this._debug(s,"session is not valid"),o!==null&&await this._removeSession();return}const l=((r=o.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<Lh;if(this._debug(s,`session has${l?"":" not"} expired with margin of ${Lh}s`),l){if(this.autoRefreshToken&&o.refresh_token){const{error:u}=await this._callRefreshToken(o.refresh_token);u&&(console.error(u),Uh(u)||(this._debug(s,"refresh failed with a non-retryable error, removing the session",u),await this._removeSession()))}}else if(o.user&&o.user.__isUserNotAvailableProxy===!0)try{const{data:u,error:d}=await this._getUser(o.access_token);!d&&(u!=null&&u.user)?(o.user=u.user,await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)):this._debug(s,"could not get user data, skipping SIGNED_IN notification")}catch(u){console.error("Error getting user data:",u),this._debug(s,"error getting user data, skipping SIGNED_IN notification",u)}else await this._notifyAllSubscribers("SIGNED_IN",o)}catch(o){this._debug(s,"error",o),console.error(o);return}finally{this._debug(s,"end")}}async _callRefreshToken(e){var r,s;if(!e)throw new ka;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const o=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(o,"begin");try{this.refreshingDeferred=new Hu;const{data:l,error:u}=await this._refreshAccessToken(e);if(u)throw u;if(!l.session)throw new ka;await this._saveSession(l.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",l.session);const d={session:l.session,error:null};return this.refreshingDeferred.resolve(d),d}catch(l){if(this._debug(o,"error",l),Ce(l)){const u={session:null,error:l};return Uh(l)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(u),u}throw(s=this.refreshingDeferred)===null||s===void 0||s.reject(l),l}finally{this.refreshingDeferred=null,this._debug(o,"end")}}async _notifyAllSubscribers(e,r,s=!0){const o=`#_notifyAllSubscribers(${e})`;this._debug(o,"begin",r,`broadcast = ${s}`);try{this.broadcastChannel&&s&&this.broadcastChannel.postMessage({event:e,session:r});const l=[],u=Array.from(this.stateChangeEmitters.values()).map(async d=>{try{await d.callback(e,r)}catch(m){l.push(m)}});if(await Promise.all(u),l.length>0){for(let d=0;d<l.length;d+=1)console.error(l[d]);throw l[0]}}finally{this._debug(o,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0;const r=Object.assign({},e),s=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!s&&r.user&&await ji(this.userStorage,this.storageKey+"-user",{user:r.user});const o=Object.assign({},r);delete o.user;const l=Eb(o);await ji(this.storage,this.storageKey,l)}else{const o=Eb(r);await ji(this.storage,this.storageKey,o)}}async _removeSession(){this._debug("#_removeSession()"),await Ea(this.storage,this.storageKey),await Ea(this.storage,this.storageKey+"-code-verifier"),await Ea(this.storage,this.storageKey+"-user"),this.userStorage&&await Ea(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&Gn()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}
269catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),ki);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async r=>{const{data:{session:s}}=r;if(!s||!s.refresh_token||!s.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const o=Math.floor((s.expires_at*1e3-e)/ki);this._debug("#_autoRefreshTokenTick()",`access token expires in ${o} ticks, a tick lasts ${ki}ms, refresh threshold is ${mm} ticks`),o<=mm&&await this._callRefreshToken(s.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof Dx)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Gn()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const r=`#_onVisibilityChanged(${e})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,r,s){const o=[`provider=${encodeURIComponent(r)}`];if(s!=null&&s.redirectTo&&o.push(`redirect_to=${encodeURIComponent(s.redirectTo)}`),s!=null&&s.scopes&&o.push(`scopes=${encodeURIComponent(s.scopes)}`),this.flowType==="pkce"){const[l,u]=await Si(this.storage,this.storageKey),d=new URLSearchParams({code_challenge:`${encodeURIComponent(l)}`,code_challenge_method:`${encodeURIComponent(u)}`});o.push(d.toString())}if(s!=null&&s.queryParams){const l=new URLSearchParams(s.queryParams);o.push(l.toString())}return s!=null&&s.skipBrowserRedirect&&o.push(`skip_http_redirect=${s.skipBrowserRedirect}`),`${e}?${o.join("&")}`}async _unenroll(e){try{return await this._useSession(async r=>{var s;const{data:o,error:l}=r;return l?{data:null,error:l}:await Ue(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(s=o==null?void 0:o.session)===null||s===void 0?void 0:s.access_token})})}catch(r){if(Ce(r))return{data:null,error:r};throw r}}async _enroll(e){try{return await this._useSession(async r=>{var s,o;const{data:l,error:u}=r;if(u)return{data:null,error:u};const d=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:{issuer:e.issuer}),{data:m,error:h}=await Ue(this.fetch,"POST",`${this.url}/factors`,{body:d,headers:this.headers,jwt:(s=l==null?void 0:l.session)===null||s===void 0?void 0:s.access_token});return h?{data:null,error:h}:(e.factorType==="totp"&&(!((o=m==null?void 0:m.totp)===null||o===void 0)&&o.qr_code)&&(m.totp.qr_code=`data:image/svg+xml;utf-8,${m.totp.qr_code}`),{data:m,error:null})})}catch(r){if(Ce(r))return{data:null,error:r};throw r}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var s;const{data:o,error:l}=r;if(l)return{data:null,error:l};const{data:u,error:d}=await Ue(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:(s=o==null?void 0:o.session)===null||s===void 0?void 0:s.access_token});return d?{data:null,error:d}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+u.expires_in},u)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",u),{data:u,error:d})})}catch(r){if(Ce(r))return{data:null,error:r};throw r}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var s;const{data:o,error:l}=r;return l?{data:null,error:l}:await Ue(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:{channel:e.channel},headers:this.headers,jwt:(s=o==null?void 0:o.session)===null||s===void 0?void 0:s.access_token})})}catch(r){if(Ce(r))return{data:null,error:r};throw r}})}async _challengeAndVerify(e){const{data:r,error:s}=await this._challenge({factorId:e.factorId});return s?{data:null,error:s}:await this._verify({factorId:e.factorId,challengeId:r.id,code:e.code})}async _listFactors(){const{data:{user:e},error:r}=await this.getUser();if(r)return{data:null,error:r};const s=(e==null?void 0:e.factors)||[],o=s.filter(u=>u.factor_type==="totp"&&u.status==="verified"),l=s.filter(u=>u.factor_type==="phone"&&u.status==="verified");return{data:{all:s,totp:o,phone:l},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async e=>{var r,s;const{data:{session:o},error:l}=e;if(l)return{data:null,error:l};if(!o)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:u}=zh(o.access_token);let d=null;u.aal&&(d=u.aal);let m=d;((s=(r=o.user.factors)===null||r===void 0?void 0:r.filter(v=>v.status==="verified"))!==null&&s!==void 0?s:[]).length>0&&(m="aal2");const g=u.amr||[];return{data:{currentLevel:d,nextLevel:m,currentAuthenticationMethods:g},error:null}}))}async fetchJwk(e,r={keys:[]}){let s=r.keys.find(d=>d.kid===e);if(s)return s;const o=Date.now();if(s=this.jwks.keys.find(d=>d.kid===e),s&&this.jwks_cached_at+SN>o)return s;const{data:l,error:u}=await Ue(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(u)throw u;return!l.keys||l.keys.length===0||(this.jwks=l,this.jwks_cached_at=o,s=l.keys.find(d=>d.kid===e),!s)?null:s}async getClaims(e,r={}){try{let s=e;if(!s){const{data:C,error:x}
269=await this.getSession();if(x||!C.session)return{data:null,error:x};s=C.session.access_token}const{header:o,payload:l,signature:u,raw:{header:d,payload:m}}=zh(s);r!=null&&r.allowExpired||YN(l.exp);const h=!o.alg||o.alg.startsWith("HS")||!o.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(o.kid,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!h){const{error:C}=await this.getUser(s);if(C)throw C;return{data:{claims:l,header:o,signature:u},error:null}}const g=FN(o.alg),v=await crypto.subtle.importKey("jwk",h,g,!0,["verify"]);if(!await crypto.subtle.verify(g,v,u,MN(`${d}.${m}`)))throw new vm("Invalid JWT signature");return{data:{claims:l,header:o,signature:u},error:null}}catch(s){if(Ce(s))return{data:null,error:s};throw s}}}pl.nextInstanceID=0;const uO=pl;class fO extends uO{constructor(e){super(e)}}var dO=function(t,e,r,s){function o(l){return l instanceof r?l:new r(function(u){u(l)})}return new(r||(r=Promise))(function(l,u){function d(g){try{h(s.next(g))}catch(v){u(v)}}function m(g){try{h(s.throw(g))}catch(v){u(v)}}function h(g){g.done?l(g.value):o(g.value).then(d,m)}h((s=s.apply(t,e||[])).next())})};class hO{constructor(e,r,s){var o,l,u;if(this.supabaseUrl=e,this.supabaseKey=r,!e)throw new Error("supabaseUrl is required.");if(!r)throw new Error("supabaseKey is required.");const d=vN(e),m=new URL(d);this.realtimeUrl=new URL("realtime/v1",m),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",m),this.storageUrl=new URL("storage/v1",m),this.functionsUrl=new URL("functions/v1",m);const h=`sb-${m.hostname.split(".")[0]}-auth-token`,g={db:cN,realtime:fN,auth:Object.assign(Object.assign({},uN),{storageKey:h}),global:lN},v=yN(s??{},g);this.storageKey=(o=v.auth.storageKey)!==null&&o!==void 0?o:"",this.headers=(l=v.global.headers)!==null&&l!==void 0?l:{},v.accessToken?(this.accessToken=v.accessToken,this.auth=new Proxy({},{get:(b,C)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(C)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((u=v.auth)!==null&&u!==void 0?u:{},this.headers,v.global.fetch),this.fetch=pN(r,this._getAccessToken.bind(this),v.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},v.realtime)),this.rest=new jR(new URL("rest/v1",m).href,{headers:this.headers,schema:v.db.schema,fetch:this.fetch}),this.storage=new sN(this.storageUrl.href,this.headers,this.fetch,s==null?void 0:s.storage),v.accessToken||this._listenForAuthEvents()}get functions(){return new vR(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,r={},s={}){return this.rest.rpc(e,r,s)}channel(e,r={config:{}}){return this.realtime.channel(e,r)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var e,r;return dO(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();const{data:s}=yield this.auth.getSession();return(r=(e=s.session)===null||e===void 0?void 0:e.access_token)!==null&&r!==void 0?r:this.supabaseKey})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:r,detectSessionInUrl:s,storage:o,storageKey:l,flowType:u,lock:d,debug:m},h,g){const v={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new fO({url:this.authUrl.href,headers:Object.assign(Object.assign({},v),h),storageKey:l,autoRefreshToken:e,persistSession:r,detectSessionInUrl:s,storage:o,flowType:u,lock:d,debug:m,fetch:g,hasCustomAuthorizationHeader:"Authorization"in this.headers})}_initRealtimeClient(e){return new VR(this.realtimeUrl.href,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((r,s)=>{this._handleTokenChanged(r,"CLIENT",s==null?void 0:s.access_token)})}_handleTokenChanged(e,r,s){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==s?this.changedAccessToken=s:e==="SIGNED_OUT"&&(this.realtime.setAuth(),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const mO=(t,e,r)=>new hO(t,e,r);function pO(){if(typeof window<"u"||typeof process>"u")return!1;const t=process.version;if(t==null)return!1;const e=t.match(/^v(\d+)\./);return e?parseInt(e[1],10)<=18:!1}pO()&&console.warn("â ï¸ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to N
269ode.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const Ca=mO(N2,O2,{auth:{storage:localStorage,autoRefreshToken:!0,persistSession:!0}});class Ai{static async login(e,r){const{error:s}=await Ca.auth.signInWithPassword({email:e,password:r});if(s)throw s}static async getSession(){const{data:{session:e},error:r}=await Ca.auth.getSession();if(r)throw r;return e}static async loginWithOtp(e){const{error:r}=await Ca.auth.signInWithOtp({email:e});if(r)throw r}static async verifyOtp(e,r){const{data:s,error:o}=await Ca.auth.verifyOtp({email:e,token:r,type:"email"});if(o)throw o;return s}static async loginWithOAuth(e){const{error:r}=await Ca.auth.signInWithOAuth({provider:e,options:{redirectTo:window.location.origin}});if(r)throw r}static async logout(){await Ca.auth.signOut(),Yn.clearAuthToken()}static async resetPassword(e){const{error:r}=await Ca.auth.resetPasswordForEmail(e);if(r)throw r}static async updateProfile(e){const{error:r,data:s}=await Ca.auth.updateUser({data:e});if(r)throw r;return s.user.user_metadata}}const gO=()=>{try{const t=new URLSearchParams(window.location.search),e=new URLSearchParams(window.location.hash.substring(1)),r=t.get("error")||e.get("error"),s=t.get("error_code")||e.get("error_code"),o=t.get("error_description")||e.get("error_description");return r?{error:r,error_code:s,error_description:o,access_token:null}:{error:null,error_code:null,error_description:null,access_token:e.get("access_token")}}catch(t){return console.error("Error parsing URL parameters:",t),{error:"parse_error",error_code:"url_parse_failed",error_description:"Failed to parse URL parameters",access_token:null}}},Jc=t=>{const e=t;return{error:e.message||"Authentication error",error_code:e.code||"",error_description:""}},vO=()=>{const[t,e]=_.useState(null),r=_.useCallback(s=>{e(s),localStorage.setItem("motia-user",JSON.stringify(s))},[]);return _.useEffect(()=>{const s=localStorage.getItem("motia-user");r(s?JSON.parse(s):null)},[r]),[t,r]},yO=({children:t})=>{const[e,r]=vO(),[s,o]=_.useState(!1),[l,u]=_.useState(null),d=fn();_.useEffect(()=>{const E=gO(),T=async()=>{u(null),o(!0);try{const k=await Ai.getSession();if(k){const z=await tb.auth(k.access_token),O=localStorage.getItem("chessarena-redirect");r(z.user),O&&(d(O),localStorage.removeItem("chessarena-redirect"))}}catch(k){console.error("Auth state change error:",k),u(Jc(k))}finally{o(!1)}};if(E.error){u({error:E.error,error_code:E.error_code||"",error_description:E.error_description||""});return}(E.access_token||!Yn.isAuthenticated())&&T()},[d,r]);const m=_.useCallback(async(E,T)=>{o(!0),u(null);try{await Ai.login(E,T)}catch(k){console.error("Login error:",k);const z=k;throw u({error:z.message||"Failed to log in",error_code:z.code||"",error_description:""}),k}finally{o(!1)}},[]),h=_.useCallback(async(E,T)=>{o(!0),u(null);try{const{session:k}=await Ai.verifyOtp(E,T);if(k!=null&&k.access_token){const z=await tb.auth(k.access_token);r(z.user)}}catch(k){console.error("Login error:",k);const z=k;throw u({error:z.message||"Failed to log in",error_code:z.code||"",error_description:""}),k}finally{o(!1)}},[r]),g=_.useCallback(async E=>{u(null),o(!0);try{await Ai.loginWithOtp(E)}catch(T){throw console.error("Magic link error:",T),u(Jc(T)),T}finally{o(!1)}},[]),v=_.useCallback(async E=>{o(!0),u(null);try{await Ai.loginWithOAuth(E)}catch(T){throw console.error("OAuth login error:",T),u(Jc(T)),T}finally{o(!1)}},[]),b=_.useCallback(async()=>{o(!0),u(null);try{await Ai.logout(),r(null)}catch(E){console.error("Logout error:",E),u(Jc(E))}finally{o(!1)}},[r]),C=Yn.isAuthenticated(),x=_.useMemo(()=>({user:e,isAuthenticated:C,isLoading:s,authError:l,login:m,loginWithOtp:g,loginWithOAuth:v,logout:b,verifyOtp:h}),[e,C,s,l,m,g,v,b,h]);return y.jsx(q1.Provider,{value:x,children:t})},an=({children:t,className:e})=>y.jsx("p",{className:ke("font-medium text-white/90 w-full text-justify [&+p]:mt-4",e),children:t}),bO=()=>{const t=fn(),e=()=>t("/");return Da("Privacy Policy"),y.jsx(Ii,{children:y.jsxs(Gi,{children:[y.jsx($i,{onBack:e}),y.jsxs("div",{className:"flex flex-col gap-6",children:[y.jsx(qu,{}),y.jsxs("div",{children:[y.jsx("h2",{className:"text-2xl font-title text-white mb-4",children:"Privacy Policy"}),y.jsxs(an,{children:[y.jsx("strong",{children:"Effective Date:"})," August 16, 2025"]}),y.jsx(an,{children:'Motia ("we," "our," or "us") respects your privacy and is committed to protecting it. This Privacy Policy explains how we
269collect, use, and share information when you use our application.'}),y.jsx("h3",{className:"text-2xl font-title text-white my-4",children:"1. Information We Collect"}),y.jsx(an,{children:"When you sign in to Motia with your Google account, we only request access to the following public information:"}),y.jsxs("ul",{className:"list-disc list-inside text-white ml-4",children:[y.jsx("li",{children:"Name"}),y.jsx("li",{children:"Profile Picture"}),y.jsx("li",{children:"Email Address"})]}),y.jsx("h3",{className:"text-2xl font-title text-white my-4",children:"2. How We Use Your Information"}),y.jsxs(an,{children:[y.jsx("strong",{children:"Name and Profile Picture:"})," Displayed to other users within the app to help identify you."]}),y.jsxs(an,{children:[y.jsx("strong",{children:"Email Address:"})," Kept private and never shared with other users. It may only be used internally for authentication, account management, or to contact you about your account."]}),y.jsxs(an,{children:["We do ",y.jsx("strong",{children:"not"})," collect or request any additional Google account data beyond what is listed above."]}),y.jsx("h3",{className:"text-2xl font-title text-white my-4",children:"3. Data Sharing"}),y.jsxs(an,{children:["We do not sell, rent, or share your personal data with third parties. The only information visible to other users is your ",y.jsx("strong",{children:"name"})," and ",y.jsx("strong",{children:"profile picture"}),". Your"," ",y.jsx("strong",{children:"email address"})," is strictly private and never disclosed to other users."]}),y.jsx("h3",{className:"text-2xl font-title text-white my-4",children:"4. Data Security"}),y.jsx(an,{children:"We implement reasonable technical and organizational measures to protect your information from unauthorized access, loss, or misuse. However, no system is completely secure, and we cannot guarantee absolute protection."}),y.jsx("h3",{className:"text-2xl font-title text-white my-4",children:"5. Your Choices"}),y.jsx(an,{children:"You may disconnect your Google account at any time through your account settings. Doing so will revoke our access to your Google information."}),y.jsxs(an,{children:["If you wish to delete your account and associated data, you may contact us at"," ",y.jsx("strong",{children:"[email protected]"}),"."]}),y.jsx("h3",{className:"text-2xl font-title text-white my-4",children:"6. Childrenâs Privacy"}),y.jsx(an,{children:"Our app is not directed to individuals under 13. We do not knowingly collect personal data from children."}),y.jsx("h3",{className:"text-2xl font-title text-white my-4",children:"7. Changes to This Policy"}),y.jsx(an,{children:"We may update this Privacy Policy from time to time. Any changes will be reflected with a revised âEffective Dateâ at the top of this page."}),y.jsx("h3",{className:"text-2xl font-title text-white my-4",children:"8. Contact Us"}),y.jsx(an,{children:"If you have any questions about this Privacy Policy, please contact us at:"}),y.jsxs(an,{children:[y.jsx("strong",{children:"Email:"})," [email protected]"]})]})]})]})})};function wO(){return y.jsxs(H2,{address:R2,children:[y.jsx(iC,{children:y.jsx(yO,{children:y.jsxs(UE,{children:[y.jsx(Pr,{path:"/",element:y.jsx(Wj,{})}),y.jsx(Pr,{path:"/login",element:y.jsx(fR,{})}),y.jsx(Pr,{path:"/live-matches",element:y.jsx(nR,{})}),y.jsx(Pr,{path:"/new",element:y.jsx(E4,{})}),y.jsx(Pr,{path:"/leaderboard",element:y.jsx(eR,{})}),y.jsx(Pr,{path:"/game/:gameId",element:y.jsx(Qj,{})}),y.jsx(Pr,{path:"/about",element:y.jsx(sR,{})}),y.jsx(Pr,{path:"/privacy-policy",element:y.jsx(bO,{})})]})})}),y.jsx(j2,{})]})}ZS.createRoot(document.getElementById("root")).render(y.jsx(_.StrictMode,{children:y.jsx(wO,{})}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.