diff --git "a/project 2/dist/assets/index-zPcAIS4j.js" "b/project 2/dist/assets/index-zPcAIS4j.js" new file mode 100644--- /dev/null +++ "b/project 2/dist/assets/index-zPcAIS4j.js" @@ -0,0 +1,187 @@ +function H0(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var ze=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function q0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function G0(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var bf={exports:{}},bo={},Pf={exports:{}},$={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Fi=Symbol.for("react.element"),K0=Symbol.for("react.portal"),Q0=Symbol.for("react.fragment"),J0=Symbol.for("react.strict_mode"),Y0=Symbol.for("react.profiler"),X0=Symbol.for("react.provider"),Z0=Symbol.for("react.context"),ey=Symbol.for("react.forward_ref"),ty=Symbol.for("react.suspense"),ny=Symbol.for("react.memo"),ry=Symbol.for("react.lazy"),Mc=Symbol.iterator;function iy(e){return e===null||typeof e!="object"?null:(e=Mc&&e[Mc]||e["@@iterator"],typeof e=="function"?e:null)}var Ef={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Cf=Object.assign,Tf={};function Rr(e,t,n){this.props=e,this.context=t,this.refs=Tf,this.updater=n||Ef}Rr.prototype.isReactComponent={};Rr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Rr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function jf(){}jf.prototype=Rr.prototype;function mu(e,t,n){this.props=e,this.context=t,this.refs=Tf,this.updater=n||Ef}var gu=mu.prototype=new jf;gu.constructor=mu;Cf(gu,Rr.prototype);gu.isPureReactComponent=!0;var Vc=Array.isArray,Af=Object.prototype.hasOwnProperty,yu={current:null},Rf={key:!0,ref:!0,__self:!0,__source:!0};function Of(e,t,n){var r,i={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)Af.call(t,r)&&!Rf.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1>>1,G=T[L];if(0>>1;Li(Wn,D))$ei(gn,Wn)?(T[L]=gn,T[$e]=D,L=$e):(T[L]=Wn,T[ft]=D,L=ft);else if($ei(gn,D))T[L]=gn,T[$e]=D,L=$e;else break e}}return N}function i(T,N){var D=T.sortIndex-N.sortIndex;return D!==0?D:T.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],u=[],c=1,d=null,h=3,f=!1,v=!1,w=!1,_=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function p(T){for(var N=n(u);N!==null;){if(N.callback===null)r(u);else if(N.startTime<=T)r(u),N.sortIndex=N.expirationTime,t(l,N);else break;N=n(u)}}function x(T){if(w=!1,p(T),!v)if(n(l)!==null)v=!0,te(S);else{var N=n(u);N!==null&&Ke(x,N.startTime-T)}}function S(T,N){v=!1,w&&(w=!1,y(C),C=-1),f=!0;var D=h;try{for(p(N),d=n(l);d!==null&&(!(d.expirationTime>N)||T&&!Q());){var L=d.callback;if(typeof L=="function"){d.callback=null,h=d.priorityLevel;var G=L(d.expirationTime<=N);N=e.unstable_now(),typeof G=="function"?d.callback=G:d===n(l)&&r(l),p(N)}else r(l);d=n(l)}if(d!==null)var mn=!0;else{var ft=n(u);ft!==null&&Ke(x,ft.startTime-N),mn=!1}return mn}finally{d=null,h=D,f=!1}}var b=!1,P=null,C=-1,A=5,R=-1;function Q(){return!(e.unstable_now()-RT||125L?(T.sortIndex=D,t(u,T),n(l)===null&&T===n(u)&&(w?(y(C),C=-1):w=!0,Ke(x,D-L))):(T.sortIndex=G,t(l,T),v||f||(v=!0,te(S))),T},e.unstable_shouldYield=Q,e.unstable_wrapCallback=function(T){var N=h;return function(){var D=h;h=N;try{return T.apply(this,arguments)}finally{h=D}}}})(Mf);Df.exports=Mf;var gy=Df.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var yy=k,We=gy;function E(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qa=Object.prototype.hasOwnProperty,vy=/^[: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]*$/,Fc={},Uc={};function wy(e){return Qa.call(Uc,e)?!0:Qa.call(Fc,e)?!1:vy.test(e)?Uc[e]=!0:(Fc[e]=!0,!1)}function xy(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function _y(e,t,n,r){if(t===null||typeof t>"u"||xy(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ae(e,t,n,r,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var ve={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ve[e]=new Ae(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ve[t]=new Ae(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ve[e]=new Ae(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ve[e]=new Ae(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ve[e]=new Ae(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ve[e]=new Ae(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ve[e]=new Ae(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ve[e]=new Ae(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ve[e]=new Ae(e,5,!1,e.toLowerCase(),null,!1,!1)});var xu=/[\-:]([a-z])/g;function _u(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(xu,_u);ve[t]=new Ae(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(xu,_u);ve[t]=new Ae(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(xu,_u);ve[t]=new Ae(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ve[e]=new Ae(e,1,!1,e.toLowerCase(),null,!1,!1)});ve.xlinkHref=new Ae("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ve[e]=new Ae(e,1,!1,e.toLowerCase(),null,!0,!0)});function Su(e,t,n,r){var i=ve.hasOwnProperty(t)?ve[t]:null;(i!==null?i.type!==0:r||!(2a||i[o]!==s[a]){var l=` +`+i[o].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{oa=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Qr(e):""}function Sy(e){switch(e.tag){case 5:return Qr(e.type);case 16:return Qr("Lazy");case 13:return Qr("Suspense");case 19:return Qr("SuspenseList");case 0:case 2:case 15:return e=aa(e.type,!1),e;case 11:return e=aa(e.type.render,!1),e;case 1:return e=aa(e.type,!0),e;default:return""}}function Za(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Xn:return"Fragment";case Yn:return"Portal";case Ja:return"Profiler";case ku:return"StrictMode";case Ya:return"Suspense";case Xa:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ff:return(e.displayName||"Context")+".Consumer";case $f:return(e._context.displayName||"Context")+".Provider";case bu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Pu:return t=e.displayName||null,t!==null?t:Za(e.type)||"Memo";case Ft:t=e._payload,e=e._init;try{return Za(e(t))}catch{}}return null}function ky(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Za(t);case 8:return t===ku?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function on(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Bf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function by(e){var t=Bf(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ts(e){e._valueTracker||(e._valueTracker=by(e))}function zf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Bf(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Fs(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function el(e,t){var n=t.checked;return Z({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function zc(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=on(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Wf(e,t){t=t.checked,t!=null&&Su(e,"checked",t,!1)}function tl(e,t){Wf(e,t);var n=on(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?nl(e,t.type,n):t.hasOwnProperty("defaultValue")&&nl(e,t.type,on(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Wc(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function nl(e,t,n){(t!=="number"||Fs(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Jr=Array.isArray;function fr(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=ns.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function vi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ti={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Py=["Webkit","ms","Moz","O"];Object.keys(ti).forEach(function(e){Py.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ti[t]=ti[e]})});function Kf(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ti.hasOwnProperty(e)&&ti[e]?(""+t).trim():t+"px"}function Qf(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=Kf(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Ey=Z({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function sl(e,t){if(t){if(Ey[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(E(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(E(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(E(61))}if(t.style!=null&&typeof t.style!="object")throw Error(E(62))}}function ol(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var al=null;function Eu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ll=null,pr=null,mr=null;function Gc(e){if(e=zi(e)){if(typeof ll!="function")throw Error(E(280));var t=e.stateNode;t&&(t=jo(t),ll(e.stateNode,e.type,t))}}function Jf(e){pr?mr?mr.push(e):mr=[e]:pr=e}function Yf(){if(pr){var e=pr,t=mr;if(mr=pr=null,Gc(e),t)for(e=0;e>>=0,e===0?32:31-(My(e)/Vy|0)|0}var rs=64,is=4194304;function Yr(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ws(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=Yr(a):(s&=o,s!==0&&(r=Yr(s)))}else o=n&~i,o!==0?r=Yr(o):s!==0&&(r=Yr(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Ui(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ct(t),e[t]=n}function By(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=ri),nd=" ",rd=!1;function yp(e,t){switch(e){case"keyup":return gv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Zn=!1;function vv(e,t){switch(e){case"compositionend":return vp(t);case"keypress":return t.which!==32?null:(rd=!0,nd);case"textInput":return e=t.data,e===nd&&rd?null:e;default:return null}}function wv(e,t){if(Zn)return e==="compositionend"||!Lu&&yp(e,t)?(e=mp(),js=Ru=Gt=null,Zn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ad(n)}}function Sp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Sp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function kp(){for(var e=window,t=Fs();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Fs(e.document)}return t}function Iu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Tv(e){var t=kp(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Sp(n.ownerDocument.documentElement,n)){if(r!==null&&Iu(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=ld(n,s);var o=ld(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,er=null,pl=null,si=null,ml=!1;function ud(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ml||er==null||er!==Fs(r)||(r=er,"selectionStart"in r&&Iu(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),si&&bi(si,r)||(si=r,r=Gs(pl,"onSelect"),0rr||(e.current=_l[rr],_l[rr]=null,rr--)}function z(e,t){rr++,_l[rr]=e.current,e.current=t}var an={},ke=dn(an),Ie=dn(!1),Ln=an;function _r(e,t){var n=e.type.contextTypes;if(!n)return an;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function De(e){return e=e.childContextTypes,e!=null}function Qs(){H(Ie),H(ke)}function gd(e,t,n){if(ke.current!==an)throw Error(E(168));z(ke,t),z(Ie,n)}function Op(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(E(108,ky(e)||"Unknown",i));return Z({},n,r)}function Js(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||an,Ln=ke.current,z(ke,e),z(Ie,Ie.current),!0}function yd(e,t,n){var r=e.stateNode;if(!r)throw Error(E(169));n?(e=Op(e,t,Ln),r.__reactInternalMemoizedMergedChildContext=e,H(Ie),H(ke),z(ke,e)):H(Ie),z(Ie,n)}var kt=null,Ao=!1,_a=!1;function Np(e){kt===null?kt=[e]:kt.push(e)}function Fv(e){Ao=!0,Np(e)}function hn(){if(!_a&&kt!==null){_a=!0;var e=0,t=U;try{var n=kt;for(U=1;e>=o,i-=o,bt=1<<32-ct(t)+i|n<C?(A=P,P=null):A=P.sibling;var R=h(y,P,p[C],x);if(R===null){P===null&&(P=A);break}e&&P&&R.alternate===null&&t(y,P),m=s(R,m,C),b===null?S=R:b.sibling=R,b=R,P=A}if(C===p.length)return n(y,P),K&&xn(y,C),S;if(P===null){for(;CC?(A=P,P=null):A=P.sibling;var Q=h(y,P,R.value,x);if(Q===null){P===null&&(P=A);break}e&&P&&Q.alternate===null&&t(y,P),m=s(Q,m,C),b===null?S=Q:b.sibling=Q,b=Q,P=A}if(R.done)return n(y,P),K&&xn(y,C),S;if(P===null){for(;!R.done;C++,R=p.next())R=d(y,R.value,x),R!==null&&(m=s(R,m,C),b===null?S=R:b.sibling=R,b=R);return K&&xn(y,C),S}for(P=r(y,P);!R.done;C++,R=p.next())R=f(P,y,C,R.value,x),R!==null&&(e&&R.alternate!==null&&P.delete(R.key===null?C:R.key),m=s(R,m,C),b===null?S=R:b.sibling=R,b=R);return e&&P.forEach(function(me){return t(y,me)}),K&&xn(y,C),S}function _(y,m,p,x){if(typeof p=="object"&&p!==null&&p.type===Xn&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case es:e:{for(var S=p.key,b=m;b!==null;){if(b.key===S){if(S=p.type,S===Xn){if(b.tag===7){n(y,b.sibling),m=i(b,p.props.children),m.return=y,y=m;break e}}else if(b.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Ft&&xd(S)===b.type){n(y,b.sibling),m=i(b,p.props),m.ref=zr(y,b,p),m.return=y,y=m;break e}n(y,b);break}else t(y,b);b=b.sibling}p.type===Xn?(m=Rn(p.props.children,y.mode,x,p.key),m.return=y,y=m):(x=Ms(p.type,p.key,p.props,null,y.mode,x),x.ref=zr(y,m,p),x.return=y,y=x)}return o(y);case Yn:e:{for(b=p.key;m!==null;){if(m.key===b)if(m.tag===4&&m.stateNode.containerInfo===p.containerInfo&&m.stateNode.implementation===p.implementation){n(y,m.sibling),m=i(m,p.children||[]),m.return=y,y=m;break e}else{n(y,m);break}else t(y,m);m=m.sibling}m=ja(p,y.mode,x),m.return=y,y=m}return o(y);case Ft:return b=p._init,_(y,m,b(p._payload),x)}if(Jr(p))return v(y,m,p,x);if(Vr(p))return w(y,m,p,x);ds(y,p)}return typeof p=="string"&&p!==""||typeof p=="number"?(p=""+p,m!==null&&m.tag===6?(n(y,m.sibling),m=i(m,p),m.return=y,y=m):(n(y,m),m=Ta(p,y.mode,x),m.return=y,y=m),o(y)):n(y,m)}return _}var kr=Mp(!0),Vp=Mp(!1),Zs=dn(null),eo=null,or=null,$u=null;function Fu(){$u=or=eo=null}function Uu(e){var t=Zs.current;H(Zs),e._currentValue=t}function bl(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function yr(e,t){eo=e,$u=or=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Le=!0),e.firstContext=null)}function tt(e){var t=e._currentValue;if($u!==e)if(e={context:e,memoizedValue:t,next:null},or===null){if(eo===null)throw Error(E(308));or=e,eo.dependencies={lanes:0,firstContext:e}}else or=or.next=e;return t}var Cn=null;function Bu(e){Cn===null?Cn=[e]:Cn.push(e)}function $p(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Bu(t)):(n.next=i.next,i.next=n),t.interleaved=n,Ot(e,r)}function Ot(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ut=!1;function zu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Fp(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ct(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function en(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,F&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Ot(e,n)}return i=r.interleaved,i===null?(t.next=t,Bu(r)):(t.next=i.next,i.next=t),r.interleaved=t,Ot(e,n)}function Rs(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Tu(e,n)}}function _d(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function to(e,t,n,r){var i=e.updateQueue;Ut=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?s=u:o.next=u,o=l;var c=e.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==o&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(s!==null){var d=i.baseState;o=0,c=u=l=null,a=s;do{var h=a.lane,f=a.eventTime;if((r&h)===h){c!==null&&(c=c.next={eventTime:f,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=e,w=a;switch(h=t,f=n,w.tag){case 1:if(v=w.payload,typeof v=="function"){d=v.call(f,d,h);break e}d=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=w.payload,h=typeof v=="function"?v.call(f,d,h):v,h==null)break e;d=Z({},d,h);break e;case 2:Ut=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[a]:h.push(a))}else f={eventTime:f,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=f,l=d):c=c.next=f,o|=h;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;h=a,a=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(c===null&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=c,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);Mn|=o,e.lanes=o,e.memoizedState=d}}function Sd(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=ka.transition;ka.transition={};try{e(!1),t()}finally{U=n,ka.transition=r}}function rm(){return nt().memoizedState}function Wv(e,t,n){var r=nn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},im(e))sm(t,n);else if(n=$p(e,t,n,r),n!==null){var i=Te();dt(n,e,r,i),om(n,t,r)}}function Hv(e,t,n){var r=nn(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(im(e))sm(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,ht(a,o)){var l=t.interleaved;l===null?(i.next=i,Bu(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=$p(e,t,i,r),n!==null&&(i=Te(),dt(n,e,r,i),om(n,t,r))}}function im(e){var t=e.alternate;return e===X||t!==null&&t===X}function sm(e,t){oi=ro=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function om(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Tu(e,n)}}var io={readContext:tt,useCallback:we,useContext:we,useEffect:we,useImperativeHandle:we,useInsertionEffect:we,useLayoutEffect:we,useMemo:we,useReducer:we,useRef:we,useState:we,useDebugValue:we,useDeferredValue:we,useTransition:we,useMutableSource:we,useSyncExternalStore:we,useId:we,unstable_isNewReconciler:!1},qv={readContext:tt,useCallback:function(e,t){return mt().memoizedState=[e,t===void 0?null:t],e},useContext:tt,useEffect:bd,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ns(4194308,4,Xp.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ns(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ns(4,2,e,t)},useMemo:function(e,t){var n=mt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=mt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Wv.bind(null,X,e),[r.memoizedState,e]},useRef:function(e){var t=mt();return e={current:e},t.memoizedState=e},useState:kd,useDebugValue:Yu,useDeferredValue:function(e){return mt().memoizedState=e},useTransition:function(){var e=kd(!1),t=e[0];return e=zv.bind(null,e[1]),mt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=X,i=mt();if(K){if(n===void 0)throw Error(E(407));n=n()}else{if(n=t(),pe===null)throw Error(E(349));Dn&30||Wp(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,bd(qp.bind(null,r,s,e),[e]),r.flags|=2048,Oi(9,Hp.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=mt(),t=pe.identifierPrefix;if(K){var n=Pt,r=bt;n=(r&~(1<<32-ct(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ai++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[gt]=t,e[Ci]=r,gm(e,t,!1,!1),t.stateNode=e;e:{switch(o=ol(n,r),n){case"dialog":W("cancel",e),W("close",e),i=r;break;case"iframe":case"object":case"embed":W("load",e),i=r;break;case"video":case"audio":for(i=0;iEr&&(t.flags|=128,r=!0,Wr(s,!1),t.lanes=4194304)}else{if(!r)if(e=no(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Wr(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!K)return xe(t),null}else 2*ne()-s.renderingStartTime>Er&&n!==1073741824&&(t.flags|=128,r=!0,Wr(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=ne(),t.sibling=null,n=J.current,z(J,r?n&1|2:n&1),t):(xe(t),null);case 22:case 23:return rc(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Fe&1073741824&&(xe(t),t.subtreeFlags&6&&(t.flags|=8192)):xe(t),null;case 24:return null;case 25:return null}throw Error(E(156,t.tag))}function ew(e,t){switch(Mu(t),t.tag){case 1:return De(t.type)&&Qs(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return br(),H(Ie),H(ke),qu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Hu(t),null;case 13:if(H(J),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(E(340));Sr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return H(J),null;case 4:return br(),null;case 10:return Uu(t.type._context),null;case 22:case 23:return rc(),null;case 24:return null;default:return null}}var fs=!1,Se=!1,tw=typeof WeakSet=="function"?WeakSet:Set,j=null;function ar(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ee(e,t,r)}else n.current=null}function Nl(e,t,n){try{n()}catch(r){ee(e,t,r)}}var Id=!1;function nw(e,t){if(gl=Hs,e=kp(),Iu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,u=0,c=0,d=e,h=null;t:for(;;){for(var f;d!==n||i!==0&&d.nodeType!==3||(a=o+i),d!==s||r!==0&&d.nodeType!==3||(l=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(f=d.firstChild)!==null;)h=d,d=f;for(;;){if(d===e)break t;if(h===n&&++u===i&&(a=o),h===s&&++c===r&&(l=o),(f=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=f}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(yl={focusedElem:e,selectionRange:n},Hs=!1,j=t;j!==null;)if(t=j,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,j=e;else for(;j!==null;){t=j;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var w=v.memoizedProps,_=v.memoizedState,y=t.stateNode,m=y.getSnapshotBeforeUpdate(t.elementType===t.type?w:st(t.type,w),_);y.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var p=t.stateNode.containerInfo;p.nodeType===1?p.textContent="":p.nodeType===9&&p.documentElement&&p.removeChild(p.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(E(163))}}catch(x){ee(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,j=e;break}j=t.return}return v=Id,Id=!1,v}function ai(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&Nl(t,n,s)}i=i.next}while(i!==r)}}function No(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ll(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function wm(e){var t=e.alternate;t!==null&&(e.alternate=null,wm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[gt],delete t[Ci],delete t[xl],delete t[Vv],delete t[$v])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function xm(e){return e.tag===5||e.tag===3||e.tag===4}function Dd(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||xm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Il(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ks));else if(r!==4&&(e=e.child,e!==null))for(Il(e,t,n),e=e.sibling;e!==null;)Il(e,t,n),e=e.sibling}function Dl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Dl(e,t,n),e=e.sibling;e!==null;)Dl(e,t,n),e=e.sibling}var ge=null,at=!1;function Mt(e,t,n){for(n=n.child;n!==null;)_m(e,t,n),n=n.sibling}function _m(e,t,n){if(yt&&typeof yt.onCommitFiberUnmount=="function")try{yt.onCommitFiberUnmount(Po,n)}catch{}switch(n.tag){case 5:Se||ar(n,t);case 6:var r=ge,i=at;ge=null,Mt(e,t,n),ge=r,at=i,ge!==null&&(at?(e=ge,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ge.removeChild(n.stateNode));break;case 18:ge!==null&&(at?(e=ge,n=n.stateNode,e.nodeType===8?xa(e.parentNode,n):e.nodeType===1&&xa(e,n),Si(e)):xa(ge,n.stateNode));break;case 4:r=ge,i=at,ge=n.stateNode.containerInfo,at=!0,Mt(e,t,n),ge=r,at=i;break;case 0:case 11:case 14:case 15:if(!Se&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&Nl(n,t,o),i=i.next}while(i!==r)}Mt(e,t,n);break;case 1:if(!Se&&(ar(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){ee(n,t,a)}Mt(e,t,n);break;case 21:Mt(e,t,n);break;case 22:n.mode&1?(Se=(r=Se)||n.memoizedState!==null,Mt(e,t,n),Se=r):Mt(e,t,n);break;default:Mt(e,t,n)}}function Md(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new tw),t.forEach(function(r){var i=dw.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function rt(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=o),r&=~s}if(r=i,r=ne()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*iw(r/1960))-r,10e?16:e,Kt===null)var r=!1;else{if(e=Kt,Kt=null,ao=0,F&6)throw Error(E(331));var i=F;for(F|=4,j=e.current;j!==null;){var s=j,o=s.child;if(j.flags&16){var a=s.deletions;if(a!==null){for(var l=0;lne()-tc?An(e,0):ec|=n),Me(e,t)}function jm(e,t){t===0&&(e.mode&1?(t=is,is<<=1,!(is&130023424)&&(is=4194304)):t=1);var n=Te();e=Ot(e,t),e!==null&&(Ui(e,t,n),Me(e,n))}function cw(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),jm(e,n)}function dw(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(E(314))}r!==null&&r.delete(t),jm(e,n)}var Am;Am=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ie.current)Le=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Le=!1,Xv(e,t,n);Le=!!(e.flags&131072)}else Le=!1,K&&t.flags&1048576&&Lp(t,Xs,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ls(e,t),e=t.pendingProps;var i=_r(t,ke.current);yr(t,n),i=Ku(null,t,r,e,i,n);var s=Qu();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,De(r)?(s=!0,Js(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,zu(t),i.updater=Oo,t.stateNode=i,i._reactInternals=t,El(t,r,e,n),t=jl(null,t,r,!0,s,n)):(t.tag=0,K&&s&&Du(t),Ce(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ls(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=fw(r),e=st(r,e),i){case 0:t=Tl(null,t,r,e,n);break e;case 1:t=Od(null,t,r,e,n);break e;case 11:t=Ad(null,t,r,e,n);break e;case 14:t=Rd(null,t,r,st(r.type,e),n);break e}throw Error(E(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:st(r,i),Tl(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:st(r,i),Od(e,t,r,i,n);case 3:e:{if(fm(t),e===null)throw Error(E(387));r=t.pendingProps,s=t.memoizedState,i=s.element,Fp(e,t),to(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=Pr(Error(E(423)),t),t=Nd(e,t,r,n,i);break e}else if(r!==i){i=Pr(Error(E(424)),t),t=Nd(e,t,r,n,i);break e}else for(Ue=Zt(t.stateNode.containerInfo.firstChild),Be=t,K=!0,ut=null,n=Vp(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Sr(),r===i){t=Nt(e,t,n);break e}Ce(e,t,r,n)}t=t.child}return t;case 5:return Up(t),e===null&&kl(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,vl(r,i)?o=null:s!==null&&vl(r,s)&&(t.flags|=32),hm(e,t),Ce(e,t,o,n),t.child;case 6:return e===null&&kl(t),null;case 13:return pm(e,t,n);case 4:return Wu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=kr(t,null,r,n):Ce(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:st(r,i),Ad(e,t,r,i,n);case 7:return Ce(e,t,t.pendingProps,n),t.child;case 8:return Ce(e,t,t.pendingProps.children,n),t.child;case 12:return Ce(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,z(Zs,r._currentValue),r._currentValue=o,s!==null)if(ht(s.value,o)){if(s.children===i.children&&!Ie.current){t=Nt(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=Ct(-1,n&-n),l.tag=2;var u=s.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),bl(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(E(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),bl(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Ce(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,yr(t,n),i=tt(i),r=r(i),t.flags|=1,Ce(e,t,r,n),t.child;case 14:return r=t.type,i=st(r,t.pendingProps),i=st(r.type,i),Rd(e,t,r,i,n);case 15:return cm(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:st(r,i),Ls(e,t),t.tag=1,De(r)?(e=!0,Js(t)):e=!1,yr(t,n),am(t,r,i),El(t,r,i,n),jl(null,t,r,!0,e,n);case 19:return mm(e,t,n);case 22:return dm(e,t,n)}throw Error(E(156,t.tag))};function Rm(e,t){return ip(e,t)}function hw(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ze(e,t,n,r){return new hw(e,t,n,r)}function sc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function fw(e){if(typeof e=="function")return sc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===bu)return 11;if(e===Pu)return 14}return 2}function rn(e,t){var n=e.alternate;return n===null?(n=Ze(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ms(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")sc(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Xn:return Rn(n.children,i,s,t);case ku:o=8,i|=8;break;case Ja:return e=Ze(12,n,t,i|2),e.elementType=Ja,e.lanes=s,e;case Ya:return e=Ze(13,n,t,i),e.elementType=Ya,e.lanes=s,e;case Xa:return e=Ze(19,n,t,i),e.elementType=Xa,e.lanes=s,e;case Uf:return Io(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case $f:o=10;break e;case Ff:o=9;break e;case bu:o=11;break e;case Pu:o=14;break e;case Ft:o=16,r=null;break e}throw Error(E(130,e==null?e:typeof e,""))}return t=Ze(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function Rn(e,t,n,r){return e=Ze(7,e,r,t),e.lanes=n,e}function Io(e,t,n,r){return e=Ze(22,e,r,t),e.elementType=Uf,e.lanes=n,e.stateNode={isHidden:!1},e}function Ta(e,t,n){return e=Ze(6,e,null,t),e.lanes=n,e}function ja(e,t,n){return t=Ze(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function pw(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ua(0),this.expirationTimes=ua(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ua(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function oc(e,t,n,r,i,s,o,a,l){return e=new pw(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Ze(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},zu(s),e}function mw(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Im)}catch(e){console.error(e)}}Im(),If.exports=qe;var xw=If.exports,Dm,Hd=xw;Dm=Hd.createRoot,Hd.hydrateRoot;/** + * @remix-run/router v1.23.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Li(){return Li=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Mm(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Sw(){return Math.random().toString(36).substr(2,8)}function Gd(e,t){return{usr:e.state,key:e.key,idx:t}}function Ul(e,t,n,r){return n===void 0&&(n=null),Li({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Lr(t):t,{state:n,key:t&&t.key||r||Sw()})}function Vm(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Lr(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function kw(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,a=Qt.Pop,l=null,u=c();u==null&&(u=0,o.replaceState(Li({},o.state,{idx:u}),""));function c(){return(o.state||{idx:null}).idx}function d(){a=Qt.Pop;let _=c(),y=_==null?null:_-u;u=_,l&&l({action:a,location:w.location,delta:y})}function h(_,y){a=Qt.Push;let m=Ul(w.location,_,y);u=c()+1;let p=Gd(m,u),x=w.createHref(m);try{o.pushState(p,"",x)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;i.location.assign(x)}s&&l&&l({action:a,location:w.location,delta:1})}function f(_,y){a=Qt.Replace;let m=Ul(w.location,_,y);u=c();let p=Gd(m,u),x=w.createHref(m);o.replaceState(p,"",x),s&&l&&l({action:a,location:w.location,delta:0})}function v(_){let y=i.location.origin!=="null"?i.location.origin:i.location.href,m=typeof _=="string"?_:Vm(_);return m=m.replace(/ $/,"%20"),le(y,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,y)}let w={get action(){return a},get location(){return e(i,o)},listen(_){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(qd,d),l=_,()=>{i.removeEventListener(qd,d),l=null}},createHref(_){return t(i,_)},createURL:v,encodeLocation(_){let y=v(_);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:h,replace:f,go(_){return o.go(_)}};return w}var Kd;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Kd||(Kd={}));function bw(e,t,n){return n===void 0&&(n="/"),Pw(e,t,n,!1)}function Pw(e,t,n,r){let i=typeof t=="string"?Lr(t):t,s=Um(i.pathname||"/",n);if(s==null)return null;let o=$m(e);Ew(o);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(le(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=On([r,l.relativePath]),c=n.concat(l);s.children&&s.children.length>0&&(le(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),$m(s.children,t,c,u)),!(s.path==null&&!s.index)&&t.push({path:u,score:Nw(u,s.index),routesMeta:c})};return e.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let l of Fm(s.path))i(s,o,l)}),t}function Fm(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=Fm(r.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function Ew(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Lw(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Cw=/^:[\w-]+$/,Tw=3,jw=2,Aw=1,Rw=10,Ow=-2,Qd=e=>e==="*";function Nw(e,t){let n=e.split("/"),r=n.length;return n.some(Qd)&&(r+=Ow),t&&(r+=jw),n.filter(i=>!Qd(i)).reduce((i,s)=>i+(Cw.test(s)?Tw:s===""?Aw:Rw),r)}function Lw(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function Iw(e,t,n){let{routesMeta:r}=e,i={},s="/",o=[];for(let a=0;a{let{paramName:h,isOptional:f}=c;if(h==="*"){let w=a[d]||"";o=s.slice(0,s.length-w.length).replace(/(.)\/+$/,"$1")}const v=a[d];return f&&!v?u[h]=void 0:u[h]=(v||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:o,pattern:e}}function Dw(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Mm(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function Mw(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Mm(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Um(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Vw(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Lr(e):e;return{pathname:n?n.startsWith("/")?n:$w(n,t):t,search:Ww(r),hash:Hw(i)}}function $w(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Aa(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Fw(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Uw(e,t){let n=Fw(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Bw(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Lr(e):(i=Li({},e),le(!i.pathname||!i.pathname.includes("?"),Aa("?","pathname","search",i)),le(!i.pathname||!i.pathname.includes("#"),Aa("#","pathname","hash",i)),le(!i.search||!i.search.includes("#"),Aa("#","search","hash",i)));let s=e===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=n;else{let d=t.length-1;if(!r&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),d-=1;i.pathname=h.join("/")}a=d>=0?t[d]:"/"}let l=Vw(i,a),u=o&&o!=="/"&&o.endsWith("/"),c=(s||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const On=e=>e.join("/").replace(/\/\/+/g,"/"),zw=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Ww=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Hw=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function qw(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Bm=["post","put","patch","delete"];new Set(Bm);const Gw=["get",...Bm];new Set(Gw);/** + * React Router v6.30.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Ii(){return Ii=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),k.useCallback(function(u,c){if(c===void 0&&(c={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let d=Bw(u,JSON.parse(o),s,c.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:On([t,d.pathname])),(c.replace?r.replace:r.push)(d,c.state,c)},[t,r,o,s,e])}function Jw(e,t){return Yw(e,t)}function Yw(e,t,n,r){Bo()||le(!1);let{navigator:i}=k.useContext(Fo),{matches:s}=k.useContext(Ir),o=s[s.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=Wm(),c;if(t){var d;let _=typeof t=="string"?Lr(t):t;l==="/"||(d=_.pathname)!=null&&d.startsWith(l)||le(!1),c=_}else c=u;let h=c.pathname||"/",f=h;if(l!=="/"){let _=l.replace(/^\//,"").split("/");f="/"+h.replace(/^\//,"").split("/").slice(_.length).join("/")}let v=bw(e,{pathname:f}),w=n1(v&&v.map(_=>Object.assign({},_,{params:Object.assign({},a,_.params),pathname:On([l,i.encodeLocation?i.encodeLocation(_.pathname).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?l:On([l,i.encodeLocation?i.encodeLocation(_.pathnameBase).pathname:_.pathnameBase])})),s,n,r);return t&&w?k.createElement(Uo.Provider,{value:{location:Ii({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:Qt.Pop}},w):w}function Xw(){let e=o1(),t=qw(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return k.createElement(k.Fragment,null,k.createElement("h2",null,"Unexpected Application Error!"),k.createElement("h3",{style:{fontStyle:"italic"}},t),n?k.createElement("pre",{style:i},n):null,null)}const Zw=k.createElement(Xw,null);class e1 extends k.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,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?k.createElement(Ir.Provider,{value:this.props.routeContext},k.createElement(zm.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function t1(e){let{routeContext:t,match:n,children:r}=e,i=k.useContext(cc);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),k.createElement(Ir.Provider,{value:t},r)}function n1(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,a=(i=n)==null?void 0:i.errors;if(a!=null){let c=o.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);c>=0||le(!1),o=o.slice(0,Math.min(o.length,c+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let c=0;c=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((c,d,h)=>{let f,v=!1,w=null,_=null;n&&(f=a&&d.route.id?a[d.route.id]:void 0,w=d.route.errorElement||Zw,l&&(u<0&&h===0?(v=!0,_=null):u===h&&(v=!0,_=d.route.hydrateFallbackElement||null)));let y=t.concat(o.slice(0,h+1)),m=()=>{let p;return f?p=w:v?p=_:d.route.Component?p=k.createElement(d.route.Component,null):d.route.element?p=d.route.element:p=c,k.createElement(t1,{match:d,routeContext:{outlet:c,matches:y,isDataRoute:n!=null},children:p})};return n&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?k.createElement(e1,{location:n.location,revalidation:n.revalidation,component:w,error:f,children:m(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):m()},null)}var Gm=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Gm||{}),co=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(co||{});function r1(e){let t=k.useContext(cc);return t||le(!1),t}function i1(e){let t=k.useContext(Kw);return t||le(!1),t}function s1(e){let t=k.useContext(Ir);return t||le(!1),t}function Km(e){let t=s1(),n=t.matches[t.matches.length-1];return n.route.id||le(!1),n.route.id}function o1(){var e;let t=k.useContext(zm),n=i1(co.UseRouteError),r=Km(co.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function a1(){let{router:e}=r1(Gm.UseNavigateStable),t=Km(co.UseNavigateStable),n=k.useRef(!1);return Hm(()=>{n.current=!0}),k.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,Ii({fromRouteId:t},s)))},[e,t])}function l1(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Bl(e){le(!1)}function u1(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Qt.Pop,navigator:s,static:o=!1,future:a}=e;Bo()&&le(!1);let l=t.replace(/^\/*/,"/"),u=k.useMemo(()=>({basename:l,navigator:s,static:o,future:Ii({v7_relativeSplatPath:!1},a)}),[l,a,s,o]);typeof r=="string"&&(r=Lr(r));let{pathname:c="/",search:d="",hash:h="",state:f=null,key:v="default"}=r,w=k.useMemo(()=>{let _=Um(c,l);return _==null?null:{location:{pathname:_,search:d,hash:h,state:f,key:v},navigationType:i}},[l,c,d,h,f,v,i]);return w==null?null:k.createElement(Fo.Provider,{value:u},k.createElement(Uo.Provider,{children:n,value:w}))}function c1(e){let{children:t,location:n}=e;return Jw(zl(t),n)}new Promise(()=>{});function zl(e,t){t===void 0&&(t=[]);let n=[];return k.Children.forEach(e,(r,i)=>{if(!k.isValidElement(r))return;let s=[...t,i];if(r.type===k.Fragment){n.push.apply(n,zl(r.props.children,s));return}r.type!==Bl&&le(!1),!r.props.index||!r.props.children||le(!1);let o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=zl(r.props.children,s)),n.push(o)}),n}/** + * React Router DOM v6.30.1 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */const d1="6";try{window.__reactRouterVersion=d1}catch{}const h1="startTransition",Yd=uy[h1];function f1(e){let{basename:t,children:n,future:r,window:i}=e,s=k.useRef();s.current==null&&(s.current=_w({window:i,v5Compat:!0}));let o=s.current,[a,l]=k.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},c=k.useCallback(d=>{u&&Yd?Yd(()=>l(d)):l(d)},[l,u]);return k.useLayoutEffect(()=>o.listen(c),[o,c]),k.useEffect(()=>l1(r),[r]),k.createElement(u1,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}var Xd;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Xd||(Xd={}));var Zd;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Zd||(Zd={}));const Qm=k.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),zo=k.createContext({}),dc=k.createContext(null),Wo=typeof document<"u",p1=Wo?k.useLayoutEffect:k.useEffect,Jm=k.createContext({strict:!1}),hc=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),m1="framerAppearId",Ym="data-"+hc(m1);function g1(e,t,n,r){const{visualElement:i}=k.useContext(zo),s=k.useContext(Jm),o=k.useContext(dc),a=k.useContext(Qm).reducedMotion,l=k.useRef();r=r||s.renderer,!l.current&&r&&(l.current=r(e,{visualState:t,parent:i,props:n,presenceContext:o,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:a}));const u=l.current;k.useInsertionEffect(()=>{u&&u.update(n,o)});const c=k.useRef(!!(n[Ym]&&!window.HandoffComplete));return p1(()=>{u&&(u.render(),c.current&&u.animationState&&u.animationState.animateChanges())}),k.useEffect(()=>{u&&(u.updateFeatures(),!c.current&&u.animationState&&u.animationState.animateChanges(),c.current&&(c.current=!1,window.HandoffComplete=!0))}),u}function ur(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function y1(e,t,n){return k.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):ur(n)&&(n.current=r))},[t])}function Di(e){return typeof e=="string"||Array.isArray(e)}function Ho(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const fc=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],pc=["initial",...fc];function qo(e){return Ho(e.animate)||pc.some(t=>Di(e[t]))}function Xm(e){return!!(qo(e)||e.variants)}function v1(e,t){if(qo(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Di(n)?n:void 0,animate:Di(r)?r:void 0}}return e.inherit!==!1?t:{}}function w1(e){const{initial:t,animate:n}=v1(e,k.useContext(zo));return k.useMemo(()=>({initial:t,animate:n}),[eh(t),eh(n)])}function eh(e){return Array.isArray(e)?e.join(" "):e}const th={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Mi={};for(const e in th)Mi[e]={isEnabled:t=>th[e].some(n=>!!t[n])};function x1(e){for(const t in e)Mi[t]={...Mi[t],...e[t]}}const Zm=k.createContext({}),eg=k.createContext({}),_1=Symbol.for("motionComponentSymbol");function S1({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&x1(e);function s(a,l){let u;const c={...k.useContext(Qm),...a,layoutId:k1(a)},{isStatic:d}=c,h=w1(a),f=r(a,d);if(!d&&Wo){h.visualElement=g1(i,f,c,t);const v=k.useContext(eg),w=k.useContext(Jm).strict;h.visualElement&&(u=h.visualElement.loadFeatures(c,w,e,v))}return k.createElement(zo.Provider,{value:h},u&&h.visualElement?k.createElement(u,{visualElement:h.visualElement,...c}):null,n(i,a,y1(f,h.visualElement,l),f,d,h.visualElement))}const o=k.forwardRef(s);return o[_1]=i,o}function k1({layoutId:e}){const t=k.useContext(Zm).id;return t&&e!==void 0?t+"-"+e:e}function b1(e){function t(r,i={}){return S1(e(r,i))}if(typeof Proxy>"u")return t;const n=new Map;return new Proxy(t,{get:(r,i)=>(n.has(i)||n.set(i,t(i)),n.get(i))})}const P1=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function mc(e){return typeof e!="string"||e.includes("-")?!1:!!(P1.indexOf(e)>-1||/[A-Z]/.test(e))}const ho={};function E1(e){Object.assign(ho,e)}const Hi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Un=new Set(Hi);function tg(e,{layout:t,layoutId:n}){return Un.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!ho[e]||e==="opacity")}const Ve=e=>!!(e&&e.getVelocity),C1={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},T1=Hi.length;function j1(e,{enableHardwareAcceleration:t=!0,allowTransformNone:n=!0},r,i){let s="";for(let o=0;ot=>typeof t=="string"&&t.startsWith(e),rg=ng("--"),Wl=ng("var(--"),A1=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,R1=(e,t)=>t&&typeof e=="number"?t.transform(e):e,ln=(e,t,n)=>Math.min(Math.max(n,e),t),Bn={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ci={...Bn,transform:e=>ln(0,1,e)},gs={...Bn,default:1},di=e=>Math.round(e*1e5)/1e5,Go=/(-)?([\d]*\.?[\d])+/g,ig=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,O1=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function qi(e){return typeof e=="string"}const Gi=e=>({test:t=>qi(t)&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Vt=Gi("deg"),wt=Gi("%"),O=Gi("px"),N1=Gi("vh"),L1=Gi("vw"),nh={...wt,parse:e=>wt.parse(e)/100,transform:e=>wt.transform(e*100)},rh={...Bn,transform:Math.round},sg={borderWidth:O,borderTopWidth:O,borderRightWidth:O,borderBottomWidth:O,borderLeftWidth:O,borderRadius:O,radius:O,borderTopLeftRadius:O,borderTopRightRadius:O,borderBottomRightRadius:O,borderBottomLeftRadius:O,width:O,maxWidth:O,height:O,maxHeight:O,size:O,top:O,right:O,bottom:O,left:O,padding:O,paddingTop:O,paddingRight:O,paddingBottom:O,paddingLeft:O,margin:O,marginTop:O,marginRight:O,marginBottom:O,marginLeft:O,rotate:Vt,rotateX:Vt,rotateY:Vt,rotateZ:Vt,scale:gs,scaleX:gs,scaleY:gs,scaleZ:gs,skew:Vt,skewX:Vt,skewY:Vt,distance:O,translateX:O,translateY:O,translateZ:O,x:O,y:O,z:O,perspective:O,transformPerspective:O,opacity:ci,originX:nh,originY:nh,originZ:O,zIndex:rh,fillOpacity:ci,strokeOpacity:ci,numOctaves:rh};function gc(e,t,n,r){const{style:i,vars:s,transform:o,transformOrigin:a}=e;let l=!1,u=!1,c=!0;for(const d in t){const h=t[d];if(rg(d)){s[d]=h;continue}const f=sg[d],v=R1(h,f);if(Un.has(d)){if(l=!0,o[d]=v,!c)continue;h!==(f.default||0)&&(c=!1)}else d.startsWith("origin")?(u=!0,a[d]=v):i[d]=v}if(t.transform||(l||r?i.transform=j1(e.transform,n,c,r):i.transform&&(i.transform="none")),u){const{originX:d="50%",originY:h="50%",originZ:f=0}=a;i.transformOrigin=`${d} ${h} ${f}`}}const yc=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function og(e,t,n){for(const r in t)!Ve(t[r])&&!tg(r,n)&&(e[r]=t[r])}function I1({transformTemplate:e},t,n){return k.useMemo(()=>{const r=yc();return gc(r,t,{enableHardwareAcceleration:!n},e),Object.assign({},r.vars,r.style)},[t])}function D1(e,t,n){const r=e.style||{},i={};return og(i,r,e),Object.assign(i,I1(e,t,n)),e.transformValues?e.transformValues(i):i}function M1(e,t,n){const r={},i=D1(e,t,n);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=i,r}const V1=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function fo(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||V1.has(e)}let ag=e=>!fo(e);function $1(e){e&&(ag=t=>t.startsWith("on")?!fo(t):e(t))}try{$1(require("@emotion/is-prop-valid").default)}catch{}function F1(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(ag(i)||n===!0&&fo(i)||!t&&!fo(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function ih(e,t,n){return typeof e=="string"?e:O.transform(t+n*e)}function U1(e,t,n){const r=ih(t,e.x,e.width),i=ih(n,e.y,e.height);return`${r} ${i}`}const B1={offset:"stroke-dashoffset",array:"stroke-dasharray"},z1={offset:"strokeDashoffset",array:"strokeDasharray"};function W1(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?B1:z1;e[s.offset]=O.transform(-r);const o=O.transform(t),a=O.transform(n);e[s.array]=`${o} ${a}`}function vc(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,d,h){if(gc(e,u,c,h),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:v,dimensions:w}=e;f.transform&&(w&&(v.transform=f.transform),delete f.transform),w&&(i!==void 0||s!==void 0||v.transform)&&(v.transformOrigin=U1(w,i!==void 0?i:.5,s!==void 0?s:.5)),t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),o!==void 0&&W1(f,o,a,l,!1)}const lg=()=>({...yc(),attrs:{}}),wc=e=>typeof e=="string"&&e.toLowerCase()==="svg";function H1(e,t,n,r){const i=k.useMemo(()=>{const s=lg();return vc(s,t,{enableHardwareAcceleration:!1},wc(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};og(s,e.style,e),i.style={...s,...i.style}}return i}function q1(e=!1){return(n,r,i,{latestValues:s},o)=>{const l=(mc(n)?H1:M1)(r,s,o,n),c={...F1(r,typeof n=="string",e),...l,ref:i},{children:d}=r,h=k.useMemo(()=>Ve(d)?d.get():d,[d]);return k.createElement(n,{...c,children:h})}}function ug(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}const cg=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function dg(e,t,n,r){ug(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(cg.has(i)?i:hc(i),t.attrs[i])}function xc(e,t){const{style:n}=e,r={};for(const i in n)(Ve(n[i])||t.style&&Ve(t.style[i])||tg(i,e))&&(r[i]=n[i]);return r}function hg(e,t){const n=xc(e,t);for(const r in e)if(Ve(e[r])||Ve(t[r])){const i=Hi.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;n[i]=e[r]}return n}function _c(e,t,n,r={},i={}){return typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"&&(t=t(n!==void 0?n:e.custom,r,i)),t}function G1(e){const t=k.useRef(null);return t.current===null&&(t.current=e()),t.current}const po=e=>Array.isArray(e),K1=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),Q1=e=>po(e)?e[e.length-1]||0:e;function Vs(e){const t=Ve(e)?e.get():e;return K1(t)?t.toValue():t}function J1({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:n},r,i,s){const o={latestValues:Y1(r,i,s,e),renderState:t()};return n&&(o.mount=a=>n(r,a,o)),o}const fg=e=>(t,n)=>{const r=k.useContext(zo),i=k.useContext(dc),s=()=>J1(e,t,r,i);return n?s():G1(s)};function Y1(e,t,n,r){const i={},s=r(e,{});for(const h in s)i[h]=Vs(s[h]);let{initial:o,animate:a}=e;const l=qo(e),u=Xm(e);t&&u&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let c=n?n.initial===!1:!1;c=c||o===!1;const d=c?a:o;return d&&typeof d!="boolean"&&!Ho(d)&&(Array.isArray(d)?d:[d]).forEach(f=>{const v=_c(e,f);if(!v)return;const{transitionEnd:w,transition:_,...y}=v;for(const m in y){let p=y[m];if(Array.isArray(p)){const x=c?p.length-1:0;p=p[x]}p!==null&&(i[m]=p)}for(const m in w)i[m]=w[m]}),i}const re=e=>e;class sh{constructor(){this.order=[],this.scheduled=new Set}add(t){if(!this.scheduled.has(t))return this.scheduled.add(t),this.order.push(t),!0}remove(t){const n=this.order.indexOf(t);n!==-1&&(this.order.splice(n,1),this.scheduled.delete(t))}clear(){this.order.length=0,this.scheduled.clear()}}function X1(e){let t=new sh,n=new sh,r=0,i=!1,s=!1;const o=new WeakSet,a={schedule:(l,u=!1,c=!1)=>{const d=c&&i,h=d?t:n;return u&&o.add(l),h.add(l)&&d&&i&&(r=t.order.length),l},cancel:l=>{n.remove(l),o.delete(l)},process:l=>{if(i){s=!0;return}if(i=!0,[t,n]=[n,t],n.clear(),r=t.order.length,r)for(let u=0;u(d[h]=X1(()=>n=!0),d),{}),o=d=>s[d].process(i),a=()=>{const d=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(d-i.timestamp,Z1),1),i.timestamp=d,i.isProcessing=!0,ys.forEach(o),i.isProcessing=!1,n&&t&&(r=!1,e(a))},l=()=>{n=!0,r=!0,i.isProcessing||e(a)};return{schedule:ys.reduce((d,h)=>{const f=s[h];return d[h]=(v,w=!1,_=!1)=>(n||l(),f.schedule(v,w,_)),d},{}),cancel:d=>ys.forEach(h=>s[h].cancel(d)),state:i,steps:s}}const{schedule:q,cancel:Lt,state:_e,steps:Ra}=ex(typeof requestAnimationFrame<"u"?requestAnimationFrame:re,!0),tx={useVisualState:fg({scrapeMotionValuesFromProps:hg,createRenderState:lg,onMount:(e,t,{renderState:n,latestValues:r})=>{q.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),q.render(()=>{vc(n,r,{enableHardwareAcceleration:!1},wc(t.tagName),e.transformTemplate),dg(t,n)})}})},nx={useVisualState:fg({scrapeMotionValuesFromProps:xc,createRenderState:yc})};function rx(e,{forwardMotionProps:t=!1},n,r){return{...mc(e)?tx:nx,preloadedFeatures:n,useRender:q1(t),createVisualElement:r,Component:e}}function Et(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const pg=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Ko(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}const ix=e=>t=>pg(t)&&e(t,Ko(t));function Tt(e,t,n,r){return Et(e,t,ix(n),r)}const sx=(e,t)=>n=>t(e(n)),sn=(...e)=>e.reduce(sx);function mg(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const oh=mg("dragHorizontal"),ah=mg("dragVertical");function gg(e){let t=!1;if(e==="y")t=ah();else if(e==="x")t=oh();else{const n=oh(),r=ah();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function yg(){const e=gg(!0);return e?(e(),!1):!0}class fn{constructor(t){this.isMounted=!1,this.node=t}update(){}}function lh(e,t){const n="pointer"+(t?"enter":"leave"),r="onHover"+(t?"Start":"End"),i=(s,o)=>{if(s.pointerType==="touch"||yg())return;const a=e.getProps();e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",t),a[r]&&q.update(()=>a[r](s,o))};return Tt(e.current,n,i,{passive:!e.getProps()[r]})}class ox extends fn{mount(){this.unmount=sn(lh(this.node,!0),lh(this.node,!1))}unmount(){}}class ax extends fn{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=sn(Et(this.node.current,"focus",()=>this.onFocus()),Et(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const vg=(e,t)=>t?e===t?!0:vg(e,t.parentElement):!1;function Oa(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,Ko(n))}class lx extends fn{constructor(){super(...arguments),this.removeStartListeners=re,this.removeEndListeners=re,this.removeAccessibleListeners=re,this.startPointerPress=(t,n)=>{if(this.isPressing)return;this.removeEndListeners();const r=this.node.getProps(),s=Tt(window,"pointerup",(a,l)=>{if(!this.checkPressEnd())return;const{onTap:u,onTapCancel:c,globalTapTarget:d}=this.node.getProps();q.update(()=>{!d&&!vg(this.node.current,a.target)?c&&c(a,l):u&&u(a,l)})},{passive:!(r.onTap||r.onPointerUp)}),o=Tt(window,"pointercancel",(a,l)=>this.cancelPress(a,l),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=sn(s,o),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=s=>{if(s.key!=="Enter"||this.isPressing)return;const o=a=>{a.key!=="Enter"||!this.checkPressEnd()||Oa("up",(l,u)=>{const{onTap:c}=this.node.getProps();c&&q.update(()=>c(l,u))})};this.removeEndListeners(),this.removeEndListeners=Et(this.node.current,"keyup",o),Oa("down",(a,l)=>{this.startPress(a,l)})},n=Et(this.node.current,"keydown",t),r=()=>{this.isPressing&&Oa("cancel",(s,o)=>this.cancelPress(s,o))},i=Et(this.node.current,"blur",r);this.removeAccessibleListeners=sn(n,i)}}startPress(t,n){this.isPressing=!0;const{onTapStart:r,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&q.update(()=>r(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!yg()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&q.update(()=>r(t,n))}mount(){const t=this.node.getProps(),n=Tt(t.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),r=Et(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=sn(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const Hl=new WeakMap,Na=new WeakMap,ux=e=>{const t=Hl.get(e.target);t&&t(e)},cx=e=>{e.forEach(ux)};function dx({root:e,...t}){const n=e||document;Na.has(n)||Na.set(n,{});const r=Na.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(cx,{root:e,...t})),r[i]}function hx(e,t,n){const r=dx(t);return Hl.set(e,n),r.observe(e),()=>{Hl.delete(e),r.unobserve(e)}}const fx={some:0,all:1};class px extends fn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:fx[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:c,onViewportLeave:d}=this.node.getProps(),h=u?c:d;h&&h(l)};return hx(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(mx(t,n))&&this.startObserver()}unmount(){}}function mx({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const gx={inView:{Feature:px},tap:{Feature:lx},focus:{Feature:ax},hover:{Feature:ox}};function wg(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;rt[r]=n.get()),t}function vx(e){const t={};return e.values.forEach((n,r)=>t[r]=n.getVelocity()),t}function Qo(e,t,n){const r=e.getProps();return _c(r,t,n!==void 0?n:r.custom,yx(e),vx(e))}let mo=re;const Nn=e=>e*1e3,jt=e=>e/1e3,wx={current:!1},xg=e=>Array.isArray(e)&&typeof e[0]=="number";function _g(e){return!!(!e||typeof e=="string"&&Sg[e]||xg(e)||Array.isArray(e)&&e.every(_g))}const Zr=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Sg={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Zr([0,.65,.55,1]),circOut:Zr([.55,0,1,.45]),backIn:Zr([.31,.01,.66,-.59]),backOut:Zr([.33,1.53,.69,.99])};function kg(e){if(e)return xg(e)?Zr(e):Array.isArray(e)?e.map(kg):Sg[e]}function xx(e,t,n,{delay:r=0,duration:i,repeat:s=0,repeatType:o="loop",ease:a,times:l}={}){const u={[t]:n};l&&(u.offset=l);const c=kg(a);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:r,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}function _x(e,{repeat:t,repeatType:n="loop"}){const r=t&&n!=="loop"&&t%2===1?0:e.length-1;return e[r]}const bg=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,Sx=1e-7,kx=12;function bx(e,t,n,r,i){let s,o,a=0;do o=t+(n-t)/2,s=bg(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>Sx&&++abx(s,0,1,e,n);return s=>s===0||s===1?s:bg(i(s),t,r)}const Px=Ki(.42,0,1,1),Ex=Ki(0,0,.58,1),Pg=Ki(.42,0,.58,1),Cx=e=>Array.isArray(e)&&typeof e[0]!="number",Eg=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Cg=e=>t=>1-e(1-t),Sc=e=>1-Math.sin(Math.acos(e)),Tg=Cg(Sc),Tx=Eg(Sc),jg=Ki(.33,1.53,.69,.99),kc=Cg(jg),jx=Eg(kc),Ax=e=>(e*=2)<1?.5*kc(e):.5*(2-Math.pow(2,-10*(e-1))),uh={linear:re,easeIn:Px,easeInOut:Pg,easeOut:Ex,circIn:Sc,circInOut:Tx,circOut:Tg,backIn:kc,backInOut:jx,backOut:jg,anticipate:Ax},ch=e=>{if(Array.isArray(e)){mo(e.length===4);const[t,n,r,i]=e;return Ki(t,n,r,i)}else if(typeof e=="string")return mo(uh[e]!==void 0),uh[e];return e},bc=(e,t)=>n=>!!(qi(n)&&O1.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t)),Ag=(e,t,n)=>r=>{if(!qi(r))return r;const[i,s,o,a]=r.match(Go);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Rx=e=>ln(0,255,e),La={...Bn,transform:e=>Math.round(Rx(e))},jn={test:bc("rgb","red"),parse:Ag("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+La.transform(e)+", "+La.transform(t)+", "+La.transform(n)+", "+di(ci.transform(r))+")"};function Ox(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const ql={test:bc("#"),parse:Ox,transform:jn.transform},cr={test:bc("hsl","hue"),parse:Ag("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+wt.transform(di(t))+", "+wt.transform(di(n))+", "+di(ci.transform(r))+")"},Ee={test:e=>jn.test(e)||ql.test(e)||cr.test(e),parse:e=>jn.test(e)?jn.parse(e):cr.test(e)?cr.parse(e):ql.parse(e),transform:e=>qi(e)?e:e.hasOwnProperty("red")?jn.transform(e):cr.transform(e)},Y=(e,t,n)=>-n*e+n*t+e;function Ia(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Nx({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,o=0;if(!t)i=s=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=Ia(l,a,e+1/3),s=Ia(l,a,e),o=Ia(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}const Da=(e,t,n)=>{const r=e*e;return Math.sqrt(Math.max(0,n*(t*t-r)+r))},Lx=[ql,jn,cr],Ix=e=>Lx.find(t=>t.test(e));function dh(e){const t=Ix(e);let n=t.parse(e);return t===cr&&(n=Nx(n)),n}const Rg=(e,t)=>{const n=dh(e),r=dh(t),i={...n};return s=>(i.red=Da(n.red,r.red,s),i.green=Da(n.green,r.green,s),i.blue=Da(n.blue,r.blue,s),i.alpha=Y(n.alpha,r.alpha,s),jn.transform(i))};function Dx(e){var t,n;return isNaN(e)&&qi(e)&&(((t=e.match(Go))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(ig))===null||n===void 0?void 0:n.length)||0)>0}const Og={regex:A1,countKey:"Vars",token:"${v}",parse:re},Ng={regex:ig,countKey:"Colors",token:"${c}",parse:Ee.parse},Lg={regex:Go,countKey:"Numbers",token:"${n}",parse:Bn.parse};function Ma(e,{regex:t,countKey:n,token:r,parse:i}){const s=e.tokenised.match(t);s&&(e["num"+n]=s.length,e.tokenised=e.tokenised.replace(t,r),e.values.push(...s.map(i)))}function go(e){const t=e.toString(),n={value:t,tokenised:t,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&Ma(n,Og),Ma(n,Ng),Ma(n,Lg),n}function Ig(e){return go(e).values}function Dg(e){const{values:t,numColors:n,numVars:r,tokenised:i}=go(e),s=t.length;return o=>{let a=i;for(let l=0;ltypeof e=="number"?0:e;function Vx(e){const t=Ig(e);return Dg(e)(t.map(Mx))}const un={test:Dx,parse:Ig,createTransformer:Dg,getAnimatableNone:Vx},Mg=(e,t)=>n=>`${n>0?t:e}`;function Vg(e,t){return typeof e=="number"?n=>Y(e,t,n):Ee.test(e)?Rg(e,t):e.startsWith("var(")?Mg(e,t):Fg(e,t)}const $g=(e,t)=>{const n=[...e],r=n.length,i=e.map((s,o)=>Vg(s,t[o]));return s=>{for(let o=0;o{const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Vg(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}},Fg=(e,t)=>{const n=un.createTransformer(t),r=go(e),i=go(t);return r.numVars===i.numVars&&r.numColors===i.numColors&&r.numNumbers>=i.numNumbers?sn($g(r.values,i.values),n):Mg(e,t)},Vi=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},hh=(e,t)=>n=>Y(e,t,n);function Fx(e){return typeof e=="number"?hh:typeof e=="string"?Ee.test(e)?Rg:Fg:Array.isArray(e)?$g:typeof e=="object"?$x:hh}function Ux(e,t,n){const r=[],i=n||Fx(e[0]),s=e.length-1;for(let o=0;ot[0];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=Ux(t,r,i),a=o.length,l=u=>{let c=0;if(a>1)for(;cl(ln(e[0],e[s-1],u)):l}function Bx(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Vi(0,t,r);e.push(Y(n,1,i))}}function zx(e){const t=[0];return Bx(t,e.length-1),t}function Wx(e,t){return e.map(n=>n*t)}function Hx(e,t){return e.map(()=>t||Pg).splice(0,e.length-1)}function yo({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=Cx(r)?r.map(ch):ch(r),s={done:!1,value:t[0]},o=Wx(n&&n.length===t.length?n:zx(t),e),a=Ug(o,t,{ease:Array.isArray(i)?i:Hx(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}function Bg(e,t){return t?e*(1e3/t):0}const qx=5;function zg(e,t,n){const r=Math.max(t-qx,0);return Bg(n-e(r),t-r)}const Va=.001,Gx=.01,Kx=10,Qx=.05,Jx=1;function Yx({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,s,o=1-t;o=ln(Qx,Jx,o),e=ln(Gx,Kx,jt(e)),o<1?(i=u=>{const c=u*o,d=c*e,h=c-n,f=Gl(u,o),v=Math.exp(-d);return Va-h/f*v},s=u=>{const d=u*o*e,h=d*n+n,f=Math.pow(o,2)*Math.pow(u,2)*e,v=Math.exp(-d),w=Gl(Math.pow(u,2),o);return(-i(u)+Va>0?-1:1)*((h-f)*v)/w}):(i=u=>{const c=Math.exp(-u*e),d=(u-n)*e+1;return-Va+c*d},s=u=>{const c=Math.exp(-u*e),d=(n-u)*(e*e);return c*d});const a=5/e,l=Zx(i,s,a);if(e=Nn(e),isNaN(l))return{stiffness:100,damping:10,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const Xx=12;function Zx(e,t,n){let r=n;for(let i=1;ie[n]!==void 0)}function n_(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!fh(e,t_)&&fh(e,e_)){const n=Yx(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}function Wg({keyframes:e,restDelta:t,restSpeed:n,...r}){const i=e[0],s=e[e.length-1],o={done:!1,value:i},{stiffness:a,damping:l,mass:u,duration:c,velocity:d,isResolvedFromDuration:h}=n_({...r,velocity:-jt(r.velocity||0)}),f=d||0,v=l/(2*Math.sqrt(a*u)),w=s-i,_=jt(Math.sqrt(a/u)),y=Math.abs(w)<5;n||(n=y?.01:2),t||(t=y?.005:.5);let m;if(v<1){const p=Gl(_,v);m=x=>{const S=Math.exp(-v*_*x);return s-S*((f+v*_*w)/p*Math.sin(p*x)+w*Math.cos(p*x))}}else if(v===1)m=p=>s-Math.exp(-_*p)*(w+(f+_*w)*p);else{const p=_*Math.sqrt(v*v-1);m=x=>{const S=Math.exp(-v*_*x),b=Math.min(p*x,300);return s-S*((f+v*_*w)*Math.sinh(b)+p*w*Math.cosh(b))/p}}return{calculatedDuration:h&&c||null,next:p=>{const x=m(p);if(h)o.done=p>=c;else{let S=f;p!==0&&(v<1?S=zg(m,p,x):S=0);const b=Math.abs(S)<=n,P=Math.abs(s-x)<=t;o.done=b&&P}return o.value=o.done?s:x,o}}}function ph({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const d=e[0],h={done:!1,value:d},f=C=>a!==void 0&&Cl,v=C=>a===void 0?l:l===void 0||Math.abs(a-C)-w*Math.exp(-C/r),p=C=>y+m(C),x=C=>{const A=m(C),R=p(C);h.done=Math.abs(A)<=u,h.value=h.done?y:R};let S,b;const P=C=>{f(h.value)&&(S=C,b=Wg({keyframes:[h.value,v(h.value)],velocity:zg(p,C,h.value),damping:i,stiffness:s,restDelta:u,restSpeed:c}))};return P(0),{calculatedDuration:null,next:C=>{let A=!1;return!b&&S===void 0&&(A=!0,x(C),P(C)),S!==void 0&&C>S?b.next(C-S):(!A&&x(C),h)}}}const r_=e=>{const t=({timestamp:n})=>e(n);return{start:()=>q.update(t,!0),stop:()=>Lt(t),now:()=>_e.isProcessing?_e.timestamp:performance.now()}},mh=2e4;function gh(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t=mh?1/0:t}const i_={decay:ph,inertia:ph,tween:yo,keyframes:yo,spring:Wg};function vo({autoplay:e=!0,delay:t=0,driver:n=r_,keyframes:r,type:i="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:a="loop",onPlay:l,onStop:u,onComplete:c,onUpdate:d,...h}){let f=1,v=!1,w,_;const y=()=>{_=new Promise(L=>{w=L})};y();let m;const p=i_[i]||yo;let x;p!==yo&&typeof r[0]!="number"&&(x=Ug([0,100],r,{clamp:!1}),r=[0,100]);const S=p({...h,keyframes:r});let b;a==="mirror"&&(b=p({...h,keyframes:[...r].reverse(),velocity:-(h.velocity||0)}));let P="idle",C=null,A=null,R=null;S.calculatedDuration===null&&s&&(S.calculatedDuration=gh(S));const{calculatedDuration:Q}=S;let me=1/0,be=1/0;Q!==null&&(me=Q+o,be=me*(s+1)-o);let ce=0;const Dt=L=>{if(A===null)return;f>0&&(A=Math.min(A,L)),f<0&&(A=Math.min(L-be/f,A)),C!==null?ce=C:ce=Math.round(L-A)*f;const G=ce-t*(f>=0?1:-1),mn=f>=0?G<0:G>be;ce=Math.max(G,0),P==="finished"&&C===null&&(ce=be);let ft=ce,Wn=S;if(s){const ra=Math.min(ce,be)/me;let Xi=Math.floor(ra),yn=ra%1;!yn&&ra>=1&&(yn=1),yn===1&&Xi--,Xi=Math.min(Xi,s+1),!!(Xi%2)&&(a==="reverse"?(yn=1-yn,o&&(yn-=o/me)):a==="mirror"&&(Wn=b)),ft=ln(0,1,yn)*me}const $e=mn?{done:!1,value:r[0]}:Wn.next(ft);x&&($e.value=x($e.value));let{done:gn}=$e;!mn&&Q!==null&&(gn=f>=0?ce>=be:ce<=0);const W0=C===null&&(P==="finished"||P==="running"&&gn);return d&&d($e.value),W0&&T(),$e},te=()=>{m&&m.stop(),m=void 0},Ke=()=>{P="idle",te(),w(),y(),A=R=null},T=()=>{P="finished",c&&c(),te(),w()},N=()=>{if(v)return;m||(m=n(Dt));const L=m.now();l&&l(),C!==null?A=L-C:(!A||P==="finished")&&(A=L),P==="finished"&&y(),R=A,C=null,P="running",m.start()};e&&N();const D={then(L,G){return _.then(L,G)},get time(){return jt(ce)},set time(L){L=Nn(L),ce=L,C!==null||!m||f===0?C=L:A=m.now()-L/f},get duration(){const L=S.calculatedDuration===null?gh(S):S.calculatedDuration;return jt(L)},get speed(){return f},set speed(L){L===f||!m||(f=L,D.time=jt(ce))},get state(){return P},play:N,pause:()=>{P="paused",C=ce},stop:()=>{v=!0,P!=="idle"&&(P="idle",u&&u(),Ke())},cancel:()=>{R!==null&&Dt(R),Ke()},complete:()=>{P="finished"},sample:L=>(A=0,Dt(L))};return D}function s_(e){let t;return()=>(t===void 0&&(t=e()),t)}const o_=s_(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),a_=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),vs=10,l_=2e4,u_=(e,t)=>t.type==="spring"||e==="backgroundColor"||!_g(t.ease);function c_(e,t,{onUpdate:n,onComplete:r,...i}){if(!(o_()&&a_.has(t)&&!i.repeatDelay&&i.repeatType!=="mirror"&&i.damping!==0&&i.type!=="inertia"))return!1;let o=!1,a,l,u=!1;const c=()=>{l=new Promise(p=>{a=p})};c();let{keyframes:d,duration:h=300,ease:f,times:v}=i;if(u_(t,i)){const p=vo({...i,repeat:0,delay:0});let x={done:!1,value:d[0]};const S=[];let b=0;for(;!x.done&&b{u=!1,w.cancel()},y=()=>{u=!0,q.update(_),a(),c()};return w.onfinish=()=>{u||(e.set(_x(d,i)),r&&r(),y())},{then(p,x){return l.then(p,x)},attachTimeline(p){return w.timeline=p,w.onfinish=null,re},get time(){return jt(w.currentTime||0)},set time(p){w.currentTime=Nn(p)},get speed(){return w.playbackRate},set speed(p){w.playbackRate=p},get duration(){return jt(h)},play:()=>{o||(w.play(),Lt(_))},pause:()=>w.pause(),stop:()=>{if(o=!0,w.playState==="idle")return;const{currentTime:p}=w;if(p){const x=vo({...i,autoplay:!1});e.setWithVelocity(x.sample(p-vs).value,x.sample(p).value,vs)}y()},complete:()=>{u||w.finish()},cancel:y}}function d_({keyframes:e,delay:t,onUpdate:n,onComplete:r}){const i=()=>(n&&n(e[e.length-1]),r&&r(),{time:0,speed:1,duration:0,play:re,pause:re,stop:re,then:s=>(s(),Promise.resolve()),cancel:re,complete:re});return t?vo({keyframes:[0,1],duration:0,delay:t,onComplete:i}):i()}const h_={type:"spring",stiffness:500,damping:25,restSpeed:10},f_=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),p_={type:"keyframes",duration:.8},m_={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},g_=(e,{keyframes:t})=>t.length>2?p_:Un.has(e)?e.startsWith("scale")?f_(t[1]):h_:m_,Kl=(e,t)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(un.test(t)||t==="0")&&!t.startsWith("url(")),y_=new Set(["brightness","contrast","saturate","opacity"]);function v_(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Go)||[];if(!r)return e;const i=n.replace(r,"");let s=y_.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const w_=/([a-z-]*)\(.*?\)/g,Ql={...un,getAnimatableNone:e=>{const t=e.match(w_);return t?t.map(v_).join(" "):e}},x_={...sg,color:Ee,backgroundColor:Ee,outlineColor:Ee,fill:Ee,stroke:Ee,borderColor:Ee,borderTopColor:Ee,borderRightColor:Ee,borderBottomColor:Ee,borderLeftColor:Ee,filter:Ql,WebkitFilter:Ql},Pc=e=>x_[e];function Hg(e,t){let n=Pc(e);return n!==Ql&&(n=un),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const qg=e=>/^0[^.\s]+$/.test(e);function __(e){if(typeof e=="number")return e===0;if(e!==null)return e==="none"||e==="0"||qg(e)}function S_(e,t,n,r){const i=Kl(t,n);let s;Array.isArray(n)?s=[...n]:s=[null,n];const o=r.from!==void 0?r.from:e.get();let a;const l=[];for(let u=0;ui=>{const s=Ec(r,e)||{},o=s.delay||r.delay||0;let{elapsed:a=0}=r;a=a-Nn(o);const l=S_(t,e,n,s),u=l[0],c=l[l.length-1],d=Kl(e,u),h=Kl(e,c);let f={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...s,delay:-a,onUpdate:v=>{t.set(v),s.onUpdate&&s.onUpdate(v)},onComplete:()=>{i(),s.onComplete&&s.onComplete()}};if(k_(s)||(f={...f,...g_(e,f)}),f.duration&&(f.duration=Nn(f.duration)),f.repeatDelay&&(f.repeatDelay=Nn(f.repeatDelay)),!d||!h||wx.current||s.type===!1||b_.skipAnimations)return d_(f);if(!r.isHandoff&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){const v=c_(t,e,f);if(v)return v}return vo(f)};function wo(e){return!!(Ve(e)&&e.add)}const Gg=e=>/^\-?\d*\.?\d+$/.test(e);function Tc(e,t){e.indexOf(t)===-1&&e.push(t)}function jc(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class Ac{constructor(){this.subscriptions=[]}add(t){return Tc(this.subscriptions,t),()=>jc(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s!isNaN(parseFloat(e));class E_{constructor(t,n={}){this.version="10.18.0",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(r,i=!0)=>{this.prev=this.current,this.current=r;const{delta:s,timestamp:o}=_e;this.lastUpdated!==o&&(this.timeDelta=s,this.lastUpdated=o,q.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>q.postRender(this.velocityCheck),this.velocityCheck=({timestamp:r})=>{r!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=P_(this.current),this.owner=n.owner}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Ac);const r=this.events[t].add(n);return t==="change"?()=>{r(),q.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=t,this.timeDelta=r}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?Bg(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Cr(e,t){return new E_(e,t)}const Kg=e=>t=>t.test(e),C_={test:e=>e==="auto",parse:e=>e},Qg=[Bn,O,wt,Vt,L1,N1,C_],qr=e=>Qg.find(Kg(e)),T_=[...Qg,Ee,un],j_=e=>T_.find(Kg(e));function A_(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Cr(n))}function R_(e,t){const n=Qo(e,t);let{transitionEnd:r={},transition:i={},...s}=n?e.makeTargetAnimatable(n,!1):{};s={...s,...r};for(const o in s){const a=Q1(s[o]);A_(e,o,a)}}function O_(e,t,n){var r,i;const s=Object.keys(t).filter(a=>!e.hasValue(a)),o=s.length;if(o)for(let a=0;al.remove(d))),u.push(_)}return o&&Promise.all(u).then(()=>{o&&R_(e,o)}),u}function Jl(e,t,n={}){const r=Qo(e,t,n.custom);let{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);const s=r?()=>Promise.all(Jg(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:c,staggerDirection:d}=i;return M_(e,t,u+l,c,d,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[l,u]=a==="beforeChildren"?[s,o]:[o,s];return l().then(()=>u())}else return Promise.all([s(),o(n.delay)])}function M_(e,t,n=0,r=0,i=1,s){const o=[],a=(e.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>a-u*r;return Array.from(e.variantChildren).sort(V_).forEach((u,c)=>{u.notify("AnimationStart",t),o.push(Jl(u,t,{...s,delay:n+l(c)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(o)}function V_(e,t){return e.sortNodePosition(t)}function $_(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>Jl(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=Jl(e,t,n);else{const i=typeof t=="function"?Qo(e,t,n.custom):t;r=Promise.all(Jg(e,i,n))}return r.then(()=>e.notify("AnimationComplete",t))}const F_=[...fc].reverse(),U_=fc.length;function B_(e){return t=>Promise.all(t.map(({animation:n,options:r})=>$_(e,n,r)))}function z_(e){let t=B_(e);const n=H_();let r=!0;const i=(l,u)=>{const c=Qo(e,u);if(c){const{transition:d,transitionEnd:h,...f}=c;l={...l,...f,...h}}return l};function s(l){t=l(e)}function o(l,u){const c=e.getProps(),d=e.getVariantContext(!0)||{},h=[],f=new Set;let v={},w=1/0;for(let y=0;yw&&S,R=!1;const Q=Array.isArray(x)?x:[x];let me=Q.reduce(i,{});b===!1&&(me={});const{prevResolvedValues:be={}}=p,ce={...be,...me},Dt=te=>{A=!0,f.has(te)&&(R=!0,f.delete(te)),p.needsAnimating[te]=!0};for(const te in ce){const Ke=me[te],T=be[te];if(v.hasOwnProperty(te))continue;let N=!1;po(Ke)&&po(T)?N=!wg(Ke,T):N=Ke!==T,N?Ke!==void 0?Dt(te):f.add(te):Ke!==void 0&&f.has(te)?Dt(te):p.protectedKeys[te]=!0}p.prevProp=x,p.prevResolvedValues=me,p.isActive&&(v={...v,...me}),r&&e.blockInitialAnimation&&(A=!1),A&&(!P||R)&&h.push(...Q.map(te=>({animation:te,options:{type:m,...l}})))}if(f.size){const y={};f.forEach(m=>{const p=e.getBaseTarget(m);p!==void 0&&(y[m]=p)}),h.push({animation:y})}let _=!!h.length;return r&&(c.initial===!1||c.initial===c.animate)&&!e.manuallyAnimateOnMount&&(_=!1),r=!1,_?t(h):Promise.resolve()}function a(l,u,c){var d;if(n[l].isActive===u)return Promise.resolve();(d=e.variantChildren)===null||d===void 0||d.forEach(f=>{var v;return(v=f.animationState)===null||v===void 0?void 0:v.setActive(l,u)}),n[l].isActive=u;const h=o(c,l);for(const f in n)n[f].protectedKeys={};return h}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n}}function W_(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!wg(t,e):!1}function vn(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function H_(){return{animate:vn(!0),whileInView:vn(),whileHover:vn(),whileTap:vn(),whileDrag:vn(),whileFocus:vn(),exit:vn()}}class q_ extends fn{constructor(t){super(t),t.animationState||(t.animationState=z_(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),Ho(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let G_=0;class K_ extends fn{constructor(){super(...arguments),this.id=G_++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n,custom:r}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const s=this.node.animationState.setActive("exit",!t,{custom:r??this.node.getProps().custom});n&&!t&&s.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const Q_={animation:{Feature:q_},exit:{Feature:K_}},yh=(e,t)=>Math.abs(e-t);function J_(e,t){const n=yh(e.x,t.x),r=yh(e.y,t.y);return Math.sqrt(n**2+r**2)}class Yg{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=Fa(this.lastMoveEventInfo,this.history),h=this.startEvent!==null,f=J_(d.offset,{x:0,y:0})>=3;if(!h&&!f)return;const{point:v}=d,{timestamp:w}=_e;this.history.push({...v,timestamp:w});const{onStart:_,onMove:y}=this.handlers;h||(_&&_(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),y&&y(this.lastMoveEvent,d)},this.handlePointerMove=(d,h)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=$a(h,this.transformPagePoint),q.update(this.updatePoint,!0)},this.handlePointerUp=(d,h)=>{this.end();const{onEnd:f,onSessionEnd:v,resumeAnimation:w}=this.handlers;if(this.dragSnapToOrigin&&w&&w(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const _=Fa(d.type==="pointercancel"?this.lastMoveEventInfo:$a(h,this.transformPagePoint),this.history);this.startEvent&&f&&f(d,_),v&&v(d,_)},!pg(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=Ko(t),a=$a(o,this.transformPagePoint),{point:l}=a,{timestamp:u}=_e;this.history=[{...l,timestamp:u}];const{onSessionStart:c}=n;c&&c(t,Fa(a,this.history)),this.removeListeners=sn(Tt(this.contextWindow,"pointermove",this.handlePointerMove),Tt(this.contextWindow,"pointerup",this.handlePointerUp),Tt(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Lt(this.updatePoint)}}function $a(e,t){return t?{point:t(e.point)}:e}function vh(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Fa({point:e},t){return{point:e,delta:vh(e,Xg(t)),offset:vh(e,Y_(t)),velocity:X_(t,.1)}}function Y_(e){return e[0]}function Xg(e){return e[e.length-1]}function X_(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=Xg(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Nn(t)));)n--;if(!r)return{x:0,y:0};const s=jt(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function He(e){return e.max-e.min}function Yl(e,t=0,n=.01){return Math.abs(e-t)<=n}function wh(e,t,n,r=.5){e.origin=r,e.originPoint=Y(t.min,t.max,e.origin),e.scale=He(n)/He(t),(Yl(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=Y(n.min,n.max,e.origin)-e.originPoint,(Yl(e.translate)||isNaN(e.translate))&&(e.translate=0)}function hi(e,t,n,r){wh(e.x,t.x,n.x,r?r.originX:void 0),wh(e.y,t.y,n.y,r?r.originY:void 0)}function xh(e,t,n){e.min=n.min+t.min,e.max=e.min+He(t)}function Z_(e,t,n){xh(e.x,t.x,n.x),xh(e.y,t.y,n.y)}function _h(e,t,n){e.min=t.min-n.min,e.max=e.min+He(t)}function fi(e,t,n){_h(e.x,t.x,n.x),_h(e.y,t.y,n.y)}function eS(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?Y(n,e,r.max):Math.min(e,n)),e}function Sh(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function tS(e,{top:t,left:n,bottom:r,right:i}){return{x:Sh(e.x,n,i),y:Sh(e.y,t,r)}}function kh(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Vi(t.min,t.max-r,e.min):r>i&&(n=Vi(e.min,e.max-i,t.min)),ln(0,1,n)}function iS(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Xl=.35;function sS(e=Xl){return e===!1?e=0:e===!0&&(e=Xl),{x:bh(e,"left","right"),y:bh(e,"top","bottom")}}function bh(e,t,n){return{min:Ph(e,t),max:Ph(e,n)}}function Ph(e,t){return typeof e=="number"?e:e[t]||0}const Eh=()=>({translate:0,scale:1,origin:0,originPoint:0}),dr=()=>({x:Eh(),y:Eh()}),Ch=()=>({min:0,max:0}),ie=()=>({x:Ch(),y:Ch()});function Je(e){return[e("x"),e("y")]}function Zg({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function oS({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function aS(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Ua(e){return e===void 0||e===1}function Zl({scale:e,scaleX:t,scaleY:n}){return!Ua(e)||!Ua(t)||!Ua(n)}function Sn(e){return Zl(e)||e0(e)||e.z||e.rotate||e.rotateX||e.rotateY}function e0(e){return Th(e.x)||Th(e.y)}function Th(e){return e&&e!=="0%"}function xo(e,t,n){const r=e-n,i=t*r;return n+i}function jh(e,t,n,r,i){return i!==void 0&&(e=xo(e,i,r)),xo(e,n,r)+t}function eu(e,t=0,n=1,r,i){e.min=jh(e.min,t,n,r,i),e.max=jh(e.max,t,n,r,i)}function t0(e,{x:t,y:n}){eu(e.x,t.translate,t.scale,t.originPoint),eu(e.y,n.translate,n.scale,n.originPoint)}function lS(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,o;for(let a=0;a1.0000000000001||e<.999999999999?e:1}function Bt(e,t){e.min=e.min+t,e.max=e.max+t}function Rh(e,t,[n,r,i]){const s=t[i]!==void 0?t[i]:.5,o=Y(e.min,e.max,s);eu(e,t[n],t[r],o,t.scale)}const uS=["x","scaleX","originX"],cS=["y","scaleY","originY"];function hr(e,t){Rh(e.x,t,uS),Rh(e.y,t,cS)}function n0(e,t){return Zg(aS(e.getBoundingClientRect(),t))}function dS(e,t,n){const r=n0(e,n),{scroll:i}=t;return i&&(Bt(r.x,i.offset.x),Bt(r.y,i.offset.y)),r}const r0=({current:e})=>e?e.ownerDocument.defaultView:null,hS=new WeakMap;class fS{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ie(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=c=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Ko(c,"page").point)},s=(c,d)=>{const{drag:h,dragPropagation:f,onDragStart:v}=this.getProps();if(h&&!f&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=gg(h),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Je(_=>{let y=this.getAxisMotionValue(_).get()||0;if(wt.test(y)){const{projection:m}=this.visualElement;if(m&&m.layout){const p=m.layout.layoutBox[_];p&&(y=He(p)*(parseFloat(y)/100))}}this.originPoint[_]=y}),v&&q.update(()=>v(c,d),!1,!0);const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},o=(c,d)=>{const{dragPropagation:h,dragDirectionLock:f,onDirectionLock:v,onDrag:w}=this.getProps();if(!h&&!this.openGlobalLock)return;const{offset:_}=d;if(f&&this.currentDirection===null){this.currentDirection=pS(_),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",d.point,_),this.updateAxis("y",d.point,_),this.visualElement.render(),w&&w(c,d)},a=(c,d)=>this.stop(c,d),l=()=>Je(c=>{var d;return this.getAnimationState(c)==="paused"&&((d=this.getAxisMotionValue(c).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new Yg(t,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:r0(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&q.update(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!ws(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=eS(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,s=this.constraints;n&&ur(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=tS(i.layoutBox,n):this.constraints=!1,this.elastic=sS(r),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Je(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=iS(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!ur(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=dS(r,i.root,this.visualElement.getTransformPagePoint());let o=nS(i.layout.layoutBox,s);if(n){const a=n(oS(o));this.hasMutatedConstraints=!!a,a&&(o=Zg(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=Je(c=>{if(!ws(c,n,this.currentDirection))return;let d=l&&l[c]||{};o&&(d={min:0,max:0});const h=i?200:1e6,f=i?40:1e7,v={type:"inertia",velocity:r?t[c]:0,bounceStiffness:h,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(c,v)});return Promise.all(u).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return r.start(Cc(t,r,0,n))}stopAnimation(){Je(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Je(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n="_drag"+t.toUpperCase(),r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Je(n=>{const{drag:r}=this.getProps();if(!ws(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];s.set(t[n]-Y(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!ur(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Je(o=>{const a=this.getAxisMotionValue(o);if(a){const l=a.get();i[o]=rS({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Je(o=>{if(!ws(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(Y(l,u,i[o]))})}addListeners(){if(!this.visualElement.current)return;hS.set(this.visualElement,this);const t=this.visualElement.current,n=Tt(t,"pointerdown",l=>{const{drag:u,dragListener:c=!0}=this.getProps();u&&c&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();ur(l)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),r();const o=Et(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Je(c=>{const d=this.getAxisMotionValue(c);d&&(this.originPoint[c]+=l[c].translate,d.set(d.get()+l[c].translate))}),this.visualElement.render())});return()=>{o(),n(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=Xl,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function ws(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function pS(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class mS extends fn{constructor(t){super(t),this.removeGroupControls=re,this.removeListeners=re,this.controls=new fS(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||re}unmount(){this.removeGroupControls(),this.removeListeners()}}const Oh=e=>(t,n)=>{e&&q.update(()=>e(t,n))};class gS extends fn{constructor(){super(...arguments),this.removePointerDownListener=re}onPointerDown(t){this.session=new Yg(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:r0(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:Oh(t),onStart:Oh(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&q.update(()=>i(s,o))}}}mount(){this.removePointerDownListener=Tt(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function yS(){const e=k.useContext(dc);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=k.useId();return k.useEffect(()=>r(i),[]),!t&&n?[!1,()=>n&&n(i)]:[!0]}const $s={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Nh(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Gr={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(O.test(e))e=parseFloat(e);else return e;const n=Nh(e,t.target.x),r=Nh(e,t.target.y);return`${n}% ${r}%`}},vS={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=un.parse(e);if(i.length>5)return r;const s=un.createTransformer(e),o=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=a,i[1+o]/=l;const u=Y(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),s(i)}};class wS extends wu.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;E1(xS),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),$s.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,o=r.projection;return o&&(o.isPresent=s,i||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||q.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function i0(e){const[t,n]=yS(),r=k.useContext(Zm);return wu.createElement(wS,{...e,layoutGroup:r,switchLayoutGroup:k.useContext(eg),isPresent:t,safeToRemove:n})}const xS={borderRadius:{...Gr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Gr,borderTopRightRadius:Gr,borderBottomLeftRadius:Gr,borderBottomRightRadius:Gr,boxShadow:vS},s0=["TopLeft","TopRight","BottomLeft","BottomRight"],_S=s0.length,Lh=e=>typeof e=="string"?parseFloat(e):e,Ih=e=>typeof e=="number"||O.test(e);function SS(e,t,n,r,i,s){i?(e.opacity=Y(0,n.opacity!==void 0?n.opacity:1,kS(r)),e.opacityExit=Y(t.opacity!==void 0?t.opacity:1,0,bS(r))):s&&(e.opacity=Y(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<_S;o++){const a=`border${s0[o]}Radius`;let l=Dh(t,a),u=Dh(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||Ih(l)===Ih(u)?(e[a]=Math.max(Y(Lh(l),Lh(u),r),0),(wt.test(u)||wt.test(l))&&(e[a]+="%")):e[a]=u}(t.rotate||n.rotate)&&(e.rotate=Y(t.rotate||0,n.rotate||0,r))}function Dh(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const kS=o0(0,.5,Tg),bS=o0(.5,.95,re);function o0(e,t,n){return r=>rt?1:n(Vi(e,t,r))}function Mh(e,t){e.min=t.min,e.max=t.max}function Qe(e,t){Mh(e.x,t.x),Mh(e.y,t.y)}function Vh(e,t,n,r,i){return e-=t,e=xo(e,1/n,r),i!==void 0&&(e=xo(e,1/i,r)),e}function PS(e,t=0,n=1,r=.5,i,s=e,o=e){if(wt.test(t)&&(t=parseFloat(t),t=Y(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=Y(s.min,s.max,r);e===s&&(a-=t),e.min=Vh(e.min,t,n,a,i),e.max=Vh(e.max,t,n,a,i)}function $h(e,t,[n,r,i],s,o){PS(e,t[n],t[r],t[i],t.scale,s,o)}const ES=["x","scaleX","originX"],CS=["y","scaleY","originY"];function Fh(e,t,n,r){$h(e.x,t,ES,n?n.x:void 0,r?r.x:void 0),$h(e.y,t,CS,n?n.y:void 0,r?r.y:void 0)}function Uh(e){return e.translate===0&&e.scale===1}function a0(e){return Uh(e.x)&&Uh(e.y)}function TS(e,t){return e.x.min===t.x.min&&e.x.max===t.x.max&&e.y.min===t.y.min&&e.y.max===t.y.max}function l0(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function Bh(e){return He(e.x)/He(e.y)}class jS{constructor(){this.members=[]}add(t){Tc(this.members,t),t.scheduleRender()}remove(t){if(jc(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function zh(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y;if((i||s)&&(r=`translate3d(${i}px, ${s}px, 0) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{rotate:l,rotateX:u,rotateY:c}=n;l&&(r+=`rotate(${l}deg) `),u&&(r+=`rotateX(${u}deg) `),c&&(r+=`rotateY(${c}deg) `)}const o=e.x.scale*t.x,a=e.y.scale*t.y;return(o!==1||a!==1)&&(r+=`scale(${o}, ${a})`),r||"none"}const AS=(e,t)=>e.depth-t.depth;class RS{constructor(){this.children=[],this.isDirty=!1}add(t){Tc(this.children,t),this.isDirty=!0}remove(t){jc(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(AS),this.isDirty=!1,this.children.forEach(t)}}function OS(e,t){const n=performance.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&(Lt(r),e(s-t))};return q.read(r,!0),()=>Lt(r)}function NS(e){window.MotionDebug&&window.MotionDebug.record(e)}function LS(e){return e instanceof SVGElement&&e.tagName!=="svg"}function IS(e,t,n){const r=Ve(e)?e:Cr(e);return r.start(Cc("",r,t,n)),r.animation}const Wh=["","X","Y","Z"],DS={visibility:"hidden"},Hh=1e3;let MS=0;const kn={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function u0({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=MS++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,kn.totalNodes=kn.resolvedTargetDeltas=kn.recalculatedProjection=0,this.nodes.forEach(FS),this.nodes.forEach(HS),this.nodes.forEach(qS),this.nodes.forEach(US),NS(kn)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=OS(h,250),$s.hasAnimatedSinceResize&&($s.hasAnimatedSinceResize=!1,this.nodes.forEach(Gh))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&c&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeTargetChanged:f,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const w=this.options.transition||c.getDefaultTransition()||YS,{onLayoutAnimationStart:_,onLayoutAnimationComplete:y}=c.getProps(),m=!this.targetLayout||!l0(this.targetLayout,v)||f,p=!h&&f;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||p||h&&(m||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,p);const x={...Ec(w,"layout"),onPlay:_,onComplete:y};(c.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x)}else h||Gh(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Lt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(GS),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let c=0;cthis.update()))}clearAllSnapshots(){this.nodes.forEach(BS),this.sharedNodes.forEach(KS)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,q.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){q.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{const S=x/1e3;Kh(d.x,o.x,S),Kh(d.y,o.y,S),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(fi(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox),QS(this.relativeTarget,this.relativeTargetOrigin,h,S),p&&TS(this.relativeTarget,p)&&(this.isProjectionDirty=!1),p||(p=ie()),Qe(p,this.relativeTarget)),w&&(this.animationValues=c,SS(c,u,this.latestValues,S,m,y)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Lt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=q.update(()=>{$s.hasAnimatedSinceResize=!0,this.currentAnimation=IS(0,Hh,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Hh),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:c}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&c0(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||ie();const d=He(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const h=He(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}Qe(a,l),hr(a,c),hi(this.projectionDeltaWithTransform,this.layoutCorrected,a,c)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new jS),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.rotate||l.rotateX||l.rotateY||l.rotateZ)&&(a=!0),!a)return;const u={};for(let c=0;c{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(qh),this.root.sharedNodes.clear()}}}function VS(e){e.updateLayout()}function $S(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:s}=e.options,o=n.source!==e.layout.source;s==="size"?Je(d=>{const h=o?n.measuredBox[d]:n.layoutBox[d],f=He(h);h.min=r[d].min,h.max=h.min+f}):c0(s,n.layoutBox,r)&&Je(d=>{const h=o?n.measuredBox[d]:n.layoutBox[d],f=He(r[d]);h.max=h.min+f,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+f)});const a=dr();hi(a,r,n.layoutBox);const l=dr();o?hi(l,e.applyTransform(i,!0),n.measuredBox):hi(l,r,n.layoutBox);const u=!a0(a);let c=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:h,layout:f}=d;if(h&&f){const v=ie();fi(v,n.layoutBox,h.layoutBox);const w=ie();fi(w,r,f.layoutBox),l0(v,w)||(c=!0),d.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=v,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function FS(e){kn.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function US(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function BS(e){e.clearSnapshot()}function qh(e){e.clearMeasurements()}function zS(e){e.isLayoutDirty=!1}function WS(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Gh(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function HS(e){e.resolveTargetDelta()}function qS(e){e.calcProjection()}function GS(e){e.resetRotation()}function KS(e){e.removeLeadSnapshot()}function Kh(e,t,n){e.translate=Y(t.translate,0,n),e.scale=Y(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Qh(e,t,n,r){e.min=Y(t.min,n.min,r),e.max=Y(t.max,n.max,r)}function QS(e,t,n,r){Qh(e.x,t.x,n.x,r),Qh(e.y,t.y,n.y,r)}function JS(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const YS={duration:.45,ease:[.4,0,.1,1]},Jh=e=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(e),Yh=Jh("applewebkit/")&&!Jh("chrome/")?Math.round:re;function Xh(e){e.min=Yh(e.min),e.max=Yh(e.max)}function XS(e){Xh(e.x),Xh(e.y)}function c0(e,t,n){return e==="position"||e==="preserve-aspect"&&!Yl(Bh(t),Bh(n),.2)}const ZS=u0({attachResizeListener:(e,t)=>Et(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Ba={current:void 0},d0=u0({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Ba.current){const e=new ZS({});e.mount(window),e.setOptions({layoutScroll:!0}),Ba.current=e}return Ba.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),ek={pan:{Feature:gS},drag:{Feature:mS,ProjectionNode:d0,MeasureLayout:i0}},tk=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function nk(e){const t=tk.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]}function tu(e,t,n=1){const[r,i]=nk(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const o=s.trim();return Gg(o)?parseFloat(o):o}else return Wl(i)?tu(i,t,n+1):i}function rk(e,{...t},n){const r=e.current;if(!(r instanceof Element))return{target:t,transitionEnd:n};n&&(n={...n}),e.values.forEach(i=>{const s=i.get();if(!Wl(s))return;const o=tu(s,r);o&&i.set(o)});for(const i in t){const s=t[i];if(!Wl(s))continue;const o=tu(s,r);o&&(t[i]=o,n||(n={}),n[i]===void 0&&(n[i]=s))}return{target:t,transitionEnd:n}}const ik=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),h0=e=>ik.has(e),sk=e=>Object.keys(e).some(h0),Zh=e=>e===Bn||e===O,ef=(e,t)=>parseFloat(e.split(", ")[t]),tf=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/);if(i)return ef(i[1],t);{const s=r.match(/^matrix\((.+)\)$/);return s?ef(s[1],e):0}},ok=new Set(["x","y","z"]),ak=Hi.filter(e=>!ok.has(e));function lk(e){const t=[];return ak.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t.length&&e.render(),t}const Tr={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:tf(4,13),y:tf(5,14)};Tr.translateX=Tr.x;Tr.translateY=Tr.y;const uk=(e,t,n)=>{const r=t.measureViewportBox(),i=t.current,s=getComputedStyle(i),{display:o}=s,a={};o==="none"&&t.setStaticValue("display",e.display||"block"),n.forEach(u=>{a[u]=Tr[u](r,s)}),t.render();const l=t.measureViewportBox();return n.forEach(u=>{const c=t.getValue(u);c&&c.jump(a[u]),e[u]=Tr[u](l,s)}),e},ck=(e,t,n={},r={})=>{t={...t},r={...r};const i=Object.keys(t).filter(h0);let s=[],o=!1;const a=[];if(i.forEach(l=>{const u=e.getValue(l);if(!e.hasValue(l))return;let c=n[l],d=qr(c);const h=t[l];let f;if(po(h)){const v=h.length,w=h[0]===null?1:0;c=h[w],d=qr(c);for(let _=w;_=0?window.pageYOffset:null,u=uk(t,e,a);return s.length&&s.forEach(([c,d])=>{e.getValue(c).set(d)}),e.render(),Wo&&l!==null&&window.scrollTo({top:l}),{target:u,transitionEnd:r}}else return{target:t,transitionEnd:r}};function dk(e,t,n,r){return sk(t)?ck(e,t,n,r):{target:t,transitionEnd:r}}const hk=(e,t,n,r)=>{const i=rk(e,t,r);return t=i.target,r=i.transitionEnd,dk(e,t,n,r)},nu={current:null},f0={current:!1};function fk(){if(f0.current=!0,!!Wo)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>nu.current=e.matches;e.addListener(t),t()}else nu.current=!1}function pk(e,t,n){const{willChange:r}=t;for(const i in t){const s=t[i],o=n[i];if(Ve(s))e.addValue(i,s),wo(r)&&r.add(i);else if(Ve(o))e.addValue(i,Cr(s,{owner:e})),wo(r)&&r.remove(i);else if(o!==s)if(e.hasValue(i)){const a=e.getValue(i);!a.hasAnimated&&a.set(s)}else{const a=e.getStaticValue(i);e.addValue(i,Cr(a!==void 0?a:s,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const nf=new WeakMap,p0=Object.keys(Mi),mk=p0.length,rf=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],gk=pc.length;class yk{constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,visualState:s},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>q.render(this.render,!1,!0);const{latestValues:a,renderState:l}=s;this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=o,this.isControllingVariants=qo(n),this.isVariantNode=Xm(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(n,{});for(const d in c){const h=c[d];a[d]!==void 0&&Ve(h)&&(h.set(a[d],!1),wo(u)&&u.add(d))}}scrapeMotionValuesFromProps(t,n){return{}}mount(t){this.current=t,nf.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),f0.current||fk(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:nu.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){nf.delete(this.current),this.projection&&this.projection.unmount(),Lt(this.notifyUpdate),Lt(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,n){const r=Un.has(t),i=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&q.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{i(),s()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}loadFeatures({children:t,...n},r,i,s){let o,a;for(let l=0;lthis.scheduleRender(),animationType:typeof u=="string"?u:"both",initialPromotionConfig:s,layoutScroll:h,layoutRoot:f})}return a}updateFeatures(){for(const t in this.features){const n=this.features[t];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ie()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}makeTargetAnimatable(t,n=!0){return this.makeTargetAnimatableFromInstance(t,this.props,n)}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){n!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,n)),this.values.set(t,n),this.latestValues[t]=n.get()}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Cr(n,{owner:this}),this.addValue(t,r)),r}readValue(t){var n;return this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(n=this.getBaseTargetFromProps(this.props,t))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,t,this.options)}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props,i=typeof r=="string"||typeof r=="object"?(n=_c(this.props,r))===null||n===void 0?void 0:n[t]:void 0;if(r&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Ve(s)?s:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Ac),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class m0 extends yk{sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:n,...r},{transformValues:i},s){let o=L_(r,t||{},this);if(i&&(n&&(n=i(n)),r&&(r=i(r)),o&&(o=i(o))),s){O_(this,r,o);const a=hk(this,r,o,n);n=a.transitionEnd,r=a.target}return{transition:t,transitionEnd:n,...r}}}function vk(e){return window.getComputedStyle(e)}class wk extends m0{constructor(){super(...arguments),this.type="html"}readValueFromInstance(t,n){if(Un.has(n)){const r=Pc(n);return r&&r.default||0}else{const r=vk(t),i=(rg(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return n0(t,n)}build(t,n,r,i){gc(t,n,r,i.transformTemplate)}scrapeMotionValuesFromProps(t,n){return xc(t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ve(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(t,n,r,i){ug(t,n,r,i)}}class xk extends m0{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Un.has(n)){const r=Pc(n);return r&&r.default||0}return n=cg.has(n)?n:hc(n),t.getAttribute(n)}measureInstanceViewportBox(){return ie()}scrapeMotionValuesFromProps(t,n){return hg(t,n)}build(t,n,r,i){vc(t,n,r,this.isSVGTag,i.transformTemplate)}renderInstance(t,n,r,i){dg(t,n,r,i)}mount(t){this.isSVGTag=wc(t.tagName),super.mount(t)}}const _k=(e,t)=>mc(e)?new xk(t,{enableHardwareAcceleration:!1}):new wk(t,{enableHardwareAcceleration:!0}),Sk={layout:{ProjectionNode:d0,MeasureLayout:i0}},kk={...Q_,...gx,...ek,...Sk},V=b1((e,t)=>rx(e,t,kk,_k));/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var bk={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"};/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Pk=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),ue=(e,t)=>{const n=k.forwardRef(({color:r="currentColor",size:i=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:a="",children:l,...u},c)=>k.createElement("svg",{ref:c,...bk,width:i,height:i,stroke:r,strokeWidth:o?Number(s)*24/Number(i):s,className:["lucide",`lucide-${Pk(e)}`,a].join(" "),...u},[...t.map(([d,h])=>k.createElement(d,h)),...Array.isArray(l)?l:[l]]));return n.displayName=`${e}`,n};/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ek=ue("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ck=ue("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Tk=ue("BrainCircuit",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const jk=ue("Building",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["path",{d:"M9 22v-4h6v4",key:"r93iot"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ak=ue("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Rk=ue("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ok=ue("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Nk=ue("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Lk=ue("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ik=ue("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const g0=ue("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Dk=ue("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Mk=ue("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Vk=ue("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $k=ue("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Fk=ue("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const y0=ue("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Uk=ue("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** + * @license lucide-react v0.344.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Bk=ue("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]),zk=()=>{const[e,t]=k.useState(!1),[n,r]=k.useState(!1),[i,s]=k.useState({x:"50%",y:"50%"}),o=qm();k.useEffect(()=>{const c=()=>{t(window.scrollY>20)};return window.addEventListener("scroll",c),()=>window.removeEventListener("scroll",c)},[]);const a=()=>{o("/book-call")},l=(c,d,h)=>{const f=h.getBoundingClientRect(),v=(c-f.left)/f.width*100,w=(d-f.top)/f.height*100;s({x:`${v}%`,y:`${w}%`})},u=`fixed top-0 w-full z-50 transition-all duration-300 ${e?"bg-background/80 backdrop-blur-lg py-3 shadow-lg":"bg-transparent py-5"}`;return g.jsxs("nav",{className:u,children:[g.jsx("div",{className:"container mx-auto px-4 md:px-6",children:g.jsxs("div",{className:"flex justify-between items-center",children:[g.jsxs(V.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.5},className:"flex items-center cursor-pointer",onClick:()=>o("/"),children:[g.jsx("img",{src:"/assets/logo.png",alt:"Logo",className:"w-8 h-8 mr-2"}),g.jsxs("span",{className:"text-xl font-semibold tracking-tight",children:["NeoCyber",g.jsx("span",{className:"bg-gradient-to-r from-accent-500 to-secondary-900 bg-clip-text text-transparent",children:"Acquisition"})]})]}),g.jsxs(V.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.5,delay:.1},className:"hidden md:flex items-center space-x-8",children:[["Features","Results","Contact"].map((c,d)=>g.jsxs("a",{href:`#${c.toLowerCase()}`,className:"text-text-secondary hover:text-text-primary transition-colors relative group",children:[c,g.jsx("span",{className:"absolute -bottom-1 left-0 w-0 h-0.5 bg-secondary-500 transition-all duration-300 group-hover:w-full"})]},c)),g.jsx("div",{onMouseMove:c=>l(c.clientX,c.clientY,c.currentTarget),onTouchMove:c=>{const d=c.touches[0];d&&l(d.clientX,d.clientY,c.currentTarget)},children:g.jsxs("button",{onClick:a,className:"relative overflow-hidden text-white font-semibold py-2 px-6 rounded-md shadow-lg transition-all duration-300 ease-out ml-4",style:{background:"linear-gradient(135deg, #003234, #00AAAE)"},children:["Book a Call",g.jsx("span",{className:"absolute inset-0 pointer-events-none transition-all duration-300 ease-out",style:{background:`radial-gradient(circle at ${i.x} ${i.y}, rgba(32,201,151,0.5) 10%, transparent 40%)`,opacity:1}})]})})]}),g.jsx("div",{className:"md:hidden",children:g.jsx("button",{onClick:()=>r(!n),className:"text-text-primary p-2",children:n?g.jsx(Uk,{size:24}):g.jsx(Dk,{size:24})})})]})}),n&&g.jsx(V.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.3},className:"md:hidden bg-background/95 backdrop-blur-lg mt-2 p-4",children:g.jsxs("div",{className:"flex flex-col space-y-4",children:[["Features","Results","Contact"].map(c=>g.jsx("a",{href:`#${c.toLowerCase()}`,className:"text-text-secondary py-2 hover:text-text-primary transition-colors",onClick:()=>r(!1),children:c},c)),g.jsx("button",{onClick:()=>{a(),r(!1)},className:"relative overflow-hidden text-white font-semibold py-3 px-6 rounded-md shadow-lg transition-all duration-300 ease-out mt-4",style:{background:"linear-gradient(135deg, #003234, #00AAAE)"},children:"Book a Call"})]})})]})},Wk=()=>{const e=k.useRef(null),[t,n]=k.useState({x:"50%",y:"50%"}),r=qm();k.useEffect(()=>{const o=e.current,a=l=>{window.scrollBy({top:l.deltaY,behavior:"auto"})};return o&&o.addEventListener("wheel",a,{passive:!1}),()=>{o&&o.removeEventListener("wheel",a)}},[]),k.useEffect(()=>{const o="spline-viewer-script";if(!document.getElementById(o)){const a=document.createElement("script");a.type="module",a.src="https://unpkg.com/@splinetool/viewer@1.9.98/build/spline-viewer.js",a.id=o,document.body.appendChild(a)}},[]);const i=(o,a,l)=>{const u=l.getBoundingClientRect(),c=(o-u.left)/u.width*100,d=(a-u.top)/u.height*100;n({x:`${c}%`,y:`${d}%`})},s=()=>{r("/book-call")};return g.jsxs("section",{className:"relative h-screen w-full overflow-hidden",id:"home",children:[g.jsx("div",{className:"absolute inset-0 z-0",ref:e,children:g.jsx("spline-viewer",{url:"https://prod.spline.design/odVPsg6TTzs-Etco/scene.splinecode",className:"w-full h-full"})}),g.jsx("div",{className:"absolute bottom-4 right-4 z-10",onMouseMove:o=>i(o.clientX,o.clientY,o.currentTarget),onTouchMove:o=>{const a=o.touches[0];a&&i(a.clientX,a.clientY,o.currentTarget)},children:g.jsxs("button",{onClick:s,className:"relative overflow-hidden text-white font-semibold py-3 px-8 rounded-md shadow-lg transition-all duration-300 ease-out",style:{background:"linear-gradient(135deg, #003234, #00AAAE)"},children:["Book a Call",g.jsx("span",{className:"absolute inset-0 pointer-events-none transition-all duration-300 ease-out",style:{background:`radial-gradient(circle at ${t.x} ${t.y}, rgba(32,201,151,0.5) 10%, transparent 40%)`,opacity:1}})]})}),g.jsx(V.div,{className:"absolute bottom-8 left-1/2 transform -translate-x-1/2 z-10",initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.5,delay:1.5,repeat:1/0,repeatType:"reverse"},children:g.jsx(Rk,{size:32,className:"text-white animate-bounce"})})]})};var ru=new Map,xs=new WeakMap,sf=0,Hk=void 0;function qk(e){return e?(xs.has(e)||(sf+=1,xs.set(e,sf.toString())),xs.get(e)):"0"}function Gk(e){return Object.keys(e).sort().filter(t=>e[t]!==void 0).map(t=>`${t}_${t==="root"?qk(e.root):e[t]}`).toString()}function Kk(e){const t=Gk(e);let n=ru.get(t);if(!n){const r=new Map;let i;const s=new IntersectionObserver(o=>{o.forEach(a=>{var l;const u=a.isIntersecting&&i.some(c=>a.intersectionRatio>=c);e.trackVisibility&&typeof a.isVisible>"u"&&(a.isVisible=u),(l=r.get(a.target))==null||l.forEach(c=>{c(u,a)})})},e);i=s.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:s,elements:r},ru.set(t,n)}return n}function Qk(e,t,n={},r=Hk){if(typeof window.IntersectionObserver>"u"&&r!==void 0){const l=e.getBoundingClientRect();return t(r,{isIntersecting:r,target:e,intersectionRatio:typeof n.threshold=="number"?n.threshold:0,time:0,boundingClientRect:l,intersectionRect:l,rootBounds:l}),()=>{}}const{id:i,observer:s,elements:o}=Kk(n),a=o.get(e)||[];return o.has(e)||o.set(e,a),a.push(t),s.observe(e),function(){a.splice(a.indexOf(t),1),a.length===0&&(o.delete(e),s.unobserve(e)),o.size===0&&(s.disconnect(),ru.delete(i))}}function jr({threshold:e,delay:t,trackVisibility:n,rootMargin:r,root:i,triggerOnce:s,skip:o,initialInView:a,fallbackInView:l,onChange:u}={}){var c;const[d,h]=k.useState(null),f=k.useRef(u),[v,w]=k.useState({inView:!!a,entry:void 0});f.current=u,k.useEffect(()=>{if(o||!d)return;let p;return p=Qk(d,(x,S)=>{w({inView:x,entry:S}),f.current&&f.current(x,S),S.isIntersecting&&s&&p&&(p(),p=void 0)},{root:i,rootMargin:r,threshold:e,trackVisibility:n,delay:t},l),()=>{p&&p()}},[Array.isArray(e)?e.toString():e,d,i,r,s,o,n,l,t]);const _=(c=v.entry)==null?void 0:c.target,y=k.useRef(void 0);!d&&_&&!s&&!o&&y.current!==_&&(y.current=_,w({inView:!!a,entry:void 0}));const m=[h,v.inView,v.entry];return m.ref=m[0],m.inView=m[1],m.entry=m[2],m}const Jk=({icon:e,title:t,description:n,index:r})=>{const[i,s]=jr({triggerOnce:!0,threshold:.1});return g.jsxs(V.div,{ref:i,initial:{opacity:0,y:50},animate:s?{opacity:1,y:0}:{opacity:0,y:50},transition:{duration:.6,delay:r*.1},className:"bg-background-light border border-primary-900/30 rounded-xl p-6 shadow-lg shadow-primary-900/5 relative overflow-hidden group",children:[g.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-primary-600/0 via-primary-600/20 to-accent-600/0 opacity-0 group-hover:opacity-100 transition-opacity duration-500"}),g.jsxs("div",{className:"relative z-10",children:[g.jsx("div",{className:"bg-gradient-to-br from-primary-500 to-accent-500 rounded-lg p-3 inline-block mb-4",children:e}),g.jsx("h3",{className:"text-xl font-semibold mb-3 text-text-primary",children:t}),g.jsx("p",{className:"text-text-secondary text-base",children:n})]})]})},Yk=()=>{const[e,t]=jr({triggerOnce:!0,threshold:.1}),[n,r]=jr({triggerOnce:!0,threshold:.1}),i=[{icon:g.jsx(Tk,{size:24,className:"text-white"}),title:"AI-Powered Automation",description:"Implement intelligent automation solutions that adapt to your business needs and scale with your growth."},{icon:g.jsx(Nk,{size:24,className:"text-white"}),title:"CRM Integration",description:"Seamlessly connect your AI tools with existing CRM systems for enhanced workflow and customer insights."},{icon:g.jsx(y0,{size:24,className:"text-white"}),title:"Lead Generation",description:"Generate qualified leads through AI-driven targeting and personalized outreach campaigns."},{icon:g.jsx(Bk,{size:24,className:"text-white"}),title:"Rapid Implementation",description:"Quick deployment of AI solutions with minimal disruption to your existing operations."}];return g.jsx("section",{className:"py-20 md:py-28 relative",id:"features",children:g.jsxs("div",{className:"container mx-auto px-4 md:px-6",children:[g.jsxs(V.div,{ref:e,initial:{opacity:0,y:20},animate:t?{opacity:1,y:0}:{opacity:0,y:20},transition:{duration:.6},className:"text-center mb-16",children:[g.jsx("h2",{className:"text-4xl md:text-5xl font-bold mb-4",children:"Cutting-Edge AI Solutions"}),g.jsx("p",{className:"text-text-secondary max-w-2xl mx-auto text-xl",children:"Our innovative technology stack delivers powerful automation and integration capabilities to transform your business operations."})]}),g.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12 lg:gap-16 items-start",children:[g.jsx("div",{className:"space-y-6",children:i.map((s,o)=>g.jsx(Jk,{icon:s.icon,title:s.title,description:s.description,index:o},o))}),g.jsxs(V.div,{ref:n,initial:{opacity:0,x:50},animate:r?{opacity:1,x:0}:{opacity:0,x:50},transition:{duration:.8,delay:.2},className:"flex flex-col items-center lg:sticky lg:top-24",children:[g.jsx(V.div,{initial:{opacity:0,y:-20},animate:r?{opacity:1,y:0}:{opacity:0,y:-20},transition:{duration:.6,delay:.4},className:"mb-6",children:g.jsx("h3",{className:"text-2xl font-bold text-center bg-gradient-to-r from-secondary-400 to-accent-400 bg-clip-text text-transparent",children:"Founder"})}),g.jsxs(V.div,{initial:{opacity:0,scale:.9},animate:r?{opacity:1,scale:1}:{opacity:0,scale:.9},transition:{duration:.8,delay:.6},className:"relative group",children:[g.jsx("div",{className:"absolute -inset-1 bg-gradient-to-r from-secondary-500 via-accent-500 to-primary-500 rounded-2xl blur-sm opacity-60 group-hover:opacity-100 transition-opacity duration-500 animate-pulse"}),g.jsx("div",{className:"relative bg-background-light rounded-2xl p-2 border border-secondary-800/30 overflow-hidden",children:g.jsxs("div",{className:"relative w-80 h-80 rounded-xl overflow-hidden",children:[g.jsx("img",{src:"/assets/WhatsApp Image 2025-06-28 at 12.51.41.jpeg",alt:"Founder",className:"w-full h-full object-cover object-center grayscale hover:grayscale-0 transition-all duration-500"}),g.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/20 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500"})]})}),g.jsx("div",{className:"absolute inset-0 pointer-events-none",children:[...Array(6)].map((s,o)=>g.jsx(V.div,{className:"absolute w-1 h-1 bg-accent-400/60 rounded-full",style:{left:`${20+o*15}%`,top:`${10+o*12}%`},animate:{y:[-10,10,-10],opacity:[.3,.8,.3]},transition:{duration:3+o*.5,repeat:1/0,delay:o*.3}},o))})]}),g.jsx(V.div,{initial:{opacity:0,y:20},animate:r?{opacity:1,y:0}:{opacity:0,y:20},transition:{duration:.6,delay:.8},className:"mt-6 text-center",children:g.jsx("p",{className:"text-text-secondary text-sm max-w-xs",children:"Leading the future of AI automation with innovative solutions that transform businesses worldwide."})})]})]})]})})};var Rc={},iu={exports:{}};(function(e,t){(function(n,r){r(t)})(ze,function(n){var r=function(){return r=Object.assign||function(s){for(var o,a=1,l=arguments.length;au.endVal;u.frameVal=h?u.endVal:u.frameVal,u.frameVal=Number(u.frameVal.toFixed(u.options.decimalPlaces)),u.printValue(u.frameVal),d1?u.options.decimal+_[1]:"",u.options.useGrouping){v="";for(var y=3,m=0,p=0,x=h.length;pwindow.scrollY&&o.paused?(o.paused=!1,setTimeout(function(){return o.start()},o.options.scrollSpyDelay),o.options.scrollSpyOnce&&(o.once=!0)):(window.scrollY>c||u>a)&&!o.paused&&o.reset()}},s.prototype.determineDirectionAndSmartEasing=function(){var o=this.finalEndVal?this.finalEndVal:this.endVal;this.countDown=this.startVal>o;var a=o-this.startVal;if(Math.abs(a)>this.options.smartEasingThreshold&&this.options.useEasing){this.finalEndVal=o;var l=this.countDown?1:-1;this.endVal=o+l*this.options.smartEasingAmount,this.duration=this.duration/2}else this.endVal=o,this.finalEndVal=null;this.finalEndVal!==null?this.useEasing=!1:this.useEasing=this.options.useEasing},s.prototype.start=function(o){this.error||(this.options.onStartCallback&&this.options.onStartCallback(),o&&(this.options.onCompleteCallback=o),this.duration>0?(this.determineDirectionAndSmartEasing(),this.paused=!1,this.rAF=requestAnimationFrame(this.count)):this.printValue(this.endVal))},s.prototype.pauseResume=function(){this.paused?(this.startTime=null,this.duration=this.remaining,this.startVal=this.frameVal,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count)):cancelAnimationFrame(this.rAF),this.paused=!this.paused},s.prototype.reset=function(){cancelAnimationFrame(this.rAF),this.paused=!0,this.resetDuration(),this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.printValue(this.startVal)},s.prototype.update=function(o){cancelAnimationFrame(this.rAF),this.startTime=null,this.endVal=this.validateValue(o),this.endVal!==this.frameVal&&(this.startVal=this.frameVal,this.finalEndVal==null&&this.resetDuration(),this.finalEndVal=null,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count))},s.prototype.printValue=function(o){var a;if(this.el){var l=this.formattingFn(o);!((a=this.options.plugin)===null||a===void 0)&&a.render?this.options.plugin.render(this.el,l):this.el.tagName==="INPUT"?this.el.value=l:this.el.tagName==="text"||this.el.tagName==="tspan"?this.el.textContent=l:this.el.innerHTML=l}},s.prototype.ensureNumber=function(o){return typeof o=="number"&&!isNaN(o)},s.prototype.validateValue=function(o){var a=Number(o);return this.ensureNumber(a)?a:(this.error="[CountUp] invalid start or end value: ".concat(o),null)},s.prototype.resetDuration=function(){this.startTime=null,this.duration=1e3*Number(this.options.duration),this.remaining=this.duration},s}();n.CountUp=i})})(iu,iu.exports);var Xk=iu.exports;Object.defineProperty(Rc,"__esModule",{value:!0});var fe=k,Zk=Xk;function eb(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,s,o,a=[],l=!0,u=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,i=c}finally{try{if(!l&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw i}}return a}}function of(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function _o(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function v0(e,t){if(e==null)return{};var n=ib(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function sb(e,t){return ob(e)||eb(e,t)||ab(e,t)||lb()}function ob(e){if(Array.isArray(e))return e}function ab(e,t){if(e){if(typeof e=="string")return af(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return af(e,t)}}function af(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?w.current=setTimeout(A,a*1e3):A(),u==null||u({pauseResume:x,reset:S,update:b})}),x=ot(function(){m().pauseResume(),c==null||c({reset:S,start:P,update:b})}),S=ot(function(){m().el&&(w.current&&clearTimeout(w.current),m().reset(),d==null||d({pauseResume:x,start:P,update:b}))}),b=ot(function(A){m().update(A),h==null||h({pauseResume:x,reset:S,start:P})}),P=ot(function(){S(),p()}),C=ot(function(A){s&&(A&&S(),p())});return fe.useEffect(function(){_.current?o&&C(!0):(_.current=!0,C())},[o,_,C,a,t.start,t.suffix,t.prefix,t.duration,t.separator,t.decimals,t.decimal,t.formattingFn]),fe.useEffect(function(){return function(){S()}},[S]),{start:P,pauseResume:x,reset:S,update:b,getCountUp:m}},fb=["className","redraw","containerProps","children","style"],pb=function(t){var n=t.className,r=t.redraw,i=t.containerProps,s=t.children,o=t.style,a=v0(t,fb),l=fe.useRef(null),u=fe.useRef(!1),c=w0(_o(_o({},a),{},{ref:l,startOnMount:typeof s!="function"||t.delay===0,enableReinitialize:!1})),d=c.start,h=c.reset,f=c.update,v=c.pauseResume,w=c.getCountUp,_=ot(function(){d()}),y=ot(function(x){t.preserveValue||h(),f(x)}),m=ot(function(){if(typeof t.children=="function"&&!(l.current instanceof Element)){console.error(`Couldn't find attached element to hook the CountUp instance into! Try to attach "containerRef" from the render prop to a an Element, eg. .`);return}w()});fe.useEffect(function(){m()},[m]),fe.useEffect(function(){u.current&&y(t.end)},[t.end,y]);var p=r&&t;return fe.useEffect(function(){r&&u.current&&_()},[_,r,p]),fe.useEffect(function(){!r&&u.current&&_()},[_,r,t.start,t.suffix,t.prefix,t.duration,t.separator,t.decimals,t.decimal,t.className,t.formattingFn]),fe.useEffect(function(){u.current=!0},[]),typeof s=="function"?s({countUpRef:l,start:d,reset:h,update:f,pauseResume:v,getCountUp:w}):fe.createElement("span",su({className:n,ref:l,style:o},i),typeof t.start<"u"?w().formattingFn(t.start):"")},mb=Rc.default=pb;Rc.useCountUp=w0;const gb=({count:e,label:t,icon:n,delay:r})=>{const[i,s]=jr({triggerOnce:!0,threshold:.1});return g.jsxs(V.div,{ref:i,initial:{opacity:0,scale:.9},animate:s?{opacity:1,scale:1}:{opacity:0,scale:.9},transition:{duration:.6,delay:r},className:"text-center p-6 relative",children:[g.jsx(V.div,{className:"absolute inset-0 bg-gradient-to-br from-secondary-900/20 to-primary-900/10 rounded-xl",animate:{opacity:[.5,.7,.5]},transition:{duration:3,repeat:1/0}}),g.jsxs("div",{className:"relative z-10",children:[g.jsx("div",{className:"text-4xl md:text-5xl lg:text-6xl font-bold mb-3 bg-clip-text text-transparent bg-gradient-to-r from-secondary-400 to-accent-400",children:s?g.jsxs(g.Fragment,{children:[g.jsx(mb,{end:e,duration:2.5,separator:","}),n]}):"0"}),g.jsx("p",{className:"text-text-secondary text-lg",children:t})]})]})},yb=()=>{const[e,t]=jr({triggerOnce:!0,threshold:.1}),n=[{count:150,label:"Bespoke AI solutions developed",icon:"+",delay:0},{count:500,label:"AI Opportunities identified for businesses",icon:"+",delay:.2},{count:2500,label:"Professionals upskilled in AI via our platforms",icon:"+",delay:.4}];return g.jsxs("section",{className:"py-24 relative",id:"results",children:[g.jsx("div",{className:"absolute left-0 right-0 top-0 h-px bg-gradient-to-r from-transparent via-secondary-700/50 to-transparent"}),g.jsxs("div",{className:"container mx-auto px-4 md:px-6",children:[g.jsxs(V.div,{ref:e,initial:{opacity:0,y:20},animate:t?{opacity:1,y:0}:{opacity:0,y:20},transition:{duration:.6},className:"text-center mb-16",children:[g.jsx("h2",{className:"text-3xl md:text-4xl font-bold mb-4",children:"Transforming Businesses with AI"}),g.jsx("p",{className:"text-text-secondary max-w-2xl mx-auto text-lg",children:"Our track record speaks for itself. See how we've helped businesses achieve remarkable results."})]}),g.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:n.map((r,i)=>g.jsx(gb,{count:r.count,label:r.label,icon:r.icon,delay:r.delay},i))})]})]})},vb=()=>{const[e,t]=jr({triggerOnce:!0,threshold:.1}),n="M 5 80 Q 15 75 25 70 Q 35 68 45 65 Q 55 63 65 45 Q 75 25 85 20 Q 95 15 100 12",r=[{icon:g.jsx(Ok,{size:20,className:"text-secondary-400"}),title:"Time Efficiency",value:"85%",subtitle:"Faster Processing",color:"#14c7c7",barData:[20,35,45,60,75,85,90,85,88,92,95,98]},{icon:g.jsx(Lk,{size:20,className:"text-accent-400"}),title:"Revenue Impact",value:"240%",subtitle:"Growth Increase",color:"#00e6e0",barData:[15,25,30,40,55,70,85,95,100,110,125,140]},{icon:g.jsx(y0,{size:20,className:"text-primary-400"}),title:"Client Success",value:"96%",subtitle:"Satisfaction Rate",color:"#33d9d9",barData:[60,65,70,75,80,85,88,90,92,94,95,96]}];return g.jsxs("section",{className:"py-24 relative",id:"contact",children:[g.jsx("div",{className:"absolute left-0 right-0 top-0 h-px bg-gradient-to-r from-transparent via-secondary-700/50 to-transparent"}),g.jsxs("div",{className:"container mx-auto px-4 md:px-6",children:[g.jsxs(V.div,{ref:e,initial:{opacity:0,y:30},animate:t?{opacity:1,y:0}:{opacity:0,y:30},transition:{duration:.6},className:"text-center mb-16",children:[g.jsx("h2",{className:"text-3xl md:text-4xl font-bold mb-6",children:"Performance Dashboard"}),g.jsx("p",{className:"text-text-secondary text-lg max-w-2xl mx-auto leading-relaxed",children:"Real-time insights into the transformative impact of our AI automation solutions."})]}),g.jsx(V.div,{initial:{opacity:0,y:40},animate:t?{opacity:1,y:0}:{opacity:0,y:40},transition:{duration:.8,delay:.2},className:"max-w-7xl mx-auto",children:g.jsxs("div",{className:"bg-white/[0.02] backdrop-blur-sm border border-white/[0.05] rounded-3xl p-8 md:p-12 shadow-2xl relative overflow-hidden",children:[g.jsx("div",{className:"absolute inset-0 opacity-[0.02]",children:g.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"linear-gradient(rgba(255,255,255,0.1) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.1) 1px, transparent 1px)",backgroundSize:"20px 20px"}})}),g.jsxs("div",{className:"relative z-10",children:[g.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8 mb-12",children:r.map((i,s)=>g.jsxs(V.div,{initial:{opacity:0,y:20},animate:t?{opacity:1,y:0}:{opacity:0,y:20},transition:{duration:.6,delay:.4+s*.1},className:"bg-white/[0.03] rounded-2xl p-6 border border-white/[0.08] hover:bg-white/[0.05] transition-all duration-300",children:[g.jsx("div",{className:"flex items-center justify-between mb-4",children:g.jsxs("div",{className:"flex items-center space-x-3",children:[i.icon,g.jsx("span",{className:"text-white/70 text-sm font-medium",children:i.title})]})}),g.jsxs("div",{className:"mb-4",children:[g.jsx("div",{className:"text-3xl font-bold text-white mb-1",children:i.value}),g.jsx("div",{className:"text-white/60 text-sm",children:i.subtitle})]}),g.jsx("div",{className:"flex items-end space-x-1 h-12",children:i.barData.map((o,a)=>g.jsx(V.div,{className:"flex-1 rounded-sm",style:{backgroundColor:i.color},initial:{height:0,opacity:.6},animate:t?{height:`${o/Math.max(...i.barData)*100}%`,opacity:a===i.barData.length-1?1:.6}:{height:0,opacity:.6},transition:{duration:1.2,delay:.8+s*.2+a*.05,ease:"easeOut"}},a))})]},s))}),g.jsxs("div",{className:"bg-white/[0.02] rounded-2xl p-8 border border-white/[0.05]",children:[g.jsxs("div",{className:"flex items-center justify-between mb-8",children:[g.jsxs("div",{children:[g.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:"Monthly Performance Trajectory"}),g.jsx("p",{className:"text-white/60 text-sm",children:"Cumulative impact across all business metrics"})]}),g.jsxs("div",{className:"text-right",children:[g.jsx("div",{className:"text-3xl font-bold",style:{color:"#00e6e0"},children:"92"}),g.jsx("div",{className:"text-white/60 text-sm",children:"Performance Score"})]})]}),g.jsxs("div",{className:"relative h-80 rounded-xl overflow-hidden",children:[g.jsx("div",{className:"absolute inset-0 bg-black/10 rounded-xl"}),g.jsx("div",{className:"absolute inset-0",children:g.jsxs("svg",{className:"w-full h-full",children:[g.jsx("defs",{children:g.jsx("pattern",{id:"chartGrid",width:"60",height:"40",patternUnits:"userSpaceOnUse",children:g.jsx("path",{d:"M 60 0 L 0 0 0 40",fill:"none",stroke:"rgba(255,255,255,0.05)",strokeWidth:"1"})})}),g.jsx("rect",{width:"100%",height:"100%",fill:"url(#chartGrid)"})]})}),g.jsx("div",{className:"absolute inset-8",children:g.jsxs("svg",{viewBox:"0 0 100 100",className:"w-full h-full",preserveAspectRatio:"none",children:[g.jsxs("defs",{children:[g.jsxs("linearGradient",{id:"lineGradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[g.jsx("stop",{offset:"0%",stopColor:"#14c7c7"}),g.jsx("stop",{offset:"50%",stopColor:"#00e6e0"}),g.jsx("stop",{offset:"100%",stopColor:"#33d9d9"})]}),g.jsxs("linearGradient",{id:"areaFill",x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[g.jsx("stop",{offset:"0%",stopColor:"#00e6e0",stopOpacity:"0.2"}),g.jsx("stop",{offset:"100%",stopColor:"#00e6e0",stopOpacity:"0"})]}),g.jsxs("filter",{id:"glow",children:[g.jsx("feGaussianBlur",{stdDeviation:"3",result:"coloredBlur"}),g.jsxs("feMerge",{children:[g.jsx("feMergeNode",{in:"coloredBlur"}),g.jsx("feMergeNode",{in:"SourceGraphic"})]})]})]}),g.jsx(V.path,{d:`${n} L 100 100 L 5 100 Z`,fill:"url(#areaFill)",initial:{opacity:0},animate:t?{opacity:1}:{opacity:0},transition:{duration:1.5,delay:1.2}}),g.jsx(V.path,{d:n,fill:"none",stroke:"url(#lineGradient)",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",filter:"url(#glow)",initial:{pathLength:0,opacity:0},animate:t?{pathLength:1,opacity:1}:{pathLength:0,opacity:0},transition:{duration:2.5,delay:.8,ease:"easeInOut"}}),[{x:5,y:80,label:"Q1"},{x:25,y:70,label:"Q2"},{x:45,y:65,label:"Q3"},{x:65,y:45,label:"Q4"},{x:85,y:20,label:"Q5"},{x:100,y:12,label:"Q6"}].map((i,s)=>g.jsxs("g",{children:[g.jsx(V.circle,{cx:i.x,cy:i.y,r:"4",fill:"#00e6e0",stroke:"white",strokeWidth:"2",initial:{scale:0,opacity:0},animate:t?{scale:1,opacity:1}:{scale:0,opacity:0},transition:{duration:.4,delay:1.5+s*.1,type:"spring",stiffness:200}}),g.jsx(V.circle,{cx:i.x,cy:i.y,r:"4",fill:"none",stroke:"#00e6e0",strokeWidth:"1",initial:{scale:0,opacity:0},animate:t?{scale:[1,2,1],opacity:[.8,0,.8]}:{scale:0,opacity:0},transition:{duration:2,delay:2+s*.1,repeat:1/0,repeatDelay:3}})]},s))]})}),g.jsx("div",{className:"absolute bottom-4 left-8 right-8 flex justify-between",children:["Jan","Mar","May","Jul","Sep","Nov"].map((i,s)=>g.jsx("span",{className:"text-xs font-medium text-white/50",children:i},s))}),g.jsxs("div",{className:"absolute left-4 top-8 bottom-8 flex flex-col justify-between",children:[g.jsx("span",{className:"text-xs font-medium text-white/50",children:"100"}),g.jsx("span",{className:"text-xs font-medium text-white/50",children:"75"}),g.jsx("span",{className:"text-xs font-medium text-white/50",children:"50"}),g.jsx("span",{className:"text-xs font-medium text-white/50",children:"25"}),g.jsx("span",{className:"text-xs font-medium text-white/50",children:"0"})]})]})]}),g.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mt-8",children:[{color:"#14c7c7",title:"Foundation Phase",description:"Initial setup and system integration with immediate efficiency gains"},{color:"#00e6e0",title:"Optimization Phase",description:"AI learning and process refinement leading to exponential improvements"},{color:"#33d9d9",title:"Scale Phase",description:"Full automation deployment with sustained high-performance results"}].map((i,s)=>g.jsxs(V.div,{initial:{opacity:0,y:20},animate:t?{opacity:1,y:0}:{opacity:0,y:20},transition:{duration:.6,delay:2.2+s*.1},className:"flex items-start space-x-4",children:[g.jsx("div",{className:"w-3 h-3 rounded-full mt-1 flex-shrink-0",style:{backgroundColor:i.color}}),g.jsxs("div",{children:[g.jsx("h4",{className:"text-white font-medium text-sm mb-1",children:i.title}),g.jsx("p",{className:"text-white/60 text-xs leading-relaxed",children:i.description})]})]},s))})]})]})}),g.jsxs(V.div,{initial:{opacity:0,y:30},animate:t?{opacity:1,y:0}:{opacity:0,y:30},transition:{duration:.6,delay:2.8},className:"text-center mt-16",children:[g.jsx("h3",{className:"text-2xl font-semibold mb-6 text-white",children:"Ready to See These Results?"}),g.jsx("p",{className:"text-white/70 mb-10 max-w-2xl mx-auto text-lg leading-relaxed",children:"Join forward-thinking companies that have transformed their operations with our proven AI methodology."}),g.jsxs(V.button,{onClick:()=>window.location.href="/book-call",className:"inline-flex items-center px-10 py-4 text-lg font-semibold text-white bg-gradient-to-r from-secondary-600 to-accent-700 rounded-xl shadow-2xl shadow-secondary-900/30 hover:shadow-secondary-800/50 transition-all duration-300 border border-white/10",whileHover:{scale:1.02,y:-2},whileTap:{scale:.98},children:["Schedule Strategy Session",g.jsx($k,{className:"ml-3",size:20})]})]})]})]})},wb=()=>g.jsx("footer",{className:"bg-background-dark py-12 border-t border-secondary-900/20 relative",children:g.jsxs("div",{className:"container mx-auto px-4 md:px-6",children:[g.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-8",children:[g.jsxs("div",{className:"col-span-1 md:col-span-1",children:[g.jsxs("div",{className:"flex items-center mb-4",children:[g.jsx("img",{src:"/assets/logo.png",alt:"Logo",className:"w-8 h-8 mr-2"}),g.jsxs("span",{className:"text-xl font-semibold",children:["NeoCyber",g.jsx("span",{className:"bg-gradient-to-r from-accent-500 to-secondary-900 bg-clip-text text-transparent",children:"Acquisition"})]})]}),g.jsx("p",{className:"text-text-secondary text-sm mb-6",children:"Transforming businesses with cutting-edge AI automation and integration solutions."})]}),g.jsxs("div",{className:"col-span-1",children:[g.jsx("h3",{className:"text-text-primary font-medium mb-4",children:"Quick Links"}),g.jsx("ul",{className:"space-y-2",children:["Home","Features","Results","Contact"].map(e=>g.jsx("li",{children:g.jsx("a",{href:`#${e.toLowerCase()}`,className:"text-text-secondary hover:text-accent-400 transition-colors text-sm",children:e})},e))})]}),g.jsxs("div",{className:"col-span-1",children:[g.jsx("h3",{className:"text-text-primary font-medium mb-4",children:"Contact"}),g.jsxs("ul",{className:"space-y-3",children:[g.jsx("li",{className:"flex items-start",children:g.jsx("span",{className:"text-text-secondary text-sm"})}),g.jsxs("li",{className:"flex items-center",children:[g.jsx(g0,{size:18,className:"text-secondary-400 mr-2 flex-shrink-0"}),g.jsx("a",{href:"mailto:damian@neocyberacquisition.com",className:"text-text-secondary hover:text-accent-400 transition-colors text-sm",children:"damian@neocyberacquisition.com"})]}),g.jsx("li",{className:"flex items-center",children:g.jsx("a",{href:"tel:+1234567890",className:"text-text-secondary hover:text-accent-400 transition-colors text-sm"})})]})]}),g.jsxs("div",{className:"col-span-1",children:[g.jsx("h3",{className:"text-text-primary font-medium mb-4",children:"Connect"}),g.jsx("div",{className:"flex space-x-4",children:[{icon:g.jsx("span",{className:"text-lg",children:"𝕏"}),href:"https://x.com/Damian_Bobica"},{icon:"in",href:"https://www.linkedin.com/in/damian-bobica-a49653335/"},{icon:"IG",href:"https://www.instagram.com/damianbobica/"}].map((e,t)=>g.jsx("a",{href:e.href,className:"bg-background-light hover:bg-secondary-900/50 transition-colors p-2 rounded-full text-text-secondary hover:text-secondary-400",children:e.icon},t))})]})]}),g.jsx("div",{className:"border-t border-secondary-900/20 mt-12 pt-6 text-center text-text-secondary text-sm",children:g.jsxs("p",{children:["© ",new Date().getFullYear()," NeoCyberAcquisition. All rights reserved."]})})]})}),xb=()=>g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"fixed inset-0 bg-black"}),g.jsx("div",{className:"fixed inset-0 bg-grain opacity-[0.015] pointer-events-none z-10"}),g.jsxs("div",{className:"fixed bottom-0 left-0 right-0 h-64 pointer-events-none overflow-hidden",children:[g.jsx(V.div,{className:"absolute bottom-0 left-[-10%] right-[-10%] h-64",style:{backgroundImage:`url("data:image/svg+xml,%3Csvg viewBox='0 0 1200 300' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M 0 250 Q 300 150 600 200 T 1200 250 L 1200 300 L 0 300 Z' fill='%23003534' opacity='0.2'/%3E%3C/svg%3E")`,backgroundRepeat:"repeat-x",backgroundSize:"100% 100%"},animate:{x:[0,-50]},transition:{duration:20,repeat:1/0,repeatType:"reverse",ease:"linear"}}),g.jsx(V.div,{className:"absolute bottom-0 left-[-10%] right-[-10%] h-64",style:{backgroundImage:`url("data:image/svg+xml,%3Csvg viewBox='0 0 1200 300' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M 0 250 Q 300 200 600 250 T 1200 200 L 1200 300 L 0 300 Z' fill='%23003534' opacity='0.15'/%3E%3C/svg%3E")`,backgroundRepeat:"repeat-x",backgroundSize:"120% 100%"},animate:{x:[-50,0]},transition:{duration:15,repeat:1/0,repeatType:"reverse",ease:"linear"}})]}),g.jsxs("div",{className:"fixed inset-0 overflow-hidden pointer-events-none",children:[g.jsx(V.div,{className:"absolute top-[20%] right-[15%] w-[400px] h-[400px] rounded-full bg-accent-900/10 filter blur-[100px]",animate:{opacity:[.3,.5,.3],scale:[1,1.1,1]},transition:{duration:8,repeat:1/0,repeatType:"reverse"}}),g.jsx(V.div,{className:"absolute bottom-[30%] left-[10%] w-[300px] h-[300px] rounded-full bg-primary-900/15 filter blur-[80px]",animate:{opacity:[.2,.4,.2],scale:[1,1.15,1]},transition:{duration:7,repeat:1/0,repeatType:"reverse",delay:2}})]})]}),_b=()=>g.jsxs("div",{className:"relative min-h-screen bg-background font-sans",children:[g.jsx(xb,{}),g.jsx(zk,{}),g.jsxs("main",{children:[g.jsx(Wk,{}),g.jsx(Yk,{}),g.jsx(yb,{}),g.jsx(vb,{})]}),g.jsx(wb,{})]}),Sb="modulepreload",kb=function(e){return"/"+e},lf={},Qi=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(n.map(l=>{if(l=kb(l),l in lf)return;lf[l]=!0;const u=l.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":Sb,u||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),u)return new Promise((h,f)=>{d.addEventListener("load",h),d.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})},bb=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...n)=>Qi(async()=>{const{default:r}=await Promise.resolve().then(()=>Dr);return{default:r}},void 0).then(({default:r})=>r(...n)):t=fetch,(...n)=>t(...n)};class Oc extends Error{constructor(t,n="FunctionsError",r){super(t),this.name=n,this.context=r}}class Pb extends Oc{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class Eb extends Oc{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class Cb extends Oc{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var ou;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(ou||(ou={}));var Tb=function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(d){o(d)}}function l(c){try{u(r.throw(c))}catch(d){o(d)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((r=r.apply(e,t||[])).next())})};class jb{constructor(t,{headers:n={},customFetch:r,region:i=ou.Any}={}){this.url=t,this.headers=n,this.region=i,this.fetch=bb(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t,n={}){var r;return Tb(this,void 0,void 0,function*(){try{const{headers:i,method:s,body:o}=n;let a={},{region:l}=n;l||(l=this.region),l&&l!=="any"&&(a["x-region"]=l);let u;o&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)&&(typeof Blob<"u"&&o instanceof Blob||o instanceof ArrayBuffer?(a["Content-Type"]="application/octet-stream",u=o):typeof o=="string"?(a["Content-Type"]="text/plain",u=o):typeof FormData<"u"&&o instanceof FormData?u=o:(a["Content-Type"]="application/json",u=JSON.stringify(o)));const c=yield this.fetch(`${this.url}/${t}`,{method:s||"POST",headers:Object.assign(Object.assign(Object.assign({},a),this.headers),i),body:u}).catch(v=>{throw new Pb(v)}),d=c.headers.get("x-relay-error");if(d&&d==="true")throw new Eb(c);if(!c.ok)throw new Cb(c);let h=((r=c.headers.get("Content-Type"))!==null&&r!==void 0?r:"text/plain").split(";")[0].trim(),f;return h==="application/json"?f=yield c.json():h==="application/octet-stream"?f=yield c.blob():h==="text/event-stream"?f=c:h==="multipart/form-data"?f=yield c.formData():f=yield c.text(),{data:f,error:null}}catch(i){return{data:null,error:i}}})}}var Ne={},Nc={},Jo={},Ji={},Yo={},Xo={},Ab=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")},Ar=Ab();const Rb=Ar.fetch,x0=Ar.fetch.bind(Ar),_0=Ar.Headers,Ob=Ar.Request,Nb=Ar.Response,Dr=Object.freeze(Object.defineProperty({__proto__:null,Headers:_0,Request:Ob,Response:Nb,default:x0,fetch:Rb},Symbol.toStringTag,{value:"Module"})),Lb=G0(Dr);var Zo={};Object.defineProperty(Zo,"__esModule",{value:!0});let Ib=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}};Zo.default=Ib;var S0=ze&&ze.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Xo,"__esModule",{value:!0});const Db=S0(Lb),Mb=S0(Zo);let Vb=class{constructor(t){this.shouldThrowOnError=!1,this.method=t.method,this.url=t.url,this.headers=t.headers,this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=t.shouldThrowOnError,this.signal=t.signal,this.isMaybeSingle=t.isMaybeSingle,t.fetch?this.fetch=t.fetch:typeof fetch>"u"?this.fetch=Db.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,n){return this.headers=Object.assign({},this.headers),this.headers[t]=n,this}then(t,n){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 r=this.fetch;let i=r(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async s=>{var o,a,l;let u=null,c=null,d=null,h=s.status,f=s.statusText;if(s.ok){if(this.method!=="HEAD"){const y=await s.text();y===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?c=y:c=JSON.parse(y))}const w=(o=this.headers.Prefer)===null||o===void 0?void 0:o.match(/count=(exact|planned|estimated)/),_=(a=s.headers.get("content-range"))===null||a===void 0?void 0:a.split("/");w&&_&&_.length>1&&(d=parseInt(_[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(c)&&(c.length>1?(u={code:"PGRST116",details:`Results contain ${c.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},c=null,d=null,h=406,f="Not Acceptable"):c.length===1?c=c[0]:c=null)}else{const w=await s.text();try{u=JSON.parse(w),Array.isArray(u)&&s.status===404&&(c=[],u=null,h=200,f="OK")}catch{s.status===404&&w===""?(h=204,f="No Content"):u={message:w}}if(u&&this.isMaybeSingle&&(!((l=u==null?void 0:u.details)===null||l===void 0)&&l.includes("0 rows"))&&(u=null,h=200,f="OK"),u&&this.shouldThrowOnError)throw new Mb.default(u)}return{error:u,data:c,count:d,status:h,statusText:f}});return this.shouldThrowOnError||(i=i.catch(s=>{var o,a,l;return{error:{message:`${(o=s==null?void 0:s.name)!==null&&o!==void 0?o:"FetchError"}: ${s==null?void 0:s.message}`,details:`${(a=s==null?void 0:s.stack)!==null&&a!==void 0?a:""}`,hint:"",code:`${(l=s==null?void 0:s.code)!==null&&l!==void 0?l:""}`},data:null,count:null,status:0,statusText:""}})),i.then(t,n)}returns(){return this}overrideTypes(){return this}};Xo.default=Vb;var $b=ze&&ze.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Yo,"__esModule",{value:!0});const Fb=$b(Xo);let Ub=class extends Fb.default{select(t){let n=!1;const r=(t??"*").split("").map(i=>/\s/.test(i)&&!n?"":(i==='"'&&(n=!n),i)).join("");return this.url.searchParams.set("select",r),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(t,{ascending:n=!0,nullsFirst:r,foreignTable:i,referencedTable:s=i}={}){const o=s?`${s}.order`:"order",a=this.url.searchParams.get(o);return this.url.searchParams.set(o,`${a?`${a},`:""}${t}.${n?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:n,referencedTable:r=n}={}){const i=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(i,`${t}`),this}range(t,n,{foreignTable:r,referencedTable:i=r}={}){const s=typeof i>"u"?"offset":`${i}.offset`,o=typeof i>"u"?"limit":`${i}.limit`;return this.url.searchParams.set(s,`${t}`),this.url.searchParams.set(o,`${n-t+1}`),this}abortSignal(t){return this.signal=t,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}explain({analyze:t=!1,verbose:n=!1,settings:r=!1,buffers:i=!1,wal:s=!1,format:o="text"}={}){var a;const l=[t?"analyze":null,n?"verbose":null,r?"settings":null,i?"buffers":null,s?"wal":null].filter(Boolean).join("|"),u=(a=this.headers.Accept)!==null&&a!==void 0?a:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${o}; for="${u}"; options=${l};`,o==="json"?this:this}rollback(){var t;return((t=this.headers.Prefer)!==null&&t!==void 0?t:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}};Yo.default=Ub;var Bb=ze&&ze.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ji,"__esModule",{value:!0});const zb=Bb(Yo);let Wb=class extends zb.default{eq(t,n){return this.url.searchParams.append(t,`eq.${n}`),this}neq(t,n){return this.url.searchParams.append(t,`neq.${n}`),this}gt(t,n){return this.url.searchParams.append(t,`gt.${n}`),this}gte(t,n){return this.url.searchParams.append(t,`gte.${n}`),this}lt(t,n){return this.url.searchParams.append(t,`lt.${n}`),this}lte(t,n){return this.url.searchParams.append(t,`lte.${n}`),this}like(t,n){return this.url.searchParams.append(t,`like.${n}`),this}likeAllOf(t,n){return this.url.searchParams.append(t,`like(all).{${n.join(",")}}`),this}likeAnyOf(t,n){return this.url.searchParams.append(t,`like(any).{${n.join(",")}}`),this}ilike(t,n){return this.url.searchParams.append(t,`ilike.${n}`),this}ilikeAllOf(t,n){return this.url.searchParams.append(t,`ilike(all).{${n.join(",")}}`),this}ilikeAnyOf(t,n){return this.url.searchParams.append(t,`ilike(any).{${n.join(",")}}`),this}is(t,n){return this.url.searchParams.append(t,`is.${n}`),this}in(t,n){const r=Array.from(new Set(n)).map(i=>typeof i=="string"&&new RegExp("[,()]").test(i)?`"${i}"`:`${i}`).join(",");return this.url.searchParams.append(t,`in.(${r})`),this}contains(t,n){return typeof n=="string"?this.url.searchParams.append(t,`cs.${n}`):Array.isArray(n)?this.url.searchParams.append(t,`cs.{${n.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(n)}`),this}containedBy(t,n){return typeof n=="string"?this.url.searchParams.append(t,`cd.${n}`):Array.isArray(n)?this.url.searchParams.append(t,`cd.{${n.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(n)}`),this}rangeGt(t,n){return this.url.searchParams.append(t,`sr.${n}`),this}rangeGte(t,n){return this.url.searchParams.append(t,`nxl.${n}`),this}rangeLt(t,n){return this.url.searchParams.append(t,`sl.${n}`),this}rangeLte(t,n){return this.url.searchParams.append(t,`nxr.${n}`),this}rangeAdjacent(t,n){return this.url.searchParams.append(t,`adj.${n}`),this}overlaps(t,n){return typeof n=="string"?this.url.searchParams.append(t,`ov.${n}`):this.url.searchParams.append(t,`ov.{${n.join(",")}}`),this}textSearch(t,n,{config:r,type:i}={}){let s="";i==="plain"?s="pl":i==="phrase"?s="ph":i==="websearch"&&(s="w");const o=r===void 0?"":`(${r})`;return this.url.searchParams.append(t,`${s}fts${o}.${n}`),this}match(t){return Object.entries(t).forEach(([n,r])=>{this.url.searchParams.append(n,`eq.${r}`)}),this}not(t,n,r){return this.url.searchParams.append(t,`not.${n}.${r}`),this}or(t,{foreignTable:n,referencedTable:r=n}={}){const i=r?`${r}.or`:"or";return this.url.searchParams.append(i,`(${t})`),this}filter(t,n,r){return this.url.searchParams.append(t,`${n}.${r}`),this}};Ji.default=Wb;var Hb=ze&&ze.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Jo,"__esModule",{value:!0});const Kr=Hb(Ji);let qb=class{constructor(t,{headers:n={},schema:r,fetch:i}){this.url=t,this.headers=n,this.schema=r,this.fetch=i}select(t,{head:n=!1,count:r}={}){const i=n?"HEAD":"GET";let s=!1;const o=(t??"*").split("").map(a=>/\s/.test(a)&&!s?"":(a==='"'&&(s=!s),a)).join("");return this.url.searchParams.set("select",o),r&&(this.headers.Prefer=`count=${r}`),new Kr.default({method:i,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(t,{count:n,defaultToNull:r=!0}={}){const i="POST",s=[];if(this.headers.Prefer&&s.push(this.headers.Prefer),n&&s.push(`count=${n}`),r||s.push("missing=default"),this.headers.Prefer=s.join(","),Array.isArray(t)){const o=t.reduce((a,l)=>a.concat(Object.keys(l)),[]);if(o.length>0){const a=[...new Set(o)].map(l=>`"${l}"`);this.url.searchParams.set("columns",a.join(","))}}return new Kr.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:this.fetch,allowEmpty:!1})}upsert(t,{onConflict:n,ignoreDuplicates:r=!1,count:i,defaultToNull:s=!0}={}){const o="POST",a=[`resolution=${r?"ignore":"merge"}-duplicates`];if(n!==void 0&&this.url.searchParams.set("on_conflict",n),this.headers.Prefer&&a.push(this.headers.Prefer),i&&a.push(`count=${i}`),s||a.push("missing=default"),this.headers.Prefer=a.join(","),Array.isArray(t)){const l=t.reduce((u,c)=>u.concat(Object.keys(c)),[]);if(l.length>0){const u=[...new Set(l)].map(c=>`"${c}"`);this.url.searchParams.set("columns",u.join(","))}}return new Kr.default({method:o,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:this.fetch,allowEmpty:!1})}update(t,{count:n}={}){const r="PATCH",i=[];return this.headers.Prefer&&i.push(this.headers.Prefer),n&&i.push(`count=${n}`),this.headers.Prefer=i.join(","),new Kr.default({method:r,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:this.fetch,allowEmpty:!1})}delete({count:t}={}){const n="DELETE",r=[];return t&&r.push(`count=${t}`),this.headers.Prefer&&r.unshift(this.headers.Prefer),this.headers.Prefer=r.join(","),new Kr.default({method:n,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};Jo.default=qb;var ea={},ta={};Object.defineProperty(ta,"__esModule",{value:!0});ta.version=void 0;ta.version="0.0.0-automated";Object.defineProperty(ea,"__esModule",{value:!0});ea.DEFAULT_HEADERS=void 0;const Gb=ta;ea.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${Gb.version}`};var k0=ze&&ze.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Nc,"__esModule",{value:!0});const Kb=k0(Jo),Qb=k0(Ji),Jb=ea;let Yb=class b0{constructor(t,{headers:n={},schema:r,fetch:i}={}){this.url=t,this.headers=Object.assign(Object.assign({},Jb.DEFAULT_HEADERS),n),this.schemaName=r,this.fetch=i}from(t){const n=new URL(`${this.url}/${t}`);return new Kb.default(n,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(t){return new b0(this.url,{headers:this.headers,schema:t,fetch:this.fetch})}rpc(t,n={},{head:r=!1,get:i=!1,count:s}={}){let o;const a=new URL(`${this.url}/rpc/${t}`);let l;r||i?(o=r?"HEAD":"GET",Object.entries(n).filter(([c,d])=>d!==void 0).map(([c,d])=>[c,Array.isArray(d)?`{${d.join(",")}}`:`${d}`]).forEach(([c,d])=>{a.searchParams.append(c,d)})):(o="POST",l=n);const u=Object.assign({},this.headers);return s&&(u.Prefer=`count=${s}`),new Qb.default({method:o,url:a,headers:u,schema:this.schemaName,body:l,fetch:this.fetch,allowEmpty:!1})}};Nc.default=Yb;var Mr=ze&&ze.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.PostgrestError=Ne.PostgrestBuilder=Ne.PostgrestTransformBuilder=Ne.PostgrestFilterBuilder=Ne.PostgrestQueryBuilder=Ne.PostgrestClient=void 0;const P0=Mr(Nc);Ne.PostgrestClient=P0.default;const E0=Mr(Jo);Ne.PostgrestQueryBuilder=E0.default;const C0=Mr(Ji);Ne.PostgrestFilterBuilder=C0.default;const T0=Mr(Yo);Ne.PostgrestTransformBuilder=T0.default;const j0=Mr(Xo);Ne.PostgrestBuilder=j0.default;const A0=Mr(Zo);Ne.PostgrestError=A0.default;var Xb=Ne.default={PostgrestClient:P0.default,PostgrestQueryBuilder:E0.default,PostgrestFilterBuilder:C0.default,PostgrestTransformBuilder:T0.default,PostgrestBuilder:j0.default,PostgrestError:A0.default};const{PostgrestClient:Zb,PostgrestQueryBuilder:JE,PostgrestFilterBuilder:YE,PostgrestTransformBuilder:XE,PostgrestBuilder:ZE,PostgrestError:eC}=Xb;let au;typeof window>"u"?au=require("ws"):au=window.WebSocket;const eP=au,tP="2.11.10",nP={"X-Client-Info":`realtime-js/${tP}`},rP="1.0.0",R0=1e4,iP=1e3;var wr;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(wr||(wr={}));var Pe;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(Pe||(Pe={}));var lt;(function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"})(lt||(lt={}));var lu;(function(e){e.websocket="websocket"})(lu||(lu={}));var Pn;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(Pn||(Pn={}));class sP{constructor(){this.HEADER_LENGTH=1}decode(t,n){return t.constructor===ArrayBuffer?n(this._binaryDecode(t)):n(typeof t=="string"?JSON.parse(t):{})}_binaryDecode(t){const n=new DataView(t),r=new TextDecoder;return this._decodeBroadcast(t,n,r)}_decodeBroadcast(t,n,r){const i=n.getUint8(1),s=n.getUint8(2);let o=this.HEADER_LENGTH+2;const a=r.decode(t.slice(o,o+i));o=o+i;const l=r.decode(t.slice(o,o+s));o=o+s;const u=JSON.parse(r.decode(t.slice(o,t.byteLength)));return{ref:null,topic:a,event:l,payload:u}}}class O0{constructor(t,n){this.callback=t,this.timerCalc=n,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=n}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var B;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(B||(B={}));const uf=(e,t,n={})=>{var r;const i=(r=n.skipTypes)!==null&&r!==void 0?r:[];return Object.keys(t).reduce((s,o)=>(s[o]=oP(o,e,t,i),s),{})},oP=(e,t,n,r)=>{const i=t.find(a=>a.name===e),s=i==null?void 0:i.type,o=n[e];return s&&!r.includes(s)?N0(s,o):uu(o)},N0=(e,t)=>{if(e.charAt(0)==="_"){const n=e.slice(1,e.length);return cP(t,n)}switch(e){case B.bool:return aP(t);case B.float4:case B.float8:case B.int2:case B.int4:case B.int8:case B.numeric:case B.oid:return lP(t);case B.json:case B.jsonb:return uP(t);case B.timestamp:return dP(t);case B.abstime:case B.date:case B.daterange:case B.int4range:case B.int8range:case B.money:case B.reltime:case B.text:case B.time:case B.timestamptz:case B.timetz:case B.tsrange:case B.tstzrange:return uu(t);default:return uu(t)}},uu=e=>e,aP=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},lP=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},uP=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch(t){return console.log(`JSON parse error: ${t}`),e}return e},cP=(e,t)=>{if(typeof e!="string")return e;const n=e.length-1,r=e[n];if(e[0]==="{"&&r==="}"){let s;const o=e.slice(1,n);try{s=JSON.parse("["+o+"]")}catch{s=o?o.split(","):[]}return s.map(a=>N0(t,a))}return e},dP=e=>typeof e=="string"?e.replace(" ","T"):e,L0=e=>{let t=e;return t=t.replace(/^ws/i,"http"),t=t.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),t.replace(/\/+$/,"")};class za{constructor(t,n,r={},i=R0){this.channel=t,this.event=n,this.payload=r,this.timeout=i,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(t){this.timeout=t,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(t){this.payload=Object.assign(Object.assign({},this.payload),t)}receive(t,n){var r;return this._hasReceived(t)&&n((r=this.receivedResp)===null||r===void 0?void 0:r.response),this.recHooks.push({status:t,callback:n}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const t=n=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=n,this._matchReceive(n)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,n){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:n})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:t,response:n}){this.recHooks.filter(r=>r.status===t).forEach(r=>r.callback(n))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}}var cf;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(cf||(cf={}));class pi{constructor(t,n){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const r=(n==null?void 0:n.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},i=>{const{onJoin:s,onLeave:o,onSync:a}=this.caller;this.joinRef=this.channel._joinRef(),this.state=pi.syncState(this.state,i,s,o),this.pendingDiffs.forEach(l=>{this.state=pi.syncDiff(this.state,l,s,o)}),this.pendingDiffs=[],a()}),this.channel._on(r.diff,{},i=>{const{onJoin:s,onLeave:o,onSync:a}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(i):(this.state=pi.syncDiff(this.state,i,s,o),a())}),this.onJoin((i,s,o)=>{this.channel._trigger("presence",{event:"join",key:i,currentPresences:s,newPresences:o})}),this.onLeave((i,s,o)=>{this.channel._trigger("presence",{event:"leave",key:i,currentPresences:s,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,n,r,i){const s=this.cloneDeep(t),o=this.transformState(n),a={},l={};return this.map(s,(u,c)=>{o[u]||(l[u]=c)}),this.map(o,(u,c)=>{const d=s[u];if(d){const h=c.map(_=>_.presence_ref),f=d.map(_=>_.presence_ref),v=c.filter(_=>f.indexOf(_.presence_ref)<0),w=d.filter(_=>h.indexOf(_.presence_ref)<0);v.length>0&&(a[u]=v),w.length>0&&(l[u]=w)}else a[u]=c}),this.syncDiff(s,{joins:a,leaves:l},r,i)}static syncDiff(t,n,r,i){const{joins:s,leaves:o}={joins:this.transformState(n.joins),leaves:this.transformState(n.leaves)};return r||(r=()=>{}),i||(i=()=>{}),this.map(s,(a,l)=>{var u;const c=(u=t[a])!==null&&u!==void 0?u:[];if(t[a]=this.cloneDeep(l),c.length>0){const d=t[a].map(f=>f.presence_ref),h=c.filter(f=>d.indexOf(f.presence_ref)<0);t[a].unshift(...h)}r(a,c,l)}),this.map(o,(a,l)=>{let u=t[a];if(!u)return;const c=l.map(d=>d.presence_ref);u=u.filter(d=>c.indexOf(d.presence_ref)<0),t[a]=u,i(a,u,l),u.length===0&&delete t[a]}),t}static map(t,n){return Object.getOwnPropertyNames(t).map(r=>n(r,t[r]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((n,r)=>{const i=t[r];return"metas"in i?n[r]=i.metas.map(s=>(s.presence_ref=s.phx_ref,delete s.phx_ref,delete s.phx_ref_prev,s)):n[r]=i,n},{})}static cloneDeep(t){return JSON.parse(JSON.stringify(t))}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var df;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(df||(df={}));var hf;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(hf||(hf={}));var St;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(St||(St={}));class Lc{constructor(t,n={config:{}},r){this.topic=t,this.params=n,this.socket=r,this.bindings={},this.state=Pe.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""},private:!1},n.config),this.timeout=this.socket.timeout,this.joinPush=new za(this,lt.join,this.params,this.timeout),this.rejoinTimer=new O0(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Pe.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(i=>i.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Pe.closed,this.socket._remove(this)}),this._onError(i=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,i),this.state=Pe.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Pe.errored,this.rejoinTimer.scheduleTimeout())}),this._on(lt.reply,{},(i,s)=>{this._trigger(this._replyEventName(s),i)}),this.presence=new pi(this),this.broadcastEndpointURL=L0(this.socket.endPoint)+"/api/broadcast",this.private=this.params.config.private||!1}subscribe(t,n=this.timeout){var r,i;if(this.socket.isConnected()||this.socket.connect(),this.joinedOnce)throw"tried to subscribe multiple times. 'subscribe' can only be called a single time per channel instance";{const{config:{broadcast:s,presence:o,private:a}}=this.params;this._onError(c=>t==null?void 0:t(St.CHANNEL_ERROR,c)),this._onClose(()=>t==null?void 0:t(St.CLOSED));const l={},u={broadcast:s,presence:o,postgres_changes:(i=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(c=>c.filter))!==null&&i!==void 0?i:[],private:a};this.socket.accessTokenValue&&(l.access_token=this.socket.accessTokenValue),this.updateJoinPayload(Object.assign({config:u},l)),this.joinedOnce=!0,this._rejoin(n),this.joinPush.receive("ok",async({postgres_changes:c})=>{var d;if(this.socket.setAuth(),c===void 0){t==null||t(St.SUBSCRIBED);return}else{const h=this.bindings.postgres_changes,f=(d=h==null?void 0:h.length)!==null&&d!==void 0?d:0,v=[];for(let w=0;w{this.state=Pe.errored,t==null||t(St.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(c).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(St.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,n={}){return await this.send({type:"presence",event:"track",payload:t},n.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,n,r){return this._on(t,n,r)}async send(t,n={}){var r,i;if(!this._canPush()&&t.type==="broadcast"){const{event:s,payload:o}=t,l={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:s,payload:o,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((i=u.body)===null||i===void 0?void 0:i.cancel()),u.ok?"ok":"error"}catch(u){return u.name==="AbortError"?"timed out":"error"}}else return new Promise(s=>{var o,a,l;const u=this._push(t.type,t,n.timeout||this.timeout);t.type==="broadcast"&&!(!((l=(a=(o=this.params)===null||o===void 0?void 0:o.config)===null||a===void 0?void 0:a.broadcast)===null||l===void 0)&&l.ack)&&s("ok"),u.receive("ok",()=>s("ok")),u.receive("error",()=>s("error")),u.receive("timeout",()=>s("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=Pe.leaving;const n=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(lt.close,"leave",this._joinRef())};return this.joinPush.destroy(),new Promise(r=>{const i=new za(this,lt.leave,{},t);i.receive("ok",()=>{n(),r("ok")}).receive("timeout",()=>{n(),r("timed out")}).receive("error",()=>{r("error")}),i.send(),this._canPush()||i.trigger("ok",{})})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.rejoinTimer&&clearTimeout(this.rejoinTimer.timer),this.joinPush.destroy()}async _fetchWithTimeout(t,n,r){const i=new AbortController,s=setTimeout(()=>i.abort(),r),o=await this.socket.fetch(t,Object.assign(Object.assign({},n),{signal:i.signal}));return clearTimeout(s),o}_push(t,n,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let i=new za(this,t,n,r);return this._canPush()?i.send():(i.startTimeout(),this.pushBuffer.push(i)),i}_onMessage(t,n,r){return n}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,n,r){var i,s;const o=t.toLocaleLowerCase(),{close:a,error:l,leave:u,join:c}=lt;if(r&&[a,l,u,c].indexOf(o)>=0&&r!==this._joinRef())return;let h=this._onMessage(o,n,r);if(n&&!h)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(i=this.bindings.postgres_changes)===null||i===void 0||i.filter(f=>{var v,w,_;return((v=f.filter)===null||v===void 0?void 0:v.event)==="*"||((_=(w=f.filter)===null||w===void 0?void 0:w.event)===null||_===void 0?void 0:_.toLocaleLowerCase())===o}).map(f=>f.callback(h,r)):(s=this.bindings[o])===null||s===void 0||s.filter(f=>{var v,w,_,y,m,p;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in f){const x=f.id,S=(v=f.filter)===null||v===void 0?void 0:v.event;return x&&((w=n.ids)===null||w===void 0?void 0:w.includes(x))&&(S==="*"||(S==null?void 0:S.toLocaleLowerCase())===((_=n.data)===null||_===void 0?void 0:_.type.toLocaleLowerCase()))}else{const x=(m=(y=f==null?void 0:f.filter)===null||y===void 0?void 0:y.event)===null||m===void 0?void 0:m.toLocaleLowerCase();return x==="*"||x===((p=n==null?void 0:n.event)===null||p===void 0?void 0:p.toLocaleLowerCase())}else return f.type.toLocaleLowerCase()===o}).map(f=>{if(typeof h=="object"&&"ids"in h){const v=h.data,{schema:w,table:_,commit_timestamp:y,type:m,errors:p}=v;h=Object.assign(Object.assign({},{schema:w,table:_,commit_timestamp:y,eventType:m,new:{},old:{},errors:p}),this._getPayloadRecords(v))}f.callback(h,r)})}_isClosed(){return this.state===Pe.closed}_isJoined(){return this.state===Pe.joined}_isJoining(){return this.state===Pe.joining}_isLeaving(){return this.state===Pe.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,n,r){const i=t.toLocaleLowerCase(),s={type:i,filter:n,callback:r};return this.bindings[i]?this.bindings[i].push(s):this.bindings[i]=[s],this}_off(t,n){const r=t.toLocaleLowerCase();return this.bindings[r]=this.bindings[r].filter(i=>{var s;return!(((s=i.type)===null||s===void 0?void 0:s.toLocaleLowerCase())===r&&Lc.isEqual(i.filter,n))}),this}static isEqual(t,n){if(Object.keys(t).length!==Object.keys(n).length)return!1;for(const r in t)if(t[r]!==n[r])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(lt.close,{},t)}_onError(t){this._on(lt.error,{},n=>t(n))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Pe.joining,this.joinPush.resend(t))}_getPayloadRecords(t){const n={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(n.new=uf(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(n.old=uf(t.columns,t.old_record)),n}}const ff=()=>{},hP=` + addEventListener("message", (e) => { + if (e.data.event === "start") { + setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); + } + });`;class fP{constructor(t,n){var r;this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers=nP,this.params={},this.timeout=R0,this.heartbeatIntervalMs=25e3,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=ff,this.ref=0,this.logger=ff,this.conn=null,this.sendBuffer=[],this.serializer=new sP,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._resolveFetch=s=>{let o;return s?o=s:typeof fetch>"u"?o=(...a)=>Qi(async()=>{const{default:l}=await Promise.resolve().then(()=>Dr);return{default:l}},void 0).then(({default:l})=>l(...a)):o=fetch,(...a)=>o(...a)},this.endPoint=`${t}/${lu.websocket}`,this.httpEndpoint=L0(t),n!=null&&n.transport?this.transport=n.transport:this.transport=null,n!=null&&n.params&&(this.params=n.params),n!=null&&n.headers&&(this.headers=Object.assign(Object.assign({},this.headers),n.headers)),n!=null&&n.timeout&&(this.timeout=n.timeout),n!=null&&n.logger&&(this.logger=n.logger),(n!=null&&n.logLevel||n!=null&&n.log_level)&&(this.logLevel=n.logLevel||n.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),n!=null&&n.heartbeatIntervalMs&&(this.heartbeatIntervalMs=n.heartbeatIntervalMs);const i=(r=n==null?void 0:n.params)===null||r===void 0?void 0:r.apikey;if(i&&(this.accessTokenValue=i,this.apiKey=i),this.reconnectAfterMs=n!=null&&n.reconnectAfterMs?n.reconnectAfterMs:s=>[1e3,2e3,5e3,1e4][s-1]||1e4,this.encode=n!=null&&n.encode?n.encode:(s,o)=>o(JSON.stringify(s)),this.decode=n!=null&&n.decode?n.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new O0(async()=>{this.disconnect(),this.connect()},this.reconnectAfterMs),this.fetch=this._resolveFetch(n==null?void 0:n.fetch),n!=null&&n.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.worker=(n==null?void 0:n.worker)||!1,this.workerUrl=n==null?void 0:n.workerUrl}this.accessToken=(n==null?void 0:n.accessToken)||null}connect(){if(!this.conn){if(this.transport||(this.transport=eP),this.transport){typeof window<"u"&&this.transport===window.WebSocket?this.conn=new this.transport(this.endpointURL()):this.conn=new this.transport(this.endpointURL(),void 0,{headers:this.headers}),this.setupConnection();return}this.conn=new pP(this.endpointURL(),void 0,{close:()=>{this.conn=null}})}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:rP}))}disconnect(t,n){this.conn&&(this.conn.onclose=function(){},t?this.conn.close(t,n??""):this.conn.close(),this.conn=null,this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.reset(),this.channels.forEach(r=>r.teardown()))}getChannels(){return this.channels}async removeChannel(t){const n=await t.unsubscribe();return this.channels=this.channels.filter(r=>r._joinRef!==t._joinRef),this.channels.length===0&&this.disconnect(),n}async removeAllChannels(){const t=await Promise.all(this.channels.map(n=>n.unsubscribe()));return this.channels=[],this.disconnect(),t}log(t,n,r){this.logger(t,n,r)}connectionState(){switch(this.conn&&this.conn.readyState){case wr.connecting:return Pn.Connecting;case wr.open:return Pn.Open;case wr.closing:return Pn.Closing;default:return Pn.Closed}}isConnected(){return this.connectionState()===Pn.Open}channel(t,n={config:{}}){const r=`realtime:${t}`,i=this.getChannels().find(s=>s.topic===r);if(i)return i;{const s=new Lc(`realtime:${t}`,n,this);return this.channels.push(s),s}}push(t){const{topic:n,event:r,payload:i,ref:s}=t,o=()=>{this.encode(t,a=>{var l;(l=this.conn)===null||l===void 0||l.send(a)})};this.log("push",`${n} ${r} (${s})`,i),this.isConnected()?o():this.sendBuffer.push(o)}async setAuth(t=null){let n=t||this.accessToken&&await this.accessToken()||this.accessTokenValue;this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(r=>{n&&r.updateJoinPayload({access_token:n,version:this.headers&&this.headers["X-Client-Info"]}),r.joinedOnce&&r._isJoined()&&r._push(lt.access_token,{access_token:n})}))}async sendHeartbeat(){var t;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"),(t=this.conn)===null||t===void 0||t.close(iP,"hearbeat timeout");return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatCallback("sent"),await this.setAuth()}onHeartbeat(t){this.heartbeatCallback=t}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}_makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}_leaveOpenTopic(t){let n=this.channels.find(r=>r.topic===t&&(r._isJoined()||r._isJoining()));n&&(this.log("transport",`leaving duplicate topic "${t}"`),n.unsubscribe())}_remove(t){this.channels=this.channels.filter(n=>n.topic!==t.topic)}setupConnection(){this.conn&&(this.conn.binaryType="arraybuffer",this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=t=>this._onConnError(t),this.conn.onmessage=t=>this._onConnMessage(t),this.conn.onclose=t=>this._onConnClose(t))}_onConnMessage(t){this.decode(t.data,n=>{let{topic:r,event:i,payload:s,ref:o}=n;r==="phoenix"&&i==="phx_reply"&&this.heartbeatCallback(n.payload.status=="ok"?"ok":"error"),o&&o===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null),this.log("receive",`${s.status||""} ${r} ${i} ${o&&"("+o+")"||""}`,s),Array.from(this.channels).filter(a=>a._isMember(r)).forEach(a=>a._trigger(i,s,o)),this.stateChangeCallbacks.message.forEach(a=>a(n))})}_onConnOpen(){if(this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this.reconnectTimer.reset(),!this.worker)this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs);else{this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=n=>{this.log("worker","worker error",n.message),this.workerRef.terminate()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}this.stateChangeCallbacks.open.forEach(t=>t())}_onConnClose(t){this.log("transport","close",t),this._triggerChanError(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(n=>n(t))}_onConnError(t){this.log("transport",t.message),this._triggerChanError(),this.stateChangeCallbacks.error.forEach(n=>n(t))}_triggerChanError(){this.channels.forEach(t=>t._trigger(lt.error))}_appendParams(t,n){if(Object.keys(n).length===0)return t;const r=t.match(/\?/)?"&":"?",i=new URLSearchParams(n);return`${t}${r}${i}`}_workerObjectUrl(t){let n;if(t)n=t;else{const r=new Blob([hP],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}}class pP{constructor(t,n,r){this.binaryType="arraybuffer",this.onclose=()=>{},this.onerror=()=>{},this.onmessage=()=>{},this.onopen=()=>{},this.readyState=wr.connecting,this.send=()=>{},this.url=null,this.url=t,this.close=r.close}}class Ic extends Error{constructor(t){super(t),this.__isStorageError=!0,this.name="StorageError"}}function de(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}class mP extends Ic{constructor(t,n){super(t),this.name="StorageApiError",this.status=n}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class cu extends Ic{constructor(t,n){super(t),this.name="StorageUnknownError",this.originalError=n}}var gP=function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(d){o(d)}}function l(c){try{u(r.throw(c))}catch(d){o(d)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((r=r.apply(e,t||[])).next())})};const I0=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...n)=>Qi(async()=>{const{default:r}=await Promise.resolve().then(()=>Dr);return{default:r}},void 0).then(({default:r})=>r(...n)):t=fetch,(...n)=>t(...n)},yP=()=>gP(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield Qi(()=>Promise.resolve().then(()=>Dr),void 0)).Response:Response}),du=e=>{if(Array.isArray(e))return e.map(n=>du(n));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([n,r])=>{const i=n.replace(/([-_][a-z])/gi,s=>s.toUpperCase().replace(/[-_]/g,""));t[i]=du(r)}),t};var zn=function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(d){o(d)}}function l(c){try{u(r.throw(c))}catch(d){o(d)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((r=r.apply(e,t||[])).next())})};const Wa=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),vP=(e,t,n)=>zn(void 0,void 0,void 0,function*(){const r=yield yP();e instanceof r&&!(n!=null&&n.noResolveJson)?e.json().then(i=>{t(new mP(Wa(i),e.status||500))}).catch(i=>{t(new cu(Wa(i),i))}):t(new cu(Wa(e),e))}),wP=(e,t,n,r)=>{const i={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json"},t==null?void 0:t.headers),r&&(i.body=JSON.stringify(r)),Object.assign(Object.assign({},i),n))};function Yi(e,t,n,r,i,s){return zn(this,void 0,void 0,function*(){return new Promise((o,a)=>{e(n,wP(t,r,i,s)).then(l=>{if(!l.ok)throw l;return r!=null&&r.noResolveJson?l:l.json()}).then(l=>o(l)).catch(l=>vP(l,a,r))})})}function So(e,t,n,r){return zn(this,void 0,void 0,function*(){return Yi(e,"GET",t,n,r)})}function zt(e,t,n,r,i){return zn(this,void 0,void 0,function*(){return Yi(e,"POST",t,r,i,n)})}function xP(e,t,n,r,i){return zn(this,void 0,void 0,function*(){return Yi(e,"PUT",t,r,i,n)})}function _P(e,t,n,r){return zn(this,void 0,void 0,function*(){return Yi(e,"HEAD",t,Object.assign(Object.assign({},n),{noResolveJson:!0}),r)})}function D0(e,t,n,r,i){return zn(this,void 0,void 0,function*(){return Yi(e,"DELETE",t,r,i,n)})}var Re=function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(d){o(d)}}function l(c){try{u(r.throw(c))}catch(d){o(d)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((r=r.apply(e,t||[])).next())})};const SP={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},pf={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class kP{constructor(t,n={},r,i){this.url=t,this.headers=n,this.bucketId=r,this.fetch=I0(i)}uploadOrUpdate(t,n,r,i){return Re(this,void 0,void 0,function*(){try{let s;const o=Object.assign(Object.assign({},pf),i);let a=Object.assign(Object.assign({},this.headers),t==="POST"&&{"x-upsert":String(o.upsert)});const l=o.metadata;typeof Blob<"u"&&r instanceof Blob?(s=new FormData,s.append("cacheControl",o.cacheControl),l&&s.append("metadata",this.encodeMetadata(l)),s.append("",r)):typeof FormData<"u"&&r instanceof FormData?(s=r,s.append("cacheControl",o.cacheControl),l&&s.append("metadata",this.encodeMetadata(l))):(s=r,a["cache-control"]=`max-age=${o.cacheControl}`,a["content-type"]=o.contentType,l&&(a["x-metadata"]=this.toBase64(this.encodeMetadata(l)))),i!=null&&i.headers&&(a=Object.assign(Object.assign({},a),i.headers));const u=this._removeEmptyFolders(n),c=this._getFinalPath(u),d=yield this.fetch(`${this.url}/object/${c}`,Object.assign({method:t,body:s,headers:a},o!=null&&o.duplex?{duplex:o.duplex}:{})),h=yield d.json();return d.ok?{data:{path:u,id:h.Id,fullPath:h.Key},error:null}:{data:null,error:h}}catch(s){if(de(s))return{data:null,error:s};throw s}})}upload(t,n,r){return Re(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",t,n,r)})}uploadToSignedUrl(t,n,r,i){return Re(this,void 0,void 0,function*(){const s=this._removeEmptyFolders(t),o=this._getFinalPath(s),a=new URL(this.url+`/object/upload/sign/${o}`);a.searchParams.set("token",n);try{let l;const u=Object.assign({upsert:pf.upsert},i),c=Object.assign(Object.assign({},this.headers),{"x-upsert":String(u.upsert)});typeof Blob<"u"&&r instanceof Blob?(l=new FormData,l.append("cacheControl",u.cacheControl),l.append("",r)):typeof FormData<"u"&&r instanceof FormData?(l=r,l.append("cacheControl",u.cacheControl)):(l=r,c["cache-control"]=`max-age=${u.cacheControl}`,c["content-type"]=u.contentType);const d=yield this.fetch(a.toString(),{method:"PUT",body:l,headers:c}),h=yield d.json();return d.ok?{data:{path:s,fullPath:h.Key},error:null}:{data:null,error:h}}catch(l){if(de(l))return{data:null,error:l};throw l}})}createSignedUploadUrl(t,n){return Re(this,void 0,void 0,function*(){try{let r=this._getFinalPath(t);const i=Object.assign({},this.headers);n!=null&&n.upsert&&(i["x-upsert"]="true");const s=yield zt(this.fetch,`${this.url}/object/upload/sign/${r}`,{},{headers:i}),o=new URL(this.url+s.url),a=o.searchParams.get("token");if(!a)throw new Ic("No token returned by API");return{data:{signedUrl:o.toString(),path:t,token:a},error:null}}catch(r){if(de(r))return{data:null,error:r};throw r}})}update(t,n,r){return Re(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",t,n,r)})}move(t,n,r){return Re(this,void 0,void 0,function*(){try{return{data:yield zt(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:t,destinationKey:n,destinationBucket:r==null?void 0:r.destinationBucket},{headers:this.headers}),error:null}}catch(i){if(de(i))return{data:null,error:i};throw i}})}copy(t,n,r){return Re(this,void 0,void 0,function*(){try{return{data:{path:(yield zt(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:t,destinationKey:n,destinationBucket:r==null?void 0:r.destinationBucket},{headers:this.headers})).Key},error:null}}catch(i){if(de(i))return{data:null,error:i};throw i}})}createSignedUrl(t,n,r){return Re(this,void 0,void 0,function*(){try{let i=this._getFinalPath(t),s=yield zt(this.fetch,`${this.url}/object/sign/${i}`,Object.assign({expiresIn:n},r!=null&&r.transform?{transform:r.transform}:{}),{headers:this.headers});const o=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return s={signedUrl:encodeURI(`${this.url}${s.signedURL}${o}`)},{data:s,error:null}}catch(i){if(de(i))return{data:null,error:i};throw i}})}createSignedUrls(t,n,r){return Re(this,void 0,void 0,function*(){try{const i=yield zt(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:n,paths:t},{headers:this.headers}),s=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return{data:i.map(o=>Object.assign(Object.assign({},o),{signedUrl:o.signedURL?encodeURI(`${this.url}${o.signedURL}${s}`):null})),error:null}}catch(i){if(de(i))return{data:null,error:i};throw i}})}download(t,n){return Re(this,void 0,void 0,function*(){const i=typeof(n==null?void 0:n.transform)<"u"?"render/image/authenticated":"object",s=this.transformOptsToQueryString((n==null?void 0:n.transform)||{}),o=s?`?${s}`:"";try{const a=this._getFinalPath(t);return{data:yield(yield So(this.fetch,`${this.url}/${i}/${a}${o}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(a){if(de(a))return{data:null,error:a};throw a}})}info(t){return Re(this,void 0,void 0,function*(){const n=this._getFinalPath(t);try{const r=yield So(this.fetch,`${this.url}/object/info/${n}`,{headers:this.headers});return{data:du(r),error:null}}catch(r){if(de(r))return{data:null,error:r};throw r}})}exists(t){return Re(this,void 0,void 0,function*(){const n=this._getFinalPath(t);try{return yield _P(this.fetch,`${this.url}/object/${n}`,{headers:this.headers}),{data:!0,error:null}}catch(r){if(de(r)&&r instanceof cu){const i=r.originalError;if([400,404].includes(i==null?void 0:i.status))return{data:!1,error:r}}throw r}})}getPublicUrl(t,n){const r=this._getFinalPath(t),i=[],s=n!=null&&n.download?`download=${n.download===!0?"":n.download}`:"";s!==""&&i.push(s);const a=typeof(n==null?void 0:n.transform)<"u"?"render/image":"object",l=this.transformOptsToQueryString((n==null?void 0:n.transform)||{});l!==""&&i.push(l);let u=i.join("&");return u!==""&&(u=`?${u}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${r}${u}`)}}}remove(t){return Re(this,void 0,void 0,function*(){try{return{data:yield D0(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:t},{headers:this.headers}),error:null}}catch(n){if(de(n))return{data:null,error:n};throw n}})}list(t,n,r){return Re(this,void 0,void 0,function*(){try{const i=Object.assign(Object.assign(Object.assign({},SP),n),{prefix:t||""});return{data:yield zt(this.fetch,`${this.url}/object/list/${this.bucketId}`,i,{headers:this.headers},r),error:null}}catch(i){if(de(i))return{data:null,error:i};throw i}})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(t){const n=[];return t.width&&n.push(`width=${t.width}`),t.height&&n.push(`height=${t.height}`),t.resize&&n.push(`resize=${t.resize}`),t.format&&n.push(`format=${t.format}`),t.quality&&n.push(`quality=${t.quality}`),n.join("&")}}const bP="2.7.1",PP={"X-Client-Info":`storage-js/${bP}`};var qn=function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(d){o(d)}}function l(c){try{u(r.throw(c))}catch(d){o(d)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((r=r.apply(e,t||[])).next())})};class EP{constructor(t,n={},r){this.url=t,this.headers=Object.assign(Object.assign({},PP),n),this.fetch=I0(r)}listBuckets(){return qn(this,void 0,void 0,function*(){try{return{data:yield So(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(t){if(de(t))return{data:null,error:t};throw t}})}getBucket(t){return qn(this,void 0,void 0,function*(){try{return{data:yield So(this.fetch,`${this.url}/bucket/${t}`,{headers:this.headers}),error:null}}catch(n){if(de(n))return{data:null,error:n};throw n}})}createBucket(t,n={public:!1}){return qn(this,void 0,void 0,function*(){try{return{data:yield zt(this.fetch,`${this.url}/bucket`,{id:t,name:t,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(de(r))return{data:null,error:r};throw r}})}updateBucket(t,n){return qn(this,void 0,void 0,function*(){try{return{data:yield xP(this.fetch,`${this.url}/bucket/${t}`,{id:t,name:t,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(de(r))return{data:null,error:r};throw r}})}emptyBucket(t){return qn(this,void 0,void 0,function*(){try{return{data:yield zt(this.fetch,`${this.url}/bucket/${t}/empty`,{},{headers:this.headers}),error:null}}catch(n){if(de(n))return{data:null,error:n};throw n}})}deleteBucket(t){return qn(this,void 0,void 0,function*(){try{return{data:yield D0(this.fetch,`${this.url}/bucket/${t}`,{},{headers:this.headers}),error:null}}catch(n){if(de(n))return{data:null,error:n};throw n}})}}class CP extends EP{constructor(t,n={},r){super(t,n,r)}from(t){return new kP(this.url,this.headers,t,this.fetch)}}const TP="2.50.0";let ei="";typeof Deno<"u"?ei="deno":typeof document<"u"?ei="web":typeof navigator<"u"&&navigator.product==="ReactNative"?ei="react-native":ei="node";const jP={"X-Client-Info":`supabase-js-${ei}/${TP}`},AP={headers:jP},RP={schema:"public"},OP={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},NP={};var LP=function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(d){o(d)}}function l(c){try{u(r.throw(c))}catch(d){o(d)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((r=r.apply(e,t||[])).next())})};const IP=e=>{let t;return e?t=e:typeof fetch>"u"?t=x0:t=fetch,(...n)=>t(...n)},DP=()=>typeof Headers>"u"?_0:Headers,MP=(e,t,n)=>{const r=IP(n),i=DP();return(s,o)=>LP(void 0,void 0,void 0,function*(){var a;const l=(a=yield t())!==null&&a!==void 0?a:e;let u=new i(o==null?void 0:o.headers);return u.has("apikey")||u.set("apikey",e),u.has("Authorization")||u.set("Authorization",`Bearer ${l}`),r(s,Object.assign(Object.assign({},o),{headers:u}))})};var VP=function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(d){o(d)}}function l(c){try{u(r.throw(c))}catch(d){o(d)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((r=r.apply(e,t||[])).next())})};function $P(e){return e.endsWith("/")?e:e+"/"}function FP(e,t){var n,r;const{db:i,auth:s,realtime:o,global:a}=e,{db:l,auth:u,realtime:c,global:d}=t,h={db:Object.assign(Object.assign({},l),i),auth:Object.assign(Object.assign({},u),s),realtime:Object.assign(Object.assign({},c),o),global:Object.assign(Object.assign(Object.assign({},d),a),{headers:Object.assign(Object.assign({},(n=d==null?void 0:d.headers)!==null&&n!==void 0?n:{}),(r=a==null?void 0:a.headers)!==null&&r!==void 0?r:{})}),accessToken:()=>VP(this,void 0,void 0,function*(){return""})};return e.accessToken?h.accessToken=e.accessToken:delete h.accessToken,h}const M0="2.70.0",Jn=30*1e3,hu=3,Ha=hu*Jn,UP="http://localhost:9999",BP="supabase.auth.token",zP={"X-Client-Info":`gotrue-js/${M0}`},fu="X-Supabase-Api-Version",V0={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},WP=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,HP=6e5;class Dc extends Error{constructor(t,n,r){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}}function I(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class qP extends Dc{constructor(t,n,r){super(t,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function GP(e){return I(e)&&e.name==="AuthApiError"}class $0 extends Dc{constructor(t,n){super(t),this.name="AuthUnknownError",this.originalError=n}}class pn extends Dc{constructor(t,n,r,i){super(t,r,i),this.name=n,this.status=r}}class $t extends pn{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function KP(e){return I(e)&&e.name==="AuthSessionMissingError"}class _s extends pn{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class Ss extends pn{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class ks extends pn{constructor(t,n=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function QP(e){return I(e)&&e.name==="AuthImplicitGrantRedirectError"}class mf extends pn{constructor(t,n=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class pu extends pn{constructor(t,n){super(t,"AuthRetryableFetchError",n,void 0)}}function qa(e){return I(e)&&e.name==="AuthRetryableFetchError"}class gf extends pn{constructor(t,n,r){super(t,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}}class mi extends pn{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const ko="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),yf=` +\r=`.split(""),JP=(()=>{const e=new Array(128);for(let t=0;t=6;){const r=t.queue>>t.queuedBits-6&63;n(ko[r]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;n(ko[r]),t.queuedBits-=6}}function F0(e,t,n){const r=JP[e];if(r>-1)for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function wf(e){const t=[],n=o=>{t.push(String.fromCodePoint(o))},r={utf8seq:0,codepoint:0},i={queue:0,queuedBits:0},s=o=>{ZP(o,r,n)};for(let o=0;o>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function XP(e,t){for(let n=0;n55295&&r<=56319){const i=(r-55296)*1024&65535;r=(e.charCodeAt(n+1)-56320&65535|i)+65536,n+=1}YP(r,t)}}function ZP(e,t,n){if(t.utf8seq===0){if(e<=127){n(e);return}for(let r=1;r<6;r+=1)if(!(e>>7-r&1)){t.utf8seq=r;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&n(t.codepoint)}}function eE(e){const t=[],n={queue:0,queuedBits:0},r=i=>{t.push(i)};for(let i=0;it.push(n)),new Uint8Array(t)}function nE(e){const t=[],n={queue:0,queuedBits:0},r=i=>{t.push(i)};return e.forEach(i=>vf(i,n,r)),vf(null,n,r),t.join("")}function rE(e){return Math.round(Date.now()/1e3)+e}function iE(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}const it=()=>typeof window<"u"&&typeof document<"u",wn={tested:!1,writable:!1},gi=()=>{if(!it())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(wn.tested)return wn.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),wn.tested=!0,wn.writable=!0}catch{wn.tested=!0,wn.writable=!1}return wn.writable};function sE(e){const t={},n=new URL(e);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((i,s)=>{t[s]=i})}catch{}return n.searchParams.forEach((r,i)=>{t[i]=r}),t}const U0=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...n)=>Qi(async()=>{const{default:r}=await Promise.resolve().then(()=>Dr);return{default:r}},void 0).then(({default:r})=>r(...n)):t=fetch,(...n)=>t(...n)},oE=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",B0=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},bs=async(e,t)=>{const n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return n}},Ps=async(e,t)=>{await e.removeItem(t)};class na{constructor(){this.promise=new na.promiseConstructor((t,n)=>{this.resolve=t,this.reject=n})}}na.promiseConstructor=Promise;function Ga(e){const t=e.split(".");if(t.length!==3)throw new mi("Invalid JWT structure");for(let r=0;r{setTimeout(()=>t(null),e)})}function lE(e,t){return new Promise((r,i)=>{(async()=>{for(let s=0;s<1/0;s++)try{const o=await e(s);if(!t(s,null,o)){r(o);return}}catch(o){if(!t(s,o)){i(o);return}}})()})}function uE(e){return("0"+e.toString(16)).substr(-2)}function cE(){const t=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let i="";for(let s=0;s<56;s++)i+=n.charAt(Math.floor(Math.random()*r));return i}return crypto.getRandomValues(t),Array.from(t,uE).join("")}async function dE(e){const n=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",n),i=new Uint8Array(r);return Array.from(i).map(s=>String.fromCharCode(s)).join("")}async function hE(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const n=await dE(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Gn(e,t,n=!1){const r=cE();let i=r;n&&(i+="/PASSWORD_RECOVERY"),await B0(e,`${t}-code-verifier`,i);const s=await hE(r);return[s,r===s?"plain":"s256"]}const fE=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function pE(e){const t=e.headers.get(fu);if(!t||!t.match(fE))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function mE(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function gE(e){switch(e){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 yE=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Kn(e){if(!yE.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}var vE=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);ie.msg||e.message||e.error_description||e.error||JSON.stringify(e),wE=[502,503,504];async function xf(e){var t;if(!oE(e))throw new pu(bn(e),0);if(wE.includes(e.status))throw new pu(bn(e),e.status);let n;try{n=await e.json()}catch(s){throw new $0(bn(s),s)}let r;const i=pE(e);if(i&&i.getTime()>=V0["2024-01-01"].timestamp&&typeof n=="object"&&n&&typeof n.code=="string"?r=n.code:typeof n=="object"&&n&&typeof n.error_code=="string"&&(r=n.error_code),r){if(r==="weak_password")throw new gf(bn(n),e.status,((t=n.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(r==="session_not_found")throw new $t}else if(typeof n=="object"&&n&&typeof n.weak_password=="object"&&n.weak_password&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.reasons.reduce((s,o)=>s&&typeof o=="string",!0))throw new gf(bn(n),e.status,n.weak_password.reasons);throw new qP(bn(n),e.status||500,r)}const xE=(e,t,n,r)=>{const i={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),i.body=JSON.stringify(r),Object.assign(Object.assign({},i),n))};async function M(e,t,n,r){var i;const s=Object.assign({},r==null?void 0:r.headers);s[fu]||(s[fu]=V0["2024-01-01"].name),r!=null&&r.jwt&&(s.Authorization=`Bearer ${r.jwt}`);const o=(i=r==null?void 0:r.query)!==null&&i!==void 0?i:{};r!=null&&r.redirectTo&&(o.redirect_to=r.redirectTo);const a=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",l=await _E(e,t,n+a,{headers:s,noResolveJson:r==null?void 0:r.noResolveJson},{},r==null?void 0:r.body);return r!=null&&r.xform?r==null?void 0:r.xform(l):{data:Object.assign({},l),error:null}}async function _E(e,t,n,r,i,s){const o=xE(t,r,i,s);let a;try{a=await e(n,Object.assign({},o))}catch(l){throw console.error(l),new pu(bn(l),0)}if(a.ok||await xf(a),r!=null&&r.noResolveJson)return a;try{return await a.json()}catch(l){await xf(l)}}function xt(e){var t;let n=null;PE(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=rE(e.expires_in)));const r=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:n,user:r},error:null}}function _f(e){const t=xt(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((n,r)=>n&&typeof r=="string",!0)&&(t.data.weak_password=e.weak_password),t}function qt(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function SE(e){return{data:e,error:null}}function kE(e){const{action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:s}=e,o=vE(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:t,email_otp:n,hashed_token:r,redirect_to:i,verification_type:s},l=Object.assign({},o);return{data:{properties:a,user:l},error:null}}function bE(e){return e}function PE(e){return e.access_token&&e.refresh_token&&e.expires_in}const Ka=["global","local","others"];var EE=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i0&&(f.forEach(v=>{const w=parseInt(v.split(";")[0].split("=")[1].substring(0,1)),_=JSON.parse(v.split(";")[1].split("=")[1]);u[`${_}Page`]=w}),u.total=parseInt(h)),{data:Object.assign(Object.assign({},d),u),error:null}}catch(u){if(I(u))return{data:{users:[]},error:u};throw u}}async getUserById(t){Kn(t);try{return await M(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:qt})}catch(n){if(I(n))return{data:{user:null},error:n};throw n}}async updateUserById(t,n){Kn(t);try{return await M(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:n,headers:this.headers,xform:qt})}catch(r){if(I(r))return{data:{user:null},error:r};throw r}}async deleteUser(t,n=!1){Kn(t);try{return await M(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:n},xform:qt})}catch(r){if(I(r))return{data:{user:null},error:r};throw r}}async _listFactors(t){Kn(t.userId);try{const{data:n,error:r}=await M(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:i=>({data:{factors:i},error:null})});return{data:n,error:r}}catch(n){if(I(n))return{data:null,error:n};throw n}}async _deleteFactor(t){Kn(t.userId),Kn(t.id);try{return{data:await M(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(n){if(I(n))return{data:null,error:n};throw n}}}const TE={getItem:e=>gi()?globalThis.localStorage.getItem(e):null,setItem:(e,t)=>{gi()&&globalThis.localStorage.setItem(e,t)},removeItem:e=>{gi()&&globalThis.localStorage.removeItem(e)}};function Sf(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}function jE(){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 Qn={debug:!!(globalThis&&gi()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class z0 extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class AE extends z0{}async function RE(e,t,n){Qn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const r=new globalThis.AbortController;return t>0&&setTimeout(()=>{r.abort(),Qn.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async i=>{if(i){Qn.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,i.name);try{return await n()}finally{Qn.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,i.name)}}else{if(t===0)throw Qn.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new AE(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(Qn.debug)try{const s=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(s,null," "))}catch(s){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",s)}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 n()}}))}jE();const OE={url:UP,storageKey:BP,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:zP,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function kf(e,t,n){return await n()}class $i{constructor(t){var n,r;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=$i.nextInstanceID,$i.nextInstanceID+=1,this.instanceID>0&&it()&&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 i=Object.assign(Object.assign({},OE),t);if(this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.persistSession=i.persistSession,this.storageKey=i.storageKey,this.autoRefreshToken=i.autoRefreshToken,this.admin=new CE({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=U0(i.fetch),this.lock=i.lock||kf,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,i.lock?this.lock=i.lock:it()&&(!((n=globalThis==null?void 0:globalThis.navigator)===null||n===void 0)&&n.locks)?this.lock=RE:this.lock=kf,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?i.storage?this.storage=i.storage:gi()?this.storage=TE:(this.memoryStorage={},this.storage=Sf(this.memoryStorage)):(this.memoryStorage={},this.storage=Sf(this.memoryStorage)),it()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(s){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",s)}(r=this.broadcastChannel)===null||r===void 0||r.addEventListener("message",async s=>{this._debug("received broadcast notification from other tab or client",s),await this._notifyAllSubscribers(s.data.event,s.data.session,!1)})}this.initialize()}_debug(...t){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${M0}) ${new Date().toISOString()}`,...t),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 t;try{const n=sE(window.location.href);let r="none";if(this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce"),it()&&this.detectSessionInUrl&&r!=="none"){const{data:i,error:s}=await this._getSessionFromURL(n,r);if(s){if(this._debug("#_initialize()","error detecting session from URL",s),QP(s)){const l=(t=s.details)===null||t===void 0?void 0:t.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:s}}return await this._removeSession(),{error:s}}const{session:o,redirectType:a}=i;return this._debug("#_initialize()","detected session in URL",o,"redirect type",a),await this._saveSession(o),setTimeout(async()=>{a==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return I(n)?{error:n}:{error:new $0("Unexpected error during initialization",n)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var n,r,i;try{const s=await M(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(i=t==null?void 0:t.options)===null||i===void 0?void 0:i.captchaToken}},xform:xt}),{data:o,error:a}=s;if(a||!o)return{data:{user:null,session:null},error:a};const l=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",l)),{data:{user:u,session:l},error:null}}catch(s){if(I(s))return{data:{user:null,session:null},error:s};throw s}}async signUp(t){var n,r,i;try{let s;if("email"in t){const{email:c,password:d,options:h}=t;let f=null,v=null;this.flowType==="pkce"&&([f,v]=await Gn(this.storage,this.storageKey)),s=await M(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:h==null?void 0:h.emailRedirectTo,body:{email:c,password:d,data:(n=h==null?void 0:h.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken},code_challenge:f,code_challenge_method:v},xform:xt})}else if("phone"in t){const{phone:c,password:d,options:h}=t;s=await M(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:c,password:d,data:(r=h==null?void 0:h.data)!==null&&r!==void 0?r:{},channel:(i=h==null?void 0:h.channel)!==null&&i!==void 0?i:"sms",gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken}},xform:xt})}else throw new Ss("You must provide either an email or phone number and a password");const{data:o,error:a}=s;if(a||!o)return{data:{user:null,session:null},error:a};const l=o.session,u=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",l)),{data:{user:u,session:l},error:null}}catch(s){if(I(s))return{data:{user:null,session:null},error:s};throw s}}async signInWithPassword(t){try{let n;if("email"in t){const{email:s,password:o,options:a}=t;n=await M(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:s,password:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:_f})}else if("phone"in t){const{phone:s,password:o,options:a}=t;n=await M(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:s,password:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:_f})}else throw new Ss("You must provide either an email or phone number and a password");const{data:r,error:i}=n;return i?{data:{user:null,session:null},error:i}:!r||!r.session||!r.user?{data:{user:null,session:null},error:new _s}:(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),{data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:i})}catch(n){if(I(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithOAuth(t){var n,r,i,s;return await this._handleProviderSignIn(t.provider,{redirectTo:(n=t.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=t.options)===null||r===void 0?void 0:r.scopes,queryParams:(i=t.options)===null||i===void 0?void 0:i.queryParams,skipBrowserRedirect:(s=t.options)===null||s===void 0?void 0:s.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:n}=t;if(n==="solana")return await this.signInWithSolana(t);throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}async signInWithSolana(t){var n,r,i,s,o,a,l,u,c,d,h,f;let v,w;if("message"in t)v=t.message,w=t.signature;else{const{chain:_,wallet:y,statement:m,options:p}=t;let x;if(it())if(typeof y=="object")x=y;else{const b=window;if("solana"in b&&typeof b.solana=="object"&&("signIn"in b.solana&&typeof b.solana.signIn=="function"||"signMessage"in b.solana&&typeof b.solana.signMessage=="function"))x=b.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 y!="object"||!(p!=null&&p.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");x=y}const S=new URL((n=p==null?void 0:p.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in x&&x.signIn){const b=await x.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},p==null?void 0:p.signInWithSolana),{version:"1",domain:S.host,uri:S.href}),m?{statement:m}:null));let P;if(Array.isArray(b)&&b[0]&&typeof b[0]=="object")P=b[0];else if(b&&typeof b=="object"&&"signedMessage"in b&&"signature"in b)P=b;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in P&&"signature"in P&&(typeof P.signedMessage=="string"||P.signedMessage instanceof Uint8Array)&&P.signature instanceof Uint8Array)v=typeof P.signedMessage=="string"?P.signedMessage:new TextDecoder().decode(P.signedMessage),w=P.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in x)||typeof x.signMessage!="function"||!("publicKey"in x)||typeof x!="object"||!x.publicKey||!("toBase58"in x.publicKey)||typeof x.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");v=[`${S.host} wants you to sign in with your Solana account:`,x.publicKey.toBase58(),...m?["",m,""]:[""],"Version: 1",`URI: ${S.href}`,`Issued At: ${(i=(r=p==null?void 0:p.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&i!==void 0?i:new Date().toISOString()}`,...!((s=p==null?void 0:p.signInWithSolana)===null||s===void 0)&&s.notBefore?[`Not Before: ${p.signInWithSolana.notBefore}`]:[],...!((o=p==null?void 0:p.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${p.signInWithSolana.expirationTime}`]:[],...!((a=p==null?void 0:p.signInWithSolana)===null||a===void 0)&&a.chainId?[`Chain ID: ${p.signInWithSolana.chainId}`]:[],...!((l=p==null?void 0:p.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${p.signInWithSolana.nonce}`]:[],...!((u=p==null?void 0:p.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${p.signInWithSolana.requestId}`]:[],...!((d=(c=p==null?void 0:p.signInWithSolana)===null||c===void 0?void 0:c.resources)===null||d===void 0)&&d.length?["Resources",...p.signInWithSolana.resources.map(P=>`- ${P}`)]:[]].join(` +`);const b=await x.signMessage(new TextEncoder().encode(v),"utf8");if(!b||!(b instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");w=b}}try{const{data:_,error:y}=await M(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:v,signature:nE(w)},!((h=t.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(f=t.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:xt});if(y)throw y;return!_||!_.session||!_.user?{data:{user:null,session:null},error:new _s}:(_.session&&(await this._saveSession(_.session),await this._notifyAllSubscribers("SIGNED_IN",_.session)),{data:Object.assign({},_),error:y})}catch(_){if(I(_))return{data:{user:null,session:null},error:_};throw _}}async _exchangeCodeForSession(t){const n=await bs(this.storage,`${this.storageKey}-code-verifier`),[r,i]=(n??"").split("/");try{const{data:s,error:o}=await M(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:xt});if(await Ps(this.storage,`${this.storageKey}-code-verifier`),o)throw o;return!s||!s.session||!s.user?{data:{user:null,session:null,redirectType:null},error:new _s}:(s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),{data:Object.assign(Object.assign({},s),{redirectType:i??null}),error:o})}catch(s){if(I(s))return{data:{user:null,session:null,redirectType:null},error:s};throw s}}async signInWithIdToken(t){try{const{options:n,provider:r,token:i,access_token:s,nonce:o}=t,a=await M(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:i,access_token:s,nonce:o,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:xt}),{data:l,error:u}=a;return u?{data:{user:null,session:null},error:u}:!l||!l.session||!l.user?{data:{user:null,session:null},error:new _s}:(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),{data:l,error:u})}catch(n){if(I(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithOtp(t){var n,r,i,s,o;try{if("email"in t){const{email:a,options:l}=t;let u=null,c=null;this.flowType==="pkce"&&([u,c]=await Gn(this.storage,this.storageKey));const{error:d}=await M(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(n=l==null?void 0:l.data)!==null&&n!==void 0?n:{},create_user:(r=l==null?void 0:l.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},code_challenge:u,code_challenge_method:c},redirectTo:l==null?void 0:l.emailRedirectTo});return{data:{user:null,session:null},error:d}}if("phone"in t){const{phone:a,options:l}=t,{data:u,error:c}=await M(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(i=l==null?void 0:l.data)!==null&&i!==void 0?i:{},create_user:(s=l==null?void 0:l.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},channel:(o=l==null?void 0:l.channel)!==null&&o!==void 0?o:"sms"}});return{data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:c}}throw new Ss("You must provide either an email or phone number.")}catch(a){if(I(a))return{data:{user:null,session:null},error:a};throw a}}async verifyOtp(t){var n,r;try{let i,s;"options"in t&&(i=(n=t.options)===null||n===void 0?void 0:n.redirectTo,s=(r=t.options)===null||r===void 0?void 0:r.captchaToken);const{data:o,error:a}=await M(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:s}}),redirectTo:i,xform:xt});if(a)throw a;if(!o)throw new Error("An error occurred on token verification.");const l=o.session,u=o.user;return l!=null&&l.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),{data:{user:u,session:l},error:null}}catch(i){if(I(i))return{data:{user:null,session:null},error:i};throw i}}async signInWithSSO(t){var n,r,i;try{let s=null,o=null;return this.flowType==="pkce"&&([s,o]=await Gn(this.storage,this.storageKey)),await M(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(r=(n=t.options)===null||n===void 0?void 0:n.redirectTo)!==null&&r!==void 0?r:void 0}),!((i=t==null?void 0:t.options)===null||i===void 0)&&i.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:s,code_challenge_method:o}),headers:this.headers,xform:SE})}catch(s){if(I(s))return{data:null,error:s};throw s}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;if(r)throw r;if(!n)throw new $t;const{error:i}=await M(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return{data:{user:null,session:null},error:i}})}catch(t){if(I(t))return{data:{user:null,session:null},error:t};throw t}}async resend(t){try{const n=`${this.url}/resend`;if("email"in t){const{email:r,type:i,options:s}=t,{error:o}=await M(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:i,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}},redirectTo:s==null?void 0:s.emailRedirectTo});return{data:{user:null,session:null},error:o}}else if("phone"in t){const{phone:r,type:i,options:s}=t,{data:o,error:a}=await M(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:i,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}}});return{data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:a}}throw new Ss("You must provide either an email or phone number and a type")}catch(n){if(I(n))return{data:{user:null,session:null},error:n};throw n}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async n=>n))}async _acquireLock(t,n){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),i=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await i}catch{}})()),i}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const r=n();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const i=[...this.pendingInLock];await Promise.all(i),this.pendingInLock.splice(0,i.length)}return await r}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const n=await this.__loadSession();return await t(n)}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 t=null;const n=await bs(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?t=n:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!t)return{data:{session:null},error:null};const r=t.expires_at?t.expires_at*1e3-Date.now()(!o&&u==="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."),o=!0,this.suppressGetSessionWarning=!0),Reflect.get(l,u,c))})}return{data:{session:t},error:null}}const{session:i,error:s}=await this._callRefreshToken(t.refresh_token);return s?{data:{session:null},error:s}:{data:{session:i},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(t){return t?await this._getUser(t):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(t){try{return t?await M(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:qt}):await this._useSession(async n=>{var r,i,s;const{data:o,error:a}=n;if(a)throw a;return!(!((r=o.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new $t}:await M(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(s=(i=o.session)===null||i===void 0?void 0:i.access_token)!==null&&s!==void 0?s:void 0,xform:qt})})}catch(n){if(I(n))return KP(n)&&(await this._removeSession(),await Ps(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:n};throw n}}async updateUser(t,n={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(t,n))}async _updateUser(t,n={}){try{return await this._useSession(async r=>{const{data:i,error:s}=r;if(s)throw s;if(!i.session)throw new $t;const o=i.session;let a=null,l=null;this.flowType==="pkce"&&t.email!=null&&([a,l]=await Gn(this.storage,this.storageKey));const{data:u,error:c}=await M(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n==null?void 0:n.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:a,code_challenge_method:l}),jwt:o.access_token,xform:qt});if(c)throw c;return o.user=u.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),{data:{user:o.user},error:null}})}catch(r){if(I(r))return{data:{user:null},error:r};throw r}}async setSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new $t;const n=Date.now()/1e3;let r=n,i=!0,s=null;const{payload:o}=Ga(t.access_token);if(o.exp&&(r=o.exp,i=r<=n),i){const{session:a,error:l}=await this._callRefreshToken(t.refresh_token);if(l)return{data:{user:null,session:null},error:l};if(!a)return{data:{user:null,session:null},error:null};s=a}else{const{data:a,error:l}=await this._getUser(t.access_token);if(l)throw l;s={access_token:t.access_token,refresh_token:t.refresh_token,user:a.user,token_type:"bearer",expires_in:r-n,expires_at:r},await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)}return{data:{user:s.user,session:s},error:null}}catch(n){if(I(n))return{data:{session:null,user:null},error:n};throw n}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async n=>{var r;if(!t){const{data:o,error:a}=n;if(a)throw a;t=(r=o.session)!==null&&r!==void 0?r:void 0}if(!(t!=null&&t.refresh_token))throw new $t;const{session:i,error:s}=await this._callRefreshToken(t.refresh_token);return s?{data:{user:null,session:null},error:s}:i?{data:{user:i.user,session:i},error:null}:{data:{user:null,session:null},error:null}})}catch(n){if(I(n))return{data:{user:null,session:null},error:n};throw n}}async _getSessionFromURL(t,n){try{if(!it())throw new ks("No browser detected.");if(t.error||t.error_description||t.error_code)throw new ks(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new mf("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new ks("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new mf("No code detected.");const{data:m,error:p}=await this._exchangeCodeForSession(t.code);if(p)throw p;const x=new URL(window.location.href);return x.searchParams.delete("code"),window.history.replaceState(window.history.state,"",x.toString()),{data:{session:m.session,redirectType:null},error:null}}const{provider_token:r,provider_refresh_token:i,access_token:s,refresh_token:o,expires_in:a,expires_at:l,token_type:u}=t;if(!s||!a||!o||!u)throw new ks("No session defined in URL");const c=Math.round(Date.now()/1e3),d=parseInt(a);let h=c+d;l&&(h=parseInt(l));const f=h-c;f*1e3<=Jn&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${f}s, should have been closer to ${d}s`);const v=h-d;c-v>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",v,h,c):c-v<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",v,h,c);const{data:w,error:_}=await this._getUser(s);if(_)throw _;const y={provider_token:r,provider_refresh_token:i,access_token:s,expires_in:d,expires_at:h,refresh_token:o,token_type:u,user:w.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:y,redirectType:t.type},error:null}}catch(r){if(I(r))return{data:{session:null,redirectType:null},error:r};throw r}}_isImplicitGrantCallback(t){return!!(t.access_token||t.error_description)}async _isPKCECallback(t){const n=await bs(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&n)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async n=>{var r;const{data:i,error:s}=n;if(s)return{error:s};const o=(r=i.session)===null||r===void 0?void 0:r.access_token;if(o){const{error:a}=await this.admin.signOut(o,t);if(a&&!(GP(a)&&(a.status===404||a.status===401||a.status===403)))return{error:a}}return t!=="others"&&(await this._removeSession(),await Ps(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(t){const n=iE(),r={id:n,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",n),this.stateChangeEmitters.delete(n)}};return this._debug("#onAuthStateChange()","registered callback with id",n),this.stateChangeEmitters.set(n,r),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:r}}}async _emitInitialSession(t){return await this._useSession(async n=>{var r,i;try{const{data:{session:s},error:o}=n;if(o)throw o;await((r=this.stateChangeEmitters.get(t))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",s)),this._debug("INITIAL_SESSION","callback id",t,"session",s)}catch(s){await((i=this.stateChangeEmitters.get(t))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",s),console.error(s)}})}async resetPasswordForEmail(t,n={}){let r=null,i=null;this.flowType==="pkce"&&([r,i]=await Gn(this.storage,this.storageKey,!0));try{return await M(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:r,code_challenge_method:i,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(s){if(I(s))return{data:null,error:s};throw s}}async getUserIdentities(){var t;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return{data:{identities:(t=n.user.identities)!==null&&t!==void 0?t:[]},error:null}}catch(n){if(I(n))return{data:null,error:n};throw n}}async linkIdentity(t){var n;try{const{data:r,error:i}=await this._useSession(async s=>{var o,a,l,u,c;const{data:d,error:h}=s;if(h)throw h;const f=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(o=t.options)===null||o===void 0?void 0:o.redirectTo,scopes:(a=t.options)===null||a===void 0?void 0:a.scopes,queryParams:(l=t.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await M(this.fetch,"GET",f,{headers:this.headers,jwt:(c=(u=d.session)===null||u===void 0?void 0:u.access_token)!==null&&c!==void 0?c:void 0})});if(i)throw i;return it()&&!(!((n=t.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),{data:{provider:t.provider,url:r==null?void 0:r.url},error:null}}catch(r){if(I(r))return{data:{provider:t.provider,url:null},error:r};throw r}}async unlinkIdentity(t){try{return await this._useSession(async n=>{var r,i;const{data:s,error:o}=n;if(o)throw o;return await M(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(i=(r=s.session)===null||r===void 0?void 0:r.access_token)!==null&&i!==void 0?i:void 0})})}catch(n){if(I(n))return{data:null,error:n};throw n}}async _refreshAccessToken(t){const n=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(n,"begin");try{const r=Date.now();return await lE(async i=>(i>0&&await aE(200*Math.pow(2,i-1)),this._debug(n,"refreshing attempt",i),await M(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:xt})),(i,s)=>{const o=200*Math.pow(2,i);return s&&qa(s)&&Date.now()+o-r{try{await a.callback(t,n)}catch(l){s.push(l)}});if(await Promise.all(o),s.length>0){for(let a=0;athis._autoRefreshTokenTick(),Jn);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t)}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 t=Date.now();try{return await this._useSession(async n=>{const{data:{session:r}}=n;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const i=Math.floor((r.expires_at*1e3-t)/Jn);this._debug("#_autoRefreshTokenTick()",`access token expires in ${i} ticks, a tick lasts ${Jn}ms, refresh threshold is ${hu} ticks`),i<=hu&&await this._callRefreshToken(r.refresh_token)})}catch(n){console.error("Auto refresh tick failed with error. This is likely a transient error.",n)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof z0)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!it()||!(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(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const n=`#_onVisibilityChanged(${t})`;this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(n,"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(t,n,r){const i=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&i.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&i.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[s,o]=await Gn(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(s)}`,code_challenge_method:`${encodeURIComponent(o)}`});i.push(a.toString())}if(r!=null&&r.queryParams){const s=new URLSearchParams(r.queryParams);i.push(s.toString())}return r!=null&&r.skipBrowserRedirect&&i.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${t}?${i.join("&")}`}async _unenroll(t){try{return await this._useSession(async n=>{var r;const{data:i,error:s}=n;return s?{data:null,error:s}:await M(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(I(n))return{data:null,error:n};throw n}}async _enroll(t){try{return await this._useSession(async n=>{var r,i;const{data:s,error:o}=n;if(o)return{data:null,error:o};const a=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:{issuer:t.issuer}),{data:l,error:u}=await M(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});return u?{data:null,error:u}:(t.factorType==="totp"&&(!((i=l==null?void 0:l.totp)===null||i===void 0)&&i.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),{data:l,error:null})})}catch(n){if(I(n))return{data:null,error:n};throw n}}async _verify(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async n=>{var r;const{data:i,error:s}=n;if(s)return{data:null,error:s};const{data:o,error:a}=await M(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:{code:t.code,challenge_id:t.challengeId},headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token});return a?{data:null,error:a}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),{data:o,error:a})})}catch(n){if(I(n))return{data:null,error:n};throw n}})}async _challenge(t){return this._acquireLock(-1,async()=>{try{return await this._useSession(async n=>{var r;const{data:i,error:s}=n;return s?{data:null,error:s}:await M(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:{channel:t.channel},headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(I(n))return{data:null,error:n};throw n}})}async _challengeAndVerify(t){const{data:n,error:r}=await this._challenge({factorId:t.factorId});return r?{data:null,error:r}:await this._verify({factorId:t.factorId,challengeId:n.id,code:t.code})}async _listFactors(){const{data:{user:t},error:n}=await this.getUser();if(n)return{data:null,error:n};const r=(t==null?void 0:t.factors)||[],i=r.filter(o=>o.factor_type==="totp"&&o.status==="verified"),s=r.filter(o=>o.factor_type==="phone"&&o.status==="verified");return{data:{all:r,totp:i,phone:s},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async t=>{var n,r;const{data:{session:i},error:s}=t;if(s)return{data:null,error:s};if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:o}=Ga(i.access_token);let a=null;o.aal&&(a=o.aal);let l=a;((r=(n=i.user.factors)===null||n===void 0?void 0:n.filter(d=>d.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(l="aal2");const c=o.amr||[];return{data:{currentLevel:a,nextLevel:l,currentAuthenticationMethods:c},error:null}}))}async fetchJwk(t,n={keys:[]}){let r=n.keys.find(o=>o.kid===t);if(r||(r=this.jwks.keys.find(o=>o.kid===t),r&&this.jwks_cached_at+HP>Date.now()))return r;const{data:i,error:s}=await M(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(s)throw s;if(!i.keys||i.keys.length===0)throw new mi("JWKS is empty");if(this.jwks=i,this.jwks_cached_at=Date.now(),r=i.keys.find(o=>o.kid===t),!r)throw new mi("No matching signing key found in JWKS");return r}async getClaims(t,n={keys:[]}){try{let r=t;if(!r){const{data:f,error:v}=await this.getSession();if(v||!f.session)return{data:null,error:v};r=f.session.access_token}const{header:i,payload:s,signature:o,raw:{header:a,payload:l}}=Ga(r);if(mE(s.exp),!i.kid||i.alg==="HS256"||!("crypto"in globalThis&&"subtle"in globalThis.crypto)){const{error:f}=await this.getUser(r);if(f)throw f;return{data:{claims:s,header:i,signature:o},error:null}}const u=gE(i.alg),c=await this.fetchJwk(i.kid,n),d=await crypto.subtle.importKey("jwk",c,u,!0,["verify"]);if(!await crypto.subtle.verify(u,d,o,tE(`${a}.${l}`)))throw new mi("Invalid JWT signature");return{data:{claims:s,header:i,signature:o},error:null}}catch(r){if(I(r))return{data:null,error:r};throw r}}}$i.nextInstanceID=0;const NE=$i;class LE extends NE{constructor(t){super(t)}}var IE=function(e,t,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(c){try{u(r.next(c))}catch(d){o(d)}}function l(c){try{u(r.throw(c))}catch(d){o(d)}}function u(c){c.done?s(c.value):i(c.value).then(a,l)}u((r=r.apply(e,t||[])).next())})};class DE{constructor(t,n,r){var i,s,o;if(this.supabaseUrl=t,this.supabaseKey=n,!t)throw new Error("supabaseUrl is required.");if(!n)throw new Error("supabaseKey is required.");const a=$P(t),l=new URL(a);this.realtimeUrl=new URL("realtime/v1",l),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",l),this.storageUrl=new URL("storage/v1",l),this.functionsUrl=new URL("functions/v1",l);const u=`sb-${l.hostname.split(".")[0]}-auth-token`,c={db:RP,realtime:NP,auth:Object.assign(Object.assign({},OP),{storageKey:u}),global:AP},d=FP(r??{},c);this.storageKey=(i=d.auth.storageKey)!==null&&i!==void 0?i:"",this.headers=(s=d.global.headers)!==null&&s!==void 0?s:{},d.accessToken?(this.accessToken=d.accessToken,this.auth=new Proxy({},{get:(h,f)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(f)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((o=d.auth)!==null&&o!==void 0?o:{},this.headers,d.global.fetch),this.fetch=MP(n,this._getAccessToken.bind(this),d.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},d.realtime)),this.rest=new Zb(new URL("rest/v1",l).href,{headers:this.headers,schema:d.db.schema,fetch:this.fetch}),d.accessToken||this._listenForAuthEvents()}get functions(){return new jb(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}get storage(){return new CP(this.storageUrl.href,this.headers,this.fetch)}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,n={},r={}){return this.rest.rpc(t,n,r)}channel(t,n={config:{}}){return this.realtime.channel(t,n)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var t,n;return IE(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();const{data:r}=yield this.auth.getSession();return(n=(t=r.session)===null||t===void 0?void 0:t.access_token)!==null&&n!==void 0?n:null})}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:n,detectSessionInUrl:r,storage:i,storageKey:s,flowType:o,lock:a,debug:l},u,c){const d={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new LE({url:this.authUrl.href,headers:Object.assign(Object.assign({},d),u),storageKey:s,autoRefreshToken:t,persistSession:n,detectSessionInUrl:r,storage:i,flowType:o,lock:a,debug:l,fetch:c,hasCustomAuthorizationHeader:"Authorization"in this.headers})}_initRealtimeClient(t){return new fP(this.realtimeUrl.href,Object.assign(Object.assign({},t),{params:Object.assign({apikey:this.supabaseKey},t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((n,r)=>{this._handleTokenChanged(n,"CLIENT",r==null?void 0:r.access_token)})}_handleTokenChanged(t,n,r){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==r?this.changedAccessToken=r:t==="SIGNED_OUT"&&(this.realtime.setAuth(),n=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const ME=(e,t,n)=>new DE(e,t,n),VE="https://jfshpaydqwdennipdela.supabase.co",$E="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Impmc2hwYXlkcXdkZW5uaXBkZWxhIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDkyMjA3MTQsImV4cCI6MjA2NDc5NjcxNH0.YqxrHuJQLKUkk9fVPNSCaTmHjYb0rAyzNzu-pdd8f18",FE=ME(VE,$E),UE=()=>{const[e,t]=k.useState({name:"",email:"",phone:"",company:"",problems:"",additionalInfo:""}),[n,r]=k.useState({type:"idle"}),i=a=>{const{name:l,value:u}=a.target;t(c=>({...c,[l]:u}))},s=async a=>{if(a.preventDefault(),["name","email","phone","company","problems"].filter(h=>!e[h].trim()).length>0){r({type:"error",message:"Please fill in all required fields."});return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e.email)){r({type:"error",message:"Please enter a valid email address."});return}if(!/^[\+]?[1-9][\d]{0,15}$/.test(e.phone.replace(/[\s\-\(\)]/g,""))){r({type:"error",message:"Please enter a valid phone number."});return}r({type:"loading"});try{const h=` +BOOKING FORM SUBMISSION: + +Phone: ${e.phone} +Company: ${e.company} +Problems to solve: ${e.problems} +${e.additionalInfo?`Additional information: ${e.additionalInfo}`:""} + `.trim(),f={name:e.name.trim(),email:e.email.trim(),company:e.company.trim(),message:h},{error:v}=await FE.from("consultations").insert([f]);if(v)throw v;r({type:"success",message:"Thank you! Your booking request has been submitted successfully. We'll contact you within 24 hours to schedule your consultation."}),t({name:"",email:"",phone:"",company:"",problems:"",additionalInfo:""})}catch(h){console.error("Error submitting booking request:",h),r({type:"error",message:"Sorry, there was an error submitting your request. Please try again."})}},o=()=>{window.history.back()};return g.jsxs("div",{className:"min-h-screen bg-background relative overflow-hidden",children:[g.jsx("div",{className:"fixed inset-0 bg-black"}),g.jsx("div",{className:"fixed inset-0 bg-grain opacity-[0.015] pointer-events-none z-10"}),g.jsxs("div",{className:"fixed inset-0 overflow-hidden pointer-events-none",children:[g.jsx(V.div,{className:"absolute top-[20%] right-[15%] w-[400px] h-[400px] rounded-full bg-accent-900/10 filter blur-[100px]",animate:{opacity:[.3,.5,.3],scale:[1,1.1,1]},transition:{duration:8,repeat:1/0,repeatType:"reverse"}}),g.jsx(V.div,{className:"absolute bottom-[30%] left-[10%] w-[300px] h-[300px] rounded-full bg-primary-900/15 filter blur-[80px]",animate:{opacity:[.2,.4,.2],scale:[1,1.15,1]},transition:{duration:7,repeat:1/0,repeatType:"reverse",delay:2}})]}),g.jsxs("div",{className:"relative z-20 container mx-auto px-4 py-8",children:[g.jsxs(V.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.6},className:"flex items-center mb-8",children:[g.jsxs("button",{onClick:o,className:"flex items-center text-text-secondary hover:text-text-primary transition-colors mr-6",children:[g.jsx(Ck,{size:20,className:"mr-2"}),"Back to Home"]}),g.jsxs("div",{className:"flex items-center",children:[g.jsx("img",{src:"/assets/logo.png",alt:"Logo",className:"w-8 h-8 mr-2"}),g.jsxs("span",{className:"text-xl font-semibold tracking-tight",children:["NeoCyber",g.jsx("span",{className:"bg-gradient-to-r from-accent-500 to-secondary-900 bg-clip-text text-transparent",children:"Acquisition"})]})]})]}),g.jsxs("div",{className:"max-w-4xl mx-auto",children:[g.jsxs(V.div,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{duration:.6,delay:.2},className:"text-center mb-12",children:[g.jsx("h1",{className:"text-4xl md:text-5xl font-bold mb-4",children:"Book Your AI Strategy Call"}),g.jsx("p",{className:"text-text-secondary text-lg max-w-2xl mx-auto",children:"Let's discuss how AI automation can transform your business. Fill out the form below and we'll schedule a personalized consultation."})]}),g.jsxs(V.div,{initial:{opacity:0,y:40},animate:{opacity:1,y:0},transition:{duration:.6,delay:.4},className:"bg-background-light rounded-2xl p-8 md:p-12 border border-secondary-800/30 shadow-xl relative overflow-hidden",children:[g.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-secondary-900/20 via-accent-900/10 to-primary-900/20 opacity-60"}),g.jsxs("div",{className:"relative z-10",children:[n.type==="success"&&g.jsxs(V.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"mb-8 p-6 bg-green-900/20 border border-green-500/30 rounded-lg flex items-start",children:[g.jsx(Ak,{className:"text-green-400 mr-3 flex-shrink-0 mt-1",size:24}),g.jsxs("div",{children:[g.jsx("h3",{className:"text-green-300 font-semibold mb-2",children:"Booking Request Submitted!"}),g.jsx("p",{className:"text-green-300 text-sm",children:n.message})]})]}),n.type==="error"&&g.jsxs(V.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"mb-8 p-6 bg-red-900/20 border border-red-500/30 rounded-lg flex items-start",children:[g.jsx(Ek,{className:"text-red-400 mr-3 flex-shrink-0 mt-1",size:24}),g.jsxs("div",{children:[g.jsx("h3",{className:"text-red-300 font-semibold mb-2",children:"Error"}),g.jsx("p",{className:"text-red-300 text-sm",children:n.message})]})]}),g.jsxs("form",{onSubmit:s,className:"space-y-8",children:[g.jsxs("div",{children:[g.jsxs("h3",{className:"text-xl font-semibold mb-6 flex items-center",children:[g.jsx(Fk,{className:"mr-3 text-secondary-400",size:24}),"Personal Information"]}),g.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[g.jsxs("div",{children:[g.jsx("label",{htmlFor:"name",className:"block text-sm font-medium text-text-primary mb-2",children:"Full Name *"}),g.jsx("input",{type:"text",id:"name",name:"name",value:e.name,onChange:i,required:!0,className:"w-full px-4 py-3 bg-background border border-secondary-700/50 rounded-lg focus:outline-none focus:ring-2 focus:ring-secondary-500 focus:border-transparent text-text-primary placeholder-text-secondary",placeholder:"Enter your full name"})]}),g.jsxs("div",{children:[g.jsx("label",{htmlFor:"email",className:"block text-sm font-medium text-text-primary mb-2",children:"Email Address *"}),g.jsxs("div",{className:"relative",children:[g.jsx(g0,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-text-secondary",size:18}),g.jsx("input",{type:"email",id:"email",name:"email",value:e.email,onChange:i,required:!0,className:"w-full pl-10 pr-4 py-3 bg-background border border-secondary-700/50 rounded-lg focus:outline-none focus:ring-2 focus:ring-secondary-500 focus:border-transparent text-text-primary placeholder-text-secondary",placeholder:"Enter your email address"})]})]})]})]}),g.jsxs("div",{children:[g.jsxs("h3",{className:"text-xl font-semibold mb-6 flex items-center",children:[g.jsx(jk,{className:"mr-3 text-secondary-400",size:24}),"Contact & Company Information"]}),g.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[g.jsxs("div",{children:[g.jsx("label",{htmlFor:"phone",className:"block text-sm font-medium text-text-primary mb-2",children:"Phone Number *"}),g.jsxs("div",{className:"relative",children:[g.jsx(Vk,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-text-secondary",size:18}),g.jsx("input",{type:"tel",id:"phone",name:"phone",value:e.phone,onChange:i,required:!0,className:"w-full pl-10 pr-4 py-3 bg-background border border-secondary-700/50 rounded-lg focus:outline-none focus:ring-2 focus:ring-secondary-500 focus:border-transparent text-text-primary placeholder-text-secondary",placeholder:"Enter your phone number"})]})]}),g.jsxs("div",{children:[g.jsx("label",{htmlFor:"company",className:"block text-sm font-medium text-text-primary mb-2",children:"Company Name *"}),g.jsx("input",{type:"text",id:"company",name:"company",value:e.company,onChange:i,required:!0,className:"w-full px-4 py-3 bg-background border border-secondary-700/50 rounded-lg focus:outline-none focus:ring-2 focus:ring-secondary-500 focus:border-transparent text-text-primary placeholder-text-secondary",placeholder:"Enter your company name"})]})]})]}),g.jsxs("div",{children:[g.jsxs("h3",{className:"text-xl font-semibold mb-6 flex items-center",children:[g.jsx(Mk,{className:"mr-3 text-secondary-400",size:24}),"Project Information"]}),g.jsxs("div",{className:"space-y-6",children:[g.jsxs("div",{children:[g.jsx("label",{htmlFor:"problems",className:"block text-sm font-medium text-text-primary mb-2",children:"What problems are you looking to solve? *"}),g.jsx("textarea",{id:"problems",name:"problems",value:e.problems,onChange:i,required:!0,rows:4,className:"w-full px-4 py-3 bg-background border border-secondary-700/50 rounded-lg focus:outline-none focus:ring-2 focus:ring-secondary-500 focus:border-transparent text-text-primary placeholder-text-secondary resize-vertical",placeholder:"Describe the specific challenges or inefficiencies you're facing that AI automation could help solve..."})]}),g.jsxs("div",{children:[g.jsxs("label",{htmlFor:"additionalInfo",className:"block text-sm font-medium text-text-primary mb-2 flex items-center",children:[g.jsx(Ik,{className:"mr-2",size:18}),"Additional Information",g.jsx("span",{className:"text-text-secondary text-xs ml-2",children:"(Optional)"})]}),g.jsx("textarea",{id:"additionalInfo",name:"additionalInfo",value:e.additionalInfo,onChange:i,rows:3,className:"w-full px-4 py-3 bg-background border border-secondary-700/50 rounded-lg focus:outline-none focus:ring-2 focus:ring-secondary-500 focus:border-transparent text-text-primary placeholder-text-secondary resize-vertical",placeholder:"Any additional details about your business, timeline, budget considerations, or specific requirements..."})]})]})]}),g.jsxs(V.button,{type:"submit",disabled:n.type==="loading",className:"group relative w-full inline-flex items-center justify-center px-8 py-4 text-lg font-medium text-white bg-gradient-to-r from-secondary-600 to-accent-700 rounded-lg overflow-hidden transition-all duration-300 shadow-lg shadow-secondary-900/30 hover:shadow-secondary-800/50 disabled:opacity-50 disabled:cursor-not-allowed",whileHover:{scale:n.type==="loading"?1:1.02},whileTap:{scale:n.type==="loading"?1:.98},children:[g.jsxs("span",{className:"relative z-10 flex items-center",children:[g.jsx("span",{children:n.type==="loading"?"Submitting Your Request...":"Submit Booking Request"}),n.type==="loading"&&g.jsx("div",{className:"ml-3 w-5 h-5 border-2 border-white/30 border-t-white rounded-full animate-spin"})]}),g.jsx("span",{className:"absolute inset-0 bg-gradient-to-r from-secondary-500 to-accent-600 opacity-0 group-hover:opacity-100 transition-opacity duration-300"})]})]}),g.jsxs("div",{className:"mt-8 p-6 bg-secondary-900/10 rounded-lg border border-secondary-800/30",children:[g.jsx("h4",{className:"text-lg font-semibold mb-3 text-secondary-300",children:"What happens next?"}),g.jsxs("ul",{className:"space-y-2 text-text-secondary text-sm",children:[g.jsxs("li",{className:"flex items-start",children:[g.jsx("span",{className:"text-secondary-400 mr-2",children:"1."}),"We'll review your submission within 24 hours"]}),g.jsxs("li",{className:"flex items-start",children:[g.jsx("span",{className:"text-secondary-400 mr-2",children:"2."}),"Our team will contact you to schedule a convenient time for your consultation"]}),g.jsxs("li",{className:"flex items-start",children:[g.jsx("span",{className:"text-secondary-400 mr-2",children:"3."}),"During the call, we'll discuss your specific needs and create a custom AI strategy"]}),g.jsxs("li",{className:"flex items-start",children:[g.jsx("span",{className:"text-secondary-400 mr-2",children:"4."}),"You'll receive a detailed proposal with timeline and next steps"]})]})]})]})]})]})]})]})};function BE(){return g.jsx(f1,{children:g.jsxs(c1,{children:[g.jsx(Bl,{path:"/",element:g.jsx(_b,{})}),g.jsx(Bl,{path:"/book-call",element:g.jsx(UE,{})})]})})}Dm(document.getElementById("root")).render(g.jsx(k.StrictMode,{children:g.jsx(BE,{})}));