const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ViewImage-B799gwqR.js","assets/external-link-BcC4XHt6.js","assets/supabase-O4DCdMYY.js","assets/ScanLocationsMap-BL8jtmRv.js","assets/map-pin-DKH0tx__.js","assets/CleanChat-BwmrnJtQ.js","assets/useAdminPresence-DLXMjZaM.js","assets/trash-2-BLZqu9wc.js","assets/Index-CvKbqRhz.js","assets/Header-Dvpew4NC.js","assets/info-C6faMiaJ.js","assets/imageProcessor-DpM45aCy.js","assets/QRCodeGeneratorWithTabs-D999kwAQ.js","assets/index-xrpVrZT6.js","assets/index-BdiWmOps.js","assets/index-g-IYWhqf.js","assets/check-W8EwXDqy.js","assets/image-cbQ4COkD.js","assets/MySharedImages-DJnZjQKY.js","assets/chart-column-DtpH6QZI.js","assets/EditScanExperience-C93bSwkD.js","assets/Pricing-v_7X9CM8.js","assets/tabs-BO6bThOk.js","assets/Comparison-Bp0-4SnO.js","assets/AdminPage-EpX3slom.js","assets/search-DEg1Rk4T.js","assets/AdminImageMigration-CdAQC0hN.js"])))=>i.map(i=>d[i]); var kw=Object.defineProperty;var Kf=e=>{throw TypeError(e)};var Ew=(e,t,n)=>t in e?kw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ln=(e,t,n)=>Ew(e,typeof t!="symbol"?t+"":t,n),Gl=(e,t,n)=>t.has(e)||Kf("Cannot "+n);var C=(e,t,n)=>(Gl(e,t,"read from private field"),n?n.call(e):t.get(e)),te=(e,t,n)=>t.has(e)?Kf("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),B=(e,t,n,r)=>(Gl(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),De=(e,t,n)=>(Gl(e,t,"access private method"),n);var $i=(e,t,n,r)=>({set _(s){B(e,t,s,n)},get _(){return C(e,t,r)}});function Cw(e,t){for(var n=0;nr[s]})}}}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 s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();var kt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _i(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Tw(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 s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}),n}var Nm={exports:{}},dl={},Om={exports:{}},Y={};/** * @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 Si=Symbol.for("react.element"),jw=Symbol.for("react.portal"),Pw=Symbol.for("react.fragment"),Nw=Symbol.for("react.strict_mode"),Ow=Symbol.for("react.profiler"),Rw=Symbol.for("react.provider"),Aw=Symbol.for("react.context"),Iw=Symbol.for("react.forward_ref"),Mw=Symbol.for("react.suspense"),Lw=Symbol.for("react.memo"),$w=Symbol.for("react.lazy"),Gf=Symbol.iterator;function Dw(e){return e===null||typeof e!="object"?null:(e=Gf&&e[Gf]||e["@@iterator"],typeof e=="function"?e:null)}var Rm={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Am=Object.assign,Im={};function to(e,t,n){this.props=e,this.context=t,this.refs=Im,this.updater=n||Rm}to.prototype.isReactComponent={};to.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")};to.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Mm(){}Mm.prototype=to.prototype;function gd(e,t,n){this.props=e,this.context=t,this.refs=Im,this.updater=n||Rm}var vd=gd.prototype=new Mm;vd.constructor=gd;Am(vd,to.prototype);vd.isPureReactComponent=!0;var Yf=Array.isArray,Lm=Object.prototype.hasOwnProperty,yd={current:null},$m={key:!0,ref:!0,__self:!0,__source:!0};function Dm(e,t,n){var r,s={},o=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(o=""+t.key),t)Lm.call(t,r)&&!$m.hasOwnProperty(r)&&(s[r]=t[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1>>1,D=T[H];if(0>>1;Hs(be,M))$es(ne,be)?(T[H]=ne,T[$e]=M,H=$e):(T[H]=be,T[X]=M,H=X);else if($es(ne,M))T[H]=ne,T[$e]=M,H=$e;else break e}}return P}function s(T,P){var M=T.sortIndex-P.sortIndex;return M!==0?M:T.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,a=i.now();e.unstable_now=function(){return i.now()-a}}var l=[],c=[],d=1,f=null,p=3,h=!1,x=!1,w=!1,b=typeof setTimeout=="function"?setTimeout:null,v=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 g(T){for(var P=n(c);P!==null;){if(P.callback===null)r(c);else if(P.startTime<=T)r(c),P.sortIndex=P.expirationTime,t(l,P);else break;P=n(c)}}function _(T){if(w=!1,g(T),!x)if(n(l)!==null)x=!0,U(S);else{var P=n(c);P!==null&&W(_,P.startTime-T)}}function S(T,P){x=!1,w&&(w=!1,v(j),j=-1),h=!0;var M=p;try{for(g(P),f=n(l);f!==null&&(!(f.expirationTime>P)||T&&!F());){var H=f.callback;if(typeof H=="function"){f.callback=null,p=f.priorityLevel;var D=H(f.expirationTime<=P);P=e.unstable_now(),typeof D=="function"?f.callback=D:f===n(l)&&r(l),g(P)}else r(l);f=n(l)}if(f!==null)var K=!0;else{var X=n(c);X!==null&&W(_,X.startTime-P),K=!1}return K}finally{f=null,p=M,h=!1}}var k=!1,E=null,j=-1,A=5,R=-1;function F(){return!(e.unstable_now()-RT||125H?(T.sortIndex=M,t(c,T),n(l)===null&&T===n(c)&&(w?(v(j),j=-1):w=!0,W(_,M-H))):(T.sortIndex=D,t(l,T),x||h||(x=!0,U(S))),T},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(T){var P=p;return function(){var M=p;p=P;try{return T.apply(this,arguments)}finally{p=M}}}})(Hm);Wm.exports=Hm;var Gw=Wm.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 Yw=y,pt=Gw;function N(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"),Vc=Object.prototype.hasOwnProperty,Jw=/^[: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]*$/,Xf={},Zf={};function Xw(e){return Vc.call(Zf,e)?!0:Vc.call(Xf,e)?!1:Jw.test(e)?Zf[e]=!0:(Xf[e]=!0,!1)}function Zw(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 ex(e,t,n,r){if(t===null||typeof t>"u"||Zw(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 Ze(e,t,n,r,s,o,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var Le={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Le[e]=new Ze(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Le[t]=new Ze(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Le[e]=new Ze(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Le[e]=new Ze(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){Le[e]=new Ze(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Le[e]=new Ze(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Le[e]=new Ze(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Le[e]=new Ze(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Le[e]=new Ze(e,5,!1,e.toLowerCase(),null,!1,!1)});var xd=/[\-:]([a-z])/g;function bd(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(xd,bd);Le[t]=new Ze(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(xd,bd);Le[t]=new Ze(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(xd,bd);Le[t]=new Ze(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Le[e]=new Ze(e,1,!1,e.toLowerCase(),null,!1,!1)});Le.xlinkHref=new Ze("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Le[e]=new Ze(e,1,!1,e.toLowerCase(),null,!0,!0)});function _d(e,t,n,r){var s=Le.hasOwnProperty(t)?Le[t]:null;(s!==null?s.type!==0:r||!(2a||s[i]!==o[a]){var l=` `+s[i].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=i&&0<=a);break}}}finally{Xl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?No(e):""}function tx(e){switch(e.tag){case 5:return No(e.type);case 16:return No("Lazy");case 13:return No("Suspense");case 19:return No("SuspenseList");case 0:case 2:case 15:return e=Zl(e.type,!1),e;case 11:return e=Zl(e.type.render,!1),e;case 1:return e=Zl(e.type,!0),e;default:return""}}function Gc(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 ms:return"Fragment";case ps:return"Portal";case qc:return"Profiler";case Sd:return"StrictMode";case Qc:return"Suspense";case Kc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Qm:return(e.displayName||"Context")+".Consumer";case qm:return(e._context.displayName||"Context")+".Provider";case kd:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ed:return t=e.displayName||null,t!==null?t:Gc(e.type)||"Memo";case Un:t=e._payload,e=e._init;try{return Gc(e(t))}catch{}}return null}function nx(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 Gc(t);case 8:return t===Sd?"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 lr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Gm(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function rx(e){var t=Gm(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 s=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(i){r=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ui(e){e._valueTracker||(e._valueTracker=rx(e))}function Ym(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Gm(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Na(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 Yc(e,t){var n=t.checked;return me({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function th(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=lr(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 Jm(e,t){t=t.checked,t!=null&&_d(e,"checked",t,!1)}function Jc(e,t){Jm(e,t);var n=lr(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")?Xc(e,t.type,n):t.hasOwnProperty("defaultValue")&&Xc(e,t.type,lr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function nh(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 Xc(e,t,n){(t!=="number"||Na(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Oo=Array.isArray;function Cs(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=zi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Yo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Mo={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},sx=["Webkit","ms","Moz","O"];Object.keys(Mo).forEach(function(e){sx.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Mo[t]=Mo[e]})});function tg(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Mo.hasOwnProperty(e)&&Mo[e]?(""+t).trim():t+"px"}function ng(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=tg(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var ox=me({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 tu(e,t){if(t){if(ox[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(N(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(N(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(N(61))}if(t.style!=null&&typeof t.style!="object")throw Error(N(62))}}function nu(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 ru=null;function Cd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var su=null,Ts=null,js=null;function oh(e){if(e=Ci(e)){if(typeof su!="function")throw Error(N(280));var t=e.stateNode;t&&(t=gl(t),su(e.stateNode,e.type,t))}}function rg(e){Ts?js?js.push(e):js=[e]:Ts=e}function sg(){if(Ts){var e=Ts,t=js;if(js=Ts=null,oh(e),t)for(e=0;e>>=0,e===0?32:31-(gx(e)/vx|0)|0}var Bi=64,Wi=4194304;function Ro(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 Ia(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,o=e.pingedLanes,i=n&268435455;if(i!==0){var a=i&~s;a!==0?r=Ro(a):(o&=i,o!==0&&(r=Ro(o)))}else i=n&~s,i!==0?r=Ro(i):o!==0&&(r=Ro(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,o=t&-t,s>=o||s===16&&(o&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 ki(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-zt(t),e[t]=n}function bx(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=$o),ph=" ",mh=!1;function kg(e,t){switch(e){case"keyup":return Gx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Eg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var gs=!1;function Jx(e,t){switch(e){case"compositionend":return Eg(t);case"keypress":return t.which!==32?null:(mh=!0,ph);case"textInput":return e=t.data,e===ph&&mh?null:e;default:return null}}function Xx(e,t){if(gs)return e==="compositionend"||!Id&&kg(e,t)?(e=_g(),pa=Od=Yn=null,gs=!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=wh(n)}}function Pg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Pg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ng(){for(var e=window,t=Na();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Na(e.document)}return t}function Md(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 a1(e){var t=Ng(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Pg(n.ownerDocument.documentElement,n)){if(r!==null&&Md(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 s=n.textContent.length,o=Math.min(r.start,s);r=r.end===void 0?o:Math.min(r.end,s),!e.extend&&o>r&&(s=r,r=o,o=s),s=xh(n,o);var i=xh(n,r);s&&i&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.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,vs=null,uu=null,Fo=null,du=!1;function bh(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;du||vs==null||vs!==Na(r)||(r=vs,"selectionStart"in r&&Md(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}),Fo&&ni(Fo,r)||(Fo=r,r=$a(uu,"onSelect"),0xs||(e.current=vu[xs],vu[xs]=null,xs--)}function ae(e,t){xs++,vu[xs]=e.current,e.current=t}var cr={},We=mr(cr),ot=mr(!1),Br=cr;function Vs(e,t){var n=e.type.contextTypes;if(!n)return cr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in n)s[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function it(e){return e=e.childContextTypes,e!=null}function Fa(){ue(ot),ue(We)}function jh(e,t,n){if(We.current!==cr)throw Error(N(168));ae(We,t),ae(ot,n)}function Fg(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(N(108,nx(e)||"Unknown",s));return me({},n,r)}function Ua(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||cr,Br=We.current,ae(We,e),ae(ot,ot.current),!0}function Ph(e,t,n){var r=e.stateNode;if(!r)throw Error(N(169));n?(e=Fg(e,t,Br),r.__reactInternalMemoizedMergedChildContext=e,ue(ot),ue(We),ae(We,e)):ue(ot),ae(ot,n)}var pn=null,vl=!1,hc=!1;function Ug(e){pn===null?pn=[e]:pn.push(e)}function w1(e){vl=!0,Ug(e)}function gr(){if(!hc&&pn!==null){hc=!0;var e=0,t=se;try{var n=pn;for(se=1;e>=i,s-=i,gn=1<<32-zt(t)+s|n<j?(A=E,E=null):A=E.sibling;var R=p(v,E,g[j],_);if(R===null){E===null&&(E=A);break}e&&E&&R.alternate===null&&t(v,E),m=o(R,m,j),k===null?S=R:k.sibling=R,k=R,E=A}if(j===g.length)return n(v,E),fe&&Er(v,j),S;if(E===null){for(;jj?(A=E,E=null):A=E.sibling;var F=p(v,E,R.value,_);if(F===null){E===null&&(E=A);break}e&&E&&F.alternate===null&&t(v,E),m=o(F,m,j),k===null?S=F:k.sibling=F,k=F,E=A}if(R.done)return n(v,E),fe&&Er(v,j),S;if(E===null){for(;!R.done;j++,R=g.next())R=f(v,R.value,_),R!==null&&(m=o(R,m,j),k===null?S=R:k.sibling=R,k=R);return fe&&Er(v,j),S}for(E=r(v,E);!R.done;j++,R=g.next())R=h(E,v,j,R.value,_),R!==null&&(e&&R.alternate!==null&&E.delete(R.key===null?j:R.key),m=o(R,m,j),k===null?S=R:k.sibling=R,k=R);return e&&E.forEach(function($){return t(v,$)}),fe&&Er(v,j),S}function b(v,m,g,_){if(typeof g=="object"&&g!==null&&g.type===ms&&g.key===null&&(g=g.props.children),typeof g=="object"&&g!==null){switch(g.$$typeof){case Fi:e:{for(var S=g.key,k=m;k!==null;){if(k.key===S){if(S=g.type,S===ms){if(k.tag===7){n(v,k.sibling),m=s(k,g.props.children),m.return=v,v=m;break e}}else if(k.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Un&&Rh(S)===k.type){n(v,k.sibling),m=s(k,g.props),m.ref=wo(v,k,g),m.return=v,v=m;break e}n(v,k);break}else t(v,k);k=k.sibling}g.type===ms?(m=zr(g.props.children,v.mode,_,g.key),m.return=v,v=m):(_=_a(g.type,g.key,g.props,null,v.mode,_),_.ref=wo(v,m,g),_.return=v,v=_)}return i(v);case ps:e:{for(k=g.key;m!==null;){if(m.key===k)if(m.tag===4&&m.stateNode.containerInfo===g.containerInfo&&m.stateNode.implementation===g.implementation){n(v,m.sibling),m=s(m,g.children||[]),m.return=v,v=m;break e}else{n(v,m);break}else t(v,m);m=m.sibling}m=bc(g,v.mode,_),m.return=v,v=m}return i(v);case Un:return k=g._init,b(v,m,k(g._payload),_)}if(Oo(g))return x(v,m,g,_);if(po(g))return w(v,m,g,_);Yi(v,g)}return typeof g=="string"&&g!==""||typeof g=="number"?(g=""+g,m!==null&&m.tag===6?(n(v,m.sibling),m=s(m,g),m.return=v,v=m):(n(v,m),m=xc(g,v.mode,_),m.return=v,v=m),i(v)):n(v,m)}return b}var Qs=Hg(!0),Vg=Hg(!1),Wa=mr(null),Ha=null,Ss=null,Fd=null;function Ud(){Fd=Ss=Ha=null}function zd(e){var t=Wa.current;ue(Wa),e._currentValue=t}function xu(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 Ns(e,t){Ha=e,Fd=Ss=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(st=!0),e.firstContext=null)}function Et(e){var t=e._currentValue;if(Fd!==e)if(e={context:e,memoizedValue:t,next:null},Ss===null){if(Ha===null)throw Error(N(308));Ss=e,Ha.dependencies={lanes:0,firstContext:e}}else Ss=Ss.next=e;return t}var Or=null;function Bd(e){Or===null?Or=[e]:Or.push(e)}function qg(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Bd(t)):(n.next=s.next,s.next=n),t.interleaved=n,bn(e,r)}function bn(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 zn=!1;function Wd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Qg(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 yn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function rr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Z&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,bn(e,n)}return s=r.interleaved,s===null?(t.next=t,Bd(r)):(t.next=s.next,s.next=t),r.interleaved=t,bn(e,n)}function ga(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,jd(e,n)}}function Ah(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?s=o=i:o=o.next=i,n=n.next}while(n!==null);o===null?s=o=t:o=o.next=t}else s=o=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:o,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 Va(e,t,n,r){var s=e.updateQueue;zn=!1;var o=s.firstBaseUpdate,i=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,c=l.next;l.next=null,i===null?o=c:i.next=c,i=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==i&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(o!==null){var f=s.baseState;i=0,d=c=l=null,a=o;do{var p=a.lane,h=a.eventTime;if((r&p)===p){d!==null&&(d=d.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var x=e,w=a;switch(p=t,h=n,w.tag){case 1:if(x=w.payload,typeof x=="function"){f=x.call(h,f,p);break e}f=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=w.payload,p=typeof x=="function"?x.call(h,f,p):x,p==null)break e;f=me({},f,p);break e;case 2:zn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,p=s.effects,p===null?s.effects=[a]:p.push(a))}else h={eventTime:h,lane:p,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=h,l=f):d=d.next=h,i|=p;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;p=a,a=p.next,p.next=null,s.lastBaseUpdate=p,s.shared.pending=null}}while(!0);if(d===null&&(l=f),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do i|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);Vr|=i,e.lanes=i,e.memoizedState=f}}function Ih(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=mc.transition;mc.transition={};try{e(!1),t()}finally{se=n,mc.transition=r}}function uv(){return Ct().memoizedState}function S1(e,t,n){var r=or(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},dv(e))fv(t,n);else if(n=qg(e,t,n,r),n!==null){var s=Je();Bt(n,e,r,s),hv(n,t,r)}}function k1(e,t,n){var r=or(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(dv(e))fv(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,a=o(i,n);if(s.hasEagerState=!0,s.eagerState=a,Wt(a,i)){var l=t.interleaved;l===null?(s.next=s,Bd(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}n=qg(e,t,s,r),n!==null&&(s=Je(),Bt(n,e,r,s),hv(n,t,r))}}function dv(e){var t=e.alternate;return e===pe||t!==null&&t===pe}function fv(e,t){Uo=Qa=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function hv(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,jd(e,n)}}var Ka={readContext:Et,useCallback:Fe,useContext:Fe,useEffect:Fe,useImperativeHandle:Fe,useInsertionEffect:Fe,useLayoutEffect:Fe,useMemo:Fe,useReducer:Fe,useRef:Fe,useState:Fe,useDebugValue:Fe,useDeferredValue:Fe,useTransition:Fe,useMutableSource:Fe,useSyncExternalStore:Fe,useId:Fe,unstable_isNewReconciler:!1},E1={readContext:Et,useCallback:function(e,t){return Gt().memoizedState=[e,t===void 0?null:t],e},useContext:Et,useEffect:Lh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ya(4194308,4,ov.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ya(4194308,4,e,t)},useInsertionEffect:function(e,t){return ya(4,2,e,t)},useMemo:function(e,t){var n=Gt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Gt();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=S1.bind(null,pe,e),[r.memoizedState,e]},useRef:function(e){var t=Gt();return e={current:e},t.memoizedState=e},useState:Mh,useDebugValue:Jd,useDeferredValue:function(e){return Gt().memoizedState=e},useTransition:function(){var e=Mh(!1),t=e[0];return e=_1.bind(null,e[1]),Gt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=pe,s=Gt();if(fe){if(n===void 0)throw Error(N(407));n=n()}else{if(n=t(),Oe===null)throw Error(N(349));Hr&30||Jg(r,t,n)}s.memoizedState=n;var o={value:n,getSnapshot:t};return s.queue=o,Lh(Zg.bind(null,r,o,e),[e]),r.flags|=2048,ui(9,Xg.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Gt(),t=Oe.identifierPrefix;if(fe){var n=vn,r=gn;n=(r&~(1<<32-zt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=li++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[en]=t,e[oi]=r,Sv(e,t,!1,!1),t.stateNode=e;e:{switch(i=nu(n,r),n){case"dialog":ce("cancel",e),ce("close",e),s=r;break;case"iframe":case"object":case"embed":ce("load",e),s=r;break;case"video":case"audio":for(s=0;sYs&&(t.flags|=128,r=!0,xo(o,!1),t.lanes=4194304)}else{if(!r)if(e=qa(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),xo(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!fe)return Ue(t),null}else 2*we()-o.renderingStartTime>Ys&&n!==1073741824&&(t.flags|=128,r=!0,xo(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(n=o.last,n!==null?n.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=we(),t.sibling=null,n=he.current,ae(he,r?n&1|2:n&1),t):(Ue(t),null);case 22:case 23:return rf(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?lt&1073741824&&(Ue(t),t.subtreeFlags&6&&(t.flags|=8192)):Ue(t),null;case 24:return null;case 25:return null}throw Error(N(156,t.tag))}function A1(e,t){switch($d(t),t.tag){case 1:return it(t.type)&&Fa(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ks(),ue(ot),ue(We),qd(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Vd(t),null;case 13:if(ue(he),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(N(340));qs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ue(he),null;case 4:return Ks(),null;case 10:return zd(t.type._context),null;case 22:case 23:return rf(),null;case 24:return null;default:return null}}var Xi=!1,Be=!1,I1=typeof WeakSet=="function"?WeakSet:Set,L=null;function ks(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ve(e,t,r)}else n.current=null}function Pu(e,t,n){try{n()}catch(r){ve(e,t,r)}}var Qh=!1;function M1(e,t){if(fu=Ma,e=Ng(),Md(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 s=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var i=0,a=-1,l=-1,c=0,d=0,f=e,p=null;t:for(;;){for(var h;f!==n||s!==0&&f.nodeType!==3||(a=i+s),f!==o||r!==0&&f.nodeType!==3||(l=i+r),f.nodeType===3&&(i+=f.nodeValue.length),(h=f.firstChild)!==null;)p=f,f=h;for(;;){if(f===e)break t;if(p===n&&++c===s&&(a=i),p===o&&++d===r&&(l=i),(h=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(hu={focusedElem:e,selectionRange:n},Ma=!1,L=t;L!==null;)if(t=L,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,L=e;else for(;L!==null;){t=L;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var w=x.memoizedProps,b=x.memoizedState,v=t.stateNode,m=v.getSnapshotBeforeUpdate(t.elementType===t.type?w:At(t.type,w),b);v.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var g=t.stateNode.containerInfo;g.nodeType===1?g.textContent="":g.nodeType===9&&g.documentElement&&g.removeChild(g.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(N(163))}}catch(_){ve(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,L=e;break}L=t.return}return x=Qh,Qh=!1,x}function zo(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var o=s.destroy;s.destroy=void 0,o!==void 0&&Pu(t,n,o)}s=s.next}while(s!==r)}}function xl(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 Nu(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 Cv(e){var t=e.alternate;t!==null&&(e.alternate=null,Cv(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[en],delete t[oi],delete t[gu],delete t[v1],delete t[y1])),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 Tv(e){return e.tag===5||e.tag===3||e.tag===4}function Kh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Tv(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 Ou(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=Da));else if(r!==4&&(e=e.child,e!==null))for(Ou(e,t,n),e=e.sibling;e!==null;)Ou(e,t,n),e=e.sibling}function Ru(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(Ru(e,t,n),e=e.sibling;e!==null;)Ru(e,t,n),e=e.sibling}var Ie=null,$t=!1;function An(e,t,n){for(n=n.child;n!==null;)jv(e,t,n),n=n.sibling}function jv(e,t,n){if(nn&&typeof nn.onCommitFiberUnmount=="function")try{nn.onCommitFiberUnmount(fl,n)}catch{}switch(n.tag){case 5:Be||ks(n,t);case 6:var r=Ie,s=$t;Ie=null,An(e,t,n),Ie=r,$t=s,Ie!==null&&($t?(e=Ie,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ie.removeChild(n.stateNode));break;case 18:Ie!==null&&($t?(e=Ie,n=n.stateNode,e.nodeType===8?fc(e.parentNode,n):e.nodeType===1&&fc(e,n),ei(e)):fc(Ie,n.stateNode));break;case 4:r=Ie,s=$t,Ie=n.stateNode.containerInfo,$t=!0,An(e,t,n),Ie=r,$t=s;break;case 0:case 11:case 14:case 15:if(!Be&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var o=s,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&Pu(n,t,i),s=s.next}while(s!==r)}An(e,t,n);break;case 1:if(!Be&&(ks(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){ve(n,t,a)}An(e,t,n);break;case 21:An(e,t,n);break;case 22:n.mode&1?(Be=(r=Be)||n.memoizedState!==null,An(e,t,n),Be=r):An(e,t,n);break;default:An(e,t,n)}}function Gh(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new I1),t.forEach(function(r){var s=H1.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Nt(e,t){var n=t.deletions;if(n!==null)for(var r=0;rs&&(s=i),r&=~o}if(r=s,r=we()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*$1(r/1960))-r,10e?16:e,Jn===null)var r=!1;else{if(e=Jn,Jn=null,Ja=0,Z&6)throw Error(N(331));var s=Z;for(Z|=4,L=e.current;L!==null;){var o=L,i=o.child;if(L.flags&16){var a=o.deletions;if(a!==null){for(var l=0;lwe()-tf?Ur(e,0):ef|=n),at(e,t)}function Lv(e,t){t===0&&(e.mode&1?(t=Wi,Wi<<=1,!(Wi&130023424)&&(Wi=4194304)):t=1);var n=Je();e=bn(e,t),e!==null&&(ki(e,t,n),at(e,n))}function W1(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Lv(e,n)}function H1(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(N(314))}r!==null&&r.delete(t),Lv(e,n)}var $v;$v=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ot.current)st=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return st=!1,O1(e,t,n);st=!!(e.flags&131072)}else st=!1,fe&&t.flags&1048576&&zg(t,Ba,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;wa(e,t),e=t.pendingProps;var s=Vs(t,We.current);Ns(t,n),s=Kd(null,t,r,e,s,n);var o=Gd();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,it(r)?(o=!0,Ua(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Wd(t),s.updater=wl,t.stateNode=s,s._reactInternals=t,_u(t,r,e,n),t=Eu(null,t,r,!0,o,n)):(t.tag=0,fe&&o&&Ld(t),Ge(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(wa(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=q1(r),e=At(r,e),s){case 0:t=ku(null,t,r,e,n);break e;case 1:t=Hh(null,t,r,e,n);break e;case 11:t=Bh(null,t,r,e,n);break e;case 14:t=Wh(null,t,r,At(r.type,e),n);break e}throw Error(N(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:At(r,s),ku(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:At(r,s),Hh(e,t,r,s,n);case 3:e:{if(xv(t),e===null)throw Error(N(387));r=t.pendingProps,o=t.memoizedState,s=o.element,Qg(e,t),Va(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=Gs(Error(N(423)),t),t=Vh(e,t,r,n,s);break e}else if(r!==s){s=Gs(Error(N(424)),t),t=Vh(e,t,r,n,s);break e}else for(ut=nr(t.stateNode.containerInfo.firstChild),dt=t,fe=!0,Ft=null,n=Vg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(qs(),r===s){t=_n(e,t,n);break e}Ge(e,t,r,n)}t=t.child}return t;case 5:return Kg(t),e===null&&wu(t),r=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,i=s.children,pu(r,s)?i=null:o!==null&&pu(r,o)&&(t.flags|=32),wv(e,t),Ge(e,t,i,n),t.child;case 6:return e===null&&wu(t),null;case 13:return bv(e,t,n);case 4:return Hd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Qs(t,null,r,n):Ge(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:At(r,s),Bh(e,t,r,s,n);case 7:return Ge(e,t,t.pendingProps,n),t.child;case 8:return Ge(e,t,t.pendingProps.children,n),t.child;case 12:return Ge(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,o=t.memoizedProps,i=s.value,ae(Wa,r._currentValue),r._currentValue=i,o!==null)if(Wt(o.value,i)){if(o.children===s.children&&!ot.current){t=_n(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){i=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=yn(-1,n&-n),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),xu(o.return,n,t),a.lanes|=n;break}l=l.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(N(341));i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),xu(i,n,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}Ge(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Ns(t,n),s=Et(s),r=r(s),t.flags|=1,Ge(e,t,r,n),t.child;case 14:return r=t.type,s=At(r,t.pendingProps),s=At(r.type,s),Wh(e,t,r,s,n);case 15:return vv(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:At(r,s),wa(e,t),t.tag=1,it(r)?(e=!0,Ua(t)):e=!1,Ns(t,n),pv(t,r,s),_u(t,r,s,n),Eu(null,t,r,!0,e,n);case 19:return _v(e,t,n);case 22:return yv(e,t,n)}throw Error(N(156,t.tag))};function Dv(e,t){return dg(e,t)}function V1(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 _t(e,t,n,r){return new V1(e,t,n,r)}function of(e){return e=e.prototype,!(!e||!e.isReactComponent)}function q1(e){if(typeof e=="function")return of(e)?1:0;if(e!=null){if(e=e.$$typeof,e===kd)return 11;if(e===Ed)return 14}return 2}function ir(e,t){var n=e.alternate;return n===null?(n=_t(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 _a(e,t,n,r,s,o){var i=2;if(r=e,typeof e=="function")of(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case ms:return zr(n.children,s,o,t);case Sd:i=8,s|=8;break;case qc:return e=_t(12,n,t,s|2),e.elementType=qc,e.lanes=o,e;case Qc:return e=_t(13,n,t,s),e.elementType=Qc,e.lanes=o,e;case Kc:return e=_t(19,n,t,s),e.elementType=Kc,e.lanes=o,e;case Km:return _l(n,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case qm:i=10;break e;case Qm:i=9;break e;case kd:i=11;break e;case Ed:i=14;break e;case Un:i=16,r=null;break e}throw Error(N(130,e==null?e:typeof e,""))}return t=_t(i,n,t,s),t.elementType=e,t.type=r,t.lanes=o,t}function zr(e,t,n,r){return e=_t(7,e,r,t),e.lanes=n,e}function _l(e,t,n,r){return e=_t(22,e,r,t),e.elementType=Km,e.lanes=n,e.stateNode={isHidden:!1},e}function xc(e,t,n){return e=_t(6,e,null,t),e.lanes=n,e}function bc(e,t,n){return t=_t(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Q1(e,t,n,r,s){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=tc(0),this.expirationTimes=tc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tc(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function af(e,t,n,r,s,o,i,a,l){return e=new Q1(e,t,n,a,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=_t(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Wd(o),e}function K1(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Bv)}catch(e){console.error(e)}}Bv(),Bm.exports=mt;var ji=Bm.exports;const Wv=_i(ji);var Hv,rp=ji;Hv=rp.createRoot,rp.hydrateRoot;var Z1=typeof Element<"u",eb=typeof Map=="function",tb=typeof Set=="function",nb=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Sa(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,s;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Sa(e[r],t[r]))return!1;return!0}var o;if(eb&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;for(o=e.entries();!(r=o.next()).done;)if(!Sa(r.value[1],t.get(r.value[0])))return!1;return!0}if(tb&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(nb&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,s[r]))return!1;if(Z1&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((s[r]==="_owner"||s[r]==="__v"||s[r]==="__o")&&e.$$typeof)&&!Sa(e[s[r]],t[s[r]]))return!1;return!0}return e!==e&&t!==t}var rb=function(t,n){try{return Sa(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const sb=_i(rb);var ob=function(e,t,n,r,s,o,i,a){if(!e){var l;if(t===void 0)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,s,o,i,a],d=0;l=new Error(t.replace(/%s/g,function(){return c[d++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},ib=ob;const sp=_i(ib);var ab=function(t,n,r,s){var o=r?r.call(s,t,n):void 0;if(o!==void 0)return!!o;if(t===n)return!0;if(typeof t!="object"||!t||typeof n!="object"||!n)return!1;var i=Object.keys(t),a=Object.keys(n);if(i.length!==a.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(n),c=0;c(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(Vv||{}),_c={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}},op=Object.values(Vv),df={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},cb=Object.entries(df).reduce((e,[t,n])=>(e[n]=t,e),{}),Ut="data-rh",Rs={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},As=(e,t)=>{for(let n=e.length-1;n>=0;n-=1){const r=e[n];if(Object.prototype.hasOwnProperty.call(r,t))return r[t]}return null},ub=e=>{let t=As(e,"title");const n=As(e,Rs.TITLE_TEMPLATE);if(Array.isArray(t)&&(t=t.join("")),n&&t)return n.replace(/%s/g,()=>t);const r=As(e,Rs.DEFAULT_TITLE);return t||r||void 0},db=e=>As(e,Rs.ON_CHANGE_CLIENT_STATE)||(()=>{}),Sc=(e,t)=>t.filter(n=>typeof n[e]<"u").map(n=>n[e]).reduce((n,r)=>({...n,...r}),{}),fb=(e,t)=>t.filter(n=>typeof n.base<"u").map(n=>n.base).reverse().reduce((n,r)=>{if(!n.length){const s=Object.keys(r);for(let o=0;oconsole&&typeof console.warn=="function"&&console.warn(e),_o=(e,t,n)=>{const r={};return n.filter(s=>Array.isArray(s[e])?!0:(typeof s[e]<"u"&&hb(`Helmet: ${e} should be of type "Array". Instead found type "${typeof s[e]}"`),!1)).map(s=>s[e]).reverse().reduce((s,o)=>{const i={};o.filter(l=>{let c;const d=Object.keys(l);for(let p=0;ps.push(l));const a=Object.keys(i);for(let l=0;l{if(Array.isArray(e)&&e.length){for(let n=0;n({baseTag:fb(["href"],e),bodyAttributes:Sc("bodyAttributes",e),defer:As(e,Rs.DEFER),encode:As(e,Rs.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:Sc("htmlAttributes",e),linkTags:_o("link",["rel","href"],e),metaTags:_o("meta",["name","charset","http-equiv","property","itemprop"],e),noscriptTags:_o("noscript",["innerHTML"],e),onChangeClientState:db(e),scriptTags:_o("script",["src","innerHTML"],e),styleTags:_o("style",["cssText"],e),title:ub(e),titleAttributes:Sc("titleAttributes",e),prioritizeSeoTags:pb(e,Rs.PRIORITIZE_SEO_TAGS)}),qv=e=>Array.isArray(e)?e.join(""):e,gb=(e,t)=>{const n=Object.keys(e);for(let r=0;rArray.isArray(e)?e.reduce((n,r)=>(gb(r,t)?n.priority.push(r):n.default.push(r),n),{priority:[],default:[]}):{default:e,priority:[]},ip=(e,t)=>({...e,[t]:void 0}),vb=["noscript","script","style"],$u=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),Qv=e=>Object.keys(e).reduce((t,n)=>{const r=typeof e[n]<"u"?`${n}="${e[n]}"`:`${n}`;return t?`${t} ${r}`:r},""),yb=(e,t,n,r)=>{const s=Qv(n),o=qv(t);return s?`<${e} ${Ut}="true" ${s}>${$u(o,r)}`:`<${e} ${Ut}="true">${$u(o,r)}`},wb=(e,t,n=!0)=>t.reduce((r,s)=>{const o=s,i=Object.keys(o).filter(c=>!(c==="innerHTML"||c==="cssText")).reduce((c,d)=>{const f=typeof o[d]>"u"?d:`${d}="${$u(o[d],n)}"`;return c?`${c} ${f}`:f},""),a=o.innerHTML||o.cssText||"",l=vb.indexOf(e)===-1;return`${r}<${e} ${Ut}="true" ${i}${l?"/>":`>${a}`}`},""),Kv=(e,t={})=>Object.keys(e).reduce((n,r)=>{const s=df[r];return n[s||r]=e[r],n},t),xb=(e,t,n)=>{const r={key:t,[Ut]:!0},s=Kv(n,r);return[O.createElement("title",s,t)]},ka=(e,t)=>t.map((n,r)=>{const s={key:r,[Ut]:!0};return Object.keys(n).forEach(o=>{const a=df[o]||o;if(a==="innerHTML"||a==="cssText"){const l=n.innerHTML||n.cssText;s.dangerouslySetInnerHTML={__html:l}}else s[a]=n[o]}),O.createElement(e,s)}),yt=(e,t,n=!0)=>{switch(e){case"title":return{toComponent:()=>xb(e,t.title,t.titleAttributes),toString:()=>yb(e,t.title,t.titleAttributes,n)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>Kv(t),toString:()=>Qv(t)};default:return{toComponent:()=>ka(e,t),toString:()=>wb(e,t,n)}}},bb=({metaTags:e,linkTags:t,scriptTags:n,encode:r})=>{const s=kc(e,_c.meta),o=kc(t,_c.link),i=kc(n,_c.script);return{priorityMethods:{toComponent:()=>[...ka("meta",s.priority),...ka("link",o.priority),...ka("script",i.priority)],toString:()=>`${yt("meta",s.priority,r)} ${yt("link",o.priority,r)} ${yt("script",i.priority,r)}`},metaTags:s.default,linkTags:o.default,scriptTags:i.default}},_b=e=>{const{baseTag:t,bodyAttributes:n,encode:r=!0,htmlAttributes:s,noscriptTags:o,styleTags:i,title:a="",titleAttributes:l,prioritizeSeoTags:c}=e;let{linkTags:d,metaTags:f,scriptTags:p}=e,h={toComponent:()=>{},toString:()=>""};return c&&({priorityMethods:h,linkTags:d,metaTags:f,scriptTags:p}=bb(e)),{priority:h,base:yt("base",t,r),bodyAttributes:yt("bodyAttributes",n,r),htmlAttributes:yt("htmlAttributes",s,r),link:yt("link",d,r),meta:yt("meta",f,r),noscript:yt("noscript",o,r),script:yt("script",p,r),style:yt("style",i,r),title:yt("title",{title:a,titleAttributes:l},r)}},Du=_b,ta=[],Gv=!!(typeof window<"u"&&window.document&&window.document.createElement),Fu=class{constructor(e,t){ln(this,"instances",[]);ln(this,"canUseDOM",Gv);ln(this,"context");ln(this,"value",{setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?ta:this.instances,add:e=>{(this.canUseDOM?ta:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?ta:this.instances).indexOf(e);(this.canUseDOM?ta:this.instances).splice(t,1)}}});this.context=e,this.canUseDOM=t||!1,t||(e.helmet=Du({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},Sb={},Yv=O.createContext(Sb),Ar,Jv=(Ar=class extends y.Component{constructor(n){super(n);ln(this,"helmetData");this.helmetData=new Fu(this.props.context||{},Ar.canUseDOM)}render(){return O.createElement(Yv.Provider,{value:this.helmetData.value},this.props.children)}},ln(Ar,"canUseDOM",Gv),Ar),os=(e,t)=>{const n=document.head||document.querySelector("head"),r=n.querySelectorAll(`${e}[${Ut}]`),s=[].slice.call(r),o=[];let i;return t&&t.length&&t.forEach(a=>{const l=document.createElement(e);for(const c in a)if(Object.prototype.hasOwnProperty.call(a,c))if(c==="innerHTML")l.innerHTML=a.innerHTML;else if(c==="cssText")l.styleSheet?l.styleSheet.cssText=a.cssText:l.appendChild(document.createTextNode(a.cssText));else{const d=c,f=typeof a[d]>"u"?"":a[d];l.setAttribute(c,f)}l.setAttribute(Ut,"true"),s.some((c,d)=>(i=d,l.isEqualNode(c)))?s.splice(i,1):o.push(l)}),s.forEach(a=>{var l;return(l=a.parentNode)==null?void 0:l.removeChild(a)}),o.forEach(a=>n.appendChild(a)),{oldTags:s,newTags:o}},Uu=(e,t)=>{const n=document.getElementsByTagName(e)[0];if(!n)return;const r=n.getAttribute(Ut),s=r?r.split(","):[],o=[...s],i=Object.keys(t);for(const a of i){const l=t[a]||"";n.getAttribute(a)!==l&&n.setAttribute(a,l),s.indexOf(a)===-1&&s.push(a);const c=o.indexOf(a);c!==-1&&o.splice(c,1)}for(let a=o.length-1;a>=0;a-=1)n.removeAttribute(o[a]);s.length===o.length?n.removeAttribute(Ut):n.getAttribute(Ut)!==i.join(",")&&n.setAttribute(Ut,i.join(","))},kb=(e,t)=>{typeof e<"u"&&document.title!==e&&(document.title=qv(e)),Uu("title",t)},ap=(e,t)=>{const{baseTag:n,bodyAttributes:r,htmlAttributes:s,linkTags:o,metaTags:i,noscriptTags:a,onChangeClientState:l,scriptTags:c,styleTags:d,title:f,titleAttributes:p}=e;Uu("body",r),Uu("html",s),kb(f,p);const h={baseTag:os("base",n),linkTags:os("link",o),metaTags:os("meta",i),noscriptTags:os("noscript",a),scriptTags:os("script",c),styleTags:os("style",d)},x={},w={};Object.keys(h).forEach(b=>{const{newTags:v,oldTags:m}=h[b];v.length&&(x[b]=v),m.length&&(w[b]=h[b].oldTags)}),t&&t(),l(e,x,w)},So=null,Eb=e=>{So&&cancelAnimationFrame(So),e.defer?So=requestAnimationFrame(()=>{ap(e,()=>{So=null})}):(ap(e),So=null)},Cb=Eb,lp=class extends y.Component{constructor(){super(...arguments);ln(this,"rendered",!1)}shouldComponentUpdate(t){return!lb(t,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:t}=this.props.context;t.remove(this),this.emitChange()}emitChange(){const{helmetInstances:t,setHelmet:n}=this.props.context;let r=null;const s=mb(t.get().map(o=>{const i={...o.props};return delete i.context,i}));Jv.canUseDOM?Cb(s):Du&&(r=Du(s)),n(r)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:t}=this.props.context;t.add(this),this.emitChange()}render(){return this.init(),null}},Hc,Ea=(Hc=class extends y.Component{shouldComponentUpdate(e){return!sb(ip(this.props,"helmetData"),ip(e,"helmetData"))}mapNestedChildrenToProps(e,t){if(!t)return null;switch(e.type){case"script":case"noscript":return{innerHTML:t};case"style":return{cssText:t};default:throw new Error(`<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(e,t,n,r){return{...t,[e.type]:[...t[e.type]||[],{...n,...this.mapNestedChildrenToProps(e,r)}]}}mapObjectTypeChildren(e,t,n,r){switch(e.type){case"title":return{...t,[e.type]:r,titleAttributes:{...n}};case"body":return{...t,bodyAttributes:{...n}};case"html":return{...t,htmlAttributes:{...n}};default:return{...t,[e.type]:{...n}}}}mapArrayTypeChildrenToProps(e,t){let n={...t};return Object.keys(e).forEach(r=>{n={...n,[r]:e[r]}}),n}warnOnInvalidChildren(e,t){return sp(op.some(n=>e.type===n),typeof e.type=="function"?"You may be attempting to nest components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${op.join(", ")} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`),sp(!t||typeof t=="string"||Array.isArray(t)&&!t.some(n=>typeof n!="string"),`Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`} ) Refer to our API for more information.`),!0}mapChildrenToProps(e,t){let n={};return O.Children.forEach(e,r=>{if(!r||!r.props)return;const{children:s,...o}=r.props,i=Object.keys(o).reduce((l,c)=>(l[cb[c]||c]=o[c],l),{});let{type:a}=r;switch(typeof a=="symbol"?a=a.toString():this.warnOnInvalidChildren(r,s),a){case"Symbol(react.fragment)":t=this.mapChildrenToProps(s,t);break;case"link":case"meta":case"noscript":case"script":case"style":n=this.flattenArrayTypeChildren(r,n,i,s);break;default:t=this.mapObjectTypeChildren(r,t,i,s);break}}),this.mapArrayTypeChildrenToProps(n,t)}render(){const{children:e,...t}=this.props;let n={...t},{helmetData:r}=t;if(e&&(n=this.mapChildrenToProps(e,n)),r&&!(r instanceof Fu)){const s=r;r=new Fu(s.context,!0),delete n.helmetData}return r?O.createElement(lp,{...n,context:r.value}):O.createElement(Yv.Consumer,null,s=>O.createElement(lp,{...n,context:s}))}},ln(Hc,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),Hc);const Tb="modulepreload",jb=function(e){return"/"+e},cp={},He=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),a=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));s=Promise.allSettled(n.map(l=>{if(l=jb(l),l in cp)return;cp[l]=!0;const c=l.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="proxy.php?url=https%3A%2F%2FScan.camera%2F%24%7Bl%7D"]${d}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":Tb,c||(f.as="script"),f.crossOrigin="",f.href=l,a&&f.setAttribute("nonce",a),document.head.appendChild(f),c)return new Promise((p,h)=>{f.addEventListener("load",p),f.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(i){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i}return s.then(i=>{for(const a of i||[])a.status==="rejected"&&o(a.reason);return t().catch(o)})},Pb=1,Nb=1e6;let Ec=0;function Ob(){return Ec=(Ec+1)%Number.MAX_SAFE_INTEGER,Ec.toString()}const Cc=new Map,up=e=>{if(Cc.has(e))return;const t=setTimeout(()=>{Cc.delete(e),Ho({type:"REMOVE_TOAST",toastId:e})},Nb);Cc.set(e,t)},Rb=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Pb)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?up(n):e.toasts.forEach(r=>{up(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Ca=[];let Ta={toasts:[]};function Ho(e){Ta=Rb(Ta,e),Ca.forEach(t=>{t(Ta)})}function Ab({...e}){const t=Ob(),n=s=>Ho({type:"UPDATE_TOAST",toast:{...s,id:t}}),r=()=>Ho({type:"DISMISS_TOAST",toastId:t});return Ho({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||r()}}}),{id:t,dismiss:r,update:n}}function Pi(){const[e,t]=y.useState(Ta);return y.useEffect(()=>(Ca.push(t),()=>{const n=Ca.indexOf(t);n>-1&&Ca.splice(n,1)}),[e]),{...e,toast:Ab,dismiss:n=>Ho({type:"DISMISS_TOAST",toastId:n})}}function Te(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function dp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Xv(...e){return t=>{let n=!1;const r=e.map(s=>{const o=dp(s,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let s=0;s{const{children:i,...a}=o,l=y.useMemo(()=>a,Object.values(a));return u.jsx(n.Provider,{value:l,children:i})};r.displayName=e+"Provider";function s(o){const i=y.useContext(n);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,s]}function Tl(e,t=[]){let n=[];function r(o,i){const a=y.createContext(i),l=n.length;n=[...n,i];const c=f=>{var v;const{scope:p,children:h,...x}=f,w=((v=p==null?void 0:p[e])==null?void 0:v[l])||a,b=y.useMemo(()=>x,Object.values(x));return u.jsx(w.Provider,{value:b,children:h})};c.displayName=o+"Provider";function d(f,p){var w;const h=((w=p==null?void 0:p[e])==null?void 0:w[l])||a,x=y.useContext(h);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${o}\``)}return[c,d]}const s=()=>{const o=n.map(i=>y.createContext(i));return function(a){const l=(a==null?void 0:a[e])||o;return y.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return s.scopeName=e,[r,Ib(s,...t)]}function Ib(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(o)[`__scope${c}`];return{...a,...f}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}function el(e){const t=Lb(e),n=y.forwardRef((r,s)=>{const{children:o,...i}=r,a=y.Children.toArray(o),l=a.find(Db);if(l){const c=l.props.children,d=a.map(f=>f===l?y.Children.count(c)>1?y.Children.only(null):y.isValidElement(c)?c.props.children:null:f);return u.jsx(t,{...i,ref:s,children:y.isValidElement(c)?y.cloneElement(c,void 0,d):null})}return u.jsx(t,{...i,ref:s,children:o})});return n.displayName=`${e}.Slot`,n}var Mb=el("Slot");function Lb(e){const t=y.forwardRef((n,r)=>{const{children:s,...o}=n;if(y.isValidElement(s)){const i=Ub(s),a=Fb(o,s.props);return s.type!==y.Fragment&&(a.ref=r?Xv(r,i):i),y.cloneElement(s,a)}return y.Children.count(s)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Zv=Symbol("radix.slottable");function $b(e){const t=({children:n})=>u.jsx(u.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Zv,t}function Db(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Zv}function Fb(e,t){const n={...t};for(const r in t){const s=e[r],o=t[r];/^on[A-Z]/.test(r)?s&&o?n[r]=(...a)=>{const l=o(...a);return s(...a),l}:s&&(n[r]=s):r==="style"?n[r]={...s,...o}:r==="className"&&(n[r]=[s,o].filter(Boolean).join(" "))}return{...e,...n}}function Ub(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function zb(e){const t=e+"CollectionProvider",[n,r]=Tl(t),[s,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),i=w=>{const{scope:b,children:v}=w,m=O.useRef(null),g=O.useRef(new Map).current;return u.jsx(s,{scope:b,itemMap:g,collectionRef:m,children:v})};i.displayName=t;const a=e+"CollectionSlot",l=el(a),c=O.forwardRef((w,b)=>{const{scope:v,children:m}=w,g=o(a,v),_=Ht(b,g.collectionRef);return u.jsx(l,{ref:_,children:m})});c.displayName=a;const d=e+"CollectionItemSlot",f="data-radix-collection-item",p=el(d),h=O.forwardRef((w,b)=>{const{scope:v,children:m,...g}=w,_=O.useRef(null),S=Ht(b,_),k=o(d,v);return O.useEffect(()=>(k.itemMap.set(_,{ref:_,...g}),()=>void k.itemMap.delete(_))),u.jsx(p,{[f]:"",ref:S,children:m})});h.displayName=d;function x(w){const b=o(e+"CollectionConsumer",w);return O.useCallback(()=>{const m=b.collectionRef.current;if(!m)return[];const g=Array.from(m.querySelectorAll(`[${f}]`));return Array.from(b.itemMap.values()).sort((k,E)=>g.indexOf(k.ref.current)-g.indexOf(E.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:i,Slot:c,ItemSlot:h},x,r]}var Bb=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],et=Bb.reduce((e,t)=>{const n=el(`Primitive.${t}`),r=y.forwardRef((s,o)=>{const{asChild:i,...a}=s,l=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(l,{...a,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function ey(e,t){e&&ji.flushSync(()=>e.dispatchEvent(t))}function ur(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Wb(e,t=globalThis==null?void 0:globalThis.document){const n=ur(e);y.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Hb="DismissableLayer",zu="dismissableLayer.update",Vb="dismissableLayer.pointerDownOutside",qb="dismissableLayer.focusOutside",fp,ty=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ff=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:a,...l}=e,c=y.useContext(ty),[d,f]=y.useState(null),p=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=y.useState({}),x=Ht(t,E=>f(E)),w=Array.from(c.layers),[b]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=w.indexOf(b),m=d?w.indexOf(d):-1,g=c.layersWithOutsidePointerEventsDisabled.size>0,_=m>=v,S=Kb(E=>{const j=E.target,A=[...c.branches].some(R=>R.contains(j));!_||A||(s==null||s(E),i==null||i(E),E.defaultPrevented||a==null||a())},p),k=Gb(E=>{const j=E.target;[...c.branches].some(R=>R.contains(j))||(o==null||o(E),i==null||i(E),E.defaultPrevented||a==null||a())},p);return Wb(E=>{m===c.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&a&&(E.preventDefault(),a()))},p),y.useEffect(()=>{if(d)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(fp=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),hp(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=fp)}},[d,p,n,c]),y.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),hp())},[d,c]),y.useEffect(()=>{const E=()=>h({});return document.addEventListener(zu,E),()=>document.removeEventListener(zu,E)},[]),u.jsx(et.div,{...l,ref:x,style:{pointerEvents:g?_?"auto":"none":void 0,...e.style},onFocusCapture:Te(e.onFocusCapture,k.onFocusCapture),onBlurCapture:Te(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:Te(e.onPointerDownCapture,S.onPointerDownCapture)})});ff.displayName=Hb;var Qb="DismissableLayerBranch",ny=y.forwardRef((e,t)=>{const n=y.useContext(ty),r=y.useRef(null),s=Ht(t,r);return y.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),u.jsx(et.div,{...e,ref:s})});ny.displayName=Qb;function Kb(e,t=globalThis==null?void 0:globalThis.document){const n=ur(e),r=y.useRef(!1),s=y.useRef(()=>{});return y.useEffect(()=>{const o=a=>{if(a.target&&!r.current){let l=function(){ry(Vb,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=l,t.addEventListener("click",s.current,{once:!0})):l()}else t.removeEventListener("click",s.current);r.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Gb(e,t=globalThis==null?void 0:globalThis.document){const n=ur(e),r=y.useRef(!1);return y.useEffect(()=>{const s=o=>{o.target&&!r.current&&ry(qb,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function hp(){const e=new CustomEvent(zu);document.dispatchEvent(e)}function ry(e,t,n,{discrete:r}){const s=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?ey(s,o):s.dispatchEvent(o)}var Yb=ff,Jb=ny,dr=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},Xb="Portal",sy=y.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[s,o]=y.useState(!1);dr(()=>o(!0),[]);const i=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Wv.createPortal(u.jsx(et.div,{...r,ref:t}),i):null});sy.displayName=Xb;function Zb(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var hf=e=>{const{present:t,children:n}=e,r=e_(t),s=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),o=Ht(r.ref,t_(s));return typeof n=="function"||r.isPresent?y.cloneElement(s,{ref:o}):null};hf.displayName="Presence";function e_(e){const[t,n]=y.useState(),r=y.useRef(null),s=y.useRef(e),o=y.useRef("none"),i=e?"mounted":"unmounted",[a,l]=Zb(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const c=na(r.current);o.current=a==="mounted"?c:"none"},[a]),dr(()=>{const c=r.current,d=s.current;if(d!==e){const p=o.current,h=na(c);e?l("MOUNT"):h==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&p!==h?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,l]),dr(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,f=h=>{const w=na(r.current).includes(h.animationName);if(h.target===t&&w&&(l("ANIMATION_END"),!s.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},p=h=>{h.target===t&&(o.current=na(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:y.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function na(e){return(e==null?void 0:e.animationName)||"none"}function t_(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var n_=Um[" useInsertionEffect ".trim().toString()]||dr;function r_({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,o,i]=s_({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:s;{const d=y.useRef(e!==void 0);y.useEffect(()=>{const f=d.current;f!==a&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,r])}const c=y.useCallback(d=>{var f;if(a){const p=o_(d)?d(e):d;p!==e&&((f=i.current)==null||f.call(i,p))}else o(d)},[a,e,o,i]);return[l,c]}function s_({defaultProp:e,onChange:t}){const[n,r]=y.useState(e),s=y.useRef(n),o=y.useRef(t);return n_(()=>{o.current=t},[t]),y.useEffect(()=>{var i;s.current!==n&&((i=o.current)==null||i.call(o,n),s.current=n)},[n,s]),[n,r,o]}function o_(e){return typeof e=="function"}var i_=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),a_="VisuallyHidden",jl=y.forwardRef((e,t)=>u.jsx(et.span,{...e,ref:t,style:{...i_,...e.style}}));jl.displayName=a_;var l_=jl,pf="ToastProvider",[mf,c_,u_]=zb("Toast"),[oy,_O]=Tl("Toast",[u_]),[d_,Pl]=oy(pf),iy=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:o=50,children:i}=e,[a,l]=y.useState(null),[c,d]=y.useState(0),f=y.useRef(!1),p=y.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${pf}\`. Expected non-empty \`string\`.`),u.jsx(mf.Provider,{scope:t,children:u.jsx(d_,{scope:t,label:n,duration:r,swipeDirection:s,swipeThreshold:o,toastCount:c,viewport:a,onViewportChange:l,onToastAdd:y.useCallback(()=>d(h=>h+1),[]),onToastRemove:y.useCallback(()=>d(h=>h-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:p,children:i})})};iy.displayName=pf;var ay="ToastViewport",f_=["F8"],Bu="toast.viewportPause",Wu="toast.viewportResume",ly=y.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=f_,label:s="Notifications ({hotkey})",...o}=e,i=Pl(ay,n),a=c_(n),l=y.useRef(null),c=y.useRef(null),d=y.useRef(null),f=y.useRef(null),p=Ht(t,f,i.onViewportChange),h=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),x=i.toastCount>0;y.useEffect(()=>{const b=v=>{var g;r.length!==0&&r.every(_=>v[_]||v.code===_)&&((g=f.current)==null||g.focus())};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[r]),y.useEffect(()=>{const b=l.current,v=f.current;if(x&&b&&v){const m=()=>{if(!i.isClosePausedRef.current){const k=new CustomEvent(Bu);v.dispatchEvent(k),i.isClosePausedRef.current=!0}},g=()=>{if(i.isClosePausedRef.current){const k=new CustomEvent(Wu);v.dispatchEvent(k),i.isClosePausedRef.current=!1}},_=k=>{!b.contains(k.relatedTarget)&&g()},S=()=>{b.contains(document.activeElement)||g()};return b.addEventListener("focusin",m),b.addEventListener("focusout",_),b.addEventListener("pointermove",m),b.addEventListener("pointerleave",S),window.addEventListener("blur",m),window.addEventListener("focus",g),()=>{b.removeEventListener("focusin",m),b.removeEventListener("focusout",_),b.removeEventListener("pointermove",m),b.removeEventListener("pointerleave",S),window.removeEventListener("blur",m),window.removeEventListener("focus",g)}}},[x,i.isClosePausedRef]);const w=y.useCallback(({tabbingDirection:b})=>{const m=a().map(g=>{const _=g.ref.current,S=[_,...E_(_)];return b==="forwards"?S:S.reverse()});return(b==="forwards"?m.reverse():m).flat()},[a]);return y.useEffect(()=>{const b=f.current;if(b){const v=m=>{var S,k,E;const g=m.altKey||m.ctrlKey||m.metaKey;if(m.key==="Tab"&&!g){const j=document.activeElement,A=m.shiftKey;if(m.target===b&&A){(S=c.current)==null||S.focus();return}const $=w({tabbingDirection:A?"backwards":"forwards"}),Q=$.findIndex(I=>I===j);Tc($.slice(Q+1))?m.preventDefault():A?(k=c.current)==null||k.focus():(E=d.current)==null||E.focus()}};return b.addEventListener("keydown",v),()=>b.removeEventListener("keydown",v)}},[a,w]),u.jsxs(Jb,{ref:l,role:"region","aria-label":s.replace("{hotkey}",h),tabIndex:-1,style:{pointerEvents:x?void 0:"none"},children:[x&&u.jsx(Hu,{ref:c,onFocusFromOutsideViewport:()=>{const b=w({tabbingDirection:"forwards"});Tc(b)}}),u.jsx(mf.Slot,{scope:n,children:u.jsx(et.ol,{tabIndex:-1,...o,ref:p})}),x&&u.jsx(Hu,{ref:d,onFocusFromOutsideViewport:()=>{const b=w({tabbingDirection:"backwards"});Tc(b)}})]})});ly.displayName=ay;var cy="ToastFocusProxy",Hu=y.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=e,o=Pl(cy,n);return u.jsx(jl,{"aria-hidden":!0,tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:i=>{var c;const a=i.relatedTarget;!((c=o.viewport)!=null&&c.contains(a))&&r()}})});Hu.displayName=cy;var Ni="Toast",h_="toast.swipeStart",p_="toast.swipeMove",m_="toast.swipeCancel",g_="toast.swipeEnd",uy=y.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:o,...i}=e,[a,l]=r_({prop:r,defaultProp:s??!0,onChange:o,caller:Ni});return u.jsx(hf,{present:n||a,children:u.jsx(w_,{open:a,...i,ref:t,onClose:()=>l(!1),onPause:ur(e.onPause),onResume:ur(e.onResume),onSwipeStart:Te(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Te(e.onSwipeMove,c=>{const{x:d,y:f}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:Te(e.onSwipeCancel,c=>{c.currentTarget.setAttribute("data-swipe","cancel"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Te(e.onSwipeEnd,c=>{const{x:d,y:f}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),l(!1)})})})});uy.displayName=Ni;var[v_,y_]=oy(Ni,{onClose(){}}),w_=y.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:o,onClose:i,onEscapeKeyDown:a,onPause:l,onResume:c,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:p,onSwipeEnd:h,...x}=e,w=Pl(Ni,n),[b,v]=y.useState(null),m=Ht(t,I=>v(I)),g=y.useRef(null),_=y.useRef(null),S=s||w.duration,k=y.useRef(0),E=y.useRef(S),j=y.useRef(0),{onToastAdd:A,onToastRemove:R}=w,F=ur(()=>{var J;(b==null?void 0:b.contains(document.activeElement))&&((J=w.viewport)==null||J.focus()),i()}),$=y.useCallback(I=>{!I||I===1/0||(window.clearTimeout(j.current),k.current=new Date().getTime(),j.current=window.setTimeout(F,I))},[F]);y.useEffect(()=>{const I=w.viewport;if(I){const J=()=>{$(E.current),c==null||c()},U=()=>{const W=new Date().getTime()-k.current;E.current=E.current-W,window.clearTimeout(j.current),l==null||l()};return I.addEventListener(Bu,U),I.addEventListener(Wu,J),()=>{I.removeEventListener(Bu,U),I.removeEventListener(Wu,J)}}},[w.viewport,S,l,c,$]),y.useEffect(()=>{o&&!w.isClosePausedRef.current&&$(S)},[o,S,w.isClosePausedRef,$]),y.useEffect(()=>(A(),()=>R()),[A,R]);const Q=y.useMemo(()=>b?vy(b):null,[b]);return w.viewport?u.jsxs(u.Fragment,{children:[Q&&u.jsx(x_,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:Q}),u.jsx(v_,{scope:n,onClose:F,children:ji.createPortal(u.jsx(mf.ItemSlot,{scope:n,children:u.jsx(Yb,{asChild:!0,onEscapeKeyDown:Te(a,()=>{w.isFocusedToastEscapeKeyDownRef.current||F(),w.isFocusedToastEscapeKeyDownRef.current=!1}),children:u.jsx(et.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":w.swipeDirection,...x,ref:m,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Te(e.onKeyDown,I=>{I.key==="Escape"&&(a==null||a(I.nativeEvent),I.nativeEvent.defaultPrevented||(w.isFocusedToastEscapeKeyDownRef.current=!0,F()))}),onPointerDown:Te(e.onPointerDown,I=>{I.button===0&&(g.current={x:I.clientX,y:I.clientY})}),onPointerMove:Te(e.onPointerMove,I=>{if(!g.current)return;const J=I.clientX-g.current.x,U=I.clientY-g.current.y,W=!!_.current,T=["left","right"].includes(w.swipeDirection),P=["left","up"].includes(w.swipeDirection)?Math.min:Math.max,M=T?P(0,J):0,H=T?0:P(0,U),D=I.pointerType==="touch"?10:2,K={x:M,y:H},X={originalEvent:I,delta:K};W?(_.current=K,ra(p_,f,X,{discrete:!1})):pp(K,w.swipeDirection,D)?(_.current=K,ra(h_,d,X,{discrete:!1}),I.target.setPointerCapture(I.pointerId)):(Math.abs(J)>D||Math.abs(U)>D)&&(g.current=null)}),onPointerUp:Te(e.onPointerUp,I=>{const J=_.current,U=I.target;if(U.hasPointerCapture(I.pointerId)&&U.releasePointerCapture(I.pointerId),_.current=null,g.current=null,J){const W=I.currentTarget,T={originalEvent:I,delta:J};pp(J,w.swipeDirection,w.swipeThreshold)?ra(g_,h,T,{discrete:!0}):ra(m_,p,T,{discrete:!0}),W.addEventListener("click",P=>P.preventDefault(),{once:!0})}})})})}),w.viewport)})]}):null}),x_=e=>{const{__scopeToast:t,children:n,...r}=e,s=Pl(Ni,t),[o,i]=y.useState(!1),[a,l]=y.useState(!1);return S_(()=>i(!0)),y.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:u.jsx(sy,{asChild:!0,children:u.jsx(jl,{...r,children:o&&u.jsxs(u.Fragment,{children:[s.label," ",n]})})})},b_="ToastTitle",dy=y.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return u.jsx(et.div,{...r,ref:t})});dy.displayName=b_;var __="ToastDescription",fy=y.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return u.jsx(et.div,{...r,ref:t})});fy.displayName=__;var hy="ToastAction",py=y.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?u.jsx(gy,{altText:n,asChild:!0,children:u.jsx(gf,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${hy}\`. Expected non-empty \`string\`.`),null)});py.displayName=hy;var my="ToastClose",gf=y.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,s=y_(my,n);return u.jsx(gy,{asChild:!0,children:u.jsx(et.button,{type:"button",...r,ref:t,onClick:Te(e.onClick,s.onClose)})})});gf.displayName=my;var gy=y.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...s}=e;return u.jsx(et.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:t})});function vy(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),k_(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",o=r.dataset.radixToastAnnounceExclude==="";if(!s)if(o){const i=r.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...vy(r))}}),t}function ra(e,t,n,{discrete:r}){const s=n.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?ey(s,o):s.dispatchEvent(o)}var pp=(e,t,n=0)=>{const r=Math.abs(e.x),s=Math.abs(e.y),o=r>s;return t==="left"||t==="right"?o&&r>n:!o&&s>n};function S_(e=()=>{}){const t=ur(e);dr(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function k_(e){return e.nodeType===e.ELEMENT_NODE}function E_(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Tc(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var C_=iy,yy=ly,wy=uy,xy=dy,by=fy,_y=py,Sy=gf;function ky(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;ttypeof e=="boolean"?`${e}`:e===0?"0":e,gp=Ey,Nl=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return gp(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:o}=t,i=Object.keys(s).map(c=>{const d=n==null?void 0:n[c],f=o==null?void 0:o[c];if(d===null)return null;const p=mp(d)||mp(f);return s[c][p]}),a=n&&Object.entries(n).reduce((c,d)=>{let[f,p]=d;return p===void 0||(c[f]=p),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:f,className:p,...h}=d;return Object.entries(h).every(x=>{let[w,b]=x;return Array.isArray(b)?b.includes({...o,...a}[w]):{...o,...a}[w]===b})?[...c,f,p]:c},[]);return gp(e,i,l,n==null?void 0:n.class,n==null?void 0:n.className)};/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const T_=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),j_=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),vp=e=>{const t=j_(e);return t.charAt(0).toUpperCase()+t.slice(1)},Cy=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),P_=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var N_={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.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const O_=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:i,...a},l)=>y.createElement("svg",{ref:l,...N_,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Cy("lucide",s),...!o&&!P_(a)&&{"aria-hidden":"true"},...a},[...i.map(([c,d])=>y.createElement(c,d)),...Array.isArray(o)?o:[o]]));/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ee=(e,t)=>{const n=y.forwardRef(({className:r,...s},o)=>y.createElement(O_,{ref:o,iconNode:t,className:Cy(`lucide-${T_(vp(e))}`,`lucide-${e}`,r),...s}));return n.displayName=vp(e),n};/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const R_=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],A_=ee("arrow-left",R_);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const I_=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],M_=ee("briefcase",I_);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const L_=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],$_=ee("calendar",L_);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const D_=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],jc=ee("camera",D_);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const F_=[["path",{d:"M12 16v5",key:"zza2cw"}],["path",{d:"M16 14v7",key:"1g90b9"}],["path",{d:"M20 10v11",key:"1iqoj0"}],["path",{d:"m22 3-8.646 8.646a.5.5 0 0 1-.708 0L9.354 8.354a.5.5 0 0 0-.707 0L2 15",key:"1fw8x9"}],["path",{d:"M4 18v3",key:"1yp0dc"}],["path",{d:"M8 14v7",key:"n3cwzv"}]],U_=ee("chart-no-axes-combined",F_);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const z_=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Ty=ee("clock",z_);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const B_=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],W_=ee("download",B_);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const H_=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],V_=ee("eye",H_);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const q_=[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]],yp=ee("flame",q_);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Q_=[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]],K_=ee("gift",Q_);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const G_=[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]],Y_=ee("git-compare-arrows",G_);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const J_=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],X_=ee("heart",J_);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Z_=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],eS=ee("lock-keyhole",Z_);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const tS=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],nS=ee("mail",tS);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const rS=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],sS=ee("menu",rS);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const oS=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],wp=ee("message-circle",oS);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const iS=[["path",{d:"M12.586 12.586 19 19",key:"ea5xo7"}],["path",{d:"M3.688 3.037a.497.497 0 0 0-.651.651l6.5 15.999a.501.501 0 0 0 .947-.062l1.569-6.083a2 2 0 0 1 1.448-1.479l6.124-1.579a.5.5 0 0 0 .063-.947z",key:"277e5u"}]],Vu=ee("mouse-pointer",iS);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const aS=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],Vo=ee("qr-code",aS);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const lS=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],cS=ee("refresh-cw",lS);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const uS=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],dS=ee("rocket",uS);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const fS=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],jy=ee("send",fS);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const hS=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],pS=ee("share-2",hS);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const mS=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],gS=ee("shield",mS);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vS=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],yS=ee("smartphone",vS);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wS=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],xS=ee("sparkles",wS);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bS=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],Py=ee("trending-up",bS);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const _S=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],xp=ee("upload",_S);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const SS=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],vf=ee("users",SS);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const kS=[["path",{d:"M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2",key:"cjf0a3"}],["path",{d:"M7 2v20",key:"1473qp"}],["path",{d:"M21 15V2a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3Zm0 0v7",key:"j28e5"}]],bp=ee("utensils",kS);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ES=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],CS=ee("video",ES);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const TS=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],jS=ee("webhook",TS);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const PS=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],yf=ee("x",PS);/** * @license lucide-react v0.544.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const NS=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Ny=ee("zap",NS),wf="-",OS=e=>{const t=AS(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{const a=i.split(wf);return a[0]===""&&a.length!==1&&a.shift(),Oy(a,t)||RS(i)},getConflictingClassGroupIds:(i,a)=>{const l=n[i]||[];return a&&r[i]?[...l,...r[i]]:l}}},Oy=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?Oy(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(wf);return(i=t.validators.find(({validator:a})=>a(o)))==null?void 0:i.classGroupId},_p=/^\[(.+)\]$/,RS=e=>{if(_p.test(e)){const t=_p.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},AS=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return MS(Object.entries(e.classGroups),n).forEach(([o,i])=>{qu(i,r,o,t)}),r},qu=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:Sp(t,s);o.classGroupId=n;return}if(typeof s=="function"){if(IS(s)){qu(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([o,i])=>{qu(i,Sp(t,o),n,r)})})},Sp=(e,t)=>{let n=e;return t.split(wf).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},IS=e=>e.isThemeGetter,MS=(e,t)=>t?e.map(([n,r])=>{const s=r.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([i,a])=>[t+i,a])):o);return[n,s]}):e,LS=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(o,i)=>{n.set(o,i),t++,t>e&&(t=0,r=n,n=new Map)};return{get(o){let i=n.get(o);if(i!==void 0)return i;if((i=r.get(o))!==void 0)return s(o,i),i},set(o,i){n.has(o)?n.set(o,i):s(o,i)}}},Ry="!",$S=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],o=t.length,i=a=>{const l=[];let c=0,d=0,f;for(let b=0;bd?f-d:void 0;return{modifiers:l,hasImportantModifier:h,baseClassName:x,maybePostfixModifierPosition:w}};return n?a=>n({className:a,parseClassName:i}):i},DS=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},FS=e=>({cache:LS(e.cacheSize),parseClassName:$S(e),...OS(e)}),US=/\s+/,zS=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,o=[],i=e.trim().split(US);let a="";for(let l=i.length-1;l>=0;l-=1){const c=i[l],{modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:h}=n(c);let x=!!h,w=r(x?p.substring(0,h):p);if(!w){if(!x){a=c+(a.length>0?" "+a:a);continue}if(w=r(p),!w){a=c+(a.length>0?" "+a:a);continue}x=!1}const b=DS(d).join(":"),v=f?b+Ry:b,m=v+w;if(o.includes(m))continue;o.push(m);const g=s(w,x);for(let _=0;_0?" "+a:a)}return a};function BS(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rf(d),e());return n=FS(c),r=n.cache.get,s=n.cache.set,o=a,a(l)}function a(l){const c=r(l);if(c)return c;const d=zS(l,n);return s(l,d),d}return function(){return o(BS.apply(null,arguments))}}const le=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Iy=/^\[(?:([a-z-]+):)?(.+)\]$/i,HS=/^\d+\/\d+$/,VS=new Set(["px","full","screen"]),qS=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,QS=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,KS=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,GS=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,YS=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,cn=e=>Is(e)||VS.has(e)||HS.test(e),In=e=>so(e,"length",sk),Is=e=>!!e&&!Number.isNaN(Number(e)),Pc=e=>so(e,"number",Is),ko=e=>!!e&&Number.isInteger(Number(e)),JS=e=>e.endsWith("%")&&Is(e.slice(0,-1)),q=e=>Iy.test(e),Mn=e=>qS.test(e),XS=new Set(["length","size","percentage"]),ZS=e=>so(e,XS,My),ek=e=>so(e,"position",My),tk=new Set(["image","url"]),nk=e=>so(e,tk,ik),rk=e=>so(e,"",ok),Eo=()=>!0,so=(e,t,n)=>{const r=Iy.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},sk=e=>QS.test(e)&&!KS.test(e),My=()=>!1,ok=e=>GS.test(e),ik=e=>YS.test(e),ak=()=>{const e=le("colors"),t=le("spacing"),n=le("blur"),r=le("brightness"),s=le("borderColor"),o=le("borderRadius"),i=le("borderSpacing"),a=le("borderWidth"),l=le("contrast"),c=le("grayscale"),d=le("hueRotate"),f=le("invert"),p=le("gap"),h=le("gradientColorStops"),x=le("gradientColorStopPositions"),w=le("inset"),b=le("margin"),v=le("opacity"),m=le("padding"),g=le("saturate"),_=le("scale"),S=le("sepia"),k=le("skew"),E=le("space"),j=le("translate"),A=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],F=()=>["auto",q,t],$=()=>[q,t],Q=()=>["",cn,In],I=()=>["auto",Is,q],J=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],U=()=>["solid","dashed","dotted","double","none"],W=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],T=()=>["start","end","center","between","around","evenly","stretch"],P=()=>["","0",q],M=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[Is,q];return{cacheSize:500,separator:":",theme:{colors:[Eo],spacing:[cn,In],blur:["none","",Mn,q],brightness:H(),borderColor:[e],borderRadius:["none","","full",Mn,q],borderSpacing:$(),borderWidth:Q(),contrast:H(),grayscale:P(),hueRotate:H(),invert:P(),gap:$(),gradientColorStops:[e],gradientColorStopPositions:[JS,In],inset:F(),margin:F(),opacity:H(),padding:$(),saturate:H(),scale:H(),sepia:P(),skew:H(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",q]}],container:["container"],columns:[{columns:[Mn]}],"break-after":[{"break-after":M()}],"break-before":[{"break-before":M()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...J(),q]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ko,q]}],basis:[{basis:F()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",q]}],grow:[{grow:P()}],shrink:[{shrink:P()}],order:[{order:["first","last","none",ko,q]}],"grid-cols":[{"grid-cols":[Eo]}],"col-start-end":[{col:["auto",{span:["full",ko,q]},q]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[Eo]}],"row-start-end":[{row:["auto",{span:[ko,q]},q]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",q]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",q]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...T()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...T(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...T(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[m]}],px:[{px:[m]}],py:[{py:[m]}],ps:[{ps:[m]}],pe:[{pe:[m]}],pt:[{pt:[m]}],pr:[{pr:[m]}],pb:[{pb:[m]}],pl:[{pl:[m]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",q,t]}],"min-w":[{"min-w":[q,t,"min","max","fit"]}],"max-w":[{"max-w":[q,t,"none","full","min","max","fit","prose",{screen:[Mn]},Mn]}],h:[{h:[q,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[q,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[q,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[q,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Mn,In]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Pc]}],"font-family":[{font:[Eo]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",q]}],"line-clamp":[{"line-clamp":["none",Is,Pc]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",cn,q]}],"list-image":[{"list-image":["none",q]}],"list-style-type":[{list:["none","disc","decimal",q]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...U(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",cn,In]}],"underline-offset":[{"underline-offset":["auto",cn,q]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...J(),ek]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ZS]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},nk]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...U(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:U()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...U()]}],"outline-offset":[{"outline-offset":[cn,q]}],"outline-w":[{outline:[cn,In]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[cn,In]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Mn,rk]}],"shadow-color":[{shadow:[Eo]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...W(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":W()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Mn,q]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[g]}],sepia:[{sepia:[S]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[g]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",q]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",q]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",q]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[ko,q]}],"translate-x":[{"translate-x":[j]}],"translate-y":[{"translate-y":[j]}],"skew-x":[{"skew-x":[k]}],"skew-y":[{"skew-y":[k]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",q]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",q]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",q]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[cn,In,Pc]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},lk=WS(ak);function Re(...e){return lk(Ey(e))}const ck=C_,Ly=y.forwardRef(({className:e,...t},n)=>u.jsx(yy,{ref:n,className:Re("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));Ly.displayName=yy.displayName;const uk=Nl("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),$y=y.forwardRef(({className:e,variant:t,...n},r)=>u.jsx(wy,{ref:r,className:Re(uk({variant:t}),e),...n}));$y.displayName=wy.displayName;const dk=y.forwardRef(({className:e,...t},n)=>u.jsx(_y,{ref:n,className:Re("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));dk.displayName=_y.displayName;const Dy=y.forwardRef(({className:e,...t},n)=>u.jsx(Sy,{ref:n,className:Re("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:u.jsx(yf,{className:"h-4 w-4"})}));Dy.displayName=Sy.displayName;const Fy=y.forwardRef(({className:e,...t},n)=>u.jsx(xy,{ref:n,className:Re("text-sm font-semibold",e),...t}));Fy.displayName=xy.displayName;const Uy=y.forwardRef(({className:e,...t},n)=>u.jsx(by,{ref:n,className:Re("text-sm opacity-90",e),...t}));Uy.displayName=by.displayName;function fk(){const{toasts:e}=Pi();return u.jsxs(ck,{children:[e.map(function({id:t,title:n,description:r,action:s,...o}){return u.jsxs($y,{...o,children:[u.jsxs("div",{className:"grid gap-1",children:[n&&u.jsx(Fy,{children:n}),r&&u.jsx(Uy,{children:r})]}),s,u.jsx(Dy,{})]},t)}),u.jsx(Ly,{})]})}var kp=["light","dark"],hk="(prefers-color-scheme: dark)",pk=y.createContext(void 0),mk={setTheme:e=>{},themes:[]},gk=()=>{var e;return(e=y.useContext(pk))!=null?e:mk};y.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:o,value:i,attrs:a,nonce:l})=>{let c=o==="system",d=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(x=>`'${x}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,f=s?kp.includes(o)&&o?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${o}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",p=(x,w=!1,b=!0)=>{let v=i?i[x]:x,m=w?x+"|| ''":`'${v}'`,g="";return s&&b&&!w&&kp.includes(x)&&(g+=`d.style.colorScheme = '${x}';`),n==="class"?w||v?g+=`c.add(${m})`:g+="null":v&&(g+=`d[s](n,${m})`),g},h=e?`!function(){${d}${p(e)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${c})){var t='${hk}',m=window.matchMedia(t);if(m.media!==t||m.matches){${p("dark")}}else{${p("light")}}}else if(e){${i?`var x=${JSON.stringify(i)};`:""}${p(i?"x[e]":"e",!0)}}${c?"":"else{"+p(o,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${i?`var x=${JSON.stringify(i)};`:""}${p(i?"x[e]":"e",!0)}}else{${p(o,!1,!1)};}${f}}catch(t){}}();`;return y.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:h}})});var vk=e=>{switch(e){case"success":return xk;case"info":return _k;case"warning":return bk;case"error":return Sk;default:return null}},yk=Array(12).fill(0),wk=({visible:e,className:t})=>O.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},O.createElement("div",{className:"sonner-spinner"},yk.map((n,r)=>O.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),xk=O.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},O.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),bk=O.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},O.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),_k=O.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},O.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Sk=O.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},O.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),kk=O.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},O.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),O.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Ek=()=>{let[e,t]=O.useState(document.hidden);return O.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},Qu=1,Ck=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:Qu++,o=this.toasts.find(a=>a.id===s),i=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),o?this.toasts=this.toasts.map(a=>a.id===s?(this.publish({...a,...e,id:s,title:n}),{...a,...e,id:s,dismissible:i,title:n}):a):this.addToast({title:n,...r,dismissible:i,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),s=n!==void 0,o,i=r.then(async l=>{if(o=["resolve",l],O.isValidElement(l))s=!1,this.create({id:n,type:"default",message:l});else if(jk(l)&&!l.ok){s=!1;let c=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,d=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description;this.create({id:n,type:"error",message:c,description:d})}else if(t.success!==void 0){s=!1;let c=typeof t.success=="function"?await t.success(l):t.success,d=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"success",message:c,description:d})}}).catch(async l=>{if(o=["reject",l],t.error!==void 0){s=!1;let c=typeof t.error=="function"?await t.error(l):t.error,d=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"error",message:c,description:d})}}).finally(()=>{var l;s&&(this.dismiss(n),n=void 0),(l=t.finally)==null||l.call(t)}),a=()=>new Promise((l,c)=>i.then(()=>o[0]==="reject"?c(o[1]):l(o[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||Qu++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},tt=new Ck,Tk=(e,t)=>{let n=(t==null?void 0:t.id)||Qu++;return tt.addToast({title:e,...t,id:n}),n},jk=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Pk=Tk,Nk=()=>tt.toasts,Ok=()=>tt.getActiveToasts(),SO=Object.assign(Pk,{success:tt.success,info:tt.info,warning:tt.warning,error:tt.error,custom:tt.custom,message:tt.message,promise:tt.promise,dismiss:tt.dismiss,loading:tt.loading},{getHistory:Nk,getToasts:Ok});function Rk(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}Rk(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} `);function sa(e){return e.label!==void 0}var Ak=3,Ik="32px",Mk="16px",Ep=4e3,Lk=356,$k=14,Dk=20,Fk=200;function Ot(...e){return e.filter(Boolean).join(" ")}function Uk(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var zk=e=>{var t,n,r,s,o,i,a,l,c,d,f;let{invert:p,toast:h,unstyled:x,interacting:w,setHeights:b,visibleToasts:v,heights:m,index:g,toasts:_,expanded:S,removeToast:k,defaultRichColors:E,closeButton:j,style:A,cancelButtonStyle:R,actionButtonStyle:F,className:$="",descriptionClassName:Q="",duration:I,position:J,gap:U,loadingIcon:W,expandByDefault:T,classNames:P,icons:M,closeButtonAriaLabel:H="Close toast",pauseWhenPageIsHidden:D}=e,[K,X]=O.useState(null),[be,$e]=O.useState(null),[ne,Xr]=O.useState(!1),[Tn,xr]=O.useState(!1),[jn,Zr]=O.useState(!1),[Pn,Ii]=O.useState(!1),[Vl,Mi]=O.useState(!1),[ql,fo]=O.useState(0),[es,Bf]=O.useState(0),ho=O.useRef(h.duration||I||Ep),Wf=O.useRef(null),br=O.useRef(null),mw=g===0,gw=g+1<=v,vt=h.type,ts=h.dismissible!==!1,vw=h.className||"",yw=h.descriptionClassName||"",Li=O.useMemo(()=>m.findIndex(z=>z.toastId===h.id)||0,[m,h.id]),ww=O.useMemo(()=>{var z;return(z=h.closeButton)!=null?z:j},[h.closeButton,j]),Hf=O.useMemo(()=>h.duration||I||Ep,[h.duration,I]),Ql=O.useRef(0),ns=O.useRef(0),Vf=O.useRef(0),rs=O.useRef(null),[xw,bw]=J.split("-"),qf=O.useMemo(()=>m.reduce((z,oe,de)=>de>=Li?z:z+oe.height,0),[m,Li]),Qf=Ek(),_w=h.invert||p,Kl=vt==="loading";ns.current=O.useMemo(()=>Li*U+qf,[Li,qf]),O.useEffect(()=>{ho.current=Hf},[Hf]),O.useEffect(()=>{Xr(!0)},[]),O.useEffect(()=>{let z=br.current;if(z){let oe=z.getBoundingClientRect().height;return Bf(oe),b(de=>[{toastId:h.id,height:oe,position:h.position},...de]),()=>b(de=>de.filter(Tt=>Tt.toastId!==h.id))}},[b,h.id]),O.useLayoutEffect(()=>{if(!ne)return;let z=br.current,oe=z.style.height;z.style.height="auto";let de=z.getBoundingClientRect().height;z.style.height=oe,Bf(de),b(Tt=>Tt.find(jt=>jt.toastId===h.id)?Tt.map(jt=>jt.toastId===h.id?{...jt,height:de}:jt):[{toastId:h.id,height:de,position:h.position},...Tt])},[ne,h.title,h.description,b,h.id]);let Nn=O.useCallback(()=>{xr(!0),fo(ns.current),b(z=>z.filter(oe=>oe.toastId!==h.id)),setTimeout(()=>{k(h)},Fk)},[h,k,b,ns]);O.useEffect(()=>{if(h.promise&&vt==="loading"||h.duration===1/0||h.type==="loading")return;let z;return S||w||D&&Qf?(()=>{if(Vf.current{var oe;(oe=h.onAutoClose)==null||oe.call(h,h),Nn()},ho.current)),()=>clearTimeout(z)},[S,w,h,vt,D,Qf,Nn]),O.useEffect(()=>{h.delete&&Nn()},[Nn,h.delete]);function Sw(){var z,oe,de;return M!=null&&M.loading?O.createElement("div",{className:Ot(P==null?void 0:P.loader,(z=h==null?void 0:h.classNames)==null?void 0:z.loader,"sonner-loader"),"data-visible":vt==="loading"},M.loading):W?O.createElement("div",{className:Ot(P==null?void 0:P.loader,(oe=h==null?void 0:h.classNames)==null?void 0:oe.loader,"sonner-loader"),"data-visible":vt==="loading"},W):O.createElement(wk,{className:Ot(P==null?void 0:P.loader,(de=h==null?void 0:h.classNames)==null?void 0:de.loader),visible:vt==="loading"})}return O.createElement("li",{tabIndex:0,ref:br,className:Ot($,vw,P==null?void 0:P.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,P==null?void 0:P.default,P==null?void 0:P[vt],(n=h==null?void 0:h.classNames)==null?void 0:n[vt]),"data-sonner-toast":"","data-rich-colors":(r=h.richColors)!=null?r:E,"data-styled":!(h.jsx||h.unstyled||x),"data-mounted":ne,"data-promise":!!h.promise,"data-swiped":Vl,"data-removed":Tn,"data-visible":gw,"data-y-position":xw,"data-x-position":bw,"data-index":g,"data-front":mw,"data-swiping":jn,"data-dismissible":ts,"data-type":vt,"data-invert":_w,"data-swipe-out":Pn,"data-swipe-direction":be,"data-expanded":!!(S||T&&ne),style:{"--index":g,"--toasts-before":g,"--z-index":_.length-g,"--offset":`${Tn?ql:ns.current}px`,"--initial-height":T?"auto":`${es}px`,...A,...h.style},onDragEnd:()=>{Zr(!1),X(null),rs.current=null},onPointerDown:z=>{Kl||!ts||(Wf.current=new Date,fo(ns.current),z.target.setPointerCapture(z.pointerId),z.target.tagName!=="BUTTON"&&(Zr(!0),rs.current={x:z.clientX,y:z.clientY}))},onPointerUp:()=>{var z,oe,de,Tt;if(Pn||!ts)return;rs.current=null;let jt=Number(((z=br.current)==null?void 0:z.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),On=Number(((oe=br.current)==null?void 0:oe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),_r=new Date().getTime()-((de=Wf.current)==null?void 0:de.getTime()),Pt=K==="x"?jt:On,Rn=Math.abs(Pt)/_r;if(Math.abs(Pt)>=Dk||Rn>.11){fo(ns.current),(Tt=h.onDismiss)==null||Tt.call(h,h),$e(K==="x"?jt>0?"right":"left":On>0?"down":"up"),Nn(),Ii(!0),Mi(!1);return}Zr(!1),X(null)},onPointerMove:z=>{var oe,de,Tt,jt;if(!rs.current||!ts||((oe=window.getSelection())==null?void 0:oe.toString().length)>0)return;let On=z.clientY-rs.current.y,_r=z.clientX-rs.current.x,Pt=(de=e.swipeDirections)!=null?de:Uk(J);!K&&(Math.abs(_r)>1||Math.abs(On)>1)&&X(Math.abs(_r)>Math.abs(On)?"x":"y");let Rn={x:0,y:0};K==="y"?(Pt.includes("top")||Pt.includes("bottom"))&&(Pt.includes("top")&&On<0||Pt.includes("bottom")&&On>0)&&(Rn.y=On):K==="x"&&(Pt.includes("left")||Pt.includes("right"))&&(Pt.includes("left")&&_r<0||Pt.includes("right")&&_r>0)&&(Rn.x=_r),(Math.abs(Rn.x)>0||Math.abs(Rn.y)>0)&&Mi(!0),(Tt=br.current)==null||Tt.style.setProperty("--swipe-amount-x",`${Rn.x}px`),(jt=br.current)==null||jt.style.setProperty("--swipe-amount-y",`${Rn.y}px`)}},ww&&!h.jsx?O.createElement("button",{"aria-label":H,"data-disabled":Kl,"data-close-button":!0,onClick:Kl||!ts?()=>{}:()=>{var z;Nn(),(z=h.onDismiss)==null||z.call(h,h)},className:Ot(P==null?void 0:P.closeButton,(s=h==null?void 0:h.classNames)==null?void 0:s.closeButton)},(o=M==null?void 0:M.close)!=null?o:kk):null,h.jsx||y.isValidElement(h.title)?h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title:O.createElement(O.Fragment,null,vt||h.icon||h.promise?O.createElement("div",{"data-icon":"",className:Ot(P==null?void 0:P.icon,(i=h==null?void 0:h.classNames)==null?void 0:i.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||Sw():null,h.type!=="loading"?h.icon||(M==null?void 0:M[vt])||vk(vt):null):null,O.createElement("div",{"data-content":"",className:Ot(P==null?void 0:P.content,(a=h==null?void 0:h.classNames)==null?void 0:a.content)},O.createElement("div",{"data-title":"",className:Ot(P==null?void 0:P.title,(l=h==null?void 0:h.classNames)==null?void 0:l.title)},typeof h.title=="function"?h.title():h.title),h.description?O.createElement("div",{"data-description":"",className:Ot(Q,yw,P==null?void 0:P.description,(c=h==null?void 0:h.classNames)==null?void 0:c.description)},typeof h.description=="function"?h.description():h.description):null),y.isValidElement(h.cancel)?h.cancel:h.cancel&&sa(h.cancel)?O.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||R,onClick:z=>{var oe,de;sa(h.cancel)&&ts&&((de=(oe=h.cancel).onClick)==null||de.call(oe,z),Nn())},className:Ot(P==null?void 0:P.cancelButton,(d=h==null?void 0:h.classNames)==null?void 0:d.cancelButton)},h.cancel.label):null,y.isValidElement(h.action)?h.action:h.action&&sa(h.action)?O.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||F,onClick:z=>{var oe,de;sa(h.action)&&((de=(oe=h.action).onClick)==null||de.call(oe,z),!z.defaultPrevented&&Nn())},className:Ot(P==null?void 0:P.actionButton,(f=h==null?void 0:h.classNames)==null?void 0:f.actionButton)},h.action.label):null))};function Cp(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Bk(e,t){let n={};return[e,t].forEach((r,s)=>{let o=s===1,i=o?"--mobile-offset":"--offset",a=o?Mk:Ik;function l(c){["top","right","bottom","left"].forEach(d=>{n[`${i}-${d}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${i}-${c}`]=a:n[`${i}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(a)}),n}var Wk=y.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:s=["altKey","KeyT"],expand:o,closeButton:i,className:a,offset:l,mobileOffset:c,theme:d="light",richColors:f,duration:p,style:h,visibleToasts:x=Ak,toastOptions:w,dir:b=Cp(),gap:v=$k,loadingIcon:m,icons:g,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:S}=e,[k,E]=O.useState([]),j=O.useMemo(()=>Array.from(new Set([r].concat(k.filter(D=>D.position).map(D=>D.position)))),[k,r]),[A,R]=O.useState([]),[F,$]=O.useState(!1),[Q,I]=O.useState(!1),[J,U]=O.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),W=O.useRef(null),T=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=O.useRef(null),M=O.useRef(!1),H=O.useCallback(D=>{E(K=>{var X;return(X=K.find(be=>be.id===D.id))!=null&&X.delete||tt.dismiss(D.id),K.filter(({id:be})=>be!==D.id)})},[]);return O.useEffect(()=>tt.subscribe(D=>{if(D.dismiss){E(K=>K.map(X=>X.id===D.id?{...X,delete:!0}:X));return}setTimeout(()=>{Wv.flushSync(()=>{E(K=>{let X=K.findIndex(be=>be.id===D.id);return X!==-1?[...K.slice(0,X),{...K[X],...D},...K.slice(X+1)]:[D,...K]})})})}),[]),O.useEffect(()=>{if(d!=="system"){U(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?U("dark"):U("light")),typeof window>"u")return;let D=window.matchMedia("(prefers-color-scheme: dark)");try{D.addEventListener("change",({matches:K})=>{U(K?"dark":"light")})}catch{D.addListener(({matches:X})=>{try{U(X?"dark":"light")}catch(be){console.error(be)}})}},[d]),O.useEffect(()=>{k.length<=1&&$(!1)},[k]),O.useEffect(()=>{let D=K=>{var X,be;s.every($e=>K[$e]||K.code===$e)&&($(!0),(X=W.current)==null||X.focus()),K.code==="Escape"&&(document.activeElement===W.current||(be=W.current)!=null&&be.contains(document.activeElement))&&$(!1)};return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[s]),O.useEffect(()=>{if(W.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,M.current=!1)}},[W.current]),O.createElement("section",{ref:t,"aria-label":`${_} ${T}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},j.map((D,K)=>{var X;let[be,$e]=D.split("-");return k.length?O.createElement("ol",{key:D,dir:b==="auto"?Cp():b,tabIndex:-1,ref:W,className:a,"data-sonner-toaster":!0,"data-theme":J,"data-y-position":be,"data-lifted":F&&k.length>1&&!o,"data-x-position":$e,style:{"--front-toast-height":`${((X=A[0])==null?void 0:X.height)||0}px`,"--width":`${Lk}px`,"--gap":`${v}px`,...h,...Bk(l,c)},onBlur:ne=>{M.current&&!ne.currentTarget.contains(ne.relatedTarget)&&(M.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:ne=>{ne.target instanceof HTMLElement&&ne.target.dataset.dismissible==="false"||M.current||(M.current=!0,P.current=ne.relatedTarget)},onMouseEnter:()=>$(!0),onMouseMove:()=>$(!0),onMouseLeave:()=>{Q||$(!1)},onDragEnd:()=>$(!1),onPointerDown:ne=>{ne.target instanceof HTMLElement&&ne.target.dataset.dismissible==="false"||I(!0)},onPointerUp:()=>I(!1)},k.filter(ne=>!ne.position&&K===0||ne.position===D).map((ne,Xr)=>{var Tn,xr;return O.createElement(zk,{key:ne.id,icons:g,index:Xr,toast:ne,defaultRichColors:f,duration:(Tn=w==null?void 0:w.duration)!=null?Tn:p,className:w==null?void 0:w.className,descriptionClassName:w==null?void 0:w.descriptionClassName,invert:n,visibleToasts:x,closeButton:(xr=w==null?void 0:w.closeButton)!=null?xr:i,interacting:Q,position:D,style:w==null?void 0:w.style,unstyled:w==null?void 0:w.unstyled,classNames:w==null?void 0:w.classNames,cancelButtonStyle:w==null?void 0:w.cancelButtonStyle,actionButtonStyle:w==null?void 0:w.actionButtonStyle,removeToast:H,toasts:k.filter(jn=>jn.position==ne.position),heights:A.filter(jn=>jn.position==ne.position),setHeights:R,expandByDefault:o,gap:v,loadingIcon:m,expanded:F,pauseWhenPageIsHidden:S,swipeDirections:e.swipeDirections})})):null}))});const Hk=({...e})=>{const{theme:t="system"}=gk();return u.jsx(Wk,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})},Vk=["top","right","bottom","left"],fr=Math.min,ct=Math.max,tl=Math.round,oa=Math.floor,sn=e=>({x:e,y:e}),qk={left:"right",right:"left",bottom:"top",top:"bottom"},Qk={start:"end",end:"start"};function Ku(e,t,n){return ct(e,fr(t,n))}function Sn(e,t){return typeof e=="function"?e(t):e}function kn(e){return e.split("-")[0]}function oo(e){return e.split("-")[1]}function xf(e){return e==="x"?"y":"x"}function bf(e){return e==="y"?"height":"width"}const Kk=new Set(["top","bottom"]);function tn(e){return Kk.has(kn(e))?"y":"x"}function _f(e){return xf(tn(e))}function Gk(e,t,n){n===void 0&&(n=!1);const r=oo(e),s=_f(e),o=bf(s);let i=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=nl(i)),[i,nl(i)]}function Yk(e){const t=nl(e);return[Gu(e),t,Gu(t)]}function Gu(e){return e.replace(/start|end/g,t=>Qk[t])}const Tp=["left","right"],jp=["right","left"],Jk=["top","bottom"],Xk=["bottom","top"];function Zk(e,t,n){switch(e){case"top":case"bottom":return n?t?jp:Tp:t?Tp:jp;case"left":case"right":return t?Jk:Xk;default:return[]}}function eE(e,t,n,r){const s=oo(e);let o=Zk(kn(e),n==="start",r);return s&&(o=o.map(i=>i+"-"+s),t&&(o=o.concat(o.map(Gu)))),o}function nl(e){return e.replace(/left|right|bottom|top/g,t=>qk[t])}function tE(e){return{top:0,right:0,bottom:0,left:0,...e}}function zy(e){return typeof e!="number"?tE(e):{top:e,right:e,bottom:e,left:e}}function rl(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Pp(e,t,n){let{reference:r,floating:s}=e;const o=tn(t),i=_f(t),a=bf(i),l=kn(t),c=o==="y",d=r.x+r.width/2-s.width/2,f=r.y+r.height/2-s.height/2,p=r[a]/2-s[a]/2;let h;switch(l){case"top":h={x:d,y:r.y-s.height};break;case"bottom":h={x:d,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-s.width,y:f};break;default:h={x:r.x,y:r.y}}switch(oo(t)){case"start":h[i]-=p*(n&&c?-1:1);break;case"end":h[i]+=p*(n&&c?-1:1);break}return h}const nE=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:i}=n,a=o.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:f}=Pp(c,r,l),p=r,h={},x=0;for(let w=0;w({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:o,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=Sn(e,t)||{};if(c==null)return{};const f=zy(d),p={x:n,y:r},h=_f(s),x=bf(h),w=await i.getDimensions(c),b=h==="y",v=b?"top":"left",m=b?"bottom":"right",g=b?"clientHeight":"clientWidth",_=o.reference[x]+o.reference[h]-p[h]-o.floating[x],S=p[h]-o.reference[h],k=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let E=k?k[g]:0;(!E||!await(i.isElement==null?void 0:i.isElement(k)))&&(E=a.floating[g]||o.floating[x]);const j=_/2-S/2,A=E/2-w[x]/2-1,R=fr(f[v],A),F=fr(f[m],A),$=R,Q=E-w[x]-F,I=E/2-w[x]/2+j,J=Ku($,I,Q),U=!l.arrow&&oo(s)!=null&&I!==J&&o.reference[x]/2-(I<$?R:F)-w[x]/2<0,W=U?I<$?I-$:I-Q:0;return{[h]:p[h]+W,data:{[h]:J,centerOffset:I-J-W,...U&&{alignmentOffset:W}},reset:U}}}),sE=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:o,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:w=!0,...b}=Sn(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const v=kn(s),m=tn(a),g=kn(a)===a,_=await(l.isRTL==null?void 0:l.isRTL(c.floating)),S=p||(g||!w?[nl(a)]:Yk(a)),k=x!=="none";!p&&k&&S.push(...eE(a,w,x,_));const E=[a,...S],j=await fi(t,b),A=[];let R=((r=o.flip)==null?void 0:r.overflows)||[];if(d&&A.push(j[v]),f){const I=Gk(s,i,_);A.push(j[I[0]],j[I[1]])}if(R=[...R,{placement:s,overflows:A}],!A.every(I=>I<=0)){var F,$;const I=(((F=o.flip)==null?void 0:F.index)||0)+1,J=E[I];if(J&&(!(f==="alignment"?m!==tn(J):!1)||R.every(T=>T.overflows[0]>0&&tn(T.placement)===m)))return{data:{index:I,overflows:R},reset:{placement:J}};let U=($=R.filter(W=>W.overflows[0]<=0).sort((W,T)=>W.overflows[1]-T.overflows[1])[0])==null?void 0:$.placement;if(!U)switch(h){case"bestFit":{var Q;const W=(Q=R.filter(T=>{if(k){const P=tn(T.placement);return P===m||P==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(P=>P>0).reduce((P,M)=>P+M,0)]).sort((T,P)=>T[1]-P[1])[0])==null?void 0:Q[0];W&&(U=W);break}case"initialPlacement":U=a;break}if(s!==U)return{reset:{placement:U}}}return{}}}};function Np(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Op(e){return Vk.some(t=>e[t]>=0)}const oE=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=Sn(e,t);switch(r){case"referenceHidden":{const o=await fi(t,{...s,elementContext:"reference"}),i=Np(o,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Op(i)}}}case"escaped":{const o=await fi(t,{...s,altBoundary:!0}),i=Np(o,n.floating);return{data:{escapedOffsets:i,escaped:Op(i)}}}default:return{}}}}},By=new Set(["left","top"]);async function iE(e,t){const{placement:n,platform:r,elements:s}=e,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),i=kn(n),a=oo(n),l=tn(n)==="y",c=By.has(i)?-1:1,d=o&&l?-1:1,f=Sn(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:x}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof x=="number"&&(h=a==="end"?x*-1:x),l?{x:h*d,y:p*c}:{x:p*c,y:h*d}}const aE=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:o,placement:i,middlewareData:a}=t,l=await iE(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:s+l.x,y:o+l.y,data:{...l,placement:i}}}}},lE=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:o=!0,crossAxis:i=!1,limiter:a={fn:b=>{let{x:v,y:m}=b;return{x:v,y:m}}},...l}=Sn(e,t),c={x:n,y:r},d=await fi(t,l),f=tn(kn(s)),p=xf(f);let h=c[p],x=c[f];if(o){const b=p==="y"?"top":"left",v=p==="y"?"bottom":"right",m=h+d[b],g=h-d[v];h=Ku(m,h,g)}if(i){const b=f==="y"?"top":"left",v=f==="y"?"bottom":"right",m=x+d[b],g=x-d[v];x=Ku(m,x,g)}const w=a.fn({...t,[p]:h,[f]:x});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[p]:o,[f]:i}}}}}},cE=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:o,middlewareData:i}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Sn(e,t),d={x:n,y:r},f=tn(s),p=xf(f);let h=d[p],x=d[f];const w=Sn(a,t),b=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(l){const g=p==="y"?"height":"width",_=o.reference[p]-o.floating[g]+b.mainAxis,S=o.reference[p]+o.reference[g]-b.mainAxis;h<_?h=_:h>S&&(h=S)}if(c){var v,m;const g=p==="y"?"width":"height",_=By.has(kn(s)),S=o.reference[f]-o.floating[g]+(_&&((v=i.offset)==null?void 0:v[f])||0)+(_?0:b.crossAxis),k=o.reference[f]+o.reference[g]+(_?0:((m=i.offset)==null?void 0:m[f])||0)-(_?b.crossAxis:0);xk&&(x=k)}return{[p]:h,[f]:x}}}},uE=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:o,platform:i,elements:a}=t,{apply:l=()=>{},...c}=Sn(e,t),d=await fi(t,c),f=kn(s),p=oo(s),h=tn(s)==="y",{width:x,height:w}=o.floating;let b,v;f==="top"||f==="bottom"?(b=f,v=p===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(v=f,b=p==="end"?"top":"bottom");const m=w-d.top-d.bottom,g=x-d.left-d.right,_=fr(w-d[b],m),S=fr(x-d[v],g),k=!t.middlewareData.shift;let E=_,j=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(j=g),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=m),k&&!p){const R=ct(d.left,0),F=ct(d.right,0),$=ct(d.top,0),Q=ct(d.bottom,0);h?j=x-2*(R!==0||F!==0?R+F:ct(d.left,d.right)):E=w-2*($!==0||Q!==0?$+Q:ct(d.top,d.bottom))}await l({...t,availableWidth:j,availableHeight:E});const A=await i.getDimensions(a.floating);return x!==A.width||w!==A.height?{reset:{rects:!0}}:{}}}};function Ol(){return typeof window<"u"}function io(e){return Wy(e)?(e.nodeName||"").toLowerCase():"#document"}function ft(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function an(e){var t;return(t=(Wy(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Wy(e){return Ol()?e instanceof Node||e instanceof ft(e).Node:!1}function Vt(e){return Ol()?e instanceof Element||e instanceof ft(e).Element:!1}function on(e){return Ol()?e instanceof HTMLElement||e instanceof ft(e).HTMLElement:!1}function Rp(e){return!Ol()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ft(e).ShadowRoot}const dE=new Set(["inline","contents"]);function Oi(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=qt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!dE.has(s)}const fE=new Set(["table","td","th"]);function hE(e){return fE.has(io(e))}const pE=[":popover-open",":modal"];function Rl(e){return pE.some(t=>{try{return e.matches(t)}catch{return!1}})}const mE=["transform","translate","scale","rotate","perspective"],gE=["transform","translate","scale","rotate","perspective","filter"],vE=["paint","layout","strict","content"];function Sf(e){const t=kf(),n=Vt(e)?qt(e):e;return mE.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||gE.some(r=>(n.willChange||"").includes(r))||vE.some(r=>(n.contain||"").includes(r))}function yE(e){let t=hr(e);for(;on(t)&&!Js(t);){if(Sf(t))return t;if(Rl(t))return null;t=hr(t)}return null}function kf(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const wE=new Set(["html","body","#document"]);function Js(e){return wE.has(io(e))}function qt(e){return ft(e).getComputedStyle(e)}function Al(e){return Vt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function hr(e){if(io(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Rp(e)&&e.host||an(e);return Rp(t)?t.host:t}function Hy(e){const t=hr(e);return Js(t)?e.ownerDocument?e.ownerDocument.body:e.body:on(t)&&Oi(t)?t:Hy(t)}function hi(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=Hy(e),o=s===((r=e.ownerDocument)==null?void 0:r.body),i=ft(s);if(o){const a=Yu(i);return t.concat(i,i.visualViewport||[],Oi(s)?s:[],a&&n?hi(a):[])}return t.concat(s,hi(s,[],n))}function Yu(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Vy(e){const t=qt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=on(e),o=s?e.offsetWidth:n,i=s?e.offsetHeight:r,a=tl(n)!==o||tl(r)!==i;return a&&(n=o,r=i),{width:n,height:r,$:a}}function Ef(e){return Vt(e)?e:e.contextElement}function Ms(e){const t=Ef(e);if(!on(t))return sn(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:o}=Vy(t);let i=(o?tl(n.width):n.width)/r,a=(o?tl(n.height):n.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const xE=sn(0);function qy(e){const t=ft(e);return!kf()||!t.visualViewport?xE:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bE(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ft(e)?!1:t}function Qr(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=Ef(e);let i=sn(1);t&&(r?Vt(r)&&(i=Ms(r)):i=Ms(e));const a=bE(o,n,r)?qy(o):sn(0);let l=(s.left+a.x)/i.x,c=(s.top+a.y)/i.y,d=s.width/i.x,f=s.height/i.y;if(o){const p=ft(o),h=r&&Vt(r)?ft(r):r;let x=p,w=Yu(x);for(;w&&r&&h!==x;){const b=Ms(w),v=w.getBoundingClientRect(),m=qt(w),g=v.left+(w.clientLeft+parseFloat(m.paddingLeft))*b.x,_=v.top+(w.clientTop+parseFloat(m.paddingTop))*b.y;l*=b.x,c*=b.y,d*=b.x,f*=b.y,l+=g,c+=_,x=ft(w),w=Yu(x)}}return rl({width:d,height:f,x:l,y:c})}function Cf(e,t){const n=Al(e).scrollLeft;return t?t.left+n:Qr(an(e)).left+n}function Qy(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=r.left+t.scrollLeft-(n?0:Cf(e,r)),o=r.top+t.scrollTop;return{x:s,y:o}}function _E(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const o=s==="fixed",i=an(r),a=t?Rl(t.floating):!1;if(r===i||a&&o)return n;let l={scrollLeft:0,scrollTop:0},c=sn(1);const d=sn(0),f=on(r);if((f||!f&&!o)&&((io(r)!=="body"||Oi(i))&&(l=Al(r)),on(r))){const h=Qr(r);c=Ms(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}const p=i&&!f&&!o?Qy(i,l,!0):sn(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+p.x,y:n.y*c.y-l.scrollTop*c.y+d.y+p.y}}function SE(e){return Array.from(e.getClientRects())}function kE(e){const t=an(e),n=Al(e),r=e.ownerDocument.body,s=ct(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=ct(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Cf(e);const a=-n.scrollTop;return qt(r).direction==="rtl"&&(i+=ct(t.clientWidth,r.clientWidth)-s),{width:s,height:o,x:i,y:a}}function EE(e,t){const n=ft(e),r=an(e),s=n.visualViewport;let o=r.clientWidth,i=r.clientHeight,a=0,l=0;if(s){o=s.width,i=s.height;const c=kf();(!c||c&&t==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:i,x:a,y:l}}const CE=new Set(["absolute","fixed"]);function TE(e,t){const n=Qr(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,o=on(e)?Ms(e):sn(1),i=e.clientWidth*o.x,a=e.clientHeight*o.y,l=s*o.x,c=r*o.y;return{width:i,height:a,x:l,y:c}}function Ap(e,t,n){let r;if(t==="viewport")r=EE(e,n);else if(t==="document")r=kE(an(e));else if(Vt(t))r=TE(t,n);else{const s=qy(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return rl(r)}function Ky(e,t){const n=hr(e);return n===t||!Vt(n)||Js(n)?!1:qt(n).position==="fixed"||Ky(n,t)}function jE(e,t){const n=t.get(e);if(n)return n;let r=hi(e,[],!1).filter(a=>Vt(a)&&io(a)!=="body"),s=null;const o=qt(e).position==="fixed";let i=o?hr(e):e;for(;Vt(i)&&!Js(i);){const a=qt(i),l=Sf(i);!l&&a.position==="fixed"&&(s=null),(o?!l&&!s:!l&&a.position==="static"&&!!s&&CE.has(s.position)||Oi(i)&&!l&&Ky(e,i))?r=r.filter(d=>d!==i):s=a,i=hr(i)}return t.set(e,r),r}function PE(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const i=[...n==="clippingAncestors"?Rl(t)?[]:jE(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((c,d)=>{const f=Ap(t,d,s);return c.top=ct(f.top,c.top),c.right=fr(f.right,c.right),c.bottom=fr(f.bottom,c.bottom),c.left=ct(f.left,c.left),c},Ap(t,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function NE(e){const{width:t,height:n}=Vy(e);return{width:t,height:n}}function OE(e,t,n){const r=on(t),s=an(t),o=n==="fixed",i=Qr(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=sn(0);function c(){l.x=Cf(s)}if(r||!r&&!o)if((io(t)!=="body"||Oi(s))&&(a=Al(t)),r){const h=Qr(t,!0,o,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else s&&c();o&&!r&&s&&c();const d=s&&!r&&!o?Qy(s,a):sn(0),f=i.left+a.scrollLeft-l.x-d.x,p=i.top+a.scrollTop-l.y-d.y;return{x:f,y:p,width:i.width,height:i.height}}function Nc(e){return qt(e).position==="static"}function Ip(e,t){if(!on(e)||qt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return an(e)===n&&(n=n.ownerDocument.body),n}function Gy(e,t){const n=ft(e);if(Rl(e))return n;if(!on(e)){let s=hr(e);for(;s&&!Js(s);){if(Vt(s)&&!Nc(s))return s;s=hr(s)}return n}let r=Ip(e,t);for(;r&&hE(r)&&Nc(r);)r=Ip(r,t);return r&&Js(r)&&Nc(r)&&!Sf(r)?n:r||yE(e)||n}const RE=async function(e){const t=this.getOffsetParent||Gy,n=this.getDimensions,r=await n(e.floating);return{reference:OE(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function AE(e){return qt(e).direction==="rtl"}const IE={convertOffsetParentRelativeRectToViewportRelativeRect:_E,getDocumentElement:an,getClippingRect:PE,getOffsetParent:Gy,getElementRects:RE,getClientRects:SE,getDimensions:NE,getScale:Ms,isElement:Vt,isRTL:AE};function Yy(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ME(e,t){let n=null,r;const s=an(e);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const c=e.getBoundingClientRect(),{left:d,top:f,width:p,height:h}=c;if(a||t(),!p||!h)return;const x=oa(f),w=oa(s.clientWidth-(d+p)),b=oa(s.clientHeight-(f+h)),v=oa(d),g={rootMargin:-x+"px "+-w+"px "+-b+"px "+-v+"px",threshold:ct(0,fr(1,l))||1};let _=!0;function S(k){const E=k[0].intersectionRatio;if(E!==l){if(!_)return i();E?i(!1,E):r=setTimeout(()=>{i(!1,1e-7)},1e3)}E===1&&!Yy(c,e.getBoundingClientRect())&&i(),_=!1}try{n=new IntersectionObserver(S,{...g,root:s.ownerDocument})}catch{n=new IntersectionObserver(S,g)}n.observe(e)}return i(!0),o}function LE(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Ef(e),d=s||o?[...c?hi(c):[],...hi(t)]:[];d.forEach(v=>{s&&v.addEventListener("scroll",n,{passive:!0}),o&&v.addEventListener("resize",n)});const f=c&&a?ME(c,n):null;let p=-1,h=null;i&&(h=new ResizeObserver(v=>{let[m]=v;m&&m.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var g;(g=h)==null||g.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let x,w=l?Qr(e):null;l&&b();function b(){const v=Qr(e);w&&!Yy(w,v)&&n(),w=v,x=requestAnimationFrame(b)}return n(),()=>{var v;d.forEach(m=>{s&&m.removeEventListener("scroll",n),o&&m.removeEventListener("resize",n)}),f==null||f(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(x)}}const $E=aE,DE=lE,FE=sE,UE=uE,zE=oE,Mp=rE,BE=cE,WE=(e,t,n)=>{const r=new Map,s={platform:IE,...n},o={...s.platform,_c:r};return nE(e,t,{...s,platform:o})};var HE=typeof document<"u",VE=function(){},ja=HE?y.useLayoutEffect:VE;function sl(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!sl(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const o=s[r];if(!(o==="_owner"&&e.$$typeof)&&!sl(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Jy(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Lp(e,t){const n=Jy(e);return Math.round(t*n)/n}function Oc(e){const t=y.useRef(e);return ja(()=>{t.current=e}),t}function qE(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:o,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,f]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=y.useState(r);sl(p,r)||h(r);const[x,w]=y.useState(null),[b,v]=y.useState(null),m=y.useCallback(T=>{T!==k.current&&(k.current=T,w(T))},[]),g=y.useCallback(T=>{T!==E.current&&(E.current=T,v(T))},[]),_=o||x,S=i||b,k=y.useRef(null),E=y.useRef(null),j=y.useRef(d),A=l!=null,R=Oc(l),F=Oc(s),$=Oc(c),Q=y.useCallback(()=>{if(!k.current||!E.current)return;const T={placement:t,strategy:n,middleware:p};F.current&&(T.platform=F.current),WE(k.current,E.current,T).then(P=>{const M={...P,isPositioned:$.current!==!1};I.current&&!sl(j.current,M)&&(j.current=M,ji.flushSync(()=>{f(M)}))})},[p,t,n,F,$]);ja(()=>{c===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,f(T=>({...T,isPositioned:!1})))},[c]);const I=y.useRef(!1);ja(()=>(I.current=!0,()=>{I.current=!1}),[]),ja(()=>{if(_&&(k.current=_),S&&(E.current=S),_&&S){if(R.current)return R.current(_,S,Q);Q()}},[_,S,Q,R,A]);const J=y.useMemo(()=>({reference:k,floating:E,setReference:m,setFloating:g}),[m,g]),U=y.useMemo(()=>({reference:_,floating:S}),[_,S]),W=y.useMemo(()=>{const T={position:n,left:0,top:0};if(!U.floating)return T;const P=Lp(U.floating,d.x),M=Lp(U.floating,d.y);return a?{...T,transform:"translate("+P+"px, "+M+"px)",...Jy(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:P,top:M}},[n,a,U.floating,d.x,d.y]);return y.useMemo(()=>({...d,update:Q,refs:J,elements:U,floatingStyles:W}),[d,Q,J,U,W])}const QE=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Mp({element:r.current,padding:s}).fn(n):{}:r?Mp({element:r,padding:s}).fn(n):{}}}},KE=(e,t)=>({...$E(e),options:[e,t]}),GE=(e,t)=>({...DE(e),options:[e,t]}),YE=(e,t)=>({...BE(e),options:[e,t]}),JE=(e,t)=>({...FE(e),options:[e,t]}),XE=(e,t)=>({...UE(e),options:[e,t]}),ZE=(e,t)=>({...zE(e),options:[e,t]}),eC=(e,t)=>({...QE(e),options:[e,t]});var tC="Arrow",Xy=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...o}=e;return u.jsx(et.svg,{...o,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});Xy.displayName=tC;var nC=Xy;function rC(e){const[t,n]=y.useState(void 0);return dr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const o=s[0];let i,a;if("borderBoxSize"in o){const l=o.borderBoxSize,c=Array.isArray(l)?l[0]:l;i=c.inlineSize,a=c.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Tf="Popper",[Zy,e0]=Tl(Tf),[sC,t0]=Zy(Tf),n0=e=>{const{__scopePopper:t,children:n}=e,[r,s]=y.useState(null);return u.jsx(sC,{scope:t,anchor:r,onAnchorChange:s,children:n})};n0.displayName=Tf;var r0="PopperAnchor",s0=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,o=t0(r0,n),i=y.useRef(null),a=Ht(t,i);return y.useEffect(()=>{o.onAnchorChange((r==null?void 0:r.current)||i.current)}),r?null:u.jsx(et.div,{...s,ref:a})});s0.displayName=r0;var jf="PopperContent",[oC,iC]=Zy(jf),o0=y.forwardRef((e,t)=>{var ne,Xr,Tn,xr,jn,Zr;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:o="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:x,...w}=e,b=t0(jf,n),[v,m]=y.useState(null),g=Ht(t,Pn=>m(Pn)),[_,S]=y.useState(null),k=rC(_),E=(k==null?void 0:k.width)??0,j=(k==null?void 0:k.height)??0,A=r+(o!=="center"?"-"+o:""),R=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},F=Array.isArray(c)?c:[c],$=F.length>0,Q={padding:R,boundary:F.filter(lC),altBoundary:$},{refs:I,floatingStyles:J,placement:U,isPositioned:W,middlewareData:T}=qE({strategy:"fixed",placement:A,whileElementsMounted:(...Pn)=>LE(...Pn,{animationFrame:h==="always"}),elements:{reference:b.anchor},middleware:[KE({mainAxis:s+j,alignmentAxis:i}),l&&GE({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?YE():void 0,...Q}),l&&JE({...Q}),XE({...Q,apply:({elements:Pn,rects:Ii,availableWidth:Vl,availableHeight:Mi})=>{const{width:ql,height:fo}=Ii.reference,es=Pn.floating.style;es.setProperty("--radix-popper-available-width",`${Vl}px`),es.setProperty("--radix-popper-available-height",`${Mi}px`),es.setProperty("--radix-popper-anchor-width",`${ql}px`),es.setProperty("--radix-popper-anchor-height",`${fo}px`)}}),_&&eC({element:_,padding:a}),cC({arrowWidth:E,arrowHeight:j}),p&&ZE({strategy:"referenceHidden",...Q})]}),[P,M]=l0(U),H=ur(x);dr(()=>{W&&(H==null||H())},[W,H]);const D=(ne=T.arrow)==null?void 0:ne.x,K=(Xr=T.arrow)==null?void 0:Xr.y,X=((Tn=T.arrow)==null?void 0:Tn.centerOffset)!==0,[be,$e]=y.useState();return dr(()=>{v&&$e(window.getComputedStyle(v).zIndex)},[v]),u.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...J,transform:W?J.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:be,"--radix-popper-transform-origin":[(xr=T.transformOrigin)==null?void 0:xr.x,(jn=T.transformOrigin)==null?void 0:jn.y].join(" "),...((Zr=T.hide)==null?void 0:Zr.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(oC,{scope:n,placedSide:P,onArrowChange:S,arrowX:D,arrowY:K,shouldHideArrow:X,children:u.jsx(et.div,{"data-side":P,"data-align":M,...w,ref:g,style:{...w.style,animation:W?void 0:"none"}})})})});o0.displayName=jf;var i0="PopperArrow",aC={top:"bottom",right:"left",bottom:"top",left:"right"},a0=y.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,o=iC(i0,r),i=aC[o.placedSide];return u.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:u.jsx(nC,{...s,ref:n,style:{...s.style,display:"block"}})})});a0.displayName=i0;function lC(e){return e!==null}var cC=e=>({name:"transformOrigin",options:e,fn(t){var b,v,m;const{placement:n,rects:r,middlewareData:s}=t,i=((b=s.arrow)==null?void 0:b.centerOffset)!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[c,d]=l0(n),f={start:"0%",center:"50%",end:"100%"}[d],p=(((v=s.arrow)==null?void 0:v.x)??0)+a/2,h=(((m=s.arrow)==null?void 0:m.y)??0)+l/2;let x="",w="";return c==="bottom"?(x=i?f:`${p}px`,w=`${-l}px`):c==="top"?(x=i?f:`${p}px`,w=`${r.floating.height+l}px`):c==="right"?(x=`${-l}px`,w=i?f:`${h}px`):c==="left"&&(x=`${r.floating.width+l}px`,w=i?f:`${h}px`),{data:{x,y:w}}}});function l0(e){const[t,n="center"]=e.split("-");return[t,n]}var kO=n0,uC=s0,dC=o0,fC=a0,[Il,EO]=Tl("Tooltip",[e0]),Pf=e0(),c0="TooltipProvider",hC=700,$p="tooltip.open",[pC,u0]=Il(c0),d0=e=>{const{__scopeTooltip:t,delayDuration:n=hC,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:o}=e,i=y.useRef(!0),a=y.useRef(!1),l=y.useRef(0);return y.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),u.jsx(pC,{scope:t,isOpenDelayedRef:i,delayDuration:n,onOpen:y.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:y.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:y.useCallback(c=>{a.current=c},[]),disableHoverableContent:s,children:o})};d0.displayName=c0;var f0="Tooltip",[CO,Ml]=Il(f0),Ju="TooltipTrigger",mC=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Ml(Ju,n),o=u0(Ju,n),i=Pf(n),a=y.useRef(null),l=Ht(t,a,s.onTriggerChange),c=y.useRef(!1),d=y.useRef(!1),f=y.useCallback(()=>c.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),u.jsx(uC,{asChild:!0,...i,children:u.jsx(et.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:l,onPointerMove:Te(e.onPointerMove,p=>{p.pointerType!=="touch"&&!d.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),d.current=!0)}),onPointerLeave:Te(e.onPointerLeave,()=>{s.onTriggerLeave(),d.current=!1}),onPointerDown:Te(e.onPointerDown,()=>{s.open&&s.onClose(),c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:Te(e.onFocus,()=>{c.current||s.onOpen()}),onBlur:Te(e.onBlur,s.onClose),onClick:Te(e.onClick,s.onClose)})})});mC.displayName=Ju;var gC="TooltipPortal",[TO,vC]=Il(gC,{forceMount:void 0}),Xs="TooltipContent",h0=y.forwardRef((e,t)=>{const n=vC(Xs,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...o}=e,i=Ml(Xs,e.__scopeTooltip);return u.jsx(hf,{present:r||i.open,children:i.disableHoverableContent?u.jsx(p0,{side:s,...o,ref:t}):u.jsx(yC,{side:s,...o,ref:t})})}),yC=y.forwardRef((e,t)=>{const n=Ml(Xs,e.__scopeTooltip),r=u0(Xs,e.__scopeTooltip),s=y.useRef(null),o=Ht(t,s),[i,a]=y.useState(null),{trigger:l,onClose:c}=n,d=s.current,{onPointerInTransitChange:f}=r,p=y.useCallback(()=>{a(null),f(!1)},[f]),h=y.useCallback((x,w)=>{const b=x.currentTarget,v={x:x.clientX,y:x.clientY},m=SC(v,b.getBoundingClientRect()),g=kC(v,m),_=EC(w.getBoundingClientRect()),S=TC([...g,..._]);a(S),f(!0)},[f]);return y.useEffect(()=>()=>p(),[p]),y.useEffect(()=>{if(l&&d){const x=b=>h(b,d),w=b=>h(b,l);return l.addEventListener("pointerleave",x),d.addEventListener("pointerleave",w),()=>{l.removeEventListener("pointerleave",x),d.removeEventListener("pointerleave",w)}}},[l,d,h,p]),y.useEffect(()=>{if(i){const x=w=>{const b=w.target,v={x:w.clientX,y:w.clientY},m=(l==null?void 0:l.contains(b))||(d==null?void 0:d.contains(b)),g=!CC(v,i);m?p():g&&(p(),c())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[l,d,i,c,p]),u.jsx(p0,{...e,ref:o})}),[wC,xC]=Il(f0,{isInside:!1}),bC=$b("TooltipContent"),p0=y.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:i,...a}=e,l=Ml(Xs,n),c=Pf(n),{onClose:d}=l;return y.useEffect(()=>(document.addEventListener($p,d),()=>document.removeEventListener($p,d)),[d]),y.useEffect(()=>{if(l.trigger){const f=p=>{const h=p.target;h!=null&&h.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),u.jsx(ff,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:u.jsxs(dC,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[u.jsx(bC,{children:r}),u.jsx(wC,{scope:n,isInside:!0,children:u.jsx(l_,{id:l.contentId,role:"tooltip",children:s||r})})]})})});h0.displayName=Xs;var m0="TooltipArrow",_C=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Pf(n);return xC(m0,n).isInside?null:u.jsx(fC,{...s,...r,ref:t})});_C.displayName=m0;function SC(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,s,o)){case o:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function kC(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function EC(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function CC(e,t){const{x:n,y:r}=e;let s=!1;for(let o=0,i=t.length-1;or!=p>r&&n<(f-c)*(r-d)/(p-d)+c&&(s=!s)}return s}function TC(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),jC(t)}function jC(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const o=t[t.length-1],i=t[t.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const o=n[n.length-1],i=n[n.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var PC=d0,g0=h0;const NC=PC,OC=y.forwardRef(({className:e,sideOffset:t=4,...n},r)=>u.jsx(g0,{ref:r,sideOffset:t,className:Re("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));OC.displayName=g0.displayName;var Ll=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},$l=typeof window>"u"||"Deno"in globalThis;function It(){}function RC(e,t){return typeof e=="function"?e(t):e}function AC(e){return typeof e=="number"&&e>=0&&e!==1/0}function IC(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Xu(e,t){return typeof e=="function"?e(t):e}function MC(e,t){return typeof e=="function"?e(t):e}function Dp(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:o,queryKey:i,stale:a}=e;if(i){if(r){if(t.queryHash!==Nf(i,t.options))return!1}else if(!mi(t.queryKey,i))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||s&&s!==t.state.fetchStatus||o&&!o(t))}function Fp(e,t){const{exact:n,status:r,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(pi(t.options.mutationKey)!==pi(o))return!1}else if(!mi(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function Nf(e,t){return((t==null?void 0:t.queryKeyHashFn)||pi)(e)}function pi(e){return JSON.stringify(e,(t,n)=>Zu(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function mi(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>mi(e[n],t[n])):!1}function v0(e,t){if(e===t)return e;const n=Up(e)&&Up(t);if(n||Zu(e)&&Zu(t)){const r=n?e:Object.keys(e),s=r.length,o=n?t:Object.keys(t),i=o.length,a=n?[]:{},l=new Set(r);let c=0;for(let d=0;d{setTimeout(t,e)})}function $C(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?v0(e,t):t}function DC(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function FC(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Of=Symbol();function y0(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Of?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function PO(e,t){return typeof e=="function"?e(...t):!!e}var Ir,Vn,Ls,_m,UC=(_m=class extends Ll{constructor(){super();te(this,Ir);te(this,Vn);te(this,Ls);B(this,Ls,t=>{if(!$l&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){C(this,Vn)||this.setEventListener(C(this,Ls))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,Vn))==null||t.call(this),B(this,Vn,void 0))}setEventListener(t){var n;B(this,Ls,t),(n=C(this,Vn))==null||n.call(this),B(this,Vn,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){C(this,Ir)!==t&&(B(this,Ir,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof C(this,Ir)=="boolean"?C(this,Ir):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ir=new WeakMap,Vn=new WeakMap,Ls=new WeakMap,_m),w0=new UC,$s,qn,Ds,Sm,zC=(Sm=class extends Ll{constructor(){super();te(this,$s,!0);te(this,qn);te(this,Ds);B(this,Ds,t=>{if(!$l&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){C(this,qn)||this.setEventListener(C(this,Ds))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,qn))==null||t.call(this),B(this,qn,void 0))}setEventListener(t){var n;B(this,Ds,t),(n=C(this,qn))==null||n.call(this),B(this,qn,t(this.setOnline.bind(this)))}setOnline(t){C(this,$s)!==t&&(B(this,$s,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return C(this,$s)}},$s=new WeakMap,qn=new WeakMap,Ds=new WeakMap,Sm),ol=new zC;function BC(){let e,t;const n=new Promise((s,o)=>{e=s,t=o});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}function WC(e){return Math.min(1e3*2**e,3e4)}function x0(e){return(e??"online")==="online"?ol.isOnline():!0}var b0=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Rc(e){return e instanceof b0}function _0(e){let t=!1,n=0,r=!1,s;const o=BC(),i=w=>{var b;r||(p(new b0(w)),(b=e.abort)==null||b.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>w0.isFocused()&&(e.networkMode==="always"||ol.isOnline())&&e.canRun(),d=()=>x0(e.networkMode)&&e.canRun(),f=w=>{var b;r||(r=!0,(b=e.onSuccess)==null||b.call(e,w),s==null||s(),o.resolve(w))},p=w=>{var b;r||(r=!0,(b=e.onError)==null||b.call(e,w),s==null||s(),o.reject(w))},h=()=>new Promise(w=>{var b;s=v=>{(r||c())&&w(v)},(b=e.onPause)==null||b.call(e)}).then(()=>{var w;s=void 0,r||(w=e.onContinue)==null||w.call(e)}),x=()=>{if(r)return;let w;const b=n===0?e.initialPromise:void 0;try{w=b??e.fn()}catch(v){w=Promise.reject(v)}Promise.resolve(w).then(f).catch(v=>{var k;if(r)return;const m=e.retry??($l?0:3),g=e.retryDelay??WC,_=typeof g=="function"?g(n,v):g,S=m===!0||typeof m=="number"&&nc()?void 0:h()).then(()=>{t?p(v):x()})})};return{promise:o,cancel:i,continue:()=>(s==null||s(),o),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?x():h().then(x),o)}}var HC=e=>setTimeout(e,0);function VC(){let e=[],t=0,n=a=>{a()},r=a=>{a()},s=HC;const o=a=>{t?e.push(a):s(()=>{n(a)})},i=()=>{const a=e;e=[],a.length&&s(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||i()}return l},batchCalls:a=>(...l)=>{o(()=>{a(...l)})},schedule:o,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{s=a}}}var Ye=VC(),Mr,km,S0=(km=class{constructor(){te(this,Mr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),AC(this.gcTime)&&B(this,Mr,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??($l?1/0:5*60*1e3))}clearGcTimeout(){C(this,Mr)&&(clearTimeout(C(this,Mr)),B(this,Mr,void 0))}},Mr=new WeakMap,km),Fs,Lr,wt,$r,ze,xi,Dr,Mt,un,Em,qC=(Em=class extends S0{constructor(t){super();te(this,Mt);te(this,Fs);te(this,Lr);te(this,wt);te(this,$r);te(this,ze);te(this,xi);te(this,Dr);B(this,Dr,!1),B(this,xi,t.defaultOptions),this.setOptions(t.options),this.observers=[],B(this,$r,t.client),B(this,wt,C(this,$r).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,B(this,Fs,KC(this.options)),this.state=t.state??C(this,Fs),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=C(this,ze))==null?void 0:t.promise}setOptions(t){this.options={...C(this,xi),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&C(this,wt).remove(this)}setData(t,n){const r=$C(this.state.data,t,this.options);return De(this,Mt,un).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){De(this,Mt,un).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=C(this,ze))==null?void 0:r.promise;return(s=C(this,ze))==null||s.cancel(t),n?n.then(It).catch(It):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(C(this,Fs))}isActive(){return this.observers.some(t=>MC(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Of||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Xu(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!IC(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=C(this,ze))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=C(this,ze))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),C(this,wt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(C(this,ze)&&(C(this,Dr)?C(this,ze).cancel({revert:!0}):C(this,ze).cancelRetry()),this.scheduleGc()),C(this,wt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||De(this,Mt,un).call(this,{type:"invalidate"})}fetch(t,n){var c,d,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(C(this,ze))return C(this,ze).continueRetry(),C(this,ze).promise}if(t&&this.setOptions(t),!this.options.queryFn){const p=this.observers.find(h=>h.options.queryFn);p&&this.setOptions(p.options)}const r=new AbortController,s=p=>{Object.defineProperty(p,"signal",{enumerable:!0,get:()=>(B(this,Dr,!0),r.signal)})},o=()=>{const p=y0(this.options,n),x=(()=>{const w={client:C(this,$r),queryKey:this.queryKey,meta:this.meta};return s(w),w})();return B(this,Dr,!1),this.options.persister?this.options.persister(p,x,this):p(x)},a=(()=>{const p={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:C(this,$r),state:this.state,fetchFn:o};return s(p),p})();(c=this.options.behavior)==null||c.onFetch(a,this),B(this,Lr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=a.fetchOptions)==null?void 0:d.meta))&&De(this,Mt,un).call(this,{type:"fetch",meta:(f=a.fetchOptions)==null?void 0:f.meta});const l=p=>{var h,x,w,b;Rc(p)&&p.silent||De(this,Mt,un).call(this,{type:"error",error:p}),Rc(p)||((x=(h=C(this,wt).config).onError)==null||x.call(h,p,this),(b=(w=C(this,wt).config).onSettled)==null||b.call(w,this.state.data,p,this)),this.scheduleGc()};return B(this,ze,_0({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:p=>{var h,x,w,b;if(p===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(p)}catch(v){l(v);return}(x=(h=C(this,wt).config).onSuccess)==null||x.call(h,p,this),(b=(w=C(this,wt).config).onSettled)==null||b.call(w,p,this.state.error,this),this.scheduleGc()},onError:l,onFail:(p,h)=>{De(this,Mt,un).call(this,{type:"failed",failureCount:p,error:h})},onPause:()=>{De(this,Mt,un).call(this,{type:"pause"})},onContinue:()=>{De(this,Mt,un).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),C(this,ze).start()}},Fs=new WeakMap,Lr=new WeakMap,wt=new WeakMap,$r=new WeakMap,ze=new WeakMap,xi=new WeakMap,Dr=new WeakMap,Mt=new WeakSet,un=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...QC(r.data,this.options),fetchMeta:t.meta??null};case"success":return B(this,Lr,void 0),{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const s=t.error;return Rc(s)&&s.revert&&C(this,Lr)?{...C(this,Lr),fetchStatus:"idle"}:{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Ye.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),C(this,wt).notify({query:this,type:"updated",action:t})})},Em);function QC(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:x0(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function KC(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Jt,Cm,GC=(Cm=class extends Ll{constructor(t={}){super();te(this,Jt);this.config=t,B(this,Jt,new Map)}build(t,n,r){const s=n.queryKey,o=n.queryHash??Nf(s,n);let i=this.get(o);return i||(i=new qC({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(i)),i}add(t){C(this,Jt).has(t.queryHash)||(C(this,Jt).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=C(this,Jt).get(t.queryHash);n&&(t.destroy(),n===t&&C(this,Jt).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Ye.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return C(this,Jt).get(t)}getAll(){return[...C(this,Jt).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Dp(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>Dp(t,r)):n}notify(t){Ye.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Ye.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Ye.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Jt=new WeakMap,Cm),Xt,Qe,Fr,Zt,Dn,Tm,YC=(Tm=class extends S0{constructor(t){super();te(this,Zt);te(this,Xt);te(this,Qe);te(this,Fr);this.mutationId=t.mutationId,B(this,Qe,t.mutationCache),B(this,Xt,[]),this.state=t.state||JC(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){C(this,Xt).includes(t)||(C(this,Xt).push(t),this.clearGcTimeout(),C(this,Qe).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){B(this,Xt,C(this,Xt).filter(n=>n!==t)),this.scheduleGc(),C(this,Qe).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){C(this,Xt).length||(this.state.status==="pending"?this.scheduleGc():C(this,Qe).remove(this))}continue(){var t;return((t=C(this,Fr))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,a,l,c,d,f,p,h,x,w,b,v,m,g,_,S,k,E,j;const n=()=>{De(this,Zt,Dn).call(this,{type:"continue"})};B(this,Fr,_0({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(A,R)=>{De(this,Zt,Dn).call(this,{type:"failed",failureCount:A,error:R})},onPause:()=>{De(this,Zt,Dn).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>C(this,Qe).canRun(this)}));const r=this.state.status==="pending",s=!C(this,Fr).canStart();try{if(r)n();else{De(this,Zt,Dn).call(this,{type:"pending",variables:t,isPaused:s}),await((i=(o=C(this,Qe).config).onMutate)==null?void 0:i.call(o,t,this));const R=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,t));R!==this.state.context&&De(this,Zt,Dn).call(this,{type:"pending",context:R,variables:t,isPaused:s})}const A=await C(this,Fr).start();return await((d=(c=C(this,Qe).config).onSuccess)==null?void 0:d.call(c,A,t,this.state.context,this)),await((p=(f=this.options).onSuccess)==null?void 0:p.call(f,A,t,this.state.context)),await((x=(h=C(this,Qe).config).onSettled)==null?void 0:x.call(h,A,null,this.state.variables,this.state.context,this)),await((b=(w=this.options).onSettled)==null?void 0:b.call(w,A,null,t,this.state.context)),De(this,Zt,Dn).call(this,{type:"success",data:A}),A}catch(A){try{throw await((m=(v=C(this,Qe).config).onError)==null?void 0:m.call(v,A,t,this.state.context,this)),await((_=(g=this.options).onError)==null?void 0:_.call(g,A,t,this.state.context)),await((k=(S=C(this,Qe).config).onSettled)==null?void 0:k.call(S,void 0,A,this.state.variables,this.state.context,this)),await((j=(E=this.options).onSettled)==null?void 0:j.call(E,void 0,A,t,this.state.context)),A}finally{De(this,Zt,Dn).call(this,{type:"error",error:A})}}finally{C(this,Qe).runNext(this)}}},Xt=new WeakMap,Qe=new WeakMap,Fr=new WeakMap,Zt=new WeakSet,Dn=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Ye.batch(()=>{C(this,Xt).forEach(r=>{r.onMutationUpdate(t)}),C(this,Qe).notify({mutation:this,type:"updated",action:t})})},Tm);function JC(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var mn,Lt,bi,jm,XC=(jm=class extends Ll{constructor(t={}){super();te(this,mn);te(this,Lt);te(this,bi);this.config=t,B(this,mn,new Set),B(this,Lt,new Map),B(this,bi,0)}build(t,n,r){const s=new YC({mutationCache:this,mutationId:++$i(this,bi)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){C(this,mn).add(t);const n=ia(t);if(typeof n=="string"){const r=C(this,Lt).get(n);r?r.push(t):C(this,Lt).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(C(this,mn).delete(t)){const n=ia(t);if(typeof n=="string"){const r=C(this,Lt).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&C(this,Lt).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=ia(t);if(typeof n=="string"){const r=C(this,Lt).get(n),s=r==null?void 0:r.find(o=>o.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=ia(t);if(typeof n=="string"){const s=(r=C(this,Lt).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ye.batch(()=>{C(this,mn).forEach(t=>{this.notify({type:"removed",mutation:t})}),C(this,mn).clear(),C(this,Lt).clear()})}getAll(){return Array.from(C(this,mn))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>Fp(n,r))}findAll(t={}){return this.getAll().filter(n=>Fp(t,n))}notify(t){Ye.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Ye.batch(()=>Promise.all(t.map(n=>n.continue().catch(It))))}},mn=new WeakMap,Lt=new WeakMap,bi=new WeakMap,jm);function ia(e){var t;return(t=e.options.scope)==null?void 0:t.id}function Bp(e){return{onFetch:(t,n)=>{var d,f,p,h,x;const r=t.options,s=(p=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:p.direction,o=((h=t.state.data)==null?void 0:h.pages)||[],i=((x=t.state.data)==null?void 0:x.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let w=!1;const b=g=>{Object.defineProperty(g,"signal",{enumerable:!0,get:()=>(t.signal.aborted?w=!0:t.signal.addEventListener("abort",()=>{w=!0}),t.signal)})},v=y0(t.options,t.fetchOptions),m=async(g,_,S)=>{if(w)return Promise.reject();if(_==null&&g.pages.length)return Promise.resolve(g);const E=(()=>{const F={client:t.client,queryKey:t.queryKey,pageParam:_,direction:S?"backward":"forward",meta:t.options.meta};return b(F),F})(),j=await v(E),{maxPages:A}=t.options,R=S?FC:DC;return{pages:R(g.pages,j,A),pageParams:R(g.pageParams,_,A)}};if(s&&o.length){const g=s==="backward",_=g?ZC:Wp,S={pages:o,pageParams:i},k=_(r,S);a=await m(S,k,g)}else{const g=e??o.length;do{const _=l===0?i[0]??r.initialPageParam:Wp(r,a);if(l>0&&_==null)break;a=await m(a,_),l++}while(l{var w,b;return(b=(w=t.options).persister)==null?void 0:b.call(w,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function Wp(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function ZC(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var ge,Qn,Kn,Us,zs,Gn,Bs,Ws,Pm,eT=(Pm=class{constructor(e={}){te(this,ge);te(this,Qn);te(this,Kn);te(this,Us);te(this,zs);te(this,Gn);te(this,Bs);te(this,Ws);B(this,ge,e.queryCache||new GC),B(this,Qn,e.mutationCache||new XC),B(this,Kn,e.defaultOptions||{}),B(this,Us,new Map),B(this,zs,new Map),B(this,Gn,0)}mount(){$i(this,Gn)._++,C(this,Gn)===1&&(B(this,Bs,w0.subscribe(async e=>{e&&(await this.resumePausedMutations(),C(this,ge).onFocus())})),B(this,Ws,ol.subscribe(async e=>{e&&(await this.resumePausedMutations(),C(this,ge).onOnline())})))}unmount(){var e,t;$i(this,Gn)._--,C(this,Gn)===0&&((e=C(this,Bs))==null||e.call(this),B(this,Bs,void 0),(t=C(this,Ws))==null||t.call(this),B(this,Ws,void 0))}isFetching(e){return C(this,ge).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return C(this,Qn).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=C(this,ge).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=C(this,ge).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Xu(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return C(this,ge).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=C(this,ge).get(r.queryHash),o=s==null?void 0:s.state.data,i=RC(t,o);if(i!==void 0)return C(this,ge).build(this,r).setData(i,{...n,manual:!0})}setQueriesData(e,t,n){return Ye.batch(()=>C(this,ge).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=C(this,ge).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=C(this,ge);Ye.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=C(this,ge);return Ye.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Ye.batch(()=>C(this,ge).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(It).catch(It)}invalidateQueries(e,t={}){return Ye.batch(()=>(C(this,ge).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Ye.batch(()=>C(this,ge).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,n);return n.throwOnError||(o=o.catch(It)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(It)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=C(this,ge).build(this,t);return n.isStaleByTime(Xu(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(It).catch(It)}fetchInfiniteQuery(e){return e.behavior=Bp(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(It).catch(It)}ensureInfiniteQueryData(e){return e.behavior=Bp(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ol.isOnline()?C(this,Qn).resumePausedMutations():Promise.resolve()}getQueryCache(){return C(this,ge)}getMutationCache(){return C(this,Qn)}getDefaultOptions(){return C(this,Kn)}setDefaultOptions(e){B(this,Kn,e)}setQueryDefaults(e,t){C(this,Us).set(pi(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...C(this,Us).values()],n={};return t.forEach(r=>{mi(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){C(this,zs).set(pi(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...C(this,zs).values()],n={};return t.forEach(r=>{mi(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...C(this,Kn).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Nf(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Of&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...C(this,Kn).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){C(this,ge).clear(),C(this,Qn).clear()}},ge=new WeakMap,Qn=new WeakMap,Kn=new WeakMap,Us=new WeakMap,zs=new WeakMap,Gn=new WeakMap,Bs=new WeakMap,Ws=new WeakMap,Pm),k0=y.createContext(void 0),NO=e=>{const t=y.useContext(k0);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},tT=({client:e,children:t})=>(y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(k0.Provider,{value:e,children:t}));/** * @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 gi(){return gi=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function E0(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function rT(){return Math.random().toString(36).substr(2,8)}function Vp(e,t){return{usr:e.state,key:e.key,idx:t}}function ed(e,t,n,r){return n===void 0&&(n=null),gi({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ao(t):t,{state:n,key:t&&t.key||r||rT()})}function il(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 ao(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 sT(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:o=!1}=r,i=s.history,a=Xn.Pop,l=null,c=d();c==null&&(c=0,i.replaceState(gi({},i.state,{idx:c}),""));function d(){return(i.state||{idx:null}).idx}function f(){a=Xn.Pop;let b=d(),v=b==null?null:b-c;c=b,l&&l({action:a,location:w.location,delta:v})}function p(b,v){a=Xn.Push;let m=ed(w.location,b,v);c=d()+1;let g=Vp(m,c),_=w.createHref(m);try{i.pushState(g,"",_)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;s.location.assign(_)}o&&l&&l({action:a,location:w.location,delta:1})}function h(b,v){a=Xn.Replace;let m=ed(w.location,b,v);c=d();let g=Vp(m,c),_=w.createHref(m);i.replaceState(g,"",_),o&&l&&l({action:a,location:w.location,delta:0})}function x(b){let v=s.location.origin!=="null"?s.location.origin:s.location.href,m=typeof b=="string"?b:il(b);return m=m.replace(/ $/,"%20"),xe(v,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,v)}let w={get action(){return a},get location(){return e(s,i)},listen(b){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(Hp,f),l=b,()=>{s.removeEventListener(Hp,f),l=null}},createHref(b){return t(s,b)},createURL:x,encodeLocation(b){let v=x(b);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:p,replace:h,go(b){return i.go(b)}};return w}var qp;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(qp||(qp={}));function oT(e,t,n){return n===void 0&&(n="/"),iT(e,t,n,!1)}function iT(e,t,n,r){let s=typeof t=="string"?ao(t):t,o=Rf(s.pathname||"/",n);if(o==null)return null;let i=C0(e);aT(i);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};l.relativePath.startsWith("/")&&(xe(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 c=ar([r,l.relativePath]),d=n.concat(l);o.children&&o.children.length>0&&(xe(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),C0(o.children,t,d,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:pT(c,o.index),routesMeta:d})};return e.forEach((o,i)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))s(o,i);else for(let l of T0(o.path))s(o,i,l)}),t}function T0(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return s?[o,""]:[o];let i=T0(r.join("/")),a=[];return a.push(...i.map(l=>l===""?o:[o,l].join("/"))),s&&a.push(...i),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function aT(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:mT(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const lT=/^:[\w-]+$/,cT=3,uT=2,dT=1,fT=10,hT=-2,Qp=e=>e==="*";function pT(e,t){let n=e.split("/"),r=n.length;return n.some(Qp)&&(r+=hT),t&&(r+=uT),n.filter(s=>!Qp(s)).reduce((s,o)=>s+(lT.test(o)?cT:o===""?dT:fT),r)}function mT(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function gT(e,t,n){let{routesMeta:r}=e,s={},o="/",i=[];for(let a=0;a{let{paramName:p,isOptional:h}=d;if(p==="*"){let w=a[f]||"";i=o.slice(0,o.length-w.length).replace(/(.)\/+$/,"$1")}const x=a[f];return h&&!x?c[p]=void 0:c[p]=(x||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:i,pattern:e}}function vT(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),E0(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=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function yT(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return E0(!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 Rf(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 wT(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?ao(e):e;return{pathname:n?n.startsWith("/")?n:xT(n,t):t,search:ST(r),hash:kT(s)}}function xT(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Ac(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 bT(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Af(e,t){let n=bT(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function If(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=ao(e):(s=gi({},e),xe(!s.pathname||!s.pathname.includes("?"),Ac("?","pathname","search",s)),xe(!s.pathname||!s.pathname.includes("#"),Ac("#","pathname","hash",s)),xe(!s.search||!s.search.includes("#"),Ac("#","search","hash",s)));let o=e===""||s.pathname==="",i=o?"/":s.pathname,a;if(i==null)a=n;else{let f=t.length-1;if(!r&&i.startsWith("..")){let p=i.split("/");for(;p[0]==="..";)p.shift(),f-=1;s.pathname=p.join("/")}a=f>=0?t[f]:"/"}let l=wT(s,a),c=i&&i!=="/"&&i.endsWith("/"),d=(o||i===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||d)&&(l.pathname+="/"),l}const ar=e=>e.join("/").replace(/\/\/+/g,"/"),_T=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),ST=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,kT=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function ET(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const j0=["post","put","patch","delete"];new Set(j0);const CT=["get",...j0];new Set(CT);/** * 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 vi(){return vi=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),y.useCallback(function(c,d){if(d===void 0&&(d={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let f=If(c,JSON.parse(i),o,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:ar([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,i,o,e])}function OO(){let{matches:e}=y.useContext(Cn),t=e[e.length-1];return t?t.params:{}}function O0(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=y.useContext(vr),{matches:s}=y.useContext(Cn),{pathname:o}=yr(),i=JSON.stringify(Af(s,r.v7_relativeSplatPath));return y.useMemo(()=>If(e,JSON.parse(i),o,n==="path"),[e,i,o,n])}function NT(e,t){return OT(e,t)}function OT(e,t,n,r){lo()||xe(!1);let{navigator:s}=y.useContext(vr),{matches:o}=y.useContext(Cn),i=o[o.length-1],a=i?i.params:{};i&&i.pathname;let l=i?i.pathnameBase:"/";i&&i.route;let c=yr(),d;if(t){var f;let b=typeof t=="string"?ao(t):t;l==="/"||(f=b.pathname)!=null&&f.startsWith(l)||xe(!1),d=b}else d=c;let p=d.pathname||"/",h=p;if(l!=="/"){let b=l.replace(/^\//,"").split("/");h="/"+p.replace(/^\//,"").split("/").slice(b.length).join("/")}let x=oT(e,{pathname:h}),w=LT(x&&x.map(b=>Object.assign({},b,{params:Object.assign({},a,b.params),pathname:ar([l,s.encodeLocation?s.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?l:ar([l,s.encodeLocation?s.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),o,n,r);return t&&w?y.createElement(Dl.Provider,{value:{location:vi({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Xn.Pop}},w):w}function RT(){let e=UT(),t=ET(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:s},n):null,null)}const AT=y.createElement(RT,null);class IT extends y.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?y.createElement(Cn.Provider,{value:this.props.routeContext},y.createElement(P0.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function MT(e){let{routeContext:t,match:n,children:r}=e,s=y.useContext(Mf);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),y.createElement(Cn.Provider,{value:t},r)}function LT(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let i=e,a=(s=n)==null?void 0:s.errors;if(a!=null){let d=i.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);d>=0||xe(!1),i=i.slice(0,Math.min(i.length,d+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?i=i.slice(0,c+1):i=[i[0]];break}}}return i.reduceRight((d,f,p)=>{let h,x=!1,w=null,b=null;n&&(h=a&&f.route.id?a[f.route.id]:void 0,w=f.route.errorElement||AT,l&&(c<0&&p===0?(x=!0,b=null):c===p&&(x=!0,b=f.route.hydrateFallbackElement||null)));let v=t.concat(i.slice(0,p+1)),m=()=>{let g;return h?g=w:x?g=b:f.route.Component?g=y.createElement(f.route.Component,null):f.route.element?g=f.route.element:g=d,y.createElement(MT,{match:f,routeContext:{outlet:d,matches:v,isDataRoute:n!=null},children:g})};return n&&(f.route.ErrorBoundary||f.route.errorElement||p===0)?y.createElement(IT,{location:n.location,revalidation:n.revalidation,component:w,error:h,children:m(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):m()},null)}var R0=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(R0||{}),al=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}(al||{});function $T(e){let t=y.useContext(Mf);return t||xe(!1),t}function DT(e){let t=y.useContext(TT);return t||xe(!1),t}function FT(e){let t=y.useContext(Cn);return t||xe(!1),t}function A0(e){let t=FT(),n=t.matches[t.matches.length-1];return n.route.id||xe(!1),n.route.id}function UT(){var e;let t=y.useContext(P0),n=DT(al.UseRouteError),r=A0(al.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function zT(){let{router:e}=$T(R0.UseNavigateStable),t=A0(al.UseNavigateStable),n=y.useRef(!1);return N0(()=>{n.current=!0}),y.useCallback(function(s,o){o===void 0&&(o={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,vi({fromRouteId:t},o)))},[e,t])}function BT(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function WT(e){let{to:t,replace:n,state:r,relative:s}=e;lo()||xe(!1);let{future:o,static:i}=y.useContext(vr),{matches:a}=y.useContext(Cn),{pathname:l}=yr(),c=Lf(),d=If(t,Af(a,o.v7_relativeSplatPath),l,s==="path"),f=JSON.stringify(d);return y.useEffect(()=>c(JSON.parse(f),{replace:n,state:r,relative:s}),[c,f,s,n,r]),null}function qe(e){xe(!1)}function HT(e){let{basename:t="/",children:n=null,location:r,navigationType:s=Xn.Pop,navigator:o,static:i=!1,future:a}=e;lo()&&xe(!1);let l=t.replace(/^\/*/,"/"),c=y.useMemo(()=>({basename:l,navigator:o,static:i,future:vi({v7_relativeSplatPath:!1},a)}),[l,a,o,i]);typeof r=="string"&&(r=ao(r));let{pathname:d="/",search:f="",hash:p="",state:h=null,key:x="default"}=r,w=y.useMemo(()=>{let b=Rf(d,l);return b==null?null:{location:{pathname:b,search:f,hash:p,state:h,key:x},navigationType:s}},[l,d,f,p,h,x,s]);return w==null?null:y.createElement(vr.Provider,{value:c},y.createElement(Dl.Provider,{children:n,value:w}))}function VT(e){let{children:t,location:n}=e;return NT(td(t),n)}new Promise(()=>{});function td(e,t){t===void 0&&(t=[]);let n=[];return y.Children.forEach(e,(r,s)=>{if(!y.isValidElement(r))return;let o=[...t,s];if(r.type===y.Fragment){n.push.apply(n,td(r.props.children,o));return}r.type!==qe&&xe(!1),!r.props.index||!r.props.children||xe(!1);let i={id:r.props.id||o.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&&(i.children=td(r.props.children,o)),n.push(i)}),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 */function nd(){return nd=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[s]=e[s]);return n}function QT(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function KT(e,t){return e.button===0&&(!t||t==="_self")&&!QT(e)}function rd(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function GT(e,t){let n=rd(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(o=>{n.append(s,o)})}),n}const YT=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],JT="6";try{window.__reactRouterVersion=JT}catch{}const XT="startTransition",Gp=Um[XT];function ZT(e){let{basename:t,children:n,future:r,window:s}=e,o=y.useRef();o.current==null&&(o.current=nT({window:s,v5Compat:!0}));let i=o.current,[a,l]=y.useState({action:i.action,location:i.location}),{v7_startTransition:c}=r||{},d=y.useCallback(f=>{c&&Gp?Gp(()=>l(f)):l(f)},[l,c]);return y.useLayoutEffect(()=>i.listen(d),[i,d]),y.useEffect(()=>BT(r),[r]),y.createElement(HT,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:i,future:r})}const ej=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",tj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ke=y.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:o,replace:i,state:a,target:l,to:c,preventScrollReset:d,viewTransition:f}=t,p=qT(t,YT),{basename:h}=y.useContext(vr),x,w=!1;if(typeof c=="string"&&tj.test(c)&&(x=c,ej))try{let g=new URL(window.location.href),_=c.startsWith("//")?new URL(g.protocol+c):new URL(c),S=Rf(_.pathname,h);_.origin===g.origin&&S!=null?c=S+_.search+_.hash:w=!0}catch{}let b=jT(c,{relative:s}),v=nj(c,{replace:i,state:a,target:l,preventScrollReset:d,relative:s,viewTransition:f});function m(g){r&&r(g),g.defaultPrevented||v(g)}return y.createElement("a",nd({},p,{href:x||b,onClick:w||o?r:m,ref:n,target:l}))});var Yp;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Yp||(Yp={}));var Jp;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Jp||(Jp={}));function nj(e,t){let{target:n,replace:r,state:s,preventScrollReset:o,relative:i,viewTransition:a}=t===void 0?{}:t,l=Lf(),c=yr(),d=O0(e,{relative:i});return y.useCallback(f=>{if(KT(f,n)){f.preventDefault();let p=r!==void 0?r:il(c)===il(d);l(e,{replace:p,state:s,preventScrollReset:o,relative:i,viewTransition:a})}},[c,l,d,r,s,n,e,o,i,a])}function RO(e){let t=y.useRef(rd(e)),n=y.useRef(!1),r=yr(),s=y.useMemo(()=>GT(r.search,n.current?null:t.current),[r.search]),o=Lf(),i=y.useCallback((a,l)=>{const c=rd(typeof a=="function"?a(s):a);n.current=!0,o("?"+c,l)},[o,s]);return[s,i]}const rj=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...n)=>He(async()=>{const{default:r}=await Promise.resolve().then(()=>co);return{default:r}},void 0).then(({default:r})=>r(...n)):t=fetch,(...n)=>t(...n)};class $f extends Error{constructor(t,n="FunctionsError",r){super(t),this.name=n,this.context=r}}class sj extends $f{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class Xp extends $f{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class Zp extends $f{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var sd;(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"})(sd||(sd={}));var oj=function(e,t,n,r){function s(o){return o instanceof n?o:new n(function(i){i(o)})}return new(n||(n=Promise))(function(o,i){function a(d){try{c(r.next(d))}catch(f){i(f)}}function l(d){try{c(r.throw(d))}catch(f){i(f)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((r=r.apply(e,t||[])).next())})};class ij{constructor(t,{headers:n={},customFetch:r,region:s=sd.Any}={}){this.url=t,this.headers=n,this.region=s,this.fetch=rj(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t,n={}){var r;return oj(this,void 0,void 0,function*(){try{const{headers:s,method:o,body:i}=n;let a={},{region:l}=n;l||(l=this.region);const c=new URL(`${this.url}/${t}`);l&&l!=="any"&&(a["x-region"]=l,c.searchParams.set("forceFunctionRegion",l));let d;i&&(s&&!Object.prototype.hasOwnProperty.call(s,"Content-Type")||!s)&&(typeof Blob<"u"&&i instanceof Blob||i instanceof ArrayBuffer?(a["Content-Type"]="application/octet-stream",d=i):typeof i=="string"?(a["Content-Type"]="text/plain",d=i):typeof FormData<"u"&&i instanceof FormData?d=i:(a["Content-Type"]="application/json",d=JSON.stringify(i)));const f=yield this.fetch(c.toString(),{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},a),this.headers),s),body:d}).catch(w=>{throw new sj(w)}),p=f.headers.get("x-relay-error");if(p&&p==="true")throw new Xp(f);if(!f.ok)throw new Zp(f);let h=((r=f.headers.get("Content-Type"))!==null&&r!==void 0?r:"text/plain").split(";")[0].trim(),x;return h==="application/json"?x=yield f.json():h==="application/octet-stream"?x=yield f.blob():h==="text/event-stream"?x=f:h==="multipart/form-data"?x=yield f.formData():x=yield f.text(),{data:x,error:null,response:f}}catch(s){return{data:null,error:s,response:s instanceof Zp||s instanceof Xp?s.context:void 0}}})}}var rt={},Df={},Fl={},Ri={},Ul={},zl={},aj=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")},Zs=aj();const lj=Zs.fetch,I0=Zs.fetch.bind(Zs),M0=Zs.Headers,cj=Zs.Request,uj=Zs.Response,co=Object.freeze(Object.defineProperty({__proto__:null,Headers:M0,Request:cj,Response:uj,default:I0,fetch:lj},Symbol.toStringTag,{value:"Module"})),dj=Tw(co);var Bl={};Object.defineProperty(Bl,"__esModule",{value:!0});let fj=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}};Bl.default=fj;var L0=kt&&kt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(zl,"__esModule",{value:!0});const hj=L0(dj),pj=L0(Bl);let mj=class{constructor(t){var n,r;this.shouldThrowOnError=!1,this.method=t.method,this.url=t.url,this.headers=new Headers(t.headers),this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=(n=t.shouldThrowOnError)!==null&&n!==void 0?n:!1,this.signal=t.signal,this.isMaybeSingle=(r=t.isMaybeSingle)!==null&&r!==void 0?r:!1,t.fetch?this.fetch=t.fetch:typeof fetch>"u"?this.fetch=hj.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,n){return this.headers=new Headers(this.headers),this.headers.set(t,n),this}then(t,n){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const r=this.fetch;let s=r(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async o=>{var i,a,l,c;let d=null,f=null,p=null,h=o.status,x=o.statusText;if(o.ok){if(this.method!=="HEAD"){const m=await o.text();m===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&(!((i=this.headers.get("Accept"))===null||i===void 0)&&i.includes("application/vnd.pgrst.plan+text"))?f=m:f=JSON.parse(m))}const b=(a=this.headers.get("Prefer"))===null||a===void 0?void 0:a.match(/count=(exact|planned|estimated)/),v=(l=o.headers.get("content-range"))===null||l===void 0?void 0:l.split("/");b&&v&&v.length>1&&(p=parseInt(v[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(f)&&(f.length>1?(d={code:"PGRST116",details:`Results contain ${f.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},f=null,p=null,h=406,x="Not Acceptable"):f.length===1?f=f[0]:f=null)}else{const b=await o.text();try{d=JSON.parse(b),Array.isArray(d)&&o.status===404&&(f=[],d=null,h=200,x="OK")}catch{o.status===404&&b===""?(h=204,x="No Content"):d={message:b}}if(d&&this.isMaybeSingle&&(!((c=d==null?void 0:d.details)===null||c===void 0)&&c.includes("0 rows"))&&(d=null,h=200,x="OK"),d&&this.shouldThrowOnError)throw new pj.default(d)}return{error:d,data:f,count:p,status:h,statusText:x}});return this.shouldThrowOnError||(s=s.catch(o=>{var i,a,l;return{error:{message:`${(i=o==null?void 0:o.name)!==null&&i!==void 0?i:"FetchError"}: ${o==null?void 0:o.message}`,details:`${(a=o==null?void 0:o.stack)!==null&&a!==void 0?a:""}`,hint:"",code:`${(l=o==null?void 0:o.code)!==null&&l!==void 0?l:""}`},data:null,count:null,status:0,statusText:""}})),s.then(t,n)}returns(){return this}overrideTypes(){return this}};zl.default=mj;var gj=kt&&kt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ul,"__esModule",{value:!0});const vj=gj(zl);let yj=class extends vj.default{select(t){let n=!1;const r=(t??"*").split("").map(s=>/\s/.test(s)&&!n?"":(s==='"'&&(n=!n),s)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(t,{ascending:n=!0,nullsFirst:r,foreignTable:s,referencedTable:o=s}={}){const i=o?`${o}.order`:"order",a=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${a?`${a},`:""}${t}.${n?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:n,referencedTable:r=n}={}){const s=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(s,`${t}`),this}range(t,n,{foreignTable:r,referencedTable:s=r}={}){const o=typeof s>"u"?"offset":`${s}.offset`,i=typeof s>"u"?"limit":`${s}.limit`;return this.url.searchParams.set(o,`${t}`),this.url.searchParams.set(i,`${n-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:t=!1,verbose:n=!1,settings:r=!1,buffers:s=!1,wal:o=!1,format:i="text"}={}){var a;const l=[t?"analyze":null,n?"verbose":null,r?"settings":null,s?"buffers":null,o?"wal":null].filter(Boolean).join("|"),c=(a=this.headers.get("Accept"))!==null&&a!==void 0?a:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${i}; for="${c}"; options=${l};`),i==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(t){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${t}`),this}};Ul.default=yj;var wj=kt&&kt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ri,"__esModule",{value:!0});const xj=wj(Ul);let bj=class extends xj.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(s=>typeof s=="string"&&new RegExp("[,()]").test(s)?`"${s}"`:`${s}`).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:s}={}){let o="";s==="plain"?o="pl":s==="phrase"?o="ph":s==="websearch"&&(o="w");const i=r===void 0?"":`(${r})`;return this.url.searchParams.append(t,`${o}fts${i}.${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 s=r?`${r}.or`:"or";return this.url.searchParams.append(s,`(${t})`),this}filter(t,n,r){return this.url.searchParams.append(t,`${n}.${r}`),this}};Ri.default=bj;var _j=kt&&kt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Fl,"__esModule",{value:!0});const Co=_j(Ri);let Sj=class{constructor(t,{headers:n={},schema:r,fetch:s}){this.url=t,this.headers=new Headers(n),this.schema=r,this.fetch=s}select(t,{head:n=!1,count:r}={}){const s=n?"HEAD":"GET";let o=!1;const i=(t??"*").split("").map(a=>/\s/.test(a)&&!o?"":(a==='"'&&(o=!o),a)).join("");return this.url.searchParams.set("select",i),r&&this.headers.append("Prefer",`count=${r}`),new Co.default({method:s,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(t,{count:n,defaultToNull:r=!0}={}){var s;const o="POST";if(n&&this.headers.append("Prefer",`count=${n}`),r||this.headers.append("Prefer","missing=default"),Array.isArray(t)){const i=t.reduce((a,l)=>a.concat(Object.keys(l)),[]);if(i.length>0){const a=[...new Set(i)].map(l=>`"${l}"`);this.url.searchParams.set("columns",a.join(","))}}return new Co.default({method:o,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch})}upsert(t,{onConflict:n,ignoreDuplicates:r=!1,count:s,defaultToNull:o=!0}={}){var i;const a="POST";if(this.headers.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),n!==void 0&&this.url.searchParams.set("on_conflict",n),s&&this.headers.append("Prefer",`count=${s}`),o||this.headers.append("Prefer","missing=default"),Array.isArray(t)){const l=t.reduce((c,d)=>c.concat(Object.keys(d)),[]);if(l.length>0){const c=[...new Set(l)].map(d=>`"${d}"`);this.url.searchParams.set("columns",c.join(","))}}return new Co.default({method:a,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch})}update(t,{count:n}={}){var r;const s="PATCH";return n&&this.headers.append("Prefer",`count=${n}`),new Co.default({method:s,url:this.url,headers:this.headers,schema:this.schema,body:t,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch})}delete({count:t}={}){var n;const r="DELETE";return t&&this.headers.append("Prefer",`count=${t}`),new Co.default({method:r,url:this.url,headers:this.headers,schema:this.schema,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}};Fl.default=Sj;var $0=kt&&kt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Df,"__esModule",{value:!0});const kj=$0(Fl),Ej=$0(Ri);let Cj=class D0{constructor(t,{headers:n={},schema:r,fetch:s}={}){this.url=t,this.headers=new Headers(n),this.schemaName=r,this.fetch=s}from(t){const n=new URL(`${this.url}/${t}`);return new kj.default(n,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(t){return new D0(this.url,{headers:this.headers,schema:t,fetch:this.fetch})}rpc(t,n={},{head:r=!1,get:s=!1,count:o}={}){var i;let a;const l=new URL(`${this.url}/rpc/${t}`);let c;r||s?(a=r?"HEAD":"GET",Object.entries(n).filter(([f,p])=>p!==void 0).map(([f,p])=>[f,Array.isArray(p)?`{${p.join(",")}}`:`${p}`]).forEach(([f,p])=>{l.searchParams.append(f,p)})):(a="POST",c=n);const d=new Headers(this.headers);return o&&d.set("Prefer",`count=${o}`),new Ej.default({method:a,url:l,headers:d,schema:this.schemaName,body:c,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch})}};Df.default=Cj;var uo=kt&&kt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(rt,"__esModule",{value:!0});rt.PostgrestError=rt.PostgrestBuilder=rt.PostgrestTransformBuilder=rt.PostgrestFilterBuilder=rt.PostgrestQueryBuilder=rt.PostgrestClient=void 0;const F0=uo(Df);rt.PostgrestClient=F0.default;const U0=uo(Fl);rt.PostgrestQueryBuilder=U0.default;const z0=uo(Ri);rt.PostgrestFilterBuilder=z0.default;const B0=uo(Ul);rt.PostgrestTransformBuilder=B0.default;const W0=uo(zl);rt.PostgrestBuilder=W0.default;const H0=uo(Bl);rt.PostgrestError=H0.default;var Tj=rt.default={PostgrestClient:F0.default,PostgrestQueryBuilder:U0.default,PostgrestFilterBuilder:z0.default,PostgrestTransformBuilder:B0.default,PostgrestBuilder:W0.default,PostgrestError:H0.default};const{PostgrestClient:jj,PostgrestQueryBuilder:DO,PostgrestFilterBuilder:FO,PostgrestTransformBuilder:UO,PostgrestBuilder:zO,PostgrestError:BO}=Tj;class Pj{static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};if(typeof process<"u"){const n=process.versions;if(n&&n.node){const r=n.node,s=parseInt(r.replace(/^v/,"").split(".")[0]);return s>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${s} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${s} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option: import ws from "ws" new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.constructor)return t.constructor;let n=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(n+=` Suggested solution: ${t.workaround}`),new Error(n)}static createWebSocket(t,n){const r=this.getWebSocketConstructor();return new r(t,n)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const Nj="2.15.5",Oj=`realtime-js/${Nj}`,Rj="1.0.0",od=1e4,Aj=1e3,Ij=100;var qo;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(qo||(qo={}));var Se;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(Se||(Se={}));var Dt;(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"})(Dt||(Dt={}));var id;(function(e){e.websocket="websocket"})(id||(id={}));var Pr;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(Pr||(Pr={}));class Mj{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 s=n.getUint8(1),o=n.getUint8(2);let i=this.HEADER_LENGTH+2;const a=r.decode(t.slice(i,i+s));i=i+s;const l=r.decode(t.slice(i,i+o));i=i+o;const c=JSON.parse(r.decode(t.slice(i,t.byteLength)));return{ref:null,topic:a,event:l,payload:c}}}class V0{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),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var ie;(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"})(ie||(ie={}));const em=(e,t,n={})=>{var r;const s=(r=n.skipTypes)!==null&&r!==void 0?r:[];return Object.keys(t).reduce((o,i)=>(o[i]=Lj(i,e,t,s),o),{})},Lj=(e,t,n,r)=>{const s=t.find(a=>a.name===e),o=s==null?void 0:s.type,i=n[e];return o&&!r.includes(o)?q0(o,i):ad(i)},q0=(e,t)=>{if(e.charAt(0)==="_"){const n=e.slice(1,e.length);return Uj(t,n)}switch(e){case ie.bool:return $j(t);case ie.float4:case ie.float8:case ie.int2:case ie.int4:case ie.int8:case ie.numeric:case ie.oid:return Dj(t);case ie.json:case ie.jsonb:return Fj(t);case ie.timestamp:return zj(t);case ie.abstime:case ie.date:case ie.daterange:case ie.int4range:case ie.int8range:case ie.money:case ie.reltime:case ie.text:case ie.time:case ie.timestamptz:case ie.timetz:case ie.tsrange:case ie.tstzrange:return ad(t);default:return ad(t)}},ad=e=>e,$j=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},Dj=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},Fj=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch(t){return console.log(`JSON parse error: ${t}`),e}return e},Uj=(e,t)=>{if(typeof e!="string")return e;const n=e.length-1,r=e[n];if(e[0]==="{"&&r==="}"){let o;const i=e.slice(1,n);try{o=JSON.parse("["+i+"]")}catch{o=i?i.split(","):[]}return o.map(a=>q0(t,a))}return e},zj=e=>typeof e=="string"?e.replace(" ","T"):e,Q0=e=>{let t=e;return t=t.replace(/^ws/i,"http"),t=t.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),t.replace(/\/+$/,"")+"/api/broadcast"};class Ic{constructor(t,n,r={},s=od){this.channel=t,this.event=n,this.payload=r,this.timeout=s,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 tm;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(tm||(tm={}));class Qo{constructor(t,n){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const r=(n==null?void 0:n.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},s=>{const{onJoin:o,onLeave:i,onSync:a}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Qo.syncState(this.state,s,o,i),this.pendingDiffs.forEach(l=>{this.state=Qo.syncDiff(this.state,l,o,i)}),this.pendingDiffs=[],a()}),this.channel._on(r.diff,{},s=>{const{onJoin:o,onLeave:i,onSync:a}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=Qo.syncDiff(this.state,s,o,i),a())}),this.onJoin((s,o,i)=>{this.channel._trigger("presence",{event:"join",key:s,currentPresences:o,newPresences:i})}),this.onLeave((s,o,i)=>{this.channel._trigger("presence",{event:"leave",key:s,currentPresences:o,leftPresences:i})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,n,r,s){const o=this.cloneDeep(t),i=this.transformState(n),a={},l={};return this.map(o,(c,d)=>{i[c]||(l[c]=d)}),this.map(i,(c,d)=>{const f=o[c];if(f){const p=d.map(b=>b.presence_ref),h=f.map(b=>b.presence_ref),x=d.filter(b=>h.indexOf(b.presence_ref)<0),w=f.filter(b=>p.indexOf(b.presence_ref)<0);x.length>0&&(a[c]=x),w.length>0&&(l[c]=w)}else a[c]=d}),this.syncDiff(o,{joins:a,leaves:l},r,s)}static syncDiff(t,n,r,s){const{joins:o,leaves:i}={joins:this.transformState(n.joins),leaves:this.transformState(n.leaves)};return r||(r=()=>{}),s||(s=()=>{}),this.map(o,(a,l)=>{var c;const d=(c=t[a])!==null&&c!==void 0?c:[];if(t[a]=this.cloneDeep(l),d.length>0){const f=t[a].map(h=>h.presence_ref),p=d.filter(h=>f.indexOf(h.presence_ref)<0);t[a].unshift(...p)}r(a,d,l)}),this.map(i,(a,l)=>{let c=t[a];if(!c)return;const d=l.map(f=>f.presence_ref);c=c.filter(f=>d.indexOf(f.presence_ref)<0),t[a]=c,s(a,c,l),c.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 s=t[r];return"metas"in s?n[r]=s.metas.map(o=>(o.presence_ref=o.phx_ref,delete o.phx_ref,delete o.phx_ref_prev,o)):n[r]=s,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 nm;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(nm||(nm={}));var Ko;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(Ko||(Ko={}));var hn;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(hn||(hn={}));class Ff{constructor(t,n={config:{}},r){this.topic=t,this.params=n,this.socket=r,this.bindings={},this.state=Se.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},n.config),this.timeout=this.socket.timeout,this.joinPush=new Ic(this,Dt.join,this.params,this.timeout),this.rejoinTimer=new V0(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Se.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(s=>s.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Se.closed,this.socket._remove(this)}),this._onError(s=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,s),this.state=Se.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Se.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",s=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,s),this.state=Se.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Dt.reply,{},(s,o)=>{this._trigger(this._replyEventName(o),s)}),this.presence=new Qo(this),this.broadcastEndpointURL=Q0(this.socket.endPoint),this.private=this.params.config.private||!1}subscribe(t,n=this.timeout){var r,s,o;if(this.socket.isConnected()||this.socket.connect(),this.state==Se.closed){const{config:{broadcast:i,presence:a,private:l}}=this.params,c=(s=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(h=>h.filter))!==null&&s!==void 0?s:[],d=!!this.bindings[Ko.PRESENCE]&&this.bindings[Ko.PRESENCE].length>0||((o=this.params.config.presence)===null||o===void 0?void 0:o.enabled)===!0,f={},p={broadcast:i,presence:Object.assign(Object.assign({},a),{enabled:d}),postgres_changes:c,private:l};this.socket.accessTokenValue&&(f.access_token=this.socket.accessTokenValue),this._onError(h=>t==null?void 0:t(hn.CHANNEL_ERROR,h)),this._onClose(()=>t==null?void 0:t(hn.CLOSED)),this.updateJoinPayload(Object.assign({config:p},f)),this.joinedOnce=!0,this._rejoin(n),this.joinPush.receive("ok",async({postgres_changes:h})=>{var x;if(this.socket.setAuth(),h===void 0){t==null||t(hn.SUBSCRIBED);return}else{const w=this.bindings.postgres_changes,b=(x=w==null?void 0:w.length)!==null&&x!==void 0?x:0,v=[];for(let m=0;m{this.state=Se.errored,t==null||t(hn.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(h).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(hn.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.state===Se.joined&&t===Ko.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(()=>this.subscribe())),this._on(t,n,r)}async send(t,n={}){var r,s;if(!this._canPush()&&t.type==="broadcast"){const{event:o,payload:i}=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:o,payload:i,private:this.private}]})};try{const c=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((s=c.body)===null||s===void 0?void 0:s.cancel()),c.ok?"ok":"error"}catch(c){return c.name==="AbortError"?"timed out":"error"}}else return new Promise(o=>{var i,a,l;const c=this._push(t.type,t,n.timeout||this.timeout);t.type==="broadcast"&&!(!((l=(a=(i=this.params)===null||i===void 0?void 0:i.config)===null||a===void 0?void 0:a.broadcast)===null||l===void 0)&&l.ack)&&o("ok"),c.receive("ok",()=>o("ok")),c.receive("error",()=>o("error")),c.receive("timeout",()=>o("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=Se.leaving;const n=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Dt.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(s=>{r=new Ic(this,Dt.leave,{},t),r.receive("ok",()=>{n(),s("ok")}).receive("timeout",()=>{n(),s("timed out")}).receive("error",()=>{s("error")}),r.send(),this._canPush()||r.trigger("ok",{})}).finally(()=>{r==null||r.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Se.closed,this.bindings={}}async _fetchWithTimeout(t,n,r){const s=new AbortController,o=setTimeout(()=>s.abort(),r),i=await this.socket.fetch(t,Object.assign(Object.assign({},n),{signal:s.signal}));return clearTimeout(o),i}_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 s=new Ic(this,t,n,r);return this._canPush()?s.send():this._addToPushBuffer(s),s}_addToPushBuffer(t){if(t.startTimeout(),this.pushBuffer.push(t),this.pushBuffer.length>Ij){const n=this.pushBuffer.shift();n&&(n.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${n.event}`,n.payload))}}_onMessage(t,n,r){return n}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,n,r){var s,o;const i=t.toLocaleLowerCase(),{close:a,error:l,leave:c,join:d}=Dt;if(r&&[a,l,c,d].indexOf(i)>=0&&r!==this._joinRef())return;let p=this._onMessage(i,n,r);if(n&&!p)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(i)?(s=this.bindings.postgres_changes)===null||s===void 0||s.filter(h=>{var x,w,b;return((x=h.filter)===null||x===void 0?void 0:x.event)==="*"||((b=(w=h.filter)===null||w===void 0?void 0:w.event)===null||b===void 0?void 0:b.toLocaleLowerCase())===i}).map(h=>h.callback(p,r)):(o=this.bindings[i])===null||o===void 0||o.filter(h=>{var x,w,b,v,m,g;if(["broadcast","presence","postgres_changes"].includes(i))if("id"in h){const _=h.id,S=(x=h.filter)===null||x===void 0?void 0:x.event;return _&&((w=n.ids)===null||w===void 0?void 0:w.includes(_))&&(S==="*"||(S==null?void 0:S.toLocaleLowerCase())===((b=n.data)===null||b===void 0?void 0:b.type.toLocaleLowerCase()))}else{const _=(m=(v=h==null?void 0:h.filter)===null||v===void 0?void 0:v.event)===null||m===void 0?void 0:m.toLocaleLowerCase();return _==="*"||_===((g=n==null?void 0:n.event)===null||g===void 0?void 0:g.toLocaleLowerCase())}else return h.type.toLocaleLowerCase()===i}).map(h=>{if(typeof p=="object"&&"ids"in p){const x=p.data,{schema:w,table:b,commit_timestamp:v,type:m,errors:g}=x;p=Object.assign(Object.assign({},{schema:w,table:b,commit_timestamp:v,eventType:m,new:{},old:{},errors:g}),this._getPayloadRecords(x))}h.callback(p,r)})}_isClosed(){return this.state===Se.closed}_isJoined(){return this.state===Se.joined}_isJoining(){return this.state===Se.joining}_isLeaving(){return this.state===Se.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,n,r){const s=t.toLocaleLowerCase(),o={type:s,filter:n,callback:r};return this.bindings[s]?this.bindings[s].push(o):this.bindings[s]=[o],this}_off(t,n){const r=t.toLocaleLowerCase();return this.bindings[r]&&(this.bindings[r]=this.bindings[r].filter(s=>{var o;return!(((o=s.type)===null||o===void 0?void 0:o.toLocaleLowerCase())===r&&Ff.isEqual(s.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(Dt.close,{},t)}_onError(t){this._on(Dt.error,{},n=>t(n))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Se.joining,this.joinPush.resend(t))}_getPayloadRecords(t){const n={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(n.new=em(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(n.old=em(t.columns,t.old_record)),n}}const Mc=()=>{},aa={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},Bj=[1e3,2e3,5e3,1e4],Wj=1e4,Hj=` addEventListener("message", (e) => { if (e.data.event === "start") { setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); } });`;class Vj{constructor(t,n){var r;if(this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=od,this.transport=null,this.heartbeatIntervalMs=aa.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=Mc,this.ref=0,this.reconnectTimer=null,this.logger=Mc,this.conn=null,this.sendBuffer=[],this.serializer=new Mj,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._resolveFetch=s=>{let o;return s?o=s:typeof fetch>"u"?o=(...i)=>He(async()=>{const{default:a}=await Promise.resolve().then(()=>co);return{default:a}},void 0).then(({default:a})=>a(...i)).catch(a=>{throw new Error(`Failed to load @supabase/node-fetch: ${a.message}. This is required for HTTP requests in Node.js environments without native fetch.`)}):o=fetch,(...i)=>o(...i)},!(!((r=n==null?void 0:n.params)===null||r===void 0)&&r.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=n.params.apikey,this.endPoint=`${t}/${id.websocket}`,this.httpEndpoint=Q0(t),this._initializeOptions(n),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(n==null?void 0:n.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=Pj.createWebSocket(this.endpointURL())}catch(t){this._setConnectionState("disconnected");const n=t.message;throw n.includes("Node.js")?new Error(`${n} To use Realtime in Node.js, you need to provide a WebSocket implementation: Option 1: Use Node.js 22+ which has native WebSocket support Option 2: Install and provide the "ws" package: npm install ws import ws from "ws" const client = new RealtimeClient(url, { ...options, transport: ws })`):new Error(`WebSocket not available: ${n}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:Rj}))}disconnect(t,n){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const r=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(r),this._setConnectionState("disconnected")},t?this.conn.close(t,n??""):this.conn.close(),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(t){const n=await t.unsubscribe();return 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 qo.connecting:return Pr.Connecting;case qo.open:return Pr.Open;case qo.closing:return Pr.Closing;default:return Pr.Closed}}isConnected(){return this.connectionState()===Pr.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(t,n={config:{}}){const r=`realtime:${t}`,s=this.getChannels().find(o=>o.topic===r);if(s)return s;{const o=new Ff(`realtime:${t}`,n,this);return this.channels.push(o),o}}push(t){const{topic:n,event:r,payload:s,ref:o}=t,i=()=>{this.encode(t,a=>{var l;(l=this.conn)===null||l===void 0||l.send(a)})};this.log("push",`${n} ${r} (${o})`,s),this.isConnected()?i():this.sendBuffer.push(i)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}async sendHeartbeat(){var t;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(n){this.log("error","error in heartbeat callback",n)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(n){this.log("error","error in heartbeat callback",n)}this._wasManualDisconnect=!1,(t=this.conn)===null||t===void 0||t.close(Aj,"heartbeat timeout"),setTimeout(()=>{var n;this.isConnected()||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout()},aa.HEARTBEAT_TIMEOUT_FALLBACK);return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(n){this.log("error","error in heartbeat callback",n)}this._setAuthSafely("heartbeat")}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)}_onConnMessage(t){this.decode(t.data,n=>{if(n.topic==="phoenix"&&n.event==="phx_reply")try{this.heartbeatCallback(n.payload.status==="ok"?"ok":"error")}catch(c){this.log("error","error in heartbeat callback",c)}n.ref&&n.ref===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null);const{topic:r,event:s,payload:o,ref:i}=n,a=i?`(${i})`:"",l=o.status||"";this.log("receive",`${l} ${r} ${s} ${a}`.trim(),o),this.channels.filter(c=>c._isMember(r)).forEach(c=>c._trigger(s,o,i)),this._triggerStateCallbacks("message",n)})}_clearTimer(t){var n;t==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):t==="reconnect"&&((n=this.reconnectTimer)===null||n===void 0||n.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=t=>this._onConnError(t),this.conn.onmessage=t=>this._onConnMessage(t),this.conn.onclose=t=>this._onConnClose(t))}_teardownConnection(){this.conn&&(this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null),this._clearAllTimers(),this.channels.forEach(t=>t.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const 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})}_onConnClose(t){var n;this._setConnectionState("disconnected"),this.log("transport","close",t),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout(),this._triggerStateCallbacks("close",t)}_onConnError(t){this._setConnectionState("disconnected"),this.log("transport",`${t}`),this._triggerChanError(),this._triggerStateCallbacks("error",t)}_triggerChanError(){this.channels.forEach(t=>t._trigger(Dt.error))}_appendParams(t,n){if(Object.keys(n).length===0)return t;const r=t.match(/\?/)?"&":"?",s=new URLSearchParams(n);return`${t}${r}${s}`}_workerObjectUrl(t){let n;if(t)n=t;else{const r=new Blob([Hj],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}_setConnectionState(t,n=!1){this._connectionState=t,t==="connecting"?this._wasManualDisconnect=!1:t==="disconnecting"&&(this._wasManualDisconnect=n)}async _performAuth(t=null){let n;t?n=t:this.accessToken?n=await this.accessToken():n=this.accessTokenValue,this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(r=>{const s={access_token:n,version:Oj};n&&r.updateJoinPayload(s),r.joinedOnce&&r._isJoined()&&r._push(Dt.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this.setAuth().catch(n=>{this.log("error",`error setting auth in ${t}`,n)})}_triggerStateCallbacks(t,n){try{this.stateChangeCallbacks[t].forEach(r=>{try{r(n)}catch(s){this.log("error",`error in ${t} callback`,s)}})}catch(r){this.log("error",`error triggering ${t} callbacks`,r)}}_setupReconnectionTimer(){this.reconnectTimer=new V0(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},aa.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(t){var n,r,s,o,i,a,l,c,d;if(this.transport=(n=t==null?void 0:t.transport)!==null&&n!==void 0?n:null,this.timeout=(r=t==null?void 0:t.timeout)!==null&&r!==void 0?r:od,this.heartbeatIntervalMs=(s=t==null?void 0:t.heartbeatIntervalMs)!==null&&s!==void 0?s:aa.HEARTBEAT_INTERVAL,this.worker=(o=t==null?void 0:t.worker)!==null&&o!==void 0?o:!1,this.accessToken=(i=t==null?void 0:t.accessToken)!==null&&i!==void 0?i:null,this.heartbeatCallback=(a=t==null?void 0:t.heartbeatCallback)!==null&&a!==void 0?a:Mc,t!=null&&t.params&&(this.params=t.params),t!=null&&t.logger&&(this.logger=t.logger),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(l=t==null?void 0:t.reconnectAfterMs)!==null&&l!==void 0?l:f=>Bj[f-1]||Wj,this.encode=(c=t==null?void 0:t.encode)!==null&&c!==void 0?c:(f,p)=>p(JSON.stringify(f)),this.decode=(d=t==null?void 0:t.decode)!==null&&d!==void 0?d:this.serializer.decode.bind(this.serializer),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl}}}class Uf extends Error{constructor(t){super(t),this.__isStorageError=!0,this.name="StorageError"}}function ke(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}class qj extends Uf{constructor(t,n,r){super(t),this.name="StorageApiError",this.status=n,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class ld extends Uf{constructor(t,n){super(t),this.name="StorageUnknownError",this.originalError=n}}var Qj=function(e,t,n,r){function s(o){return o instanceof n?o:new n(function(i){i(o)})}return new(n||(n=Promise))(function(o,i){function a(d){try{c(r.next(d))}catch(f){i(f)}}function l(d){try{c(r.throw(d))}catch(f){i(f)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((r=r.apply(e,t||[])).next())})};const K0=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...n)=>He(async()=>{const{default:r}=await Promise.resolve().then(()=>co);return{default:r}},void 0).then(({default:r})=>r(...n)):t=fetch,(...n)=>t(...n)},Kj=()=>Qj(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield He(()=>Promise.resolve().then(()=>co),void 0)).Response:Response}),cd=e=>{if(Array.isArray(e))return e.map(n=>cd(n));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([n,r])=>{const s=n.replace(/([-_][a-z])/gi,o=>o.toUpperCase().replace(/[-_]/g,""));t[s]=cd(r)}),t},Gj=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)};var Jr=function(e,t,n,r){function s(o){return o instanceof n?o:new n(function(i){i(o)})}return new(n||(n=Promise))(function(o,i){function a(d){try{c(r.next(d))}catch(f){i(f)}}function l(d){try{c(r.throw(d))}catch(f){i(f)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((r=r.apply(e,t||[])).next())})};const Lc=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),Yj=(e,t,n)=>Jr(void 0,void 0,void 0,function*(){const r=yield Kj();e instanceof r&&!(n!=null&&n.noResolveJson)?e.json().then(s=>{const o=e.status||500,i=(s==null?void 0:s.statusCode)||o+"";t(new qj(Lc(s),o,i))}).catch(s=>{t(new ld(Lc(s),s))}):t(new ld(Lc(e),e))}),Jj=(e,t,n,r)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"||!r?s:(Gj(r)?(s.headers=Object.assign({"Content-Type":"application/json"},t==null?void 0:t.headers),s.body=JSON.stringify(r)):s.body=r,t!=null&&t.duplex&&(s.duplex=t.duplex),Object.assign(Object.assign({},s),n))};function Ai(e,t,n,r,s,o){return Jr(this,void 0,void 0,function*(){return new Promise((i,a)=>{e(n,Jj(t,r,s,o)).then(l=>{if(!l.ok)throw l;return r!=null&&r.noResolveJson?l:l.json()}).then(l=>i(l)).catch(l=>Yj(l,a,r))})})}function ll(e,t,n,r){return Jr(this,void 0,void 0,function*(){return Ai(e,"GET",t,n,r)})}function Yt(e,t,n,r,s){return Jr(this,void 0,void 0,function*(){return Ai(e,"POST",t,r,s,n)})}function ud(e,t,n,r,s){return Jr(this,void 0,void 0,function*(){return Ai(e,"PUT",t,r,s,n)})}function Xj(e,t,n,r){return Jr(this,void 0,void 0,function*(){return Ai(e,"HEAD",t,Object.assign(Object.assign({},n),{noResolveJson:!0}),r)})}function G0(e,t,n,r,s){return Jr(this,void 0,void 0,function*(){return Ai(e,"DELETE",t,r,s,n)})}var Ve=function(e,t,n,r){function s(o){return o instanceof n?o:new n(function(i){i(o)})}return new(n||(n=Promise))(function(o,i){function a(d){try{c(r.next(d))}catch(f){i(f)}}function l(d){try{c(r.throw(d))}catch(f){i(f)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((r=r.apply(e,t||[])).next())})};const Zj={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},rm={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class eP{constructor(t,n={},r,s){this.shouldThrowOnError=!1,this.url=t,this.headers=n,this.bucketId=r,this.fetch=K0(s)}throwOnError(){return this.shouldThrowOnError=!0,this}uploadOrUpdate(t,n,r,s){return Ve(this,void 0,void 0,function*(){try{let o;const i=Object.assign(Object.assign({},rm),s);let a=Object.assign(Object.assign({},this.headers),t==="POST"&&{"x-upsert":String(i.upsert)});const l=i.metadata;typeof Blob<"u"&&r instanceof Blob?(o=new FormData,o.append("cacheControl",i.cacheControl),l&&o.append("metadata",this.encodeMetadata(l)),o.append("",r)):typeof FormData<"u"&&r instanceof FormData?(o=r,o.append("cacheControl",i.cacheControl),l&&o.append("metadata",this.encodeMetadata(l))):(o=r,a["cache-control"]=`max-age=${i.cacheControl}`,a["content-type"]=i.contentType,l&&(a["x-metadata"]=this.toBase64(this.encodeMetadata(l)))),s!=null&&s.headers&&(a=Object.assign(Object.assign({},a),s.headers));const c=this._removeEmptyFolders(n),d=this._getFinalPath(c),f=yield(t=="PUT"?ud:Yt)(this.fetch,`${this.url}/object/${d}`,o,Object.assign({headers:a},i!=null&&i.duplex?{duplex:i.duplex}:{}));return{data:{path:c,id:f.Id,fullPath:f.Key},error:null}}catch(o){if(this.shouldThrowOnError)throw o;if(ke(o))return{data:null,error:o};throw o}})}upload(t,n,r){return Ve(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",t,n,r)})}uploadToSignedUrl(t,n,r,s){return Ve(this,void 0,void 0,function*(){const o=this._removeEmptyFolders(t),i=this._getFinalPath(o),a=new URL(this.url+`/object/upload/sign/${i}`);a.searchParams.set("token",n);try{let l;const c=Object.assign({upsert:rm.upsert},s),d=Object.assign(Object.assign({},this.headers),{"x-upsert":String(c.upsert)});typeof Blob<"u"&&r instanceof Blob?(l=new FormData,l.append("cacheControl",c.cacheControl),l.append("",r)):typeof FormData<"u"&&r instanceof FormData?(l=r,l.append("cacheControl",c.cacheControl)):(l=r,d["cache-control"]=`max-age=${c.cacheControl}`,d["content-type"]=c.contentType);const f=yield ud(this.fetch,a.toString(),l,{headers:d});return{data:{path:o,fullPath:f.Key},error:null}}catch(l){if(this.shouldThrowOnError)throw l;if(ke(l))return{data:null,error:l};throw l}})}createSignedUploadUrl(t,n){return Ve(this,void 0,void 0,function*(){try{let r=this._getFinalPath(t);const s=Object.assign({},this.headers);n!=null&&n.upsert&&(s["x-upsert"]="true");const o=yield Yt(this.fetch,`${this.url}/object/upload/sign/${r}`,{},{headers:s}),i=new URL(this.url+o.url),a=i.searchParams.get("token");if(!a)throw new Uf("No token returned by API");return{data:{signedUrl:i.toString(),path:t,token:a},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ke(r))return{data:null,error:r};throw r}})}update(t,n,r){return Ve(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",t,n,r)})}move(t,n,r){return Ve(this,void 0,void 0,function*(){try{return{data:yield Yt(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(s){if(this.shouldThrowOnError)throw s;if(ke(s))return{data:null,error:s};throw s}})}copy(t,n,r){return Ve(this,void 0,void 0,function*(){try{return{data:{path:(yield Yt(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(s){if(this.shouldThrowOnError)throw s;if(ke(s))return{data:null,error:s};throw s}})}createSignedUrl(t,n,r){return Ve(this,void 0,void 0,function*(){try{let s=this._getFinalPath(t),o=yield Yt(this.fetch,`${this.url}/object/sign/${s}`,Object.assign({expiresIn:n},r!=null&&r.transform?{transform:r.transform}:{}),{headers:this.headers});const i=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return o={signedUrl:encodeURI(`${this.url}${o.signedURL}${i}`)},{data:o,error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(ke(s))return{data:null,error:s};throw s}})}createSignedUrls(t,n,r){return Ve(this,void 0,void 0,function*(){try{const s=yield Yt(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:n,paths:t},{headers:this.headers}),o=r!=null&&r.download?`&download=${r.download===!0?"":r.download}`:"";return{data:s.map(i=>Object.assign(Object.assign({},i),{signedUrl:i.signedURL?encodeURI(`${this.url}${i.signedURL}${o}`):null})),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(ke(s))return{data:null,error:s};throw s}})}download(t,n){return Ve(this,void 0,void 0,function*(){const s=typeof(n==null?void 0:n.transform)<"u"?"render/image/authenticated":"object",o=this.transformOptsToQueryString((n==null?void 0:n.transform)||{}),i=o?`?${o}`:"";try{const a=this._getFinalPath(t);return{data:yield(yield ll(this.fetch,`${this.url}/${s}/${a}${i}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(ke(a))return{data:null,error:a};throw a}})}info(t){return Ve(this,void 0,void 0,function*(){const n=this._getFinalPath(t);try{const r=yield ll(this.fetch,`${this.url}/object/info/${n}`,{headers:this.headers});return{data:cd(r),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ke(r))return{data:null,error:r};throw r}})}exists(t){return Ve(this,void 0,void 0,function*(){const n=this._getFinalPath(t);try{return yield Xj(this.fetch,`${this.url}/object/${n}`,{headers:this.headers}),{data:!0,error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ke(r)&&r instanceof ld){const s=r.originalError;if([400,404].includes(s==null?void 0:s.status))return{data:!1,error:r}}throw r}})}getPublicUrl(t,n){const r=this._getFinalPath(t),s=[],o=n!=null&&n.download?`download=${n.download===!0?"":n.download}`:"";o!==""&&s.push(o);const a=typeof(n==null?void 0:n.transform)<"u"?"render/image":"object",l=this.transformOptsToQueryString((n==null?void 0:n.transform)||{});l!==""&&s.push(l);let c=s.join("&");return c!==""&&(c=`?${c}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${r}${c}`)}}}remove(t){return Ve(this,void 0,void 0,function*(){try{return{data:yield G0(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:t},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(ke(n))return{data:null,error:n};throw n}})}list(t,n,r){return Ve(this,void 0,void 0,function*(){try{const s=Object.assign(Object.assign(Object.assign({},Zj),n),{prefix:t||""});return{data:yield Yt(this.fetch,`${this.url}/object/list/${this.bucketId}`,s,{headers:this.headers},r),error:null}}catch(s){if(this.shouldThrowOnError)throw s;if(ke(s))return{data:null,error:s};throw s}})}listV2(t,n){return Ve(this,void 0,void 0,function*(){try{const r=Object.assign({},t);return{data:yield Yt(this.fetch,`${this.url}/object/list-v2/${this.bucketId}`,r,{headers:this.headers},n),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ke(r))return{data:null,error:r};throw r}})}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.replace(/^\/+/,"")}`}_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 tP="2.12.1",nP={"X-Client-Info":`storage-js/${tP}`};var is=function(e,t,n,r){function s(o){return o instanceof n?o:new n(function(i){i(o)})}return new(n||(n=Promise))(function(o,i){function a(d){try{c(r.next(d))}catch(f){i(f)}}function l(d){try{c(r.throw(d))}catch(f){i(f)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((r=r.apply(e,t||[])).next())})};class rP{constructor(t,n={},r,s){this.shouldThrowOnError=!1;const o=new URL(t);s!=null&&s.useNewHostname&&/supabase\.(co|in|red)$/.test(o.hostname)&&!o.hostname.includes("storage.supabase.")&&(o.hostname=o.hostname.replace("supabase.","storage.supabase.")),this.url=o.href,this.headers=Object.assign(Object.assign({},nP),n),this.fetch=K0(r)}throwOnError(){return this.shouldThrowOnError=!0,this}listBuckets(){return is(this,void 0,void 0,function*(){try{return{data:yield ll(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(t){if(this.shouldThrowOnError)throw t;if(ke(t))return{data:null,error:t};throw t}})}getBucket(t){return is(this,void 0,void 0,function*(){try{return{data:yield ll(this.fetch,`${this.url}/bucket/${t}`,{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(ke(n))return{data:null,error:n};throw n}})}createBucket(t,n={public:!1}){return is(this,void 0,void 0,function*(){try{return{data:yield Yt(this.fetch,`${this.url}/bucket`,{id:t,name:t,type:n.type,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ke(r))return{data:null,error:r};throw r}})}updateBucket(t,n){return is(this,void 0,void 0,function*(){try{return{data:yield ud(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(this.shouldThrowOnError)throw r;if(ke(r))return{data:null,error:r};throw r}})}emptyBucket(t){return is(this,void 0,void 0,function*(){try{return{data:yield Yt(this.fetch,`${this.url}/bucket/${t}/empty`,{},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(ke(n))return{data:null,error:n};throw n}})}deleteBucket(t){return is(this,void 0,void 0,function*(){try{return{data:yield G0(this.fetch,`${this.url}/bucket/${t}`,{},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(ke(n))return{data:null,error:n};throw n}})}}class sP extends rP{constructor(t,n={},r,s){super(t,n,r,s)}from(t){return new eP(this.url,this.headers,t,this.fetch)}}const oP="2.57.4";let Io="";typeof Deno<"u"?Io="deno":typeof document<"u"?Io="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Io="react-native":Io="node";const iP={"X-Client-Info":`supabase-js-${Io}/${oP}`},aP={headers:iP},lP={schema:"public"},cP={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},uP={};var dP=function(e,t,n,r){function s(o){return o instanceof n?o:new n(function(i){i(o)})}return new(n||(n=Promise))(function(o,i){function a(d){try{c(r.next(d))}catch(f){i(f)}}function l(d){try{c(r.throw(d))}catch(f){i(f)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((r=r.apply(e,t||[])).next())})};const fP=e=>{let t;return e?t=e:typeof fetch>"u"?t=I0:t=fetch,(...n)=>t(...n)},hP=()=>typeof Headers>"u"?M0:Headers,pP=(e,t,n)=>{const r=fP(n),s=hP();return(o,i)=>dP(void 0,void 0,void 0,function*(){var a;const l=(a=yield t())!==null&&a!==void 0?a:e;let c=new s(i==null?void 0:i.headers);return c.has("apikey")||c.set("apikey",e),c.has("Authorization")||c.set("Authorization",`Bearer ${l}`),r(o,Object.assign(Object.assign({},i),{headers:c}))})};var mP=function(e,t,n,r){function s(o){return o instanceof n?o:new n(function(i){i(o)})}return new(n||(n=Promise))(function(o,i){function a(d){try{c(r.next(d))}catch(f){i(f)}}function l(d){try{c(r.throw(d))}catch(f){i(f)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((r=r.apply(e,t||[])).next())})};function gP(e){return e.endsWith("/")?e:e+"/"}function vP(e,t){var n,r;const{db:s,auth:o,realtime:i,global:a}=e,{db:l,auth:c,realtime:d,global:f}=t,p={db:Object.assign(Object.assign({},l),s),auth:Object.assign(Object.assign({},c),o),realtime:Object.assign(Object.assign({},d),i),storage:{},global:Object.assign(Object.assign(Object.assign({},f),a),{headers:Object.assign(Object.assign({},(n=f==null?void 0:f.headers)!==null&&n!==void 0?n:{}),(r=a==null?void 0:a.headers)!==null&&r!==void 0?r:{})}),accessToken:()=>mP(this,void 0,void 0,function*(){return""})};return e.accessToken?p.accessToken=e.accessToken:delete p.accessToken,p}function yP(e){const t=e==null?void 0:e.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(gP(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}const Y0="2.71.1",fs=30*1e3,dd=3,$c=dd*fs,wP="http://localhost:9999",xP="supabase.auth.token",bP={"X-Client-Info":`gotrue-js/${Y0}`},fd="X-Supabase-Api-Version",J0={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},_P=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,SP=10*60*1e3;class zf extends Error{constructor(t,n,r){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}}function V(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class kP extends zf{constructor(t,n,r){super(t,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function EP(e){return V(e)&&e.name==="AuthApiError"}class X0 extends zf{constructor(t,n){super(t),this.name="AuthUnknownError",this.originalError=n}}class wr extends zf{constructor(t,n,r,s){super(t,r,s),this.name=n,this.status=r}}class Fn extends wr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function CP(e){return V(e)&&e.name==="AuthSessionMissingError"}class la extends wr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class ca extends wr{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class ua extends wr{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 TP(e){return V(e)&&e.name==="AuthImplicitGrantRedirectError"}class sm extends wr{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 hd extends wr{constructor(t,n){super(t,"AuthRetryableFetchError",n,void 0)}}function Dc(e){return V(e)&&e.name==="AuthRetryableFetchError"}class om extends wr{constructor(t,n,r){super(t,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}}class pd extends wr{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const cl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),im=` \r=`.split(""),jP=(()=>{const e=new Array(128);for(let t=0;t=6;){const r=t.queue>>t.queuedBits-6&63;n(cl[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(cl[r]),t.queuedBits-=6}}function Z0(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 lm(e){const t=[],n=i=>{t.push(String.fromCodePoint(i))},r={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},o=i=>{OP(i,r,n)};for(let i=0;i>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 NP(e,t){for(let n=0;n55295&&r<=56319){const s=(r-55296)*1024&65535;r=(e.charCodeAt(n+1)-56320&65535|s)+65536,n+=1}PP(r,t)}}function OP(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 RP(e){const t=[],n={queue:0,queuedBits:0},r=s=>{t.push(s)};for(let s=0;st.push(n)),new Uint8Array(t)}function IP(e){const t=[],n={queue:0,queuedBits:0},r=s=>{t.push(s)};return e.forEach(s=>am(s,n,r)),am(null,n,r),t.join("")}function MP(e){return Math.round(Date.now()/1e3)+e}function LP(){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 Rt=()=>typeof window<"u"&&typeof document<"u",Sr={tested:!1,writable:!1},ew=()=>{if(!Rt())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Sr.tested)return Sr.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Sr.tested=!0,Sr.writable=!0}catch{Sr.tested=!0,Sr.writable=!1}return Sr.writable};function $P(e){const t={},n=new URL(e);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((s,o)=>{t[o]=s})}catch{}return n.searchParams.forEach((r,s)=>{t[s]=r}),t}const tw=e=>{let t;return e?t=e:typeof fetch>"u"?t=(...n)=>He(async()=>{const{default:r}=await Promise.resolve().then(()=>co);return{default:r}},void 0).then(({default:r})=>r(...n)):t=fetch,(...n)=>t(...n)},DP=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",hs=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},kr=async(e,t)=>{const n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return n}},Ln=async(e,t)=>{await e.removeItem(t)};class Wl{constructor(){this.promise=new Wl.promiseConstructor((t,n)=>{this.resolve=t,this.reject=n})}}Wl.promiseConstructor=Promise;function Fc(e){const t=e.split(".");if(t.length!==3)throw new pd("Invalid JWT structure");for(let r=0;r{setTimeout(()=>t(null),e)})}function UP(e,t){return new Promise((r,s)=>{(async()=>{for(let o=0;o<1/0;o++)try{const i=await e(o);if(!t(o,null,i)){r(i);return}}catch(i){if(!t(o,i)){s(i);return}}})()})}function zP(e){return("0"+e.toString(16)).substr(-2)}function BP(){const t=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let s="";for(let o=0;o<56;o++)s+=n.charAt(Math.floor(Math.random()*r));return s}return crypto.getRandomValues(t),Array.from(t,zP).join("")}async function WP(e){const n=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",n),s=new Uint8Array(r);return Array.from(s).map(o=>String.fromCharCode(o)).join("")}async function HP(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 WP(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function as(e,t,n=!1){const r=BP();let s=r;n&&(s+="/PASSWORD_RECOVERY"),await hs(e,`${t}-code-verifier`,s);const o=await HP(r);return[o,r===o?"plain":"s256"]}const VP=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function qP(e){const t=e.headers.get(fd);if(!t||!t.match(VP))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function QP(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 KP(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 GP=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function ls(e){if(!GP.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Uc(){const e={};return new Proxy(e,{get:(t,n)=>{if(n==="__isUserNotAvailableProxy")return!0;if(typeof n=="symbol"){const r=n.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${n}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function cm(e){return JSON.parse(JSON.stringify(e))}var YP=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 s=0,r=Object.getOwnPropertySymbols(e);se.msg||e.message||e.error_description||e.error||JSON.stringify(e),JP=[502,503,504];async function um(e){var t;if(!DP(e))throw new hd(Tr(e),0);if(JP.includes(e.status))throw new hd(Tr(e),e.status);let n;try{n=await e.json()}catch(o){throw new X0(Tr(o),o)}let r;const s=qP(e);if(s&&s.getTime()>=J0["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 om(Tr(n),e.status,((t=n.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(r==="session_not_found")throw new Fn}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((o,i)=>o&&typeof i=="string",!0))throw new om(Tr(n),e.status,n.weak_password.reasons);throw new kP(Tr(n),e.status||500,r)}const XP=(e,t,n,r)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),s.body=JSON.stringify(r),Object.assign(Object.assign({},s),n))};async function G(e,t,n,r){var s;const o=Object.assign({},r==null?void 0:r.headers);o[fd]||(o[fd]=J0["2024-01-01"].name),r!=null&&r.jwt&&(o.Authorization=`Bearer ${r.jwt}`);const i=(s=r==null?void 0:r.query)!==null&&s!==void 0?s:{};r!=null&&r.redirectTo&&(i.redirect_to=r.redirectTo);const a=Object.keys(i).length?"?"+new URLSearchParams(i).toString():"",l=await ZP(e,t,n+a,{headers:o,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 ZP(e,t,n,r,s,o){const i=XP(t,r,s,o);let a;try{a=await e(n,Object.assign({},i))}catch(l){throw console.error(l),new hd(Tr(l),0)}if(a.ok||await um(a),r!=null&&r.noResolveJson)return a;try{return await a.json()}catch(l){await um(l)}}function dn(e){var t;let n=null;r2(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=MP(e.expires_in)));const r=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:n,user:r},error:null}}function dm(e){const t=dn(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 Hn(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function e2(e){return{data:e,error:null}}function t2(e){const{action_link:t,email_otp:n,hashed_token:r,redirect_to:s,verification_type:o}=e,i=YP(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:t,email_otp:n,hashed_token:r,redirect_to:s,verification_type:o},l=Object.assign({},i);return{data:{properties:a,user:l},error:null}}function n2(e){return e}function r2(e){return e.access_token&&e.refresh_token&&e.expires_in}const zc=["global","local","others"];var s2=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 s=0,r=Object.getOwnPropertySymbols(e);s0&&(h.forEach(x=>{const w=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(x.split(";")[1].split("=")[1]);c[`${b}Page`]=w}),c.total=parseInt(p)),{data:Object.assign(Object.assign({},f),c),error:null}}catch(c){if(V(c))return{data:{users:[]},error:c};throw c}}async getUserById(t){ls(t);try{return await G(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:Hn})}catch(n){if(V(n))return{data:{user:null},error:n};throw n}}async updateUserById(t,n){ls(t);try{return await G(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:n,headers:this.headers,xform:Hn})}catch(r){if(V(r))return{data:{user:null},error:r};throw r}}async deleteUser(t,n=!1){ls(t);try{return await G(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:n},xform:Hn})}catch(r){if(V(r))return{data:{user:null},error:r};throw r}}async _listFactors(t){ls(t.userId);try{const{data:n,error:r}=await G(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:n,error:r}}catch(n){if(V(n))return{data:null,error:n};throw n}}async _deleteFactor(t){ls(t.userId),ls(t.id);try{return{data:await G(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(n){if(V(n))return{data:null,error:n};throw n}}}function fm(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}function i2(){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 cs={debug:!!(globalThis&&ew()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class nw extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class a2 extends nw{}async function l2(e,t,n){cs.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const r=new globalThis.AbortController;return t>0&&setTimeout(()=>{r.abort(),cs.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 s=>{if(s){cs.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,s.name);try{return await n()}finally{cs.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,s.name)}}else{if(t===0)throw cs.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new a2(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(cs.debug)try{const o=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(o,null," "))}catch(o){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",o)}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()}}))}i2();const c2={url:wP,storageKey:xP,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:bP,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function hm(e,t,n){return await n()}const us={};class yi{constructor(t){var n,r;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=yi.nextInstanceID,yi.nextInstanceID+=1,this.instanceID>0&&Rt()&&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 s=Object.assign(Object.assign({},c2),t);if(this.logDebugMessages=!!s.debug,typeof s.debug=="function"&&(this.logger=s.debug),this.persistSession=s.persistSession,this.storageKey=s.storageKey,this.autoRefreshToken=s.autoRefreshToken,this.admin=new o2({url:s.url,headers:s.headers,fetch:s.fetch}),this.url=s.url,this.headers=s.headers,this.fetch=tw(s.fetch),this.lock=s.lock||hm,this.detectSessionInUrl=s.detectSessionInUrl,this.flowType=s.flowType,this.hasCustomAuthorizationHeader=s.hasCustomAuthorizationHeader,s.lock?this.lock=s.lock:Rt()&&(!((n=globalThis==null?void 0:globalThis.navigator)===null||n===void 0)&&n.locks)?this.lock=l2:this.lock=hm,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?(s.storage?this.storage=s.storage:ew()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=fm(this.memoryStorage)),s.userStorage&&(this.userStorage=s.userStorage)):(this.memoryStorage={},this.storage=fm(this.memoryStorage)),Rt()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(r=this.broadcastChannel)===null||r===void 0||r.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o),await this._notifyAllSubscribers(o.data.event,o.data.session,!1)})}this.initialize()}get jwks(){var t,n;return(n=(t=us[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(t){us[this.storageKey]=Object.assign(Object.assign({},us[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,n;return(n=(t=us[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){us[this.storageKey]=Object.assign(Object.assign({},us[this.storageKey]),{cachedAt:t})}_debug(...t){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${Y0}) ${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=$P(window.location.href);let r="none";if(this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce"),Rt()&&this.detectSessionInUrl&&r!=="none"){const{data:s,error:o}=await this._getSessionFromURL(n,r);if(o){if(this._debug("#_initialize()","error detecting session from URL",o),TP(o)){const l=(t=o.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:o}}return await this._removeSession(),{error:o}}const{session:i,redirectType:a}=s;return this._debug("#_initialize()","detected session in URL",i,"redirect type",a),await this._saveSession(i),setTimeout(async()=>{a==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",i):await this._notifyAllSubscribers("SIGNED_IN",i)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return V(n)?{error:n}:{error:new X0("Unexpected error during initialization",n)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var n,r,s;try{const o=await G(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:(s=t==null?void 0:t.options)===null||s===void 0?void 0:s.captchaToken}},xform:dn}),{data:i,error:a}=o;if(a||!i)return{data:{user:null,session:null},error:a};const l=i.session,c=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",l)),{data:{user:c,session:l},error:null}}catch(o){if(V(o))return{data:{user:null,session:null},error:o};throw o}}async signUp(t){var n,r,s;try{let o;if("email"in t){const{email:d,password:f,options:p}=t;let h=null,x=null;this.flowType==="pkce"&&([h,x]=await as(this.storage,this.storageKey)),o=await G(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:p==null?void 0:p.emailRedirectTo,body:{email:d,password:f,data:(n=p==null?void 0:p.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken},code_challenge:h,code_challenge_method:x},xform:dn})}else if("phone"in t){const{phone:d,password:f,options:p}=t;o=await G(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:f,data:(r=p==null?void 0:p.data)!==null&&r!==void 0?r:{},channel:(s=p==null?void 0:p.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken}},xform:dn})}else throw new ca("You must provide either an email or phone number and a password");const{data:i,error:a}=o;if(a||!i)return{data:{user:null,session:null},error:a};const l=i.session,c=i.user;return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",l)),{data:{user:c,session:l},error:null}}catch(o){if(V(o))return{data:{user:null,session:null},error:o};throw o}}async signInWithPassword(t){try{let n;if("email"in t){const{email:o,password:i,options:a}=t;n=await G(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:o,password:i,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:dm})}else if("phone"in t){const{phone:o,password:i,options:a}=t;n=await G(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:o,password:i,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:dm})}else throw new ca("You must provide either an email or phone number and a password");const{data:r,error:s}=n;return s?{data:{user:null,session:null},error:s}:!r||!r.session||!r.user?{data:{user:null,session:null},error:new la}:(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:s})}catch(n){if(V(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithOAuth(t){var n,r,s,o;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:(s=t.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(o=t.options)===null||o===void 0?void 0:o.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,s,o,i,a,l,c,d,f,p,h;let x,w;if("message"in t)x=t.message,w=t.signature;else{const{chain:b,wallet:v,statement:m,options:g}=t;let _;if(Rt())if(typeof v=="object")_=v;else{const k=window;if("solana"in k&&typeof k.solana=="object"&&("signIn"in k.solana&&typeof k.solana.signIn=="function"||"signMessage"in k.solana&&typeof k.solana.signMessage=="function"))_=k.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 v!="object"||!(g!=null&&g.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");_=v}const S=new URL((n=g==null?void 0:g.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in _&&_.signIn){const k=await _.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},g==null?void 0:g.signInWithSolana),{version:"1",domain:S.host,uri:S.href}),m?{statement:m}:null));let E;if(Array.isArray(k)&&k[0]&&typeof k[0]=="object")E=k[0];else if(k&&typeof k=="object"&&"signedMessage"in k&&"signature"in k)E=k;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in E&&"signature"in E&&(typeof E.signedMessage=="string"||E.signedMessage instanceof Uint8Array)&&E.signature instanceof Uint8Array)x=typeof E.signedMessage=="string"?E.signedMessage:new TextDecoder().decode(E.signedMessage),w=E.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in _)||typeof _.signMessage!="function"||!("publicKey"in _)||typeof _!="object"||!_.publicKey||!("toBase58"in _.publicKey)||typeof _.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");x=[`${S.host} wants you to sign in with your Solana account:`,_.publicKey.toBase58(),...m?["",m,""]:[""],"Version: 1",`URI: ${S.href}`,`Issued At: ${(s=(r=g==null?void 0:g.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((o=g==null?void 0:g.signInWithSolana)===null||o===void 0)&&o.notBefore?[`Not Before: ${g.signInWithSolana.notBefore}`]:[],...!((i=g==null?void 0:g.signInWithSolana)===null||i===void 0)&&i.expirationTime?[`Expiration Time: ${g.signInWithSolana.expirationTime}`]:[],...!((a=g==null?void 0:g.signInWithSolana)===null||a===void 0)&&a.chainId?[`Chain ID: ${g.signInWithSolana.chainId}`]:[],...!((l=g==null?void 0:g.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${g.signInWithSolana.nonce}`]:[],...!((c=g==null?void 0:g.signInWithSolana)===null||c===void 0)&&c.requestId?[`Request ID: ${g.signInWithSolana.requestId}`]:[],...!((f=(d=g==null?void 0:g.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||f===void 0)&&f.length?["Resources",...g.signInWithSolana.resources.map(E=>`- ${E}`)]:[]].join(` `);const k=await _.signMessage(new TextEncoder().encode(x),"utf8");if(!k||!(k instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");w=k}}try{const{data:b,error:v}=await G(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:x,signature:IP(w)},!((p=t.options)===null||p===void 0)&&p.captchaToken?{gotrue_meta_security:{captcha_token:(h=t.options)===null||h===void 0?void 0:h.captchaToken}}:null),xform:dn});if(v)throw v;return!b||!b.session||!b.user?{data:{user:null,session:null},error:new la}:(b.session&&(await this._saveSession(b.session),await this._notifyAllSubscribers("SIGNED_IN",b.session)),{data:Object.assign({},b),error:v})}catch(b){if(V(b))return{data:{user:null,session:null},error:b};throw b}}async _exchangeCodeForSession(t){const n=await kr(this.storage,`${this.storageKey}-code-verifier`),[r,s]=(n??"").split("/");try{const{data:o,error:i}=await G(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:dn});if(await Ln(this.storage,`${this.storageKey}-code-verifier`),i)throw i;return!o||!o.session||!o.user?{data:{user:null,session:null,redirectType:null},error:new la}:(o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",o.session)),{data:Object.assign(Object.assign({},o),{redirectType:s??null}),error:i})}catch(o){if(V(o))return{data:{user:null,session:null,redirectType:null},error:o};throw o}}async signInWithIdToken(t){try{const{options:n,provider:r,token:s,access_token:o,nonce:i}=t,a=await G(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:s,access_token:o,nonce:i,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:dn}),{data:l,error:c}=a;return c?{data:{user:null,session:null},error:c}:!l||!l.session||!l.user?{data:{user:null,session:null},error:new la}:(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),{data:l,error:c})}catch(n){if(V(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithOtp(t){var n,r,s,o,i;try{if("email"in t){const{email:a,options:l}=t;let c=null,d=null;this.flowType==="pkce"&&([c,d]=await as(this.storage,this.storageKey));const{error:f}=await G(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:c,code_challenge_method:d},redirectTo:l==null?void 0:l.emailRedirectTo});return{data:{user:null,session:null},error:f}}if("phone"in t){const{phone:a,options:l}=t,{data:c,error:d}=await G(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(s=l==null?void 0:l.data)!==null&&s!==void 0?s:{},create_user:(o=l==null?void 0:l.shouldCreateUser)!==null&&o!==void 0?o:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},channel:(i=l==null?void 0:l.channel)!==null&&i!==void 0?i:"sms"}});return{data:{user:null,session:null,messageId:c==null?void 0:c.message_id},error:d}}throw new ca("You must provide either an email or phone number.")}catch(a){if(V(a))return{data:{user:null,session:null},error:a};throw a}}async verifyOtp(t){var n,r;try{let s,o;"options"in t&&(s=(n=t.options)===null||n===void 0?void 0:n.redirectTo,o=(r=t.options)===null||r===void 0?void 0:r.captchaToken);const{data:i,error:a}=await G(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:o}}),redirectTo:s,xform:dn});if(a)throw a;if(!i)throw new Error("An error occurred on token verification.");const l=i.session,c=i.user;return l!=null&&l.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),{data:{user:c,session:l},error:null}}catch(s){if(V(s))return{data:{user:null,session:null},error:s};throw s}}async signInWithSSO(t){var n,r,s;try{let o=null,i=null;return this.flowType==="pkce"&&([o,i]=await as(this.storage,this.storageKey)),await G(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}),!((s=t==null?void 0:t.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:i}),headers:this.headers,xform:e2})}catch(o){if(V(o))return{data:null,error:o};throw o}}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 Fn;const{error:s}=await G(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return{data:{user:null,session:null},error:s}})}catch(t){if(V(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:s,options:o}=t,{error:i}=await G(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:s,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},redirectTo:o==null?void 0:o.emailRedirectTo});return{data:{user:null,session:null},error:i}}else if("phone"in t){const{phone:r,type:s,options:o}=t,{data:i,error:a}=await G(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:s,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}}});return{data:{user:null,session:null,messageId:i==null?void 0:i.message_id},error:a}}throw new ca("You must provide either an email or phone number and a type")}catch(n){if(V(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(),s=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}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 s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.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 kr(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()<$c:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",t.expires_at),!r){if(this.userStorage){const i=await kr(this.userStorage,this.storageKey+"-user");i!=null&&i.user?t.user=i.user:t.user=Uc()}if(this.storage.isServer&&t.user){let i=this.suppressGetSessionWarning;t=new Proxy(t,{get:(l,c,d)=>(!i&&c==="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."),i=!0,this.suppressGetSessionWarning=!0),Reflect.get(l,c,d))})}return{data:{session:t},error:null}}const{session:s,error:o}=await this._callRefreshToken(t.refresh_token);return o?{data:{session:null},error:o}:{data:{session:s},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 G(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:Hn}):await this._useSession(async n=>{var r,s,o;const{data:i,error:a}=n;if(a)throw a;return!(!((r=i.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Fn}:await G(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(o=(s=i.session)===null||s===void 0?void 0:s.access_token)!==null&&o!==void 0?o:void 0,xform:Hn})})}catch(n){if(V(n))return CP(n)&&(await this._removeSession(),await Ln(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:s,error:o}=r;if(o)throw o;if(!s.session)throw new Fn;const i=s.session;let a=null,l=null;this.flowType==="pkce"&&t.email!=null&&([a,l]=await as(this.storage,this.storageKey));const{data:c,error:d}=await G(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:i.access_token,xform:Hn});if(d)throw d;return i.user=c.user,await this._saveSession(i),await this._notifyAllSubscribers("USER_UPDATED",i),{data:{user:i.user},error:null}})}catch(r){if(V(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 Fn;const n=Date.now()/1e3;let r=n,s=!0,o=null;const{payload:i}=Fc(t.access_token);if(i.exp&&(r=i.exp,s=r<=n),s){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};o=a}else{const{data:a,error:l}=await this._getUser(t.access_token);if(l)throw l;o={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(o),await this._notifyAllSubscribers("SIGNED_IN",o)}return{data:{user:o.user,session:o},error:null}}catch(n){if(V(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:i,error:a}=n;if(a)throw a;t=(r=i.session)!==null&&r!==void 0?r:void 0}if(!(t!=null&&t.refresh_token))throw new Fn;const{session:s,error:o}=await this._callRefreshToken(t.refresh_token);return o?{data:{user:null,session:null},error:o}:s?{data:{user:s.user,session:s},error:null}:{data:{user:null,session:null},error:null}})}catch(n){if(V(n))return{data:{user:null,session:null},error:n};throw n}}async _getSessionFromURL(t,n){try{if(!Rt())throw new ua("No browser detected.");if(t.error||t.error_description||t.error_code)throw new ua(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 sm("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new ua("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 sm("No code detected.");const{data:m,error:g}=await this._exchangeCodeForSession(t.code);if(g)throw g;const _=new URL(window.location.href);return _.searchParams.delete("code"),window.history.replaceState(window.history.state,"",_.toString()),{data:{session:m.session,redirectType:null},error:null}}const{provider_token:r,provider_refresh_token:s,access_token:o,refresh_token:i,expires_in:a,expires_at:l,token_type:c}=t;if(!o||!a||!i||!c)throw new ua("No session defined in URL");const d=Math.round(Date.now()/1e3),f=parseInt(a);let p=d+f;l&&(p=parseInt(l));const h=p-d;h*1e3<=fs&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${h}s, should have been closer to ${f}s`);const x=p-f;d-x>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",x,p,d):d-x<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",x,p,d);const{data:w,error:b}=await this._getUser(o);if(b)throw b;const v={provider_token:r,provider_refresh_token:s,access_token:o,expires_in:f,expires_at:p,refresh_token:i,token_type:c,user:w.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:v,redirectType:t.type},error:null}}catch(r){if(V(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 kr(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:s,error:o}=n;if(o)return{error:o};const i=(r=s.session)===null||r===void 0?void 0:r.access_token;if(i){const{error:a}=await this.admin.signOut(i,t);if(a&&!(EP(a)&&(a.status===404||a.status===401||a.status===403)))return{error:a}}return t!=="others"&&(await this._removeSession(),await Ln(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(t){const n=LP(),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,s;try{const{data:{session:o},error:i}=n;if(i)throw i;await((r=this.stateChangeEmitters.get(t))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",o)),this._debug("INITIAL_SESSION","callback id",t,"session",o)}catch(o){await((s=this.stateChangeEmitters.get(t))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",o),console.error(o)}})}async resetPasswordForEmail(t,n={}){let r=null,s=null;this.flowType==="pkce"&&([r,s]=await as(this.storage,this.storageKey,!0));try{return await G(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:r,code_challenge_method:s,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(o){if(V(o))return{data:null,error:o};throw o}}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(V(n))return{data:null,error:n};throw n}}async linkIdentity(t){var n;try{const{data:r,error:s}=await this._useSession(async o=>{var i,a,l,c,d;const{data:f,error:p}=o;if(p)throw p;const h=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(i=t.options)===null||i===void 0?void 0:i.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 G(this.fetch,"GET",h,{headers:this.headers,jwt:(d=(c=f.session)===null||c===void 0?void 0:c.access_token)!==null&&d!==void 0?d:void 0})});if(s)throw s;return Rt()&&!(!((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(V(r))return{data:{provider:t.provider,url:null},error:r};throw r}}async unlinkIdentity(t){try{return await this._useSession(async n=>{var r,s;const{data:o,error:i}=n;if(i)throw i;return await G(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(s=(r=o.session)===null||r===void 0?void 0:r.access_token)!==null&&s!==void 0?s:void 0})})}catch(n){if(V(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 UP(async s=>(s>0&&await FP(200*Math.pow(2,s-1)),this._debug(n,"refreshing attempt",s),await G(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:dn})),(s,o)=>{const i=200*Math.pow(2,s);return o&&Dc(o)&&Date.now()+i-r{try{await a.callback(t,n)}catch(l){o.push(l)}});if(await Promise.all(i),o.length>0){for(let a=0;athis._autoRefreshTokenTick(),fs);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 s=Math.floor((r.expires_at*1e3-t)/fs);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${fs}ms, refresh threshold is ${dd} ticks`),s<=dd&&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 nw)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Rt()||!(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 s=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&s.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&s.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[o,i]=await as(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(o)}`,code_challenge_method:`${encodeURIComponent(i)}`});s.push(a.toString())}if(r!=null&&r.queryParams){const o=new URLSearchParams(r.queryParams);s.push(o.toString())}return r!=null&&r.skipBrowserRedirect&&s.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${t}?${s.join("&")}`}async _unenroll(t){try{return await this._useSession(async n=>{var r;const{data:s,error:o}=n;return o?{data:null,error:o}:await G(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(V(n))return{data:null,error:n};throw n}}async _enroll(t){try{return await this._useSession(async n=>{var r,s;const{data:o,error:i}=n;if(i)return{data:null,error:i};const a=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:{issuer:t.issuer}),{data:l,error:c}=await G(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(r=o==null?void 0:o.session)===null||r===void 0?void 0:r.access_token});return c?{data:null,error:c}:(t.factorType==="totp"&&(!((s=l==null?void 0:l.totp)===null||s===void 0)&&s.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),{data:l,error:null})})}catch(n){if(V(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:s,error:o}=n;if(o)return{data:null,error:o};const{data:i,error:a}=await G(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:{code:t.code,challenge_id:t.challengeId},headers:this.headers,jwt:(r=s==null?void 0:s.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)+i.expires_in},i)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",i),{data:i,error:a})})}catch(n){if(V(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:s,error:o}=n;return o?{data:null,error:o}:await G(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:{channel:t.channel},headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(V(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)||[],s=r.filter(i=>i.factor_type==="totp"&&i.status==="verified"),o=r.filter(i=>i.factor_type==="phone"&&i.status==="verified");return{data:{all:r,totp:s,phone:o},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async t=>{var n,r;const{data:{session:s},error:o}=t;if(o)return{data:null,error:o};if(!s)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:i}=Fc(s.access_token);let a=null;i.aal&&(a=i.aal);let l=a;((r=(n=s.user.factors)===null||n===void 0?void 0:n.filter(f=>f.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(l="aal2");const d=i.amr||[];return{data:{currentLevel:a,nextLevel:l,currentAuthenticationMethods:d},error:null}}))}async fetchJwk(t,n={keys:[]}){let r=n.keys.find(a=>a.kid===t);if(r)return r;const s=Date.now();if(r=this.jwks.keys.find(a=>a.kid===t),r&&this.jwks_cached_at+SP>s)return r;const{data:o,error:i}=await G(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(i)throw i;return!o.keys||o.keys.length===0||(this.jwks=o,this.jwks_cached_at=s,r=o.keys.find(a=>a.kid===t),!r)?null:r}async getClaims(t,n={}){try{let r=t;if(!r){const{data:h,error:x}=await this.getSession();if(x||!h.session)return{data:null,error:x};r=h.session.access_token}const{header:s,payload:o,signature:i,raw:{header:a,payload:l}}=Fc(r);n!=null&&n.allowExpired||QP(o.exp);const c=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!c){const{error:h}=await this.getUser(r);if(h)throw h;return{data:{claims:o,header:s,signature:i},error:null}}const d=KP(s.alg),f=await crypto.subtle.importKey("jwk",c,d,!0,["verify"]);if(!await crypto.subtle.verify(d,f,i,AP(`${a}.${l}`)))throw new pd("Invalid JWT signature");return{data:{claims:o,header:s,signature:i},error:null}}catch(r){if(V(r))return{data:null,error:r};throw r}}}yi.nextInstanceID=0;const u2=yi;class d2 extends u2{constructor(t){super(t)}}var f2=function(e,t,n,r){function s(o){return o instanceof n?o:new n(function(i){i(o)})}return new(n||(n=Promise))(function(o,i){function a(d){try{c(r.next(d))}catch(f){i(f)}}function l(d){try{c(r.throw(d))}catch(f){i(f)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((r=r.apply(e,t||[])).next())})};class h2{constructor(t,n,r){var s,o,i;this.supabaseUrl=t,this.supabaseKey=n;const a=yP(t);if(!n)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",a),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",a),this.storageUrl=new URL("storage/v1",a),this.functionsUrl=new URL("functions/v1",a);const l=`sb-${a.hostname.split(".")[0]}-auth-token`,c={db:lP,realtime:uP,auth:Object.assign(Object.assign({},cP),{storageKey:l}),global:aP},d=vP(r??{},c);this.storageKey=(s=d.auth.storageKey)!==null&&s!==void 0?s:"",this.headers=(o=d.global.headers)!==null&&o!==void 0?o:{},d.accessToken?(this.accessToken=d.accessToken,this.auth=new Proxy({},{get:(f,p)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(p)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((i=d.auth)!==null&&i!==void 0?i:{},this.headers,d.global.fetch),this.fetch=pP(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 jj(new URL("rest/v1",a).href,{headers:this.headers,schema:d.db.schema,fetch:this.fetch}),this.storage=new sP(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),d.accessToken||this._listenForAuthEvents()}get functions(){return new ij(this.functionsUrl.href,{headers:this.headers,customFetch: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 f2(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:this.supabaseKey})}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:n,detectSessionInUrl:r,storage:s,userStorage:o,storageKey:i,flowType:a,lock:l,debug:c},d,f){const p={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new d2({url:this.authUrl.href,headers:Object.assign(Object.assign({},p),d),storageKey:i,autoRefreshToken:t,persistSession:n,detectSessionInUrl:r,storage:s,userStorage:o,flowType:a,lock:l,debug:c,fetch:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(h=>h.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new Vj(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 p2=(e,t,n)=>new h2(e,t,n);function m2(){if(typeof window<"u"||typeof process>"u")return!1;const e=process.version;if(e==null)return!1;const t=e.match(/^v(\d+)\./);return t?parseInt(t[1],10)<=18:!1}m2()&&console.warn("โš ๏ธ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const g2="https://abwvidcbmtobzehshgim.supabase.co",v2="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImFid3ZpZGNibXRvYnplaHNoZ2ltIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTc4MTQ4NTQsImV4cCI6MjA3MzM5MDg1NH0.5_0Gvv1eFxlOVMXlXGOW5uw5xQKue5Ev8wYVdpt7rtE",ye=p2(g2,v2,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}}),y2=Nl("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Ee=y.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},o)=>{const i=r?Mb:"button";return u.jsx(i,{className:Re(y2({variant:t,size:n,className:e})),ref:o,...s})});Ee.displayName="Button";const eo=y.forwardRef(({className:e,type:t,...n},r)=>u.jsx("input",{type:t,className:Re("flex h-8 w-full rounded-md border border-input bg-background px-2 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));eo.displayName="Input";var w2="Label",rw=y.forwardRef((e,t)=>u.jsx(et.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));rw.displayName=w2;var sw=rw;const x2=Nl("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),md=y.forwardRef(({className:e,...t},n)=>u.jsx(sw,{ref:n,className:Re(x2(),e),...t}));md.displayName=sw.displayName;const Pe=y.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Re("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Pe.displayName="Card";const ow=y.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Re("flex flex-col space-y-1.5 p-6",e),...t}));ow.displayName="CardHeader";const iw=y.forwardRef(({className:e,...t},n)=>u.jsx("h3",{ref:n,className:Re("text-2xl font-semibold leading-none tracking-tight",e),...t}));iw.displayName="CardTitle";const aw=y.forwardRef(({className:e,...t},n)=>u.jsx("p",{ref:n,className:Re("text-sm text-muted-foreground",e),...t}));aw.displayName="CardDescription";const Ae=y.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Re("p-6 pt-0",e),...t}));Ae.displayName="CardContent";const b2=y.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:Re("flex items-center p-6 pt-0",e),...t}));b2.displayName="CardFooter";const ht={domain:"scan.camera",version:"1.0.127",DEFAULT_USER_IMAGES:"2c6dd94c-9915-43e9-98ed-3ce2ce5d730a",ADMIN_USER_ID:"28432d18-39ce-4ee7-9b91-a51.0.3210d74",maxFileSizeMB:10,maxImageDimensions:1400,imageQuality:85,targetFileSizeMB:.8,defaultImageFormat:"webp",storeOriginal:!0,maxOriginalDimensions:2e3,originalQuality:95,analytics:{googleAnalytics:{enabled:!0,measurementId:"G-2N89RDS3G0"},posthog:{enabled:!0,apiKey:"phc_l9Dtf15FyABa0Pqj9QbTI6eCCB08WODaSfIEQH6IGFj",host:"https://us.i.posthog.com"},microsoftClarity:{enabled:!0,projectId:"tfwk54gk6l"},globalEnabled:!0},cacheBusting:{enabled:!0,windowMinutes:5}},WO=e=>`https://${ht.domain}/v/${e}`,_2=()=>ht.version,HO=e=>{if(!e)return!1;const n=Math.max(1,Math.min(60,ht.cacheBusting.windowMinutes))*60*1e3;return Date.now()-new Date(e).getTime(){if(!t)return e;const n=new URL(e);return n.searchParams.set("t",Date.now().toString()),n.toString()},lw=({variant:e="light"})=>{const t=new Date().getFullYear(),n=_2();return e==="dark"?u.jsxs("footer",{className:"bg-black/80 backdrop-blur text-white/60 py-2 px-4 text-center text-xs select-none border-t border-white/10 w-full shrink-0",children:["ยฉ Copyright ",t,", Scan.camera",u.jsx("span",{className:"mx-2",children:"โ€ข"}),u.jsx(Ke,{to:"/privacy-policy",className:"hover:text-white/80 transition-colors",children:"Privacy Policy"}),u.jsx("span",{className:"mx-2",children:"โ€ข"}),"v",n]}):u.jsxs("footer",{className:"bg-background/80 backdrop-blur border-t border-border/40 py-3 px-4 text-center text-xs text-muted-foreground w-full shrink-0",children:["ยฉ Copyright ",t,", Scan.camera",u.jsx("span",{className:"mx-2",children:"โ€ข"}),u.jsx(Ke,{to:"/privacy-policy",className:"hover:text-foreground transition-colors",children:"Privacy Policy"}),u.jsx("span",{className:"mx-2",children:"โ€ข"}),"v",n]})},S2=()=>{const[e,t]=y.useState(!1),[n,r]=y.useState(""),[s,o]=y.useState(""),[i,a]=y.useState(!1),{toast:l}=Pi(),c=h=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(h),d=h=>h.length>=6,f=async h=>{if(h.preventDefault(),!c(n)){l({title:"Invalid Email",description:"Please enter a valid email address",variant:"destructive"});return}if(e&&!d(s)){l({title:"Password Requirements Not Met",description:"Password must be at least 6 characters long",variant:"destructive"});return}a(!0);try{if(e){const{error:x}=await ye.auth.signUp({email:n,password:s,options:{emailRedirectTo:`${window.location.origin}/app`}});l(x?{title:"Sign Up Error",description:x.message,variant:"destructive"}:{title:"Check your email",description:"We've sent you a confirmation link to complete your registration."})}else{const{error:x}=await ye.auth.signInWithPassword({email:n,password:s});x&&l({title:"Sign In Error",description:x.message,variant:"destructive"})}}catch(x){l({title:"Error",description:x.message,variant:"destructive"})}finally{a(!1)}},p=async()=>{try{const x=window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"||window.location.hostname.includes(".local")?`http://localhost:${window.location.port||3e3}/app`:`${window.location.origin}/app`;console.log("OAuth redirect URL:",x);const{error:w}=await ye.auth.signInWithOAuth({provider:"google",options:{redirectTo:x}});w&&l({title:"Authentication Error",description:w.message,variant:"destructive"})}catch{l({title:"Error",description:"Failed to sign in with Google",variant:"destructive"})}};return u.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-primary/10 via-background to-secondary/10 flex flex-col",children:[u.jsx("div",{className:"container mx-auto px-4 py-6",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs(Ke,{to:"/",className:"flex items-center space-x-2",children:[u.jsx(Vo,{className:"h-6 w-6 text-primary"}),u.jsx("span",{className:"font-bold text-lg",children:"Scan Camera"})]}),u.jsx(Ke,{to:"/",children:u.jsxs(Ee,{variant:"ghost",size:"sm",children:[u.jsx(A_,{className:"w-4 h-4 mr-2"}),"Back to Home"]})})]})}),u.jsx("div",{className:"flex items-center justify-center px-4 pb-16 flex-1",children:u.jsxs(Pe,{className:"w-full max-w-md bg-card/50 backdrop-blur border border-white/10",children:[u.jsxs(ow,{className:"space-y-1",children:[u.jsx(iw,{className:"text-2xl text-center",children:e?"Create Account":"Welcome Back"}),u.jsx(aw,{className:"text-center",children:e?"Sign up to start sharing images":"Sign in to your account"})]}),u.jsxs(Ae,{className:"space-y-4",children:[u.jsx("div",{className:"flex justify-center",children:u.jsxs(Ee,{variant:"outline",onClick:p,disabled:i,className:"w-full",children:[u.jsxs("svg",{className:"w-4 h-4 mr-2",viewBox:"0 0 24 24",children:[u.jsx("path",{fill:"currentColor",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),u.jsx("path",{fill:"currentColor",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),u.jsx("path",{fill:"currentColor",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),u.jsx("path",{fill:"currentColor",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),"Sign ",e?"up":"in"," with Google"]})}),u.jsxs("div",{className:"relative",children:[u.jsx("div",{className:"absolute inset-0 flex items-center",children:u.jsx("span",{className:"w-full border-t"})}),u.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:u.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"Or continue with email"})})]}),u.jsxs("form",{onSubmit:f,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(md,{htmlFor:"email",children:"Email"}),u.jsx(eo,{id:"email",type:"email",placeholder:"Enter your email",value:n,onChange:h=>r(h.target.value),required:!0,"data-testid":"email-input"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(md,{htmlFor:"password",children:"Password"}),u.jsx(eo,{id:"password",type:"password",placeholder:"Enter your password",value:s,onChange:h=>o(h.target.value),required:!0,"data-testid":"password-input"}),e&&u.jsx("p",{className:"text-xs text-muted-foreground",children:"Password must be at least 6 characters long"})]}),u.jsxs(Ee,{type:"submit",className:"w-full",disabled:i,"data-testid":e?"signup-button":"login-button",children:[i?u.jsx(eS,{className:"w-4 h-4 mr-2 animate-spin"}):u.jsx(nS,{className:"w-4 h-4 mr-2"}),e?"Create Account":"Sign In"]})]}),u.jsx("div",{className:"text-center text-sm",children:u.jsx("button",{type:"button","data-testid":"signup-tab",onClick:()=>t(!e),className:"text-primary hover:underline",children:e?"Already have an account? Sign in":"Don't have an account? Sign up"})})]})]})}),u.jsx(lw,{})]})},Pa=({children:e})=>{const[t,n]=y.useState(null),[r,s]=y.useState(null),[o,i]=y.useState(!0);return y.useEffect(()=>{const{data:{subscription:a}}=ye.auth.onAuthStateChange((l,c)=>{s(c),n((c==null?void 0:c.user)??null),i(!1)});return ye.auth.getSession().then(({data:{session:l}})=>{s(l),n((l==null?void 0:l.user)??null),i(!1)}),()=>a.unsubscribe()},[]),o?u.jsx("div",{className:"min-h-screen flex items-center justify-center",children:u.jsx("div",{className:"animate-spin rounded-full h-32 w-32 border-b-2 border-primary"})}):t?u.jsx(u.Fragment,{children:e}):u.jsx(S2,{})},k2=()=>{const[e,t]=y.useState([{id:"qr-created",label:"QR Codes Created",icon:Vo,min:5e6,max:9999999,current:0},{id:"total-scans",label:"Total Scans",icon:V_,min:15e6,max:25e6,current:0},{id:"cta-clicks",label:"CTA Button Clicks",icon:Vu,min:25e5,max:75e5,current:0},{id:"image-downloads",label:"Image Downloads",icon:W_,min:8e6,max:15e6,current:0},{id:"unique-visitors",label:"Unique Visitors",icon:vf,min:35e5,max:85e5,current:0},{id:"created-today",label:"QR Codes Created Today",icon:$_,min:25e3,max:85e3,current:0},{id:"viral-shares",label:"Viral Shares This Month",icon:Py,min:85e4,max:25e5,current:0},{id:"active-campaigns",label:"Active Campaigns",icon:Ny,min:45e3,max:125e3,current:0}]),n=i=>{switch(i){case"qr-created":return"text-primary";case"total-scans":return"text-blue-500";case"cta-clicks":return"text-green-500";case"image-downloads":return"text-cyan-400";case"unique-visitors":return"text-orange-500";case"created-today":return"text-pink-500";case"viral-shares":return"text-fuchsia-200";case"active-campaigns":return"text-yellow-500";default:return"text-primary"}},r=(i,a)=>Math.floor(Math.random()*(a-i+1))+i,s=i=>i.toLocaleString(),o=()=>{t(i=>i.map(a=>({...a,current:r(a.min,a.max)})))};return y.useEffect(()=>{o();const i=setInterval(()=>{o()},3e4);return()=>clearInterval(i)},[]),u.jsx("div",{className:"py-6 px-4 bg-gradient-to-r from-primary/20 to-secondary/20",children:u.jsxs("div",{className:"container mx-auto max-w-7xl",children:[u.jsxs("div",{className:"text-center mb-4",children:[u.jsx("h2",{className:"text-4xl font-bold mb-4",children:"Join Millions of Happy Users"}),u.jsx("p",{className:"text-xl text-muted-foreground",children:"See the incredible impact our platform is making worldwide"})]}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:e.map(i=>{const a=i.icon;return u.jsx(Pe,{className:"text-center hover:shadow-lg transition-shadow",children:u.jsxs(Ae,{className:"p-6",children:[u.jsx("div",{className:"flex justify-center mb-4",children:u.jsx("div",{className:"w-12 h-12 bg-primary/10 rounded-lg flex items-center justify-center",children:u.jsx(a,{className:`w-6 h-6 ${n(i.id)}`})})}),u.jsx("div",{className:"text-3xl font-bold text-primary mb-2",children:s(i.current)}),u.jsx("div",{className:"text-sm text-muted-foreground font-medium",children:i.label})]})},i.id)})}),u.jsx("div",{className:"text-center mt-2",children:u.jsx("p",{className:"text-sm text-muted-foreground",children:"* Stats updated in real-time from our global network"})})]})})};function E2(e,t){y.useEffect(()=>{const n=r=>{const s=e==null?void 0:e.current;!s||s.contains(r.target)||t(r)};return document.addEventListener("mousedown",n),document.addEventListener("touchstart",n),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("touchstart",n)}},[e,t])}const C2=Nl("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function pm({className:e,variant:t,...n}){return u.jsx("div",{className:Re(C2({variant:t}),e),...n})}function Qt(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Kr(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const cw=6048e5,T2=864e5;let j2={};function Hl(){return j2}function wi(e,t){var a,l,c,d;const n=Hl(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((d=(c=n.locale)==null?void 0:c.options)==null?void 0:d.weekStartsOn)??0,s=Qt(e),o=s.getDay(),i=(o=s.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}function mm(e){const t=Qt(e);return t.setHours(0,0,0,0),t}function gm(e){const t=Qt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function P2(e,t){const n=mm(e),r=mm(t),s=+n-gm(n),o=+r-gm(r);return Math.round((s-o)/T2)}function N2(e){const t=uw(e),n=Kr(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),ul(n)}function O2(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function R2(e){if(!O2(e)&&typeof e!="number")return!1;const t=Qt(e);return!isNaN(Number(t))}function A2(e){const t=Qt(e),n=Kr(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}const I2={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},M2=(e,t,n)=>{let r;const s=I2[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Bc(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const L2={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},$2={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},D2={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},F2={date:Bc({formats:L2,defaultWidth:"full"}),time:Bc({formats:$2,defaultWidth:"full"}),dateTime:Bc({formats:D2,defaultWidth:"full"})},U2={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},z2=(e,t,n,r)=>U2[e];function To(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):i;s=e.formattingValues[a]||e.formattingValues[i]}else{const i=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;s=e.values[a]||e.values[i]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}const B2={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},W2={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},H2={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},V2={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},q2={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Q2={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},K2=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},G2={ordinalNumber:K2,era:To({values:B2,defaultWidth:"wide"}),quarter:To({values:W2,defaultWidth:"wide",argumentCallback:e=>e-1}),month:To({values:H2,defaultWidth:"wide"}),day:To({values:V2,defaultWidth:"wide"}),dayPeriod:To({values:q2,defaultWidth:"wide",formattingValues:Q2,defaultFormattingWidth:"wide"})};function jo(e){return(t,n={})=>{const r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const i=o[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?J2(a,f=>f.test(i)):Y2(a,f=>f.test(i));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const d=t.slice(i.length);return{value:c,rest:d}}}function Y2(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function J2(e,t){for(let n=0;n{const r=t.match(e.matchPattern);if(!r)return null;const s=r[0],o=t.match(e.parsePattern);if(!o)return null;let i=e.valueCallback?e.valueCallback(o[0]):o[0];i=n.valueCallback?n.valueCallback(i):i;const a=t.slice(s.length);return{value:i,rest:a}}}const Z2=/^(\d+)(th|st|nd|rd)?/i,eN=/\d+/i,tN={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},nN={any:[/^b/i,/^(a|c)/i]},rN={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},sN={any:[/1/i,/2/i,/3/i,/4/i]},oN={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},iN={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},aN={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},lN={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},cN={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},uN={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},dN={ordinalNumber:X2({matchPattern:Z2,parsePattern:eN,valueCallback:e=>parseInt(e,10)}),era:jo({matchPatterns:tN,defaultMatchWidth:"wide",parsePatterns:nN,defaultParseWidth:"any"}),quarter:jo({matchPatterns:rN,defaultMatchWidth:"wide",parsePatterns:sN,defaultParseWidth:"any",valueCallback:e=>e+1}),month:jo({matchPatterns:oN,defaultMatchWidth:"wide",parsePatterns:iN,defaultParseWidth:"any"}),day:jo({matchPatterns:aN,defaultMatchWidth:"wide",parsePatterns:lN,defaultParseWidth:"any"}),dayPeriod:jo({matchPatterns:cN,defaultMatchWidth:"any",parsePatterns:uN,defaultParseWidth:"any"})},fN={code:"en-US",formatDistance:M2,formatLong:F2,formatRelative:z2,localize:G2,match:dN,options:{weekStartsOn:0,firstWeekContainsDate:1}};function hN(e){const t=Qt(e);return P2(t,A2(t))+1}function pN(e){const t=Qt(e),n=+ul(t)-+N2(t);return Math.round(n/cw)+1}function dw(e,t){var d,f,p,h;const n=Qt(e),r=n.getFullYear(),s=Hl(),o=(t==null?void 0:t.firstWeekContainsDate)??((f=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??s.firstWeekContainsDate??((h=(p=s.locale)==null?void 0:p.options)==null?void 0:h.firstWeekContainsDate)??1,i=Kr(e,0);i.setFullYear(r+1,0,o),i.setHours(0,0,0,0);const a=wi(i,t),l=Kr(e,0);l.setFullYear(r,0,o),l.setHours(0,0,0,0);const c=wi(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function mN(e,t){var a,l,c,d;const n=Hl(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((d=(c=n.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??1,s=dw(e,t),o=Kr(e,0);return o.setFullYear(s,0,r),o.setHours(0,0,0,0),wi(o,t)}function gN(e,t){const n=Qt(e),r=+wi(n,t)-+mN(n,t);return Math.round(r/cw)+1}function re(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const $n={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return re(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):re(n+1,2)},d(e,t){return re(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return re(e.getHours()%12||12,t.length)},H(e,t){return re(e.getHours(),t.length)},m(e,t){return re(e.getMinutes(),t.length)},s(e,t){return re(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return re(s,t.length)}},ds={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},vm={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return $n.y(e,t)},Y:function(e,t,n,r){const s=dw(e,r),o=s>0?s:1-s;if(t==="YY"){const i=o%100;return re(i,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):re(o,t.length)},R:function(e,t){const n=uw(e);return re(n,t.length)},u:function(e,t){const n=e.getFullYear();return re(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return re(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return re(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return $n.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return re(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const s=gN(e,r);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):re(s,t.length)},I:function(e,t,n){const r=pN(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):re(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):$n.d(e,t)},D:function(e,t,n){const r=hN(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):re(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const s=e.getDay(),o=(s-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return re(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const s=e.getDay(),o=(s-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return re(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),s=r===0?7:r;switch(t){case"i":return String(s);case"ii":return re(s,t.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let s;switch(r===12?s=ds.noon:r===0?s=ds.midnight:s=r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let s;switch(r>=17?s=ds.evening:r>=12?s=ds.afternoon:r>=4?s=ds.morning:s=ds.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return $n.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):$n.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):re(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):re(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):$n.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):$n.s(e,t)},S:function(e,t){return $n.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return wm(r);case"XXXX":case"XX":return jr(r);case"XXXXX":case"XXX":default:return jr(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return wm(r);case"xxxx":case"xx":return jr(r);case"xxxxx":case"xxx":default:return jr(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ym(r,":");case"OOOO":default:return"GMT"+jr(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ym(r,":");case"zzzz":default:return"GMT"+jr(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return re(r,t.length)},T:function(e,t,n){const r=e.getTime();return re(r,t.length)}};function ym(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=Math.trunc(r/60),o=r%60;return o===0?n+String(s):n+String(s)+t+re(o,2)}function wm(e,t){return e%60===0?(e>0?"-":"+")+re(Math.abs(e)/60,2):jr(e,t)}function jr(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=re(Math.trunc(r/60),2),o=re(r%60,2);return n+s+t+o}const xm=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},fw=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},vN=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return xm(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",xm(r,t)).replace("{{time}}",fw(s,t))},yN={p:fw,P:vN},wN=/^D+$/,xN=/^Y+$/,bN=["D","DD","YY","YYYY"];function _N(e){return wN.test(e)}function SN(e){return xN.test(e)}function kN(e,t,n){const r=EN(e,t,n);if(console.warn(r),bN.includes(e))throw new RangeError(r)}function EN(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const CN=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,TN=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,jN=/^'([^]*?)'?$/,PN=/''/g,NN=/[a-zA-Z]/;function ON(e,t,n){var d,f,p,h;const r=Hl(),s=r.locale??fN,o=r.firstWeekContainsDate??((f=(d=r.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,i=r.weekStartsOn??((h=(p=r.locale)==null?void 0:p.options)==null?void 0:h.weekStartsOn)??0,a=Qt(e);if(!R2(a))throw new RangeError("Invalid time value");let l=t.match(TN).map(x=>{const w=x[0];if(w==="p"||w==="P"){const b=yN[w];return b(x,s.formatLong)}return x}).join("").match(CN).map(x=>{if(x==="''")return{isToken:!1,value:"'"};const w=x[0];if(w==="'")return{isToken:!1,value:RN(x)};if(vm[w])return{isToken:!0,value:x};if(w.match(NN))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:x}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));const c={firstWeekContainsDate:o,weekStartsOn:i,locale:s};return l.map(x=>{if(!x.isToken)return x.value;const w=x.value;(SN(w)||_N(w))&&kN(w,t,String(e));const b=vm[w[0]];return b(a,w,s.localize,c)}).join("")}function RN(e){const t=e.match(jN);return t?t[1].replace(PN,"'"):e}const hw="rjlsoftware@gmail.com",AN=async()=>{try{console.log("๐Ÿ” Checking admin online status...");const{data:e,error:t}=await ye.from("admin_presence").select("is_online, last_heartbeat").eq("admin_email",hw).single();if(t)return console.log("โœ… Admin is: OFFLINE (no presence record found)"),!1;if(!e)return console.log("โœ… Admin is: OFFLINE (no presence data)"),!1;const n=new Date(Date.now()-1*60*1e3),r=new Date(e.last_heartbeat),s=e.is_online&&r>n;return console.log("โœ… Admin status:",{is_online:e.is_online,last_heartbeat:e.last_heartbeat,age_minutes:(Date.now()-r.getTime())/(60*1e3),status:s?"ONLINE":"OFFLINE"}),s}catch{return console.log("โœ… Admin is: OFFLINE (error occurred, treating as offline)"),!1}},IN=async e=>{try{console.log("๐Ÿ“ Creating new chat session:",e);const{data:t,error:n}=await ye.from("chat_sessions").insert(e).select().single();return n?(console.error("โŒ Failed to create chat session:",n),null):(console.log("โœ… Chat session created:",t.id),t)}catch(t){return console.error("โŒ Error creating chat session:",t),null}},MN=async e=>{try{const{data:t,error:n}=await ye.from("chat_sessions").select("*").eq("guest_id",e).eq("status","active").order("created_at",{ascending:!1}).limit(1).single();return n||!t?null:t}catch(t){return console.error("โŒ Error finding active session:",t),null}},LN=async e=>{try{console.log("๐Ÿ’ฌ Sending message:",e);const{data:t,error:n}=await ye.from("chat_messages").insert(e).select().single();if(n)return console.error("โŒ Failed to send message:",n),null;console.log("โœ… Message saved to database:",t.id);const r=`messages_${e.session_id}`;console.log("๐Ÿ“ข Broadcasting message to channel:",r);try{await ye.channel(r).send({type:"broadcast",event:"new_message",payload:t}),console.log("๐Ÿ“ข Message broadcasted successfully to:",r),await ye.channel("admin-updates").send({type:"broadcast",event:"session_activity",payload:{sessionId:e.session_id,lastActivity:new Date().toISOString(),newMessage:t}})}catch(s){console.error("๐Ÿ“ข Broadcast failed:",s)}return t}catch(t){return console.error("โŒ Error sending message:",t),null}},$N=async e=>{try{const{data:t,error:n}=await ye.from("chat_messages").select("*").eq("session_id",e).order("created_at",{ascending:!0});return n?(console.error("โŒ Failed to get messages:",n),[]):t||[]}catch(t){return console.error("โŒ Error getting messages:",t),[]}},DN=(e,t,n)=>(console.log("๐Ÿ”” Creating BROADCAST-ONLY subscription for session:",e),ye.channel(`messages_${e}`,{config:{broadcast:{self:!0}}}).on("broadcast",{event:"new_message"},s=>{console.log("๐Ÿ“ข New message via broadcast:",s),s.payload&&t(s.payload)}).on("broadcast",{event:"session_ended"},s=>{console.log("๐Ÿ›‘ Session ended notification received:",s),n&&n()}).subscribe((s,o)=>{console.log("๐Ÿ“ก Broadcast subscription status:",s,o),s==="SUBSCRIBED"?console.log("โœ… Successfully subscribed to BROADCAST for session:",e):s==="TIMED_OUT"?console.error("โฐ Broadcast subscription timed out for session:",e):s==="CLOSED"?console.log("๐Ÿ“ช Broadcast subscription closed for session:",e):s==="CHANNEL_ERROR"&&console.error("โŒ Broadcast subscription error for session:",e,o)})),qO=async e=>{try{const{error:t}=await ye.from("admin_presence").upsert({admin_email:hw,is_online:e,last_heartbeat:new Date().toISOString()});return t?(console.error("โŒ Failed to update admin presence:",t),!1):!0}catch(t){return console.error("โŒ Error updating admin presence:",t),!1}},Po=async e=>{try{await ye.from("chat_sessions").update({last_activity:new Date().toISOString(),status:"active"}).eq("id",e),console.log("๐Ÿ’“ Session heartbeat updated:",e)}catch(t){console.error("โŒ Failed to update session heartbeat:",t)}},FN=async()=>{try{console.log("๐Ÿงน Running automatic session cleanup...");const e=new Date(Date.now()-1*60*1e3),{data:t,error:n}=await ye.from("chat_sessions").select("id, user_email, last_activity").eq("status","active").lt("last_activity",e.toISOString());if(n)return console.error("โŒ Error finding inactive sessions:",n),0;if(!t||t.length===0)return console.log("โœ… No inactive sessions to clean"),0;console.log("๐Ÿ—‘๏ธ Found",t.length,"inactive sessions to clean");const{error:r}=await ye.from("chat_sessions").update({status:"ended",ended_at:new Date().toISOString()}).eq("status","active").lt("last_activity",e.toISOString());return r?(console.error("โŒ Error cleaning inactive sessions:",r),0):(console.log("โœ… Cleaned",t.length,"inactive sessions"),t.length)}catch(e){return console.error("โŒ Session cleanup failed:",e),0}},UN=async()=>{try{const e=new Date(Date.now()-6e4),{error:t}=await ye.from("admin_presence").update({is_online:!1}).eq("is_online",!0).lt("last_heartbeat",e.toISOString());t?console.error("โŒ Failed to cleanup stale admin presence:",t):console.log("๐Ÿงน Cleaned up stale admin presence records")}catch(e){console.error("โŒ Admin presence cleanup failed:",e)}},QO=()=>{console.log("๐Ÿš€ Starting automatic cleanup service (every 30 seconds)");const e=async()=>{await FN(),await UN()};return e(),setInterval(e,30*1e3)},KO=async e=>{try{const t=`messages_${e}`,n=ye.channel(t);await n.send({type:"broadcast",event:"session_ended",payload:{session_id:e,ended_at:new Date().toISOString(),message:"This chat session has been ended by support."}}),console.log("๐Ÿ“ข Session end broadcasted to:",t),await n.unsubscribe()}catch(t){console.error("โŒ Failed to broadcast session end:",t)}},zN=({chatSession:e,currentUserEmail:t,currentUserName:n,isAdminOnline:r=!1})=>{const[s,o]=y.useState([]),[i,a]=y.useState(""),[l,c]=y.useState(!1),d=y.useRef(null),f=y.useRef(null),{toast:p}=Pi(),h=()=>{d.current&&d.current.scrollIntoView({behavior:"smooth"})};y.useEffect(()=>{h()},[s]),y.useEffect(()=>{const v=()=>{if(f.current&&!l){const g=document.activeElement,_=(g==null?void 0:g.tagName)==="INPUT"||(g==null?void 0:g.tagName)==="TEXTAREA";(!g||g===document.body||g===f.current||!_&&!g.closest("[contenteditable]"))&&f.current.focus()}};v();const m=setTimeout(v,100);return()=>{clearTimeout(m)}},[s.length,l]),y.useEffect(()=>{const v=()=>{setTimeout(()=>{f.current&&f.current.focus()},100)},m=()=>{!document.hidden&&f.current&&setTimeout(()=>{f.current.focus()},100)};return window.addEventListener("focus",v),document.addEventListener("visibilitychange",m),()=>{window.removeEventListener("focus",v),document.removeEventListener("visibilitychange",m)}},[]),y.useEffect(()=>{(async()=>{console.log("๐Ÿ”„ Loading messages for session:",e.id),console.log("๐Ÿ”„ Current user info:",{email:t,name:n,sessionId:e.id,sessionStatus:e.status});const m=await $N(e.id);console.log("๐Ÿ“จ Loaded messages:",m),console.log("๐Ÿ“Š Messages summary:",{total:m.length,adminMessages:m.filter(g=>g.is_admin).length,userMessages:m.filter(g=>!g.is_admin).length}),o(m)})()},[e.id]),y.useEffect(()=>{console.log("๐Ÿ”” Setting up subscription for session:",e.id);const v=DN(e.id,m=>{console.log("๐Ÿ“จ Received new message via subscription:",m),o(g=>g.some(_=>_.id===m.id)?(console.log("๐Ÿ“ Message already exists, skipping duplicate"),g):(console.log("๐Ÿ“ Adding message to existing messages:",g.length,"โ†’",g.length+1),[...g,m])),h(),setTimeout(()=>{var g;return(g=f.current)==null?void 0:g.focus()},100)},()=>{console.log("๐Ÿ›‘ Session has been ended by admin"),p({variant:"destructive",title:"Chat Session Ended",description:"This chat session has been ended by our support team."}),o(m=>[...m,{id:`system_${Date.now()}`,session_id:e.id,is_admin:!0,sender_name:"System",content:"๐Ÿ›‘ This chat session has been ended by our support team. Thank you for contacting us!",created_at:new Date().toISOString()}]),c(!0)});return()=>{console.log("๐Ÿ”Œ Unsubscribing from messages"),v.unsubscribe()}},[e.id]),y.useEffect(()=>{console.log("๐Ÿ’“ Starting session heartbeat for:",e.id),Po(e.id);const v=setInterval(()=>{Po(e.id)},30*1e3);let m=null,g=Date.now();const _=()=>{const k=Date.now();m&&clearTimeout(m),k-g>=3e4?(Po(e.id),g=k):m=setTimeout(()=>{Po(e.id),g=Date.now()},2e3)},S=()=>{console.log("๐Ÿ‘‹ User leaving page, session will auto-expire in 1 minute:",e.id)};return window.addEventListener("click",_),window.addEventListener("keypress",_),window.addEventListener("scroll",_),window.addEventListener("beforeunload",S),()=>{console.log("๐Ÿ’“ Stopping session heartbeat for:",e.id),clearInterval(v),m&&clearTimeout(m),window.removeEventListener("click",_),window.removeEventListener("keypress",_),window.removeEventListener("scroll",_),window.removeEventListener("beforeunload",S)}},[e.id]);const x=async v=>{if(v.preventDefault(),!i.trim()||l)return;const m=i.trim();a(""),c(!0);const g={session_id:e.id,is_admin:!1,sender_name:n||t,content:m};console.log("๐Ÿš€ Sending message:",g);try{const _=await LN(g);if(console.log("โœ… Message sent result:",_),!_)throw new Error("Failed to send message");Po(e.id),console.log("๐Ÿ“จ Sent message will be added via subscription..."),setTimeout(()=>{var S;return(S=f.current)==null?void 0:S.focus()},100)}catch(_){console.error("โŒ Error sending message:",_),p({variant:"destructive",title:"Failed to send message",description:"Please try again."}),a(m)}finally{c(!1)}},w=v=>!v.is_admin&&v.sender_name===(n||t),b=v=>v.is_admin?"Support Team":v.sender_name;return u.jsxs("div",{className:"flex flex-col h-full",children:[u.jsxs("div",{className:"flex items-center justify-between p-4 border-b",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center",children:u.jsx(vf,{className:"w-4 h-4 text-blue-600"})}),u.jsx("div",{children:u.jsx("h3",{className:"font-semibold text-sm",children:"Support Chat"})})]}),r?u.jsx(pm,{className:"text-xs bg-green-100 text-green-800 border border-green-200 hover:bg-green-100",children:"Online"}):u.jsx(pm,{variant:"secondary",className:"text-xs",children:e.status})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4",children:[s.length===0?u.jsxs("div",{className:"text-center text-muted-foreground py-8",children:[u.jsx(Ty,{className:"w-8 h-8 mx-auto mb-2 opacity-50"}),u.jsx("p",{children:"No messages yet. Start the conversation!"})]}):u.jsx(u.Fragment,{children:s.map(v=>u.jsx("div",{className:`flex ${w(v)?"justify-end":"justify-start"}`,children:u.jsxs("div",{className:`max-w-xs lg:max-w-md px-4 py-2 rounded-lg ${w(v)?"bg-blue-600 text-white":v.is_admin?"bg-green-100 text-green-800 border border-green-200":"bg-gray-100 text-gray-800"}`,children:[u.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[u.jsx("span",{className:"text-xs font-medium",children:b(v)}),u.jsx("span",{className:"text-xs opacity-70",children:ON(new Date(v.created_at),"h:mm a")})]}),u.jsx("p",{className:"text-sm whitespace-pre-wrap",children:v.content})]})},v.id))}),u.jsx("div",{ref:d})]}),u.jsx("div",{className:"p-4 border-t",children:u.jsxs("form",{onSubmit:x,className:"flex gap-2",children:[u.jsx(eo,{ref:f,type:"text",value:i,onChange:v=>a(v.target.value),placeholder:"Type your message...",className:"flex-1",disabled:l}),u.jsx(Ee,{type:"submit",size:"sm",disabled:l||!i.trim(),children:u.jsx(jy,{className:"w-4 h-4"})})]})})]})},pw=y.forwardRef(({className:e,...t},n)=>u.jsx("textarea",{className:Re("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));pw.displayName="Textarea";const BN=({userName:e="",userEmail:t="",supportEmail:n="support@scan.camera",onSuccess:r})=>{const[s,o]=y.useState({name:e,email:t,message:""}),[i,a]=y.useState(!1),{toast:l}=Pi(),c=y.useRef(null);y.useEffect(()=>{const f=()=>{c.current&&c.current.focus()};f();const p=setTimeout(f,100);return()=>clearTimeout(p)},[]);const d=async f=>{if(f.preventDefault(),!s.name||!s.email||!s.message){l({title:"Missing information",description:"Please fill in all fields.",variant:"destructive"});return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s.email)){l({title:"Invalid email",description:"Please enter a valid email address.",variant:"destructive"});return}a(!0);try{console.log("๐Ÿ“ง Sending contact email...",{name:s.name,email:s.email,messageLength:s.message.length,supportEmail:n});const{data:h,error:x}=await ye.functions.invoke("send-contact-email",{body:{name:s.name,email:s.email,message:s.message,supportEmail:n||"support@scan.camera"}});if(console.log("๐Ÿ“ง Contact email response:",{data:h,error:x}),x)throw console.error("๐Ÿ“ง Contact email error:",x),x;l({title:"Message sent!",description:"We've received your message and will get back to you soon.",variant:"default"}),o({name:e,email:t,message:""}),r==null||r()}catch(h){console.error("Error sending email:",h),l({title:"Error",description:"Failed to send message. Please try again.",variant:"destructive"})}finally{a(!1)}};return u.jsxs("div",{className:"flex flex-col h-full max-h-full overflow-hidden",children:[u.jsxs("div",{className:"text-center p-3 pb-2 border-b shrink-0",children:[u.jsx("h3",{className:"font-semibold text-base mb-1",children:"Send us a message"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Our support team is currently offline. Send us an email and we'll get back to you as soon as possible."})]}),u.jsx("div",{className:"flex-1 overflow-y-auto min-h-0",children:u.jsxs("form",{onSubmit:d,className:"p-3 space-y-1 h-full",children:[u.jsx("div",{className:"space-y-2",children:u.jsx(eo,{ref:c,placeholder:"Your name",value:s.name,onChange:f=>o({...s,name:f.target.value}),required:!0,disabled:i,className:"text-sm"})}),u.jsx("div",{className:"space-y-2",children:u.jsx(eo,{type:"email",placeholder:"Your email address",value:s.email,onChange:f=>o({...s,email:f.target.value}),required:!0,disabled:i,className:"text-sm"})}),u.jsx("div",{className:"space-y-2",children:u.jsx(pw,{placeholder:"How can we help you?",value:s.message,onChange:f=>o({...s,message:f.target.value}),required:!0,disabled:i,rows:3,className:"resize-none min-h-[60px] text-sm"})})]})}),u.jsxs("div",{className:"p-3 pt-2 border-t bg-background shrink-0",children:[u.jsx(Ee,{type:"submit",onClick:d,className:"w-full",disabled:i,children:i?u.jsx(u.Fragment,{children:"Sending..."}):u.jsxs(u.Fragment,{children:[u.jsx(jy,{className:"w-4 h-4 mr-2"}),"Send Message"]})}),u.jsx("p",{className:"text-xs text-muted-foreground text-center mt-1",children:"You'll receive a confirmation email once your message is sent."})]})]})},WN=({userEmail:e,userName:t,supportEmail:n="support@scan.camera"})=>{const[r,s]=y.useState(!1),[o,i]=y.useState(null),[a,l]=y.useState(""),[c,d]=y.useState(!1),[f,p]=y.useState(!1);y.useState(!1);const{toast:h}=Pi();y.useEffect(()=>{if(!e&&!a){const _=`guest_${Math.random().toString(36).substr(2,9)}`;l(_)}},[e,a]);const x=e||a,w=t||`Guest_${a.slice(-6)}`,b=async()=>{try{const _=await AN();p(_)}catch{console.log("โ„น๏ธ Admin status check failed, treating as offline"),p(!1)}finally{}},v=async()=>{if(x)try{d(!0);const _=await MN(x);if(_){console.log("โœ… Found existing session:",_.id),i(_);return}const S=await IN({guest_id:x,user_name:w,user_email:e});if(S)console.log("โœ… Chat session created:",S.id),i(S);else throw new Error("Failed to create chat session")}catch(_){console.error("โŒ Error creating chat session:",_),h({variant:"destructive",title:"Connection Failed",description:"Failed to start chat. Please try again."})}finally{d(!1)}},m=async _=>{if(_&&_.preventDefault(),await b(),!f){h({title:"Support Team Offline",description:"Our support team is currently offline. Please send us an email instead.",variant:"destructive"});return}await v()};y.useEffect(()=>{setTimeout(b,1e3);const _=k=>{const E=k.detail,j=Date.now()-1*60*1e3,A=E.isOnline&&E.lastHeartbeat>j;console.log("๐Ÿ“ก Received admin presence update:",E),console.log("๐Ÿ“ก Updated admin status:",A?"ONLINE":"OFFLINE"),p(A)},S=setInterval(()=>{b()},1e4);return window.addEventListener("admin-presence-change",_),()=>{clearInterval(S),window.removeEventListener("admin-presence-change",_)}},[r]),y.useEffect(()=>{r&&b()},[r]),y.useEffect(()=>{e&&r&&!o&&f&&v()},[e,r,o,f]);const g=()=>{s(!r)};return u.jsxs("div",{className:"chat-widget-mobile",children:[!r&&u.jsxs("div",{className:"relative w-full h-full",children:[u.jsx(Ee,{onClick:g,className:"rounded-full shadow-lg hover:shadow-xl transition-shadow w-full h-full flex items-center justify-center p-0 border-2 border-primary",style:{minWidth:"unset",minHeight:"unset"},children:u.jsx(wp,{className:"w-6 h-6"})}),f&&u.jsx("div",{className:"absolute -top-2 -right-2 bg-green-500 text-white border-2 border-white rounded-full px-2 py-1 text-xs font-medium shadow-md",children:"Online"})]}),r&&u.jsx("div",{className:"chat-window-mobile",children:u.jsxs(Pe,{className:"w-full max-w-sm h-[min(calc(100vh-120px),500px)] flex flex-col shadow-2xl border-2",children:[u.jsxs("div",{className:"flex items-center justify-between px-4 py-1 border-b bg-primary text-primary-foreground rounded-t-lg shrink-0",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(wp,{className:"w-5 h-5"}),u.jsx("span",{className:"font-semibold",children:"Live Chat"}),u.jsx("div",{className:`w-2 h-2 rounded-full ml-2 ${f?"bg-green-400":"bg-red-400"}`})]}),u.jsx(Ee,{variant:"ghost",size:"icon",onClick:g,className:"text-primary-foreground hover:bg-primary-foreground/20 w-8 h-8",children:u.jsx(yf,{className:"w-4 h-4"})})]}),u.jsx("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:o?u.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:u.jsx(zN,{chatSession:o,currentUserEmail:x,currentUserName:w,isAdminOnline:f})}):u.jsxs("div",{className:"flex-1 flex flex-col justify-center p-3 space-y-2",children:[u.jsx("div",{className:"text-center mb-1",children:u.jsxs("div",{className:`inline-flex items-center gap-2 px-3 py-1 rounded-full text-sm ${f?"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200":"bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200"}`,children:[u.jsx("div",{className:`w-2 h-2 rounded-full ${f?"bg-green-500":"bg-red-500"}`}),f?"Support Online":"Support Offline"]})}),f?u.jsxs("div",{className:"text-center",children:[u.jsxs("div",{className:"mb-4",children:[u.jsx("h3",{className:"font-semibold",children:"Start Live Chat"}),u.jsxs("p",{className:"text-sm text-muted-foreground mb-4",children:[e?"Welcome back!":"Chat anonymously"," - Connect instantly with our support team"]})]}),u.jsx(Ee,{onClick:m,className:"w-full",disabled:c,size:"lg",children:c?"Connecting...":"๐Ÿ’ฌ Start Chatting"}),u.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"No email required for live chat!"})]}):u.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:u.jsx(BN,{userName:t,userEmail:e,supportEmail:n,onSuccess:()=>{s(!1),h({title:"Message Sent!",description:"Your message has been sent to our support team. We'll get back to you soon!"})}})})]})})]})})]})},HN=()=>{const[e,t]=y.useState(!1),n=y.useRef(null);E2(n,()=>t(!1));const r=s=>{var o;(o=document.getElementById(s))==null||o.scrollIntoView({behavior:"smooth"}),t(!1)};return u.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-primary/10 via-background to-secondary/10",children:[u.jsx("nav",{className:"container mx-auto px-4 py-4 relative",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx(Vo,{className:"h-6 w-6 text-primary"}),u.jsx("span",{className:"font-bold text-lg",children:"Scan Camera"})]}),u.jsxs("div",{className:"hidden md:flex items-center space-x-6",children:[u.jsx("button",{onClick:()=>r("features"),className:"text-sm font-medium hover:text-primary transition-colors",children:"Learn More"}),u.jsx(Ke,{to:"/pricing",className:"text-sm font-medium hover:text-primary transition-colors",children:"Pricing"}),u.jsx(Ke,{to:"/comparison",className:"text-sm font-medium hover:text-primary transition-colors",children:"Compare"}),u.jsx("button",{onClick:()=>r("testimonials"),className:"text-sm font-medium hover:text-primary transition-colors",children:"Testimonials"}),u.jsx(Ke,{to:"/app",children:u.jsx(Ee,{size:"sm",className:"font-medium",children:"Sign In"})})]}),u.jsxs("div",{ref:n,className:"relative md:hidden",children:[u.jsx(Ee,{variant:"ghost",size:"sm",onClick:()=>t(!e),children:e?u.jsx(yf,{className:"h-5 w-5"}):u.jsx(sS,{className:"h-5 w-5"})}),e&&u.jsx("div",{className:"absolute top-full right-0 z-50 w-screen md:hidden bg-background border border-border rounded-lg shadow-lg mt-2 animate-in slide-in-from-top-5",children:u.jsxs("div",{className:"p-4 flex flex-col space-y-3",children:[u.jsx("button",{onClick:()=>r("features"),className:"text-left text-sm font-medium hover:text-primary transition-colors p-2 rounded hover:bg-muted",children:"Learn More"}),u.jsx(Ke,{to:"/pricing",className:"text-left text-sm font-medium hover:text-primary transition-colors p-2 rounded hover:bg-muted block",children:"Pricing"}),u.jsx(Ke,{to:"/comparison",className:"text-left text-sm font-medium hover:text-primary transition-colors p-2 rounded hover:bg-muted block",children:"Compare"}),u.jsx("button",{onClick:()=>r("testimonials"),className:"text-left text-sm font-medium hover:text-primary transition-colors p-2 rounded hover:bg-muted",children:"Testimonials"}),u.jsx(Ke,{to:"/app",className:"w-full",children:u.jsx(Ee,{size:"sm",className:"font-medium w-full",children:"Sign In"})})]})})]})]})}),u.jsxs("div",{className:"container mx-auto px-4 py-4",children:[u.jsxs("div",{className:"text-center space-y-4",children:[u.jsx("div",{className:"flex justify-center",children:u.jsx(Vo,{className:"h-32 w-32 text-primary"})}),u.jsxs("div",{className:"space-y-2",children:[u.jsx("h1",{className:"text-5xl md:text-6xl font-bold bg-gradient-to-r from-primary to-secondary bg-clip-text text-transparent animate-fade-in",children:"Go Viral with Smart QR Codes"}),u.jsx("p",{className:"text-xl text-muted-foreground max-w-3xl mx-auto",children:"Create QR codes that drive traffic to YOUR content! Replace images anytime, add call-to-action buttons, track clicks, and control exactly what people see when they scan. Perfect for going viral on social media!"})]}),u.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-center",children:[u.jsx(Ke,{to:"/app",children:u.jsx(Ee,{size:"lg",className:"text-lg px-8",children:"Get Started Free"})}),u.jsx(Ee,{variant:"outline",size:"lg",className:"text-lg px-8",onClick:()=>{var s;return(s=document.getElementById("features"))==null?void 0:s.scrollIntoView({behavior:"smooth"})},children:"Learn More"})]})]}),u.jsxs("div",{id:"features",className:"mt-8 grid md:grid-cols-3 gap-8",children:[u.jsx(Pe,{className:"text-center p-6",children:u.jsxs(Ae,{className:"space-y-4",children:[u.jsx("div",{className:"flex justify-center",children:u.jsx(xp,{className:"h-12 w-12 text-yellow-400"})}),u.jsx("h3",{className:"text-xl font-semibold",children:"Replace Images Anytime"}),u.jsx("p",{className:"text-muted-foreground",children:"QR code stays the same, but you control what people see! Perfect for business cards, social media, and marketing campaigns."})]})}),u.jsx(Pe,{className:"text-center p-6",children:u.jsxs(Ae,{className:"space-y-4",children:[u.jsx("div",{className:"flex justify-center",children:u.jsx(Vu,{className:"h-12 w-12 text-orange-500"})}),u.jsx("h3",{className:"text-xl font-semibold",children:"Call-to-Action Buttons"}),u.jsx("p",{className:"text-muted-foreground",children:"Add custom buttons that drive traffic to your TikTok, Instagram, website, or any URL. Full emoji support!"})]})}),u.jsx(Pe,{className:"text-center p-6",children:u.jsxs(Ae,{className:"space-y-4",children:[u.jsx("div",{className:"flex justify-center",children:u.jsx(U_,{className:"h-12 w-12 text-teal-400"})}),u.jsx("h3",{className:"text-xl font-semibold",children:"URL Click Analytics"}),u.jsx("p",{className:"text-muted-foreground",children:"Track exactly who clicks your call-to-action buttons. Change where buttons go anytime - perfect for viral campaigns!"})]})})]}),u.jsxs("div",{className:"mt-6 text-center space-y-8 mb-2",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-center gap-3 mb-4",children:[u.jsx(jS,{className:"w-12 h-12 text-green-500"}),u.jsx("h2",{className:"text-4xl font-bold",children:"Endless Ways to Go Viral!"})]}),u.jsx("p",{className:"text-lg text-muted-foreground max-w-3xl mx-auto",children:"From business cards to social media campaigns - discover how our smart QR codes can help you reach millions!"})]}),u.jsxs("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6 max-w-6xl mx-auto",children:[u.jsx(Pe,{className:"p-6 hover:shadow-lg transition-shadow",children:u.jsxs(Ae,{className:"space-y-4",children:[u.jsx("div",{className:"flex justify-center",children:u.jsx(pS,{className:"h-10 w-10 text-blue-500"})}),u.jsx("h3",{className:"text-lg font-semibold",children:"Social Media Growth"}),u.jsx("p",{className:"text-muted-foreground text-sm",children:"Put QR codes on flyers, business cards, or posters. Drive massive traffic to your TikTok, Instagram, YouTube - watch your followers explode!"})]})}),u.jsx(Pe,{className:"p-6 hover:shadow-lg transition-shadow",children:u.jsxs(Ae,{className:"space-y-4",children:[u.jsx("div",{className:"flex justify-center",children:u.jsx(vf,{className:"h-10 w-10 text-yellow-500"})}),u.jsx("h3",{className:"text-lg font-semibold",children:"Events & Networking"}),u.jsx("p",{className:"text-muted-foreground text-sm",children:"Sports events, conferences, parties! Share team rosters, event photos, or networking info. One scan = instant connection!"})]})}),u.jsx(Pe,{className:"p-6 hover:shadow-lg transition-shadow",children:u.jsxs(Ae,{className:"space-y-4",children:[u.jsx("div",{className:"flex justify-center",children:u.jsx(bp,{className:"h-10 w-10 text-red-500"})}),u.jsx("h3",{className:"text-lg font-semibold",children:"Restaurant Specials"}),u.jsx("p",{className:"text-muted-foreground text-sm",children:"Weekly specials, new menu items, happy hour deals! Update images daily while QR codes stay the same. Customers love it!"})]})}),u.jsx(Pe,{className:"p-6 hover:shadow-lg transition-shadow",children:u.jsxs(Ae,{className:"space-y-4",children:[u.jsx("div",{className:"flex justify-center",children:u.jsx(jc,{className:"h-10 w-10 text-purple-500"})}),u.jsx("h3",{className:"text-lg font-semibold",children:"Photography Business"}),u.jsx("p",{className:"text-muted-foreground text-sm",children:"Wedding photographers, event shooters! Share galleries instantly, add buttons directing to booking pages. Turn every photo into a lead!"})]})}),u.jsx(Pe,{className:"p-6 hover:shadow-lg transition-shadow",children:u.jsxs(Ae,{className:"space-y-4",children:[u.jsx("div",{className:"flex justify-center",children:u.jsx(Vo,{className:"h-10 w-10 text-orange-500"})}),u.jsx("h3",{className:"text-lg font-semibold",children:"Business Cards 2.0"}),u.jsx("p",{className:"text-muted-foreground text-sm",children:"Print once, update forever! Share your latest work, portfolio updates, or seasonal promotions. Your business card never gets outdated!"})]})}),u.jsx(Pe,{className:"p-6 hover:shadow-lg transition-shadow",children:u.jsxs(Ae,{className:"space-y-4",children:[u.jsx("div",{className:"flex justify-center",children:u.jsx(dS,{className:"h-10 w-10 text-pink-500"})}),u.jsx("h3",{className:"text-lg font-semibold",children:"Product Launches"}),u.jsx("p",{className:"text-muted-foreground text-sm",children:"Launch new products with a bang! Share teasers, then switch to full reveals. Track engagement and build massive anticipation!"})]})})]})]}),u.jsxs("div",{className:"mt-6 mb-6 text-center space-y-6",children:[u.jsxs("div",{children:[u.jsx("h2",{className:"text-3xl font-bold mb-4",children:"The Ultimate Viral Marketing Tool"}),u.jsx("p",{className:"text-lg text-muted-foreground",children:"No setup, no coding, just point-and-click configuration that drives real results"})]}),u.jsxs("div",{className:"grid md:grid-cols-2 gap-8 max-w-6xl mx-auto",children:[u.jsxs("div",{className:"flex items-start space-x-4",children:[u.jsx(gS,{className:"h-8 w-8 text-green-500 mt-1"}),u.jsxs("div",{className:"text-left",children:[u.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Free Tier Forever"}),u.jsx("p",{className:"text-muted-foreground",children:"Get started with no credit card required! Free tier includes up to 5 QR codes, 1-7 day expiration, and all core features. Upgrade for unlimited codes and longer expiration."})]})]}),u.jsxs("div",{className:"flex items-start space-x-4",children:[u.jsx(Ny,{className:"h-8 w-8 text-yellow-500 mt-1"}),u.jsxs("div",{className:"text-left",children:[u.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Lightning Fast Setup"}),u.jsx("p",{className:"text-muted-foreground",children:"Upload an image, get your QR code in seconds. No coding, no complex setup. We automatically optimize images and generate high-quality QR codes instantly."})]})]}),u.jsxs("div",{className:"flex items-start space-x-4",children:[u.jsx(Vu,{className:"h-8 w-8 text-blue-500 mt-1"}),u.jsxs("div",{className:"text-left",children:[u.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Drive Traffic Like Never Before"}),u.jsx("p",{className:"text-muted-foreground",children:"Add custom call-to-action buttons that send people to your socials, website, or any URL. Customize button text with emojis and track every single click with detailed analytics."})]})]}),u.jsxs("div",{className:"flex items-start space-x-4",children:[u.jsx(xp,{className:"h-8 w-8 text-purple-500 mt-1"}),u.jsxs("div",{className:"text-left",children:[u.jsx("h3",{className:"text-lg font-semibold mb-2",children:"QR Code Stays, Content Changes"}),u.jsx("p",{className:"text-muted-foreground",children:"Print your QR code once, update the image and call-to-action anytime! Perfect for business cards, marketing materials, and viral campaigns that evolve over time."})]})]}),u.jsxs("div",{className:"flex items-start space-x-4",children:[u.jsx(Ty,{className:"h-8 w-8 text-orange-500 mt-1"}),u.jsxs("div",{className:"text-left",children:[u.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Smart Expiration Control"}),u.jsx("p",{className:"text-muted-foreground",children:"Set expiration from 1 day to 1 year, or change it anytime. Perfect for temporary promotions, events, or long-term sharing. Full control over your content lifecycle."})]})]}),u.jsxs("div",{className:"flex items-start space-x-4",children:[u.jsx(Py,{className:"h-8 w-8 text-pink-500 mt-1"}),u.jsxs("div",{className:"text-left",children:[u.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Advanced Click Analytics"}),u.jsx("p",{className:"text-muted-foreground",children:"Track not just QR scans, but also CTA button clicks! See exactly which campaigns drive the most traffic and optimize your viral marketing strategy in real-time. Pro plans include automatic UTM campaign tracking for seamless Google Analytics integration."})]})]})]})]}),u.jsx("div",{className:"mt-12 mb-12 text-center",children:u.jsxs("div",{className:"bg-gradient-to-r from-primary/10 to-secondary/10 rounded-xl p-8 border border-primary/20",children:[u.jsx("h3",{className:"text-2xl font-bold mb-4",children:"How do we compare to Linktree, QR Code Generator & others?"}),u.jsx("p",{className:"text-lg text-muted-foreground mb-6 max-w-2xl mx-auto",children:"See our honest, feature-by-feature comparison with the top 7 competitors. Weekly updates, transparent pricing, and real advantages."}),u.jsx(Ke,{to:"/comparison",children:u.jsxs(Ee,{size:"lg",variant:"outline",className:"border-primary/30 hover:bg-primary/10",children:[u.jsx(Y_,{className:"w-8 h-8 mr-2 text-yellow-300"}),"Compare All Features"]})})]})}),u.jsxs("div",{id:"pricing-cta",className:"mt-16 mb-16 text-center bg-gradient-to-r from-primary/10 to-secondary/10 rounded-2xl p-12",children:[u.jsx("h2",{className:"text-4xl font-bold mb-4",children:"Simple, Transparent Pricing"}),u.jsx("p",{className:"text-xl text-muted-foreground mb-8 max-w-2xl mx-auto",children:"Start free forever or choose a plan that grows with your business. No hidden fees, cancel anytime."}),u.jsxs("div",{className:"grid md:grid-cols-3 gap-6 mb-8 max-w-4xl mx-auto",children:[u.jsxs("div",{className:"bg-background/50 rounded-lg p-6 border",children:[u.jsx("div",{className:"flex items-center justify-center mb-3",children:u.jsx(K_,{className:"w-8 h-8 text-green-500"})}),u.jsx("h3",{className:"text-xl font-bold mb-2",children:"Free"}),u.jsx("p",{className:"text-3xl font-bold text-primary mb-4",children:"$0"}),u.jsxs("ul",{className:"text-left space-y-2 text-sm text-muted-foreground",children:[u.jsx("li",{children:"โœ… 3 active QR codes"}),u.jsx("li",{children:"โœ… 1,000 scans/month"}),u.jsx("li",{children:"โœ… 7-day expiration"}),u.jsx("li",{children:"โœ… Basic analytics"})]})]}),u.jsxs("div",{className:"bg-background/50 rounded-lg p-6 border border-primary/50 relative",children:[u.jsx("div",{className:"absolute -top-3 left-1/2 transform -translate-x-1/2 bg-primary text-primary-foreground px-4 py-1 rounded-full text-sm font-medium",children:"Most Popular"}),u.jsx("div",{className:"flex items-center justify-center mb-3",children:u.jsx(yS,{className:"w-8 h-8 text-blue-500"})}),u.jsx("h3",{className:"text-xl font-bold mb-2",children:"Social"}),u.jsxs("p",{className:"text-3xl font-bold text-primary mb-4",children:["$9.99",u.jsx("span",{className:"text-sm text-muted-foreground",children:"/mo"})]}),u.jsxs("ul",{className:"text-left space-y-2 text-sm text-muted-foreground",children:[u.jsx("li",{children:"โœ… 5 active QR codes"}),u.jsx("li",{children:"โœ… 5,000 scans/month"}),u.jsx("li",{children:"โœ… 90-day expiration"}),u.jsx("li",{children:"โœ… Advanced analytics"})]})]}),u.jsxs("div",{className:"bg-background/50 rounded-lg p-6 border",children:[u.jsx("div",{className:"flex items-center justify-center mb-3",children:u.jsx(M_,{className:"w-8 h-8 text-purple-500"})}),u.jsx("h3",{className:"text-xl font-bold mb-2",children:"Pro"}),u.jsxs("p",{className:"text-3xl font-bold text-primary mb-4",children:["$29.99",u.jsx("span",{className:"text-sm text-muted-foreground",children:"/mo"})]}),u.jsxs("ul",{className:"text-left space-y-2 text-sm text-muted-foreground",children:[u.jsx("li",{children:"โœ… 100 QR codes"}),u.jsx("li",{children:"โœ… 25,000 scans/month"}),u.jsx("li",{children:"โœ… 2-year expiration"}),u.jsx("li",{children:"โœ… Premium features"})]})]})]}),u.jsxs("div",{className:"flex justify-center gap-4",children:[u.jsx(Ke,{to:"/pricing",children:u.jsx(Ee,{size:"lg",className:"text-lg px-8",children:"View All Plans & Features"})}),u.jsx(Ke,{to:"/app",children:u.jsx(Ee,{size:"lg",variant:"outline",className:"text-lg px-8",children:"Start Free Today"})})]})]}),u.jsxs("div",{id:"testimonials",className:"mt-2 mb-4 text-center space-y-8",children:[u.jsxs("div",{children:[u.jsx("h2",{className:"text-3xl font-bold mb-2",children:"Real Users, Real Results"}),u.jsx("p",{className:"text-lg text-muted-foreground",children:"See how businesses and creators are using our platform to go viral and drive massive traffic"})]}),u.jsxs("div",{className:"grid md:grid-cols-2 gap-6 max-w-5xl mx-auto",children:[u.jsx(Pe,{className:"p-6",children:u.jsxs(Ae,{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center space-x-4",children:[u.jsx("div",{className:"w-12 h-12 rounded-full bg-blue-500 flex items-center justify-center",children:u.jsx(jc,{className:"w-6 h-6 text-white"})}),u.jsxs("div",{className:"text-left",children:[u.jsx("h4",{className:"font-semibold",children:"Sarah M."}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"Marketing Director, Austin, TX"})]})]}),u.jsx("p",{className:"text-left italic",children:'"Game changer! I put QR codes on my business cards that direct people to my Instagram. When I update my content, the QR code automatically shows the new stuff. My follower count went from 500 to 15K in 3 months!"'}),u.jsx("div",{className:"flex justify-start",children:u.jsx("div",{className:"flex space-x-1",children:[...Array(5)].map((s,o)=>u.jsx("span",{className:"text-yellow-400 text-lg",children:"โ˜…"},o))})})]})}),u.jsx(Pe,{className:"p-6",children:u.jsxs(Ae,{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center space-x-4",children:[u.jsx("div",{className:"w-12 h-12 rounded-full bg-green-500 flex items-center justify-center",children:u.jsx(jc,{className:"w-6 h-6 text-white"})}),u.jsxs("div",{className:"text-left",children:[u.jsx("h4",{className:"font-semibold",children:"David K."}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"Real Estate Agent, Seattle, WA"})]})]}),u.jsx("p",{className:"text-left italic",children:`"My photography business exploded! I use QR codes at weddings to share galleries instantly, with CTA buttons linking to my booking page. The click analytics show which photos generate the most bookings. It's like having a marketing team in my camera bag!"`}),u.jsx("div",{className:"flex justify-start",children:u.jsx("div",{className:"flex space-x-1",children:[...Array(5)].map((s,o)=>u.jsx("span",{className:"text-yellow-400 text-lg",children:"โ˜…"},o))})})]})}),u.jsx(Pe,{className:"p-6",children:u.jsxs(Ae,{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center space-x-4",children:[u.jsx("div",{className:"w-12 h-12 rounded-full bg-purple-500 flex items-center justify-center",children:u.jsx(bp,{className:"w-6 h-6 text-white"})}),u.jsxs("div",{className:"text-left",children:[u.jsx("h4",{className:"font-semibold",children:"Amanda R."}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"Restaurant Owner, Denver, CO"})]})]}),u.jsx("p",{className:"text-left italic",children:'"Our food truck went viral! We use QR codes on our truck with CTA buttons that change daily - sometimes linking to our TikTok, sometimes to our location tracker. The ability to switch content while keeping the same QR code is pure genius!"'}),u.jsx("div",{className:"flex justify-start",children:u.jsx("div",{className:"flex space-x-1",children:[...Array(5)].map((s,o)=>u.jsx("span",{className:"text-yellow-400 text-lg",children:"โ˜…"},o))})})]})}),u.jsx(Pe,{className:"p-6",children:u.jsxs(Ae,{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center space-x-4",children:[u.jsx("div",{className:"w-12 h-12 rounded-full bg-orange-500 flex items-center justify-center",children:u.jsx(CS,{className:"w-6 h-6 text-white"})}),u.jsxs("div",{className:"text-left",children:[u.jsx("h4",{className:"font-semibold",children:"Michael C."}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"Photographer, Miami, FL"})]})]}),u.jsx("p",{className:"text-left italic",children:`"I'm a YouTuber and this changed everything! QR codes on my thumbnails and merch link to my latest videos with subscribe buttons. When I update content, everyone with my QR codes automatically sees the new stuff. Subscriber growth has been insane!"`}),u.jsx("div",{className:"flex justify-start",children:u.jsx("div",{className:"flex space-x-1",children:[...Array(5)].map((s,o)=>u.jsx("span",{className:"text-yellow-400 text-lg",children:"โ˜…"},o))})})]})})]})]}),u.jsx(k2,{}),u.jsxs("div",{className:"mt-8 text-center space-y-6 p-8 bg-gradient-to-r from-primary/20 to-secondary/20 rounded-2xl",children:[u.jsxs("div",{className:"flex items-center justify-center gap-3",children:[u.jsx(yp,{className:"w-8 h-8 text-red-600"}),u.jsx("h2",{className:"text-3xl font-bold",children:"Ready to Go Viral?"}),u.jsx(yp,{className:"w-8 h-8 text-red-600"})]}),u.jsx("p",{className:"text-lg text-muted-foreground",children:"Join thousands of creators and businesses using smart QR codes to drive massive traffic and engagement."}),u.jsx(Ke,{to:"/app",className:"block",children:u.jsxs(Ee,{size:"lg",className:"text-base sm:text-lg px-3 sm:px-8 min-h-[44px] text-center leading-tight w-full sm:w-auto max-w-xs sm:max-w-none mx-auto",children:[u.jsx("span",{className:"block sm:hidden",children:"Start Free!"}),u.jsx("span",{className:"hidden sm:block",children:"Start Your Viral Campaign Now - Free!"})]})})]})]}),u.jsx(lw,{}),u.jsx(WN,{})]})},VN=()=>{const e=yr();return y.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),u.jsx("div",{className:"flex min-h-screen items-center justify-center bg-gray-100",children:u.jsxs("div",{className:"text-center",children:[u.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),u.jsx("p",{className:"mb-4 text-xl text-gray-600",children:"Oops! Page not found"}),u.jsx("a",{href:"/",className:"text-blue-500 underline hover:text-blue-700",children:"Return to Home"})]})})};function qN(){const e="https://scan.camera",t="Scan.camera - Quick Image Sharing with QR Codes",n="Share images instantly with QR codes. Upload, generate QR code, and share images quickly and securely. Perfect for presentations, events, and digital sharing.",r=`${e}/default-social.png`;return u.jsxs(Ea,{prioritizeSeoTags:!0,children:[u.jsx("title",{children:t}),u.jsx("meta",{name:"description",content:n}),u.jsx("meta",{name:"robots",content:"index, follow"}),u.jsx("meta",{name:"language",content:"English"}),u.jsx("meta",{name:"author",content:"Scan.camera"}),u.jsx("meta",{name:"theme-color",content:"#110c1c"}),u.jsx("meta",{name:"format-detection",content:"telephone=no"}),u.jsx("link",{rel:"preconnect",href:"https://fonts.googleapis.com"}),u.jsx("link",{rel:"dns-prefetch",href:"https://fonts.gstatic.com"}),u.jsx("link",{rel:"canonical",href:"https://scan.camera/"}),u.jsx("meta",{property:"og:type",content:"website"}),u.jsx("meta",{property:"og:site_name",content:"Scan.Camera"}),u.jsx("meta",{property:"og:title",content:t}),u.jsx("meta",{property:"og:description",content:n}),u.jsx("meta",{property:"og:url",content:e}),u.jsx("meta",{property:"og:image",content:r}),u.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),u.jsx("meta",{name:"twitter:title",content:t}),u.jsx("meta",{name:"twitter:description",content:n}),u.jsx("meta",{name:"twitter:image",content:r})]})}const QN=async()=>{try{const{data:{user:e}}=await ye.auth.getUser();if(!e)return!1;if(e.id===ht.ADMIN_USER_ID)return!0;const{data:t,error:n}=await ye.from("user_roles").select("*").eq("user_id",e.id).eq("role","admin").single();return n?(console.error("Error checking admin status:",n),!1):!!t}catch(e){return console.error("Error checking admin status:",e),!1}},Wc=({children:e})=>{const[t,n]=y.useState(null),[r,s]=y.useState(!0);return y.useEffect(()=>{(async()=>{try{const i=await QN();n(i)}catch(i){console.error("Error checking admin status:",i),n(!1)}finally{s(!1)}})()},[]),r?u.jsx("div",{className:"min-h-screen flex items-center justify-center",children:u.jsx("div",{className:"animate-spin rounded-full h-32 w-32 border-b-2 border-primary"})}):t?u.jsx(Pa,{children:e}):u.jsx(WT,{to:"/",replace:!0})},KN=()=>{const e=document.createElement("script");e.async=!0,e.src=`https://www.googletagmanager.com/gtag/js?id=${ht.analytics.googleAnalytics.measurementId}`,document.head.appendChild(e),window.dataLayer=window.dataLayer||[];function t(...n){window.dataLayer.push(arguments)}window.gtag=t,t("js",new Date),t("config",ht.analytics.googleAnalytics.measurementId,{anonymize_ip:!0,allow_google_signals:!1,allow_ad_personalization_signals:!1})},GN=e=>{typeof window.gtag=="function"&&window.gtag("config",ht.analytics.googleAnalytics.measurementId,{page_path:e.path,page_title:e.title,...e.properties})},YN=()=>{(function(e,t){var n,r,s,o;t.__SV||window.posthog&&window.posthog.__loaded||(window.posthog=t,t._i=[],t.init=function(i,a,l){function c(f,p){var h=p.split(".");h.length==2&&(f=f[h[0]],p=h[1]),f[p]=function(){f.push([p].concat(Array.prototype.slice.call(arguments,0)))}}(s=e.createElement("script")).type="text/javascript",s.crossOrigin="anonymous",s.async=!0,s.src=a.api_host.replace(".i.posthog.com","-assets.i.posthog.com")+"/static/array.js",(o=e.getElementsByTagName("script")[0]).parentNode.insertBefore(s,o);var d=t;for(l!==void 0?d=t[l]=[]:l="posthog",d.people=d.people||[],d.toString=function(f){var p="posthog";return l!=="posthog"&&(p+="."+l),f||(p+=" (stub)"),p},d.people.toString=function(){return d.toString(1)+".people (stub)"},n="init Ce Ds js Te Os As capture Ye calculateEventProperties Us register register_once register_for_session unregister unregister_for_session Hs getFeatureFlag getFeatureFlagPayload isFeatureEnabled reloadFeatureFlags updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures on onFeatureFlags onSurveysLoaded onSessionId getSurveys getActiveMatchingSurveys renderSurvey displaySurvey canRenderSurvey canRenderSurveyAsync identify setPersonProperties group resetGroups setPersonPropertiesForFlags resetPersonPropertiesForFlags setGroupPropertiesForFlags resetGroupPropertiesForFlags reset get_distinct_id getGroups get_session_id get_session_replay_url alias set_config startSessionRecording stopSessionRecording sessionRecordingStarted captureException loadToolbar get_property getSessionProperty qs Ns createPersonProfile Bs Cs Ws opt_in_capturing opt_out_capturing has_opted_in_capturing has_opted_out_capturing get_explicit_consent_status is_capturing clear_opt_in_out_capturing Ls debug L zs getPageViewId captureTraceFeedback captureTraceMetric".split(" "),r=0;r{typeof window.posthog<"u"&&window.posthog.capture("$pageview",{$current_url:e.path,page_title:e.title,...e.properties})},XN=()=>{(function(e,t,n,r,s,o,i){e[n]=e[n]||function(){(e[n].q=e[n].q||[]).push(arguments)},o=t.createElement(r),o.async=!0,o.src="proxy.php?url=https%3A%2F%2Fwww.clarity.ms%2Ftag%2F"+s,i=t.getElementsByTagName(r)[0],i.parentNode.insertBefore(o,i)})(window,document,"clarity","script",ht.analytics.microsoftClarity.projectId,{},{})},ZN=e=>{GN(e),JN(e)},eO=()=>{KN(),YN(),XN()},tO=()=>{y.useEffect(()=>{eO()},[])},nO=()=>{const e=yr();y.useEffect(()=>{const t=document.title||`Page: ${e.pathname}`;ZN({path:e.pathname+e.search,title:t,properties:{hash:e.hash,referrer:document.referrer}})},[e])},rO=async()=>{try{const e=ht.version,t=e,n=!1;return console.log(`Version check: current=${e}, latest=${t}, hasUpdate=${n}`),{hasUpdate:n,currentVersion:e,latestVersion:t}}catch(e){return console.warn("Version check failed:",e),{hasUpdate:!1,currentVersion:ht.version,latestVersion:ht.version}}},sO=(e=6e4)=>{const[t,n]=y.useState(!1),[r,s]=y.useState(""),[o,i]=y.useState(""),[a,l]=y.useState(!1),c=async()=>{if(!a){l(!0);try{const p=await rO();p.hasUpdate&&(console.log(`๐Ÿš€ Update available: ${p.currentVersion} โ†’ ${p.latestVersion}`),n(!0),s(p.currentVersion),i(p.latestVersion))}catch(p){console.warn("Version check failed:",p)}finally{l(!1)}}};return y.useEffect(()=>{const p=setTimeout(c,5e3),h=setInterval(c,e);return()=>{clearTimeout(p),clearInterval(h)}},[e]),{hasUpdate:t,currentVersion:r,latestVersion:o,isChecking:a,handleReload:()=>{window.location.reload()},dismissUpdate:()=>{n(!1)},manualCheck:c}},oO=({isVisible:e,onReload:t})=>e?u.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-[9999] flex items-center justify-center p-4",children:u.jsx(Pe,{className:"max-w-md w-full mx-auto shadow-2xl border-2 border-primary/20",children:u.jsxs(Ae,{className:"p-8 text-center space-y-6",children:[u.jsx("div",{className:"mx-auto w-16 h-16 bg-gradient-to-br from-yellow-100 to-yellow-200 rounded-full flex items-center justify-center",children:u.jsx(xS,{className:"w-8 h-8 text-yellow-500 animate-pulse"})}),u.jsxs("div",{className:"space-y-2",children:[u.jsx("h2",{className:"text-2xl font-bold text-foreground",children:"We've Made Things Better!"}),u.jsxs("div",{className:"flex items-center justify-center gap-1 text-red-500",children:[u.jsx(X_,{className:"w-4 h-4 fill-current text-red-500"}),u.jsx("span",{className:"text-sm font-medium",children:"From the Scan.Camera team"})]})]}),u.jsxs("div",{className:"space-y-3 text-muted-foreground",children:[u.jsx("p",{className:"text-lg leading-relaxed",children:"We've just released an update with improvements based on your feedback!"}),u.jsx("p",{className:"text-sm",children:"At Scan.Camera, we care about our customers and want to ensure you're using the most up-to-date software we can offer. Click below to get the latest features and improvements."})]}),u.jsxs(Ee,{onClick:t,size:"lg",className:"w-full font-semibold text-lg py-6",children:[u.jsx(cS,{className:"w-5 h-5 mr-2"}),"Get the Latest Version"]}),u.jsx("p",{className:"text-xs text-muted-foreground/80",children:"Don't worry - your work is automatically saved and will be preserved"})]})})}):null,iO=y.lazy(()=>He(()=>import("./ViewImage-B799gwqR.js"),__vite__mapDeps([0,1,2]))),aO=y.lazy(()=>He(()=>import("./ScanLocationsMap-BL8jtmRv.js"),__vite__mapDeps([3,4])).then(e=>({default:e.ScanLocationsMap}))),bm=y.lazy(()=>He(()=>import("./CleanChat-BwmrnJtQ.js"),__vite__mapDeps([5,6,7]))),lO=y.lazy(()=>He(()=>import("./PrivacyPolicy-Pgw34lz1.js"),[]).then(e=>({default:e.PrivacyPolicy}))),cO=y.lazy(()=>He(()=>import("./Index-CvKbqRhz.js"),__vite__mapDeps([8,9,10,2,11,12,13,14,15,16,1,17]))),uO=y.lazy(()=>He(()=>import("./MySharedImages-DJnZjQKY.js"),__vite__mapDeps([18,2,9,10,19,4,15,7])).then(e=>({default:e.default}))),dO=y.lazy(()=>He(()=>import("./EditScanExperience-C93bSwkD.js"),__vite__mapDeps([20,9,10,12,13,11,14,15,16,1,2])).then(e=>({default:e.default}))),fO=y.lazy(()=>He(()=>import("./Pricing-v_7X9CM8.js"),__vite__mapDeps([21,22,15,14,16]))),hO=y.lazy(()=>He(()=>import("./Comparison-Bp0-4SnO.js"),__vite__mapDeps([23,16])).then(e=>({default:e.Comparison}))),pO=y.lazy(()=>He(()=>import("./AdminPage-EpX3slom.js"),__vite__mapDeps([24,14,13,22,15,6,7,19,17,25,4])).then(e=>({default:e.AdminPage}))),mO=y.lazy(()=>He(()=>import("./AdminImageMigration-CdAQC0hN.js"),__vite__mapDeps([26,11,17,25,10]))),gO=new eT,vO=({children:e})=>(tO(),nO(),u.jsx(u.Fragment,{children:e})),yO=({children:e})=>{const{hasUpdate:t,handleReload:n}=sO(6e4);return u.jsxs(u.Fragment,{children:[e,u.jsx(oO,{isVisible:t,onReload:n})]})},wO=()=>u.jsx(tT,{client:gO,children:u.jsxs(NC,{children:[u.jsx(fk,{}),u.jsx(Hk,{}),u.jsx(ZT,{children:u.jsx(vO,{children:u.jsxs(yO,{children:[u.jsx(qN,{}),u.jsxs(VT,{children:[u.jsx(qe,{path:"/",element:u.jsx(HN,{})}),u.jsx(qe,{path:"/pricing",element:u.jsx(y.Suspense,{fallback:u.jsx("div",{className:"flex items-center justify-center min-h-screen",children:u.jsx("div",{className:"animate-spin rounded-full h-32 w-32 border-b-2 border-primary"})}),children:u.jsx(fO,{})})}),u.jsx(qe,{path:"/comparison",element:u.jsx(y.Suspense,{fallback:u.jsx("div",{className:"flex items-center justify-center min-h-screen",children:u.jsx("div",{className:"animate-spin rounded-full h-32 w-32 border-b-2 border-primary"})}),children:u.jsx(hO,{})})}),u.jsx(qe,{path:"/privacy-policy",element:u.jsx(y.Suspense,{fallback:u.jsx("div",{className:"flex items-center justify-center min-h-screen",children:u.jsx("div",{className:"animate-spin rounded-full h-32 w-32 border-b-2 border-primary"})}),children:u.jsx(lO,{})})}),u.jsx(qe,{path:"/app",element:u.jsx(Pa,{children:u.jsx(y.Suspense,{fallback:u.jsx("div",{className:"flex items-center justify-center min-h-screen",children:u.jsx("div",{className:"animate-spin rounded-full h-32 w-32 border-b-2 border-primary"})}),children:u.jsx(cO,{})})})}),u.jsx(qe,{path:"/qr-codes",element:u.jsx(Pa,{children:u.jsx(y.Suspense,{fallback:u.jsx("div",{className:"flex items-center justify-center min-h-screen",children:u.jsx("div",{className:"animate-spin rounded-full h-32 w-32 border-b-2 border-primary"})}),children:u.jsx(uO,{})})})}),u.jsx(qe,{path:"/edit/:identifier",element:u.jsx(Pa,{children:u.jsx(y.Suspense,{fallback:u.jsx("div",{className:"flex items-center justify-center min-h-screen",children:u.jsx("div",{className:"animate-spin rounded-full h-32 w-32 border-b-2 border-primary"})}),children:u.jsx(dO,{})})})}),u.jsx(qe,{path:"/v/:identifier",element:u.jsx(y.Suspense,{fallback:u.jsx("div",{className:"flex items-center justify-center min-h-screen",children:u.jsx("div",{className:"animate-spin rounded-full h-32 w-32 border-b-2 border-primary"})}),children:u.jsx(iO,{})})}),u.jsx(qe,{path:"/chat",element:u.jsx(y.Suspense,{fallback:u.jsx("div",{className:"flex items-center justify-center min-h-screen",children:u.jsx("div",{className:"animate-spin rounded-full h-32 w-32 border-b-2 border-primary"})}),children:u.jsx(bm,{})})}),u.jsx(qe,{path:"/rjl-admin",element:u.jsxs(u.Fragment,{children:[u.jsx(Ea,{children:u.jsx("meta",{name:"robots",content:"noindex,nofollow"})}),u.jsx(Wc,{children:u.jsx(y.Suspense,{fallback:u.jsx("div",{className:"flex items-center justify-center min-h-screen",children:u.jsx("div",{className:"animate-spin rounded-full h-32 w-32 border-b-2 border-primary"})}),children:u.jsx(pO,{})})})]})}),u.jsx(qe,{path:"/rjl-admin/chat",element:u.jsxs(u.Fragment,{children:[u.jsx(Ea,{children:u.jsx("meta",{name:"robots",content:"noindex,nofollow"})}),u.jsx(Wc,{children:u.jsx(y.Suspense,{fallback:u.jsx("div",{className:"flex items-center justify-center min-h-screen",children:u.jsx("div",{className:"animate-spin rounded-full h-32 w-32 border-b-2 border-primary"})}),children:u.jsx(bm,{})})})]})}),u.jsx(qe,{path:"/rjl-admin/image-migration",element:u.jsxs(u.Fragment,{children:[u.jsx(Ea,{children:u.jsx("meta",{name:"robots",content:"noindex,nofollow"})}),u.jsx(Wc,{children:u.jsx(y.Suspense,{fallback:u.jsx("div",{className:"flex items-center justify-center min-h-screen",children:u.jsx("div",{className:"animate-spin rounded-full h-32 w-32 border-b-2 border-primary"})}),children:u.jsx(mO,{})})})]})}),u.jsx(qe,{path:"/scan-locations-map",element:u.jsx(y.Suspense,{fallback:u.jsx("div",{className:"flex items-center justify-center min-h-screen",children:u.jsx("div",{className:"animate-spin rounded-full h-32 w-32 border-b-2 border-primary"})}),children:u.jsx(aO,{})})}),u.jsx(qe,{path:"*",element:u.jsx(VN,{})})]})]})})})]})});Hv(document.getElementById("root")).render(u.jsx(Jv,{children:u.jsx(wO,{})}));export{rC as $,ht as A,Ee as B,Pe as C,W_ as D,r_ as E,lw as F,sy as G,Ea as H,el as I,Re as J,$b as K,Ke as L,Vu as M,WT as N,y2 as O,et as P,Vo as Q,O as R,pS as S,Py as T,xp as U,VO as V,$_ as W,yf as X,V_ as Y,cS as Z,WO as _,OO as a,zb as a0,e0 as a1,uC as a2,dr as a3,dC as a4,fC as a5,i_ as a6,ur as a7,kO as a8,md as a9,$l as aA,AC as aB,IC as aC,w0 as aD,QC as aE,$C as aF,Ye as aG,PO as aH,NO as aI,Nl as aJ,aw as aK,eo as aa,pm as ab,yr as ac,E2 as ad,sS as ae,M_ as af,yS as ag,K_ as ah,WN as ai,Ny as aj,vf as ak,wp as al,QO as am,DN as an,jy as ao,$N as ap,LN as aq,KO as ar,qO as as,Um as at,Ll as au,BC as av,MC as aw,jO as ax,Xu as ay,It as az,Lf as b,Ae as c,A_ as d,ow as e,iw as f,hw as g,_i as h,ji as i,u as j,RO as k,Pi as l,Ty as m,HO as n,ee as o,ON as p,Tl as q,y as r,ye as s,Ab as t,SO as u,Ht as v,Te as w,hf as x,ff as y,bO as z};