PageSourceSearch

https://flow-schedule-finder.lovable.app/assets/index-DXLI5WDI.js

js flow-schedule-finder.lovable.app collected 2026-10-03 03:31:27 UTC 636,643 bytes, 242 lines download raw bytes

vendor: 5,694 bytes, lines 1-9
1var Bf=e=>{throw TypeError(e)};var Hc=(e,t,r)=>t.has(e)||Bf("Cannot "+r);var A=(e,t,r)=>(Hc(e,t,"read from private field"),r?r.call(e):t.get(e)),ue=(e,t,r)=>t.has(e)?Bf("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),ee=(e,t,r,n)=>(Hc(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Qe=(e,t,r)=>(Hc(e,t,"access private method"),r);var da=(e,t,r,n)=>({set _(s){ee(e,t,s,r)},get _(){return A(e,t,n)}});function Ux(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in e)){const o=Object.getOwnPropertyDescriptor(n,s);o&&Object.defineProperty(e,s,o.get?o:{enumerable:!0,get:()=>n[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"]'))n(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"&&n(i)}).observe(document,{childList:!0,subtree:!0});function r(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 n(s){if(s.ep)return;s.ep=!0;const o=r(s);fetch(s.href,o)}})();function Vg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Wg={exports:{}},tc={},Kg={exports:{}},se={};/**
2 * @license React
3 * react.production.min.js
4 *
5 * Copyright (c) Facebook, Inc. and its affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */var Qi=Symbol.for("react.element"),Fx=Symbol.for("react.portal"),Bx=Symbol.for("react.fragment"),zx=Symbol.for("react.strict_mode"),Hx=Symbol.for("react.profiler"),Vx=Symbol.for("react.provider"),Wx=Symbol.for("react.context"),Kx=Symbol.for("react.forward_ref"),qx=Symbol.for("react.suspense"),Gx=Symbol.for("react.memo"),Jx=Symbol.for("react.lazy"),zf=Symbol.iterator;function Qx(e){return e===null||typeof e!="object"?null:(e=zf&&e[zf]||e["@@iterator"],typeof e=="function"?e:null)}var qg={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Gg=Object.assign,Jg={};function So(e,t,r){this.props=e,this.context=t,this.refs=Jg,this.updater=r||qg}So.prototype.isReactComponent={};So.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")};So.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Qg(){}Qg.prototype=So.prototype;function fh(e,t,r){this.props=e,this.context=t,this.refs=Jg,this.updater=r||qg}var ph=fh.prototype=new Qg;ph.constructor=fh;Gg(ph,So.prototype);ph.isPureReactComponent=!0;var Hf=Array.isArray,Yg=Object.prototype.hasOwnProperty,mh={current:null},Xg={key:!0,ref:!0,__self:!0,__source:!0};function Zg(e,t,r){var n,s={},o=null,i=null;if(t!=null)for(n in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(o=""+t.key),t)Yg.call(t,n)&&!Xg.hasOwnProperty(n)&&(s[n]=t[n]);var a=arguments.length-2;if(a===1)s.children=r;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];s.children=l}if(e&&e.defaultProps)for(n in a=e.defaultProps,a)s[n]===void 0&&(s[n]=a[n]);return{$$typeof:Qi,type:e,key:o,ref:i,props:s,_owner:mh.current}}function Yx(e,t){return{$$typeof:Qi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function gh(e){return typeof e=="object"&&e!==null&&e.$$typeof===Qi}function Xx(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var Vf=/\/+/g;function Vc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Xx(""+e.key):t.toString(36)}function Ga(e,t,r,n,s){var o=typeof e;(o==="undefined"||o==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(o){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case Qi:case Fx:i=!0}}if(i)return i=e,s=s(i),e=n===""?"."+Vc(i,0):n,Hf(s)?(r="",e!=null&&(r=e.replace(Vf,"$&/")+"/"),Ga(s,t,r,"",function(c){return c})):s!=null&&(gh(s)&&(s=Yx(s,r+(!s.key||i&&i.key===s.key?"":(""+s.key).replace(Vf,"$&/")+"/")+e)),t.push(s)),1;if(i=0,n=n===""?".":n+":",Hf(e))for(var a=0;a<e.length;a++){o=e[a];var l=n+Vc(o,a);i+=Ga(o,t,r,l,s)}else if(l=Qx(e),typeof l=="function")for(e=l.call(e),a=0;!(o=e.next()).done;)o=o.value,l=n+Vc(o,a++),i+=Ga(o,t,r,l,s);else if(o==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function ha(e,t,r){if(e==null)return e;var n=[],s=0;return Ga(e,n,"","",function(o){return t.call(r,o,s++)}),n}function Zx(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var lt={current:null},Ja={transition:null},eS={ReactCurrentDispatcher:lt,ReactCurrentBatchConfig:Ja,ReactCurrentOwner:mh};function ev(){throw Error("act(...) is not supported in production builds of React.")}
vendor: 5,480 bytes, lines 9-25
9se.Children={map:ha,forEach:function(e,t,r){ha(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return ha(e,function(){t++}),t},toArray:function(e){return ha(e,function(t){return t})||[]},only:function(e){if(!gh(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};se.Component=So;se.Fragment=Bx;se.Profiler=Hx;se.PureComponent=fh;se.StrictMode=zx;se.Suspense=qx;se.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=eS;se.act=ev;se.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=Gg({},e.props),s=e.key,o=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,i=mh.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)Yg.call(t,l)&&!Xg.hasOwnProperty(l)&&(n[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)n.children=r;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];n.children=a}return{$$typeof:Qi,type:e.type,key:s,ref:o,props:n,_owner:i}};se.createContext=function(e){return e={$$typeof:Wx,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Vx,_context:e},e.Consumer=e};se.createElement=Zg;se.createFactory=function(e){var t=Zg.bind(null,e);return t.type=e,t};se.createRef=function(){return{current:null}};se.forwardRef=function(e){return{$$typeof:Kx,render:e}};se.isValidElement=gh;se.lazy=function(e){return{$$typeof:Jx,_payload:{_status:-1,_result:e},_init:Zx}};se.memo=function(e,t){return{$$typeof:Gx,type:e,compare:t===void 0?null:t}};se.startTransition=function(e){var t=Ja.transition;Ja.transition={};try{e()}finally{Ja.transition=t}};se.unstable_act=ev;se.useCallback=function(e,t){return lt.current.useCallback(e,t)};se.useContext=function(e){return lt.current.useContext(e)};se.useDebugValue=function(){};se.useDeferredValue=function(e){return lt.current.useDeferredValue(e)};se.useEffect=function(e,t){return lt.current.useEffect(e,t)};se.useId=function(){return lt.current.useId()};se.useImperativeHandle=function(e,t,r){return lt.current.useImperativeHandle(e,t,r)};se.useInsertionEffect=function(e,t){return lt.current.useInsertionEffect(e,t)};se.useLayoutEffect=function(e,t){return lt.current.useLayoutEffect(e,t)};se.useMemo=function(e,t){return lt.current.useMemo(e,t)};se.useReducer=function(e,t,r){return lt.current.useReducer(e,t,r)};se.useRef=function(e){return lt.current.useRef(e)};se.useState=function(e){return lt.current.useState(e)};se.useSyncExternalStore=function(e,t,r){return lt.current.useSyncExternalStore(e,t,r)};se.useTransition=function(){return lt.current.useTransition()};se.version="18.3.1";Kg.exports=se;var w=Kg.exports;const M=Vg(w),vh=Ux({__proto__:null,default:M},[w]);/**
10 * @license React
11 * react-jsx-runtime.production.min.js
12 *
13 * Copyright (c) Facebook, Inc. and its affiliates.
14 *
15 * This source code is licensed under the MIT license found in the
16 * LICENSE file in the root directory of this source tree.
17 */var tS=w,rS=Symbol.for("react.element"),nS=Symbol.for("react.fragment"),sS=Object.prototype.hasOwnProperty,oS=tS.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,iS={key:!0,ref:!0,__self:!0,__source:!0};function tv(e,t,r){var n,s={},o=null,i=null;r!==void 0&&(o=""+r),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(i=t.ref);for(n in t)sS.call(t,n)&&!iS.hasOwnProperty(n)&&(s[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)s[n]===void 0&&(s[n]=t[n]);return{$$typeof:rS,type:e,key:o,ref:i,props:s,_owner:oS.current}}tc.Fragment=nS;tc.jsx=tv;tc.jsxs=tv;Wg.exports=tc;var p=Wg.exports,rv={exports:{}},Rt={},nv={exports:{}},sv={};/**
18 * @license React
19 * scheduler.production.min.js
20 *
21 * Copyright (c) Facebook, Inc. and its affiliates.
22 *
23 * This source code is licensed under the MIT license found in the
24 * LICENSE file in the root directory of this source tree.
25 */(function(e){function t(C,k){var N=C.length;C.push(k);e:for(;0<N;){var U=N-1>>>1,L=C[U];if(0<s(L,k))C[U]=k,C[N]=L,N=U;else break e}}function r(C){return C.length===0?null:C[0]}function n(C){if(C.length===0)return null;var k=C[0],N=C.pop();if(N!==k){C[0]=N;e:for(var U=0,L=C.length,K=L>>>1;U<K;){var Y=2*(U+1)-1,he=C[Y],me=Y+1,F=C[me];if(0>s(he,N))me<L&&0>s(F,he)?(C[U]=F,C[me]=N,U=me):(C[U]=he,C[Y]=N,U=Y);else if(me<L&&0>s(F,N))C[U]=F,C[me]=N,U=me;else break e}}return k}function s(C,k){var N=C.sortIndex-k.sortIndex;return N!==0?N:C.id-k.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=[],u=1,d=null,h=3,f=!1,x=!1,g=!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 y(C){for(var k=r(c);k!==null;){if(k.callback===null)n(c);else if(k.startTime<=C)n(c),k.sortIndex=k.expirationTime,t(l,k);else break;k=r(c)}}function S(C){if(g=!1,y(C),!x)if(r(l)!==null)x=!0,z(E);else{var k=r(c);k!==null&&q(S,k.startTime-C)}}function E(C,k){x=!1,g&&(g=!1,v(R),R=-1),f=!0;var N=h;try{for(y(k),d=r(l);d!==null&&(!(d.expirationTime>k)||C&&!B());){var U=d.callback;
vendor: 9,152 bytes, lines 25-34
25if(typeof U=="function"){d.callback=null,h=d.priorityLevel;var L=U(d.expirationTime<=k);k=e.unstable_now(),typeof L=="function"?d.callback=L:d===r(l)&&n(l),y(k)}else n(l);d=r(l)}if(d!==null)var K=!0;else{var Y=r(c);Y!==null&&q(S,Y.startTime-k),K=!1}return K}finally{d=null,h=N,f=!1}}var _=!1,T=null,R=-1,P=5,j=-1;function B(){return!(e.unstable_now()-j<P)}function I(){if(T!==null){var C=e.unstable_now();j=C;var k=!0;try{k=T(!0,C)}finally{k?W():(_=!1,T=null)}}else _=!1}var W;if(typeof m=="function")W=function(){m(I)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,Q=$.port2;$.port1.onmessage=I,W=function(){Q.postMessage(null)}}else W=function(){b(I,0)};function z(C){T=C,_||(_=!0,W())}function q(C,k){R=b(function(){C(e.unstable_now())},k)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(C){C.callback=null},e.unstable_continueExecution=function(){x||f||(x=!0,z(E))},e.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<C?Math.floor(1e3/C):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return r(l)},e.unstable_next=function(C){switch(h){case 1:case 2:case 3:var k=3;break;default:k=h}var N=h;h=k;try{return C()}finally{h=N}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(C,k){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var N=h;h=C;try{return k()}finally{h=N}},e.unstable_scheduleCallback=function(C,k,N){var U=e.unstable_now();switch(typeof N=="object"&&N!==null?(N=N.delay,N=typeof N=="number"&&0<N?U+N:U):N=U,C){case 1:var L=-1;break;case 2:L=250;break;case 5:L=1073741823;break;case 4:L=1e4;break;default:L=5e3}return L=N+L,C={id:u++,callback:k,priorityLevel:C,startTime:N,expirationTime:L,sortIndex:-1},N>U?(C.sortIndex=N,t(c,C),r(l)===null&&C===r(c)&&(g?(v(R),R=-1):g=!0,q(S,N-U))):(C.sortIndex=L,t(l,C),x||f||(x=!0,z(E))),C},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(C){var k=h;return function(){var N=h;h=k;try{return C.apply(this,arguments)}finally{h=N}}}})(sv);nv.exports=sv;var aS=nv.exports;/**
26 * @license React
27 * react-dom.production.min.js
28 *
29 * Copyright (c) Facebook, Inc. and its affiliates.
30 *
31 * This source code is licensed under the MIT license found in the
32 * LICENSE file in the root directory of this source tree.
33 */var lS=w,Tt=aS;function O(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var ov=new Set,mi={};function ws(e,t){ho(e,t),ho(e+"Capture",t)}function ho(e,t){for(mi[e]=t,e=0;e<t.length;e++)ov.add(t[e])}var Fr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Uu=Object.prototype.hasOwnProperty,cS=/^[: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]*$/,Wf={},Kf={};function uS(e){return Uu.call(Kf,e)?!0:Uu.call(Wf,e)?!1:cS.test(e)?Kf[e]=!0:(Wf[e]=!0,!1)}function dS(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function hS(e,t,r,n){if(t===null||typeof t>"u"||dS(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.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 ct(e,t,r,n,s,o,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var qe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){qe[e]=new ct(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];qe[t]=new ct(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){qe[e]=new ct(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){qe[e]=new ct(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){qe[e]=new ct(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){qe[e]=new ct(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){qe[e]=new ct(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){qe[e]=new ct(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){qe[e]=new ct(e,5,!1,e.toLowerCase(),null,!1,!1)});var yh=/[\-:]([a-z])/g;function wh(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(yh,wh);qe[t]=new ct(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(yh,wh);qe[t]=new ct(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(yh,wh);qe[t]=new ct(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){qe[e]=new ct(e,1,!1,e.toLowerCase(),null,!1,!1)});qe.xlinkHref=new ct("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){qe[e]=new ct(e,1,!1,e.toLowerCase(),null,!0,!0)});function bh(e,t,r,n){var s=qe.hasOwnProperty(t)?qe[t]:null;(s!==null?s.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(hS(t,r,s,n)&&(r=null),n||s===null?uS(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):s.mustUseProperty?e[s.propertyName]=r===null?s.type===3?!1:"":r:(t=s.attributeName,n=s.attributeNamespace,r===null?e.removeAttribute(t):(s=s.type,r=s===3||s===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var Kr=lS.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,fa=Symbol.for("react.element"),Is=Symbol.for("react.portal"),Ls=Symbol.for("react.fragment"),xh=Symbol.for("react.strict_mode"),Fu=Symbol.for("react.profiler"),iv=Symbol.for("react.provider"),av=Symbol.for("react.context"),Sh=Symbol.for("react.forward_ref"),Bu=Symbol.for("react.suspense"),zu=Symbol.for("react.suspense_list"),_h=Symbol.for("react.memo"),rn=Symbol.for("react.lazy"),lv=Symbol.for("react.offscreen"),qf=Symbol.iterator;function Oo(e){return e===null||typeof e!="object"?null:(e=qf&&e[qf]||e["@@iterator"],typeof e=="function"?e:null)}var Te=Object.assign,Wc;function Vo(e){if(Wc===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Wc=t&&t[1]||""}return`
34`+Wc+e}var Kc=!1;function qc(e,t){if(!e||Kc)return"";Kc=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var n=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){n=c}e.call(t.prototype)}else{try{throw Error()}catch(c){n=c}e()}}
vendor: 14,030 bytes, lines 34-37
34catch(c){if(c&&n&&typeof c.stack=="string"){for(var s=c.stack.split(`
35`),o=n.stack.split(`
36`),i=s.length-1,a=o.length-1;1<=i&&0<=a&&s[i]!==o[a];)a--;for(;1<=i&&0<=a;i--,a--)if(s[i]!==o[a]){if(i!==1||a!==1)do if(i--,a--,0>a||s[i]!==o[a]){var l=`
37`+s[i].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=i&&0<=a);break}}}finally{Kc=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Vo(e):""}function fS(e){switch(e.tag){case 5:return Vo(e.type);case 16:return Vo("Lazy");case 13:return Vo("Suspense");case 19:return Vo("SuspenseList");case 0:case 2:case 15:return e=qc(e.type,!1),e;case 11:return e=qc(e.type.render,!1),e;case 1:return e=qc(e.type,!0),e;default:return""}}function Hu(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 Ls:return"Fragment";case Is:return"Portal";case Fu:return"Profiler";case xh:return"StrictMode";case Bu:return"Suspense";case zu:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case av:return(e.displayName||"Context")+".Consumer";case iv:return(e._context.displayName||"Context")+".Provider";case Sh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case _h:return t=e.displayName||null,t!==null?t:Hu(e.type)||"Memo";case rn:t=e._payload,e=e._init;try{return Hu(e(t))}catch{}}return null}function pS(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 Hu(t);case 8:return t===xh?"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 Tn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function cv(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function mS(e){var t=cv(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,o=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(i){n=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(i){n=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function pa(e){e._valueTracker||(e._valueTracker=mS(e))}function uv(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=cv(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function ml(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 Vu(e,t){var r=t.checked;return Te({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Gf(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Tn(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function dv(e,t){t=t.checked,t!=null&&bh(e,"checked",t,!1)}function Wu(e,t){dv(e,t);var r=Tn(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ku(e,t.type,r):t.hasOwnProperty("defaultValue")&&Ku(e,t.type,Tn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Jf(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Ku(e,t,r){(t!=="number"||ml(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Wo=Array.isArray;function qs(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s<r.length;s++)t["$"+r[s]]=!0;for(r=0;r<e.length;r++)s=t.hasOwnProperty("$"+e[r].value),e[r].selected!==s&&(e[r].selected=s),s&&n&&(e[r].defaultSelected=!0)}else{for(r=""+Tn(r),t=null,s=0;s<e.length;s++){if(e[s].value===r){e[s].selected=!0,n&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function qu(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(O(91));return Te({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Qf(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(O(92));if(Wo(r)){if(1<r.length)throw Error(O(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Tn(r)}}function hv(e,t){var r=Tn(t.value),n=Tn(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function Yf(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function fv(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Gu(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?fv(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ma,pv=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,s){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ma=ma||document.createElement("div"),ma.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ma.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function gi(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var ri={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},gS=["Webkit","ms","Moz","O"];Object.keys(ri).forEach(function(e){gS.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ri[t]=ri[e]})});function mv(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||ri.hasOwnProperty(e)&&ri[e]?(""+t).trim():t+"px"}function gv(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=mv(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var vS=Te({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 Ju(e,t){if(t){if(vS[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(O(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(O(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(O(61))}if(t.style!=null&&typeof t.style!="object")throw Error(O(62))}}function Qu(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 Yu=null;function Eh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Xu=null,Gs=null,Js=null;function Xf(e){if(e=Zi(e)){if(typeof Xu!="function")throw Error(O(280));var t=e.stateNode;t&&(t=ic(t),Xu(e.stateNode,e.type,t))}}function vv(e){Gs?Js?Js.push(e):Js=[e]:Gs=e}function yv(){if(Gs){var e=Gs,t=Js;if(Js=Gs=null,Xf(e),t)for(e=0;e<t.length;e++)Xf(t[e])}}function wv(e,t){return e(t)}function bv(){}var Gc=!1;function xv(e,t,r){if(Gc)return e(t,r);Gc=!0;try{return wv(e,t,r)}finally{Gc=!1,(Gs!==null||Js!==null)&&(bv(),yv())}}function vi(e,t){var r=e.stateNode;if(r===null)return null;var n=ic(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(O(231,t,typeof r));return r}var Zu=!1;if(Fr)try{var Io={};Object.defineProperty(Io,"passive",{get:function(){Zu=!0}}),window.addEventListener("test",Io,Io),window.removeEventListener("test",Io,Io)}catch{Zu=!1}function yS(e,t,r,n,s,o,i,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(r,c)}catch(u){this.onError(u)}}var ni=!1,gl=null,vl=!1,ed=null,wS={onError:function(e){ni=!0,gl=e}};function bS(e,t,r,n,s,o,i,a,l){ni=!1,gl=null,yS.apply(wS,arguments)}function xS(e,t,r,n,s,o,i,a,l){if(bS.apply(this,arguments),ni){if(ni){var c=gl;ni=!1,gl=null}else throw Error(O(198));vl||(vl=!0,ed=c)}}function bs(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function Sv(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Zf(e){if(bs(e)!==e)throw Error(O(188))}function SS(e){var t=e.alternate;if(!t){if(t=bs(e),t===null)throw Error(O(188));return t!==e?null:e}for(var r=e,n=t;;){var s=r.return;if(s===null)break;var o=s.alternate;if(o===null){if(n=s.return,n!==null){r=n;continue}break}if(s.child===o.child){for(o=s.child;o;){if(o===r)return Zf(s),e;if(o===n)return Zf(s),t;o=o.sibling}throw Error(O(188))}if(r.return!==n.return)r=s,n=o;else{for(var i=!1,a=s.child;a;){if(a===r){i=!0,r=s,n=o;break}if(a===n){i=!0,n=s,r=o;break}a=a.sibling}if(!i){for(a=o.child;a;){if(a===r){i=!0,r=o,n=s;break}if(a===n){i=!0,n=o,r=s;break}a=a.sibling}if(!i)throw Error(O(189))}}if(r.alternate!==n)throw Error(O(190))}if(r.tag!==3)throw Error(O(188));return r.stateNode.current===r?e:t}function _v(e){return e=SS(e),e!==null?Ev(e):null}function Ev(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Ev(e);if(t!==null)return t;e=e.sibling}return null}var kv=Tt.unstable_scheduleCallback,ep=Tt.unstable_cancelCallback,_S=Tt.unstable_shouldYield,ES=Tt.unstable_requestPaint,je=Tt.unstable_now,kS=Tt.unstable_getCurrentPriorityLevel,kh=Tt.unstable_ImmediatePriority,Cv=Tt.unstable_UserBlockingPriority,yl=Tt.unstable_NormalPriority,CS=Tt.unstable_LowPriority,Tv=Tt.unstable_IdlePriority,rc=null,br=null;function TS(e){if(br&&typeof br.onCommitFiberRoot=="function")try{br.onCommitFiberRoot(rc,e,void 0,(e.current.flags&128)===128)}catch{}}var tr=Math.clz32?Math.clz32:AS,RS=Math.log,PS=Math.LN2;function AS(e){return e>>>=0,e===0?32:31-(RS(e)/PS|0)|0}var ga=64,va=4194304;function Ko(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 wl(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,o=e.pingedLanes,i=r&268435455;if(i!==0){var a=i&~s;a!==0?n=Ko(a):(o&=i,o!==0&&(n=Ko(o)))}else i=r&~s,i!==0?n=Ko(i):o!==0&&(n=Ko(o));if(n===0)return 0;if(t!==0&&t!==n&&!(t&s)&&(s=n&-n,o=t&-t,s>=o||s===16&&(o&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-tr(t),s=1<<r,n|=e[r],t&=~s;return n}function NS(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function jS(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,o=e.pendingLanes;0<o;){var i=31-tr(o),a=1<<i,l=s[i];l===-1?(!(a&r)||a&n)&&(s[i]=NS(a,t)):l<=t&&(e.expiredLanes|=a),o&=~a}}function td(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Rv(){var e=ga;return ga<<=1,!(ga&4194240)&&(ga=64),e}
vendor: 3,845 bytes, line 37
37function Jc(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Yi(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-tr(t),e[t]=r}function OS(e,t){var r=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 n=e.eventTimes;for(e=e.expirationTimes;0<r;){var s=31-tr(r),o=1<<s;t[s]=0,n[s]=-1,e[s]=-1,r&=~o}}function Ch(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-tr(r),s=1<<n;s&t|e[n]&t&&(e[n]|=t),r&=~s}}var fe=0;function Pv(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Av,Th,Nv,jv,Ov,rd=!1,ya=[],vn=null,yn=null,wn=null,yi=new Map,wi=new Map,sn=[],IS="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function tp(e,t){switch(e){case"focusin":case"focusout":vn=null;break;case"dragenter":case"dragleave":yn=null;break;case"mouseover":case"mouseout":wn=null;break;case"pointerover":case"pointerout":yi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":wi.delete(t.pointerId)}}function Lo(e,t,r,n,s,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:o,targetContainers:[s]},t!==null&&(t=Zi(t),t!==null&&Th(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function LS(e,t,r,n,s){switch(t){case"focusin":return vn=Lo(vn,e,t,r,n,s),!0;case"dragenter":return yn=Lo(yn,e,t,r,n,s),!0;case"mouseover":return wn=Lo(wn,e,t,r,n,s),!0;case"pointerover":var o=s.pointerId;return yi.set(o,Lo(yi.get(o)||null,e,t,r,n,s)),!0;case"gotpointercapture":return o=s.pointerId,wi.set(o,Lo(wi.get(o)||null,e,t,r,n,s)),!0}return!1}function Iv(e){var t=Xn(e.target);if(t!==null){var r=bs(t);if(r!==null){if(t=r.tag,t===13){if(t=Sv(r),t!==null){e.blockedOn=t,Ov(e.priority,function(){Nv(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Qa(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=nd(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);Yu=n,r.target.dispatchEvent(n),Yu=null}else return t=Zi(r),t!==null&&Th(t),e.blockedOn=r,!1;t.shift()}return!0}function rp(e,t,r){Qa(e)&&r.delete(t)}function $S(){rd=!1,vn!==null&&Qa(vn)&&(vn=null),yn!==null&&Qa(yn)&&(yn=null),wn!==null&&Qa(wn)&&(wn=null),yi.forEach(rp),wi.forEach(rp)}function $o(e,t){e.blockedOn===t&&(e.blockedOn=null,rd||(rd=!0,Tt.unstable_scheduleCallback(Tt.unstable_NormalPriority,$S)))}function bi(e){function t(s){return $o(s,e)}if(0<ya.length){$o(ya[0],e);for(var r=1;r<ya.length;r++){var n=ya[r];n.blockedOn===e&&(n.blockedOn=null)}}for(vn!==null&&$o(vn,e),yn!==null&&$o(yn,e),wn!==null&&$o(wn,e),yi.forEach(t),wi.forEach(t),r=0;r<sn.length;r++)n=sn[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<sn.length&&(r=sn[0],r.blockedOn===null);)Iv(r),r.blockedOn===null&&sn.shift()}var Qs=Kr.ReactCurrentBatchConfig,bl=!0;function MS(e,t,r,n){var s=fe,o=Qs.transition;Qs.transition=null;try{fe=1,Rh(e,t,r,n)}finally{fe=s,Qs.transition=o}}function DS(e,t,r,n){var s=fe,o=Qs.transition;Qs.transition=null;try{fe=4,Rh(e,t,r,n)}finally{fe=s,Qs.transition=o}}function Rh(e,t,r,n){if(bl){var s=nd(e,t,r,n);if(s===null)ou(e,t,n,xl,r),tp(e,n);else if(LS(s,e,t,r,n))n.stopPropagation();else if(tp(e,n),t&4&&-1<IS.indexOf(e)){for(;s!==null;){var o=Zi(s);if(o!==null&&Av(o),o=nd(e,t,r,n),o===null&&ou(e,t,n,xl,r),o===s)break;s=o}s!==null&&n.stopPropagation()}else ou(e,t,n,null,r)}}var xl=null;
vendor: 10,703 bytes, line 37
37function nd(e,t,r,n){if(xl=null,e=Eh(n),e=Xn(e),e!==null)if(t=bs(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Sv(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return xl=e,null}function Lv(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(kS()){case kh:return 1;case Cv:return 4;case yl:case CS:return 16;case Tv:return 536870912;default:return 16}default:return 16}}var pn=null,Ph=null,Ya=null;function $v(){if(Ya)return Ya;var e,t=Ph,r=t.length,n,s="value"in pn?pn.value:pn.textContent,o=s.length;for(e=0;e<r&&t[e]===s[e];e++);var i=r-e;for(n=1;n<=i&&t[r-n]===s[o-n];n++);return Ya=s.slice(e,1<n?1-n:void 0)}function Xa(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function wa(){return!0}function np(){return!1}function Pt(e){function t(r,n,s,o,i){this._reactName=r,this._targetInst=s,this.type=n,this.nativeEvent=o,this.target=i,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(r=e[a],this[a]=r?r(o):o[a]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?wa:np,this.isPropagationStopped=np,this}return Te(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=wa)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=wa)},persist:function(){},isPersistent:wa}),t}var _o={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ah=Pt(_o),Xi=Te({},_o,{view:0,detail:0}),US=Pt(Xi),Qc,Yc,Mo,nc=Te({},Xi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nh,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Mo&&(Mo&&e.type==="mousemove"?(Qc=e.screenX-Mo.screenX,Yc=e.screenY-Mo.screenY):Yc=Qc=0,Mo=e),Qc)},movementY:function(e){return"movementY"in e?e.movementY:Yc}}),sp=Pt(nc),FS=Te({},nc,{dataTransfer:0}),BS=Pt(FS),zS=Te({},Xi,{relatedTarget:0}),Xc=Pt(zS),HS=Te({},_o,{animationName:0,elapsedTime:0,pseudoElement:0}),VS=Pt(HS),WS=Te({},_o,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),KS=Pt(WS),qS=Te({},_o,{data:0}),op=Pt(qS),GS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},JS={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},QS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function YS(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=QS[e])?!!t[e]:!1}function Nh(){return YS}var XS=Te({},Xi,{key:function(e){if(e.key){var t=GS[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Xa(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?JS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nh,charCode:function(e){return e.type==="keypress"?Xa(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Xa(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ZS=Pt(XS),e_=Te({},nc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ip=Pt(e_),t_=Te({},Xi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nh}),r_=Pt(t_),n_=Te({},_o,{propertyName:0,elapsedTime:0,pseudoElement:0}),s_=Pt(n_),o_=Te({},nc,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),i_=Pt(o_),a_=[9,13,27,32],jh=Fr&&"CompositionEvent"in window,si=null;Fr&&"documentMode"in document&&(si=document.documentMode);var l_=Fr&&"TextEvent"in window&&!si,Mv=Fr&&(!jh||si&&8<si&&11>=si),ap=" ",lp=!1;function Dv(e,t){switch(e){case"keyup":return a_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Uv(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var $s=!1;function c_(e,t){switch(e){case"compositionend":return Uv(t);case"keypress":return t.which!==32?null:(lp=!0,ap);case"textInput":return e=t.data,e===ap&&lp?null:e;default:return null}}function u_(e,t){if($s)return e==="compositionend"||!jh&&Dv(e,t)?(e=$v(),Ya=Ph=pn=null,$s=!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.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Mv&&t.locale!=="ko"?null:t.data;default:return null}}var d_={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function cp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!d_[e.type]:t==="textarea"}function Fv(e,t,r,n){vv(n),t=Sl(t,"onChange"),0<t.length&&(r=new Ah("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var oi=null,xi=null;function h_(e){Yv(e,0)}function sc(e){var t=Us(e);if(uv(t))return e}function f_(e,t){if(e==="change")return t}var Bv=!1;if(Fr){var Zc;if(Fr){var eu="oninput"in document;if(!eu){var up=document.createElement("div");up.setAttribute("oninput","return;"),eu=typeof up.oninput=="function"}Zc=eu}else Zc=!1;Bv=Zc&&(!document.documentMode||9<document.documentMode)}function dp(){oi&&(oi.detachEvent("onpropertychange",zv),xi=oi=null)}function zv(e){if(e.propertyName==="value"&&sc(xi)){var t=[];Fv(t,xi,e,Eh(e)),xv(h_,t)}}function p_(e,t,r){e==="focusin"?(dp(),oi=t,xi=r,oi.attachEvent("onpropertychange",zv)):e==="focusout"&&dp()}function m_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return sc(xi)}function g_(e,t){if(e==="click")return sc(t)}function v_(e,t){if(e==="input"||e==="change")return sc(t)}function y_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var nr=typeof Object.is=="function"?Object.is:y_;function Si(e,t){if(nr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var s=r[n];if(!Uu.call(t,s)||!nr(e[s],t[s]))return!1}return!0}function hp(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function fp(e,t){var r=hp(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=hp(r)}}function Hv(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Hv(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Vv(){for(var e=window,t=ml();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=ml(e.document)}return t}function Oh(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 w_(e){var t=Vv(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Hv(r.ownerDocument.documentElement,r)){if(n!==null&&Oh(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=r.textContent.length,o=Math.min(n.start,s);n=n.end===void 0?o:Math.min(n.end,s),!e.extend&&o>n&&(s=n,n=o,o=s),s=fp(r,o);var i=fp(r,n);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>n?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var b_=Fr&&"documentMode"in document&&11>=document.documentMode,Ms=null,sd=null,ii=null,od=!1;function pp(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;od||Ms==null||Ms!==ml(n)||(n=Ms,"selectionStart"in n&&Oh(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focu
vendor: 4,501 bytes, line 37
37sNode:n.focusNode,focusOffset:n.focusOffset}),ii&&Si(ii,n)||(ii=n,n=Sl(sd,"onSelect"),0<n.length&&(t=new Ah("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=Ms)))}function ba(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Ds={animationend:ba("Animation","AnimationEnd"),animationiteration:ba("Animation","AnimationIteration"),animationstart:ba("Animation","AnimationStart"),transitionend:ba("Transition","TransitionEnd")},tu={},Wv={};Fr&&(Wv=document.createElement("div").style,"AnimationEvent"in window||(delete Ds.animationend.animation,delete Ds.animationiteration.animation,delete Ds.animationstart.animation),"TransitionEvent"in window||delete Ds.transitionend.transition);function oc(e){if(tu[e])return tu[e];if(!Ds[e])return e;var t=Ds[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Wv)return tu[e]=t[r];return e}var Kv=oc("animationend"),qv=oc("animationiteration"),Gv=oc("animationstart"),Jv=oc("transitionend"),Qv=new Map,mp="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function On(e,t){Qv.set(e,t),ws(t,[e])}for(var ru=0;ru<mp.length;ru++){var nu=mp[ru],x_=nu.toLowerCase(),S_=nu[0].toUpperCase()+nu.slice(1);On(x_,"on"+S_)}On(Kv,"onAnimationEnd");On(qv,"onAnimationIteration");On(Gv,"onAnimationStart");On("dblclick","onDoubleClick");On("focusin","onFocus");On("focusout","onBlur");On(Jv,"onTransitionEnd");ho("onMouseEnter",["mouseout","mouseover"]);ho("onMouseLeave",["mouseout","mouseover"]);ho("onPointerEnter",["pointerout","pointerover"]);ho("onPointerLeave",["pointerout","pointerover"]);ws("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ws("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ws("onBeforeInput",["compositionend","keypress","textInput","paste"]);ws("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ws("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ws("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),__=new Set("cancel close invalid load scroll toggle".split(" ").concat(qo));function gp(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,xS(n,t,void 0,e),e.currentTarget=null}function Yv(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],s=n.event;n=n.listeners;e:{var o=void 0;if(t)for(var i=n.length-1;0<=i;i--){var a=n[i],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==o&&s.isPropagationStopped())break e;gp(s,a,c),o=l}else for(i=0;i<n.length;i++){if(a=n[i],l=a.instance,c=a.currentTarget,a=a.listener,l!==o&&s.isPropagationStopped())break e;gp(s,a,c),o=l}}}if(vl)throw e=ed,vl=!1,ed=null,e}function be(e,t){var r=t[ud];r===void 0&&(r=t[ud]=new Set);var n=e+"__bubble";r.has(n)||(Xv(t,e,2,!1),r.add(n))}function su(e,t,r){var n=0;t&&(n|=4),Xv(r,e,n,t)}var xa="_reactListening"+Math.random().toString(36).slice(2);function _i(e){if(!e[xa]){e[xa]=!0,ov.forEach(function(r){r!=="selectionchange"&&(__.has(r)||su(r,!1,e),su(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xa]||(t[xa]=!0,su("selectionchange",!1,t))}}function Xv(e,t,r,n){switch(Lv(t)){case 1:var s=MS;break;case 4:s=DS;break;default:s=Rh}r=s.bind(null,t,r,e),s=void 0,!Zu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),n?s!==void 0?e.addEventListener(t,r,{capture:!0,passive:s}):e.addEventListener(t,r,!0):s!==void 0?e.addEventListener(t,r,{passive:s}):e.addEventListener(t,r,!1)}function ou(e,t,r,n,s){var o=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var i=n.tag;if(i===3||i===4){var a=n.stateNode.containerInfo;
vendor: 2,527 bytes, line 37
37if(a===s||a.nodeType===8&&a.parentNode===s)break;if(i===4)for(i=n.return;i!==null;){var l=i.tag;if((l===3||l===4)&&(l=i.stateNode.containerInfo,l===s||l.nodeType===8&&l.parentNode===s))return;i=i.return}for(;a!==null;){if(i=Xn(a),i===null)return;if(l=i.tag,l===5||l===6){n=o=i;continue e}a=a.parentNode}}n=n.return}xv(function(){var c=o,u=Eh(r),d=[];e:{var h=Qv.get(e);if(h!==void 0){var f=Ah,x=e;switch(e){case"keypress":if(Xa(r)===0)break e;case"keydown":case"keyup":f=ZS;break;case"focusin":x="focus",f=Xc;break;case"focusout":x="blur",f=Xc;break;case"beforeblur":case"afterblur":f=Xc;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":f=sp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":f=BS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":f=r_;break;case Kv:case qv:case Gv:f=VS;break;case Jv:f=s_;break;case"scroll":f=US;break;case"wheel":f=i_;break;case"copy":case"cut":case"paste":f=KS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":f=ip}var g=(t&4)!==0,b=!g&&e==="scroll",v=g?h!==null?h+"Capture":null:h;g=[];for(var m=c,y;m!==null;){y=m;var S=y.stateNode;if(y.tag===5&&S!==null&&(y=S,v!==null&&(S=vi(m,v),S!=null&&g.push(Ei(m,S,y)))),b)break;m=m.return}0<g.length&&(h=new f(h,x,null,r,u),d.push({event:h,listeners:g}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",f=e==="mouseout"||e==="pointerout",h&&r!==Yu&&(x=r.relatedTarget||r.fromElement)&&(Xn(x)||x[Br]))break e;if((f||h)&&(h=u.window===u?u:(h=u.ownerDocument)?h.defaultView||h.parentWindow:window,f?(x=r.relatedTarget||r.toElement,f=c,x=x?Xn(x):null,x!==null&&(b=bs(x),x!==b||x.tag!==5&&x.tag!==6)&&(x=null)):(f=null,x=c),f!==x)){if(g=sp,S="onMouseLeave",v="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(g=ip,S="onPointerLeave",v="onPointerEnter",m="pointer"),b=f==null?h:Us(f),y=x==null?h:Us(x),h=new g(S,m+"leave",f,r,u),h.target=b,h.relatedTarget=y,S=null,Xn(u)===c&&(g=new g(v,m+"enter",x,r,u),g.target=y,g.relatedTarget=b,S=g),b=S,f&&x)t:{for(g=f,v=x,m=0,y=g;y;y=_s(y))m++;for(y=0,S=v;S;S=_s(S))y++;for(;0<m-y;)g=_s(g),m--;for(;0<y-m;)v=_s(v),y--;for(;m--;){if(g===v||v!==null&&g===v.alternate)break t;g=_s(g),v=_s(v)}g=null}else g=null;f!==null&&vp(d,h,f,g,!1),x!==null&&b!==null&&vp(d,b,x,g,!0)}}
vendor: 4,435 bytes, lines 37-38
37e:{if(h=c?Us(c):window,f=h.nodeName&&h.nodeName.toLowerCase(),f==="select"||f==="input"&&h.type==="file")var E=f_;else if(cp(h))if(Bv)E=v_;else{E=m_;var _=p_}else(f=h.nodeName)&&f.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(E=g_);if(E&&(E=E(e,c))){Fv(d,E,r,u);break e}_&&_(e,h,c),e==="focusout"&&(_=h._wrapperState)&&_.controlled&&h.type==="number"&&Ku(h,"number",h.value)}switch(_=c?Us(c):window,e){case"focusin":(cp(_)||_.contentEditable==="true")&&(Ms=_,sd=c,ii=null);break;case"focusout":ii=sd=Ms=null;break;case"mousedown":od=!0;break;case"contextmenu":case"mouseup":case"dragend":od=!1,pp(d,r,u);break;case"selectionchange":if(b_)break;case"keydown":case"keyup":pp(d,r,u)}var T;if(jh)e:{switch(e){case"compositionstart":var R="onCompositionStart";break e;case"compositionend":R="onCompositionEnd";break e;case"compositionupdate":R="onCompositionUpdate";break e}R=void 0}else $s?Dv(e,r)&&(R="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(R="onCompositionStart");R&&(Mv&&r.locale!=="ko"&&($s||R!=="onCompositionStart"?R==="onCompositionEnd"&&$s&&(T=$v()):(pn=u,Ph="value"in pn?pn.value:pn.textContent,$s=!0)),_=Sl(c,R),0<_.length&&(R=new op(R,e,null,r,u),d.push({event:R,listeners:_}),T?R.data=T:(T=Uv(r),T!==null&&(R.data=T)))),(T=l_?c_(e,r):u_(e,r))&&(c=Sl(c,"onBeforeInput"),0<c.length&&(u=new op("onBeforeInput","beforeinput",null,r,u),d.push({event:u,listeners:c}),u.data=T))}Yv(d,t)})}function Ei(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Sl(e,t){for(var r=t+"Capture",n=[];e!==null;){var s=e,o=s.stateNode;s.tag===5&&o!==null&&(s=o,o=vi(e,r),o!=null&&n.unshift(Ei(e,o,s)),o=vi(e,t),o!=null&&n.push(Ei(e,o,s))),e=e.return}return n}function _s(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function vp(e,t,r,n,s){for(var o=t._reactName,i=[];r!==null&&r!==n;){var a=r,l=a.alternate,c=a.stateNode;if(l!==null&&l===n)break;a.tag===5&&c!==null&&(a=c,s?(l=vi(r,o),l!=null&&i.unshift(Ei(r,l,a))):s||(l=vi(r,o),l!=null&&i.push(Ei(r,l,a)))),r=r.return}i.length!==0&&e.push({event:t,listeners:i})}var E_=/\r\n?/g,k_=/\u0000|\uFFFD/g;function yp(e){return(typeof e=="string"?e:""+e).replace(E_,`
38`).replace(k_,"")}function Sa(e,t,r){if(t=yp(t),yp(e)!==t&&r)throw Error(O(425))}function _l(){}var id=null,ad=null;function ld(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var cd=typeof setTimeout=="function"?setTimeout:void 0,C_=typeof clearTimeout=="function"?clearTimeout:void 0,wp=typeof Promise=="function"?Promise:void 0,T_=typeof queueMicrotask=="function"?queueMicrotask:typeof wp<"u"?function(e){return wp.resolve(null).then(e).catch(R_)}:cd;function R_(e){setTimeout(function(){throw e})}function iu(e,t){var r=t,n=0;do{var s=r.nextSibling;if(e.removeChild(r),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(n===0){e.removeChild(s),bi(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=s}while(r);bi(t)}function bn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function bp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var Eo=Math.random().toString(36).slice(2),yr="__reactFiber$"+Eo,ki="__reactProps$"+Eo,Br="__reactContainer$"+Eo,ud="__reactEvents$"+Eo,P_="__reactListeners$"+Eo,A_="__reactHandles$"+Eo;function Xn(e){var t=e[yr];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Br]||r[yr]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=bp(e);e!==null;){if(r=e[yr])return r;e=bp(e)}return t}e=r,r=e.parentNode}return null}function Zi(e){return e=e[yr]||e[Br],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Us(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(O(33))}function ic(e){return e[ki]||null}var dd=[],Fs=-1;function In(e){return{current:e}}function xe(e){0>Fs||(e.current=dd[Fs],dd[Fs]=null,Fs--)}function ye(e,t){Fs++,dd[Fs]=e.current,e.current=t}var Rn={},rt=In(Rn),mt=In(!1),ds=Rn;function fo(e,t){var r=e.type.contextTypes;if(!r)return Rn;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},o;
vendor: 14,751 bytes, line 38
38for(o in r)s[o]=t[o];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function gt(e){return e=e.childContextTypes,e!=null}function El(){xe(mt),xe(rt)}function xp(e,t,r){if(rt.current!==Rn)throw Error(O(168));ye(rt,t),ye(mt,r)}function Zv(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in t))throw Error(O(108,pS(e)||"Unknown",s));return Te({},r,n)}function kl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Rn,ds=rt.current,ye(rt,e),ye(mt,mt.current),!0}function Sp(e,t,r){var n=e.stateNode;if(!n)throw Error(O(169));r?(e=Zv(e,t,ds),n.__reactInternalMemoizedMergedChildContext=e,xe(mt),xe(rt),ye(rt,e)):xe(mt),ye(mt,r)}var Lr=null,ac=!1,au=!1;function ey(e){Lr===null?Lr=[e]:Lr.push(e)}function N_(e){ac=!0,ey(e)}function Ln(){if(!au&&Lr!==null){au=!0;var e=0,t=fe;try{var r=Lr;for(fe=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}Lr=null,ac=!1}catch(s){throw Lr!==null&&(Lr=Lr.slice(e+1)),kv(kh,Ln),s}finally{fe=t,au=!1}}return null}var Bs=[],zs=0,Cl=null,Tl=0,jt=[],Ot=0,hs=null,Mr=1,Dr="";function Jn(e,t){Bs[zs++]=Tl,Bs[zs++]=Cl,Cl=e,Tl=t}function ty(e,t,r){jt[Ot++]=Mr,jt[Ot++]=Dr,jt[Ot++]=hs,hs=e;var n=Mr;e=Dr;var s=32-tr(n)-1;n&=~(1<<s),r+=1;var o=32-tr(t)+s;if(30<o){var i=s-s%5;o=(n&(1<<i)-1).toString(32),n>>=i,s-=i,Mr=1<<32-tr(t)+s|r<<s|n,Dr=o+e}else Mr=1<<o|r<<s|n,Dr=e}function Ih(e){e.return!==null&&(Jn(e,1),ty(e,1,0))}function Lh(e){for(;e===Cl;)Cl=Bs[--zs],Bs[zs]=null,Tl=Bs[--zs],Bs[zs]=null;for(;e===hs;)hs=jt[--Ot],jt[Ot]=null,Dr=jt[--Ot],jt[Ot]=null,Mr=jt[--Ot],jt[Ot]=null}var kt=null,Et=null,Ee=!1,Zt=null;function ry(e,t){var r=It(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function _p(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,kt=e,Et=bn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,kt=e,Et=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=hs!==null?{id:Mr,overflow:Dr}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=It(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,kt=e,Et=null,!0):!1;default:return!1}}function hd(e){return(e.mode&1)!==0&&(e.flags&128)===0}function fd(e){if(Ee){var t=Et;if(t){var r=t;if(!_p(e,t)){if(hd(e))throw Error(O(418));t=bn(r.nextSibling);var n=kt;t&&_p(e,t)?ry(n,r):(e.flags=e.flags&-4097|2,Ee=!1,kt=e)}}else{if(hd(e))throw Error(O(418));e.flags=e.flags&-4097|2,Ee=!1,kt=e}}}function Ep(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;kt=e}function _a(e){if(e!==kt)return!1;if(!Ee)return Ep(e),Ee=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!ld(e.type,e.memoizedProps)),t&&(t=Et)){if(hd(e))throw ny(),Error(O(418));for(;t;)ry(e,t),t=bn(t.nextSibling)}if(Ep(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(O(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Et=bn(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Et=null}}else Et=kt?bn(e.stateNode.nextSibling):null;return!0}function ny(){for(var e=Et;e;)e=bn(e.nextSibling)}function po(){Et=kt=null,Ee=!1}function $h(e){Zt===null?Zt=[e]:Zt.push(e)}var j_=Kr.ReactCurrentBatchConfig;function Do(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(O(309));var n=r.stateNode}if(!n)throw Error(O(147,e));var s=n,o=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===o?t.ref:(t=function(i){var a=s.refs;i===null?delete a[o]:a[o]=i},t._stringRef=o,t)}if(typeof e!="string")throw Error(O(284));if(!r._owner)throw Error(O(290,e))}return e}function Ea(e,t){throw e=Object.prototype.toString.call(t),Error(O(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function kp(e){var t=e._init;return t(e._payload)}function sy(e){function t(v,m){if(e){var y=v.deletions;y===null?(v.deletions=[m],v.flags|=16):y.push(m)}}function r(v,m){if(!e)return null;for(;m!==null;)t(v,m),m=m.sibling;return null}function n(v,m){for(v=new Map;m!==null;)m.key!==null?v.set(m.key,m):v.set(m.index,m),m=m.sibling;return v}function s(v,m){return v=En(v,m),v.index=0,v.sibling=null,v}function o(v,m,y){return v.index=y,e?(y=v.alternate,y!==null?(y=y.index,y<m?(v.flags|=2,m):y):(v.flags|=2,m)):(v.flags|=1048576,m)}function i(v){return e&&v.alternate===null&&(v.flags|=2),v}function a(v,m,y,S){return m===null||m.tag!==6?(m=pu(y,v.mode,S),m.return=v,m):(m=s(m,y),m.return=v,m)}function l(v,m,y,S){var E=y.type;return E===Ls?u(v,m,y.props.children,S,y.key):m!==null&&(m.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===rn&&kp(E)===m.type)?(S=s(m,y.props),S.ref=Do(v,m,y),S.return=v,S):(S=ol(y.type,y.key,y.props,null,v.mode,S),S.ref=Do(v,m,y),S.return=v,S)}function c(v,m,y,S){return m===null||m.tag!==4||m.stateNode.containerInfo!==y.containerInfo||m.stateNode.implementation!==y.implementation?(m=mu(y,v.mode,S),m.return=v,m):(m=s(m,y.children||[]),m.return=v,m)}function u(v,m,y,S,E){return m===null||m.tag!==7?(m=us(y,v.mode,S,E),m.return=v,m):(m=s(m,y),m.return=v,m)}function d(v,m,y){if(typeof m=="string"&&m!==""||typeof m=="number")return m=pu(""+m,v.mode,y),m.return=v,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case fa:return y=ol(m.type,m.key,m.props,null,v.mode,y),y.ref=Do(v,null,m),y.return=v,y;case Is:return m=mu(m,v.mode,y),m.return=v,m;case rn:var S=m._init;return d(v,S(m._payload),y)}if(Wo(m)||Oo(m))return m=us(m,v.mode,y,null),m.return=v,m;Ea(v,m)}return null}function h(v,m,y,S){var E=m!==null?m.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return E!==null?null:a(v,m,""+y,S);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case fa:return y.key===E?l(v,m,y,S):null;case Is:return y.key===E?c(v,m,y,S):null;case rn:return E=y._init,h(v,m,E(y._payload),S)}if(Wo(y)||Oo(y))return E!==null?null:u(v,m,y,S,null);Ea(v,y)}return null}function f(v,m,y,S,E){if(typeof S=="string"&&S!==""||typeof S=="number")return v=v.get(y)||null,a(m,v,""+S,E);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case fa:return v=v.get(S.key===null?y:S.key)||null,l(m,v,S,E);case Is:return v=v.get(S.key===null?y:S.key)||null,c(m,v,S,E);case rn:var _=S._init;return f(v,m,y,_(S._payload),E)}if(Wo(S)||Oo(S))return v=v.get(y)||null,u(m,v,S,E,null);Ea(m,S)}return null}function x(v,m,y,S){for(var E=null,_=null,T=m,R=m=0,P=null;T!==null&&R<y.length;R++){T.index>R?(P=T,T=null):P=T.sibling;var j=h(v,T,y[R],S);if(j===null){T===null&&(T=P);break}e&&T&&j.alternate===null&&t(v,T),m=o(j,m,R),_===null?E=j:_.sibling=j,_=j,T=P}if(R===y.length)return r(v,T),Ee&&Jn(v,R),E;if(T===null){for(;R<y.length;R++)T=d(v,y[R],S),T!==null&&(m=o(T,m,R),_===null?E=T:_.sibling=T,_=T);return Ee&&Jn(v,R),E}for(T=n(v,T);R<y.length;R++)P=f(T,v,R,y[R],S),P!==null&&(e&&P.alternate!==null&&T.delete(P.key===null?R:P.key),m=o(P,m,R),_===null?E=P:_.sibling=P,_=P);return e&&T.forEach(function(B){return t(v,B)}),Ee&&Jn(v,R),E}function g(v,m,y,S){var E=Oo(y);if(typeof E!="function")throw Error(O(150));if(y=E.call(y),y==null)throw Error(O(151));for(var _=E=null,T=m,R=m=0,P=null,j=y.next();T!==null&&!j.done;R++,j=y.next()){T.index>R?(P=T,T=null):P=T.sibling;var B=h(v,T,j.value,S);if(B===null){T===null&&(T=P);break}e&&T&&B.alternate===null&&t(v,T),m=o(B,m,R),_===null?E=B:_.sibling=B,_=B,T=P}if(j.done)return r(v,T),Ee&&Jn(v,R),E;if(T===null){for(;!j.done;R++,j=y.next())j=d(v,j.value,S),j!==null&&(m=o(j,m,R),_===null?E=j:_.sibling=j,_=j);return Ee&&Jn(v,R),E}for(T=n(v,T);!j.done;R++,j=y.next())j=f(T,v,R,j.value,S),j!==null&&(e&&j.alternate!==null&&T.delete(j.key===null?R:j.key),m=o(j,m,R),_===null?E=j:_.sibling=j,_=j);return e&&T.forEach(function(I){return t(v,I)}),Ee&&Jn(v,R),E}function b(v,m,y,S){if(typeof y=="object"&&y!==null&&y.type===Ls&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case fa:e:{for(var E=y.key,_=m;_!==null;){if(_.key===E){if(E=y.type,E===Ls){if(_.tag===7){r(v,_.sibling),m=s(_,y.props.children),m.return=v,v=m;break e}}else if(_.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===rn&&kp(E)===_.type){r(v,_.sibling),m=s(_,y.props),m.ref=Do(v,_,y),m.return=v,v=m;break e}r(v,_);break}else t(v,_);_=_.sibling}y.type===Ls?(m=us(y.props.children,v.mode,S,y.key),m.return=v,v=m):(S=ol(y.type,y.key,y.props,null,v.mode,S),S.ref=Do(v,m,y),S.return=v,v=S)}return i(v);case Is:e:{for(_=y.key;m!==null;){if(m.key===_)if(m.tag===4&&m.stateNode.containerInfo===y.containerInfo&&m.stateNode.implementation===y.implementation){r(v,m.sibling),m=s(m,y.children||[]),m.return=v,v=m;break e}else{r(v,m);break}else t(v,m);m=m.sibling}m=mu(y,v.mode,S),m.return=v,v=m}return i(v);case rn:return _=y._init,b(v,m,_(y._payload),S)}if(Wo(y))return x(v,m,y,S);if(Oo(y))return g(v,m,y,S);Ea(v,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,m!==null&&m.tag===6?(r(v,m.sibling),m=s(m,y),m.return=v,v=m):(r(v,m),m=pu(y,v.mode,S),m.return=v,v=m),i(v)):r(v,m)}return b}var mo=sy(!0),oy=sy(!1),Rl=In(null),Pl=null,Hs=null,Mh=null;function Dh(){Mh=Hs=Pl=null}function Uh(e){var t=Rl.current;xe(Rl),e._currentValue=t}function pd(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Ys(e,t){Pl=e,Mh=Hs=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(pt=!0),e.firstContext=null)}function $t(e){var t=e._currentValue;if(Mh!==e)if(e={context:e,memoizedValue:t,next:null},Hs===null){if(Pl===null)throw Error(O(308));Hs=e,Pl.dependencies={lanes:0,firstContext:e}}else Hs=Hs.next=e;return t}var Zn=null;function Fh(e){Zn===null?Zn=[e]:Zn.push(e)}function iy(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,Fh(t)):(r.next=s.next,s.next=r),t.interleaved=r,zr(e,n)}function zr(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var nn=!1;function Bh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ay(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 Ur(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function xn(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,ce&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,zr(e,r)}return s=n.interleaved,s===null?(t.next=t,Fh(n)):(t.next=s.next,s.next=t),n.interleaved=t,zr(e,r)}function Za(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Ch(e,r)}}function Cp(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,o=null;if(r=r.firstBaseUpdate,r!==null){do{var i={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};o===null?s=o=i:o=o.next=i,r=r.next}while(r!==null);o===null?s=o=t:o=o.next=t}else s=o=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:o,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Al(e,t,r,n){var s=e.updateQueue;nn=!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 u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==i&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(o!==null){var d=s.baseState;i=0,u=c=l=null,a=o;do{var h=a.lane,f=a.eventTime;if((n&h)===h){u!==null&&(u=u.next={eventTime:f,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var x=e,g=a;switch(h=t,f=r,g.tag){case 1:if(x=g.payload,typeof x=="function"){d=x.call(f,d,h);break e}d=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=g.payload,h=typeof x=="function"?x.call(f,d,h):x,h==null)break e;d=Te({},d,h);break e;case 2:nn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[a]:h.push(a))}else f={eventTime:f,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=f,l=d):u=u.next=f,i|=h;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;h=a,a=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(u===null&&(l=d),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=u,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);ps|=i,e.lanes=i,e.memoizedState=d}}function Tp(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],s=n.callback;if(s!==null){if(n.callback=null,n=r,typeof s!="function")throw Error(O(191,s));s.call(n)}}}var ea={},xr=In(ea),Ci=In(ea),Ti=In(ea);function es(e){if(e===ea)throw Error(O(174));return e}function zh(e,t){switch(ye(Ti,t),ye(Ci,e),ye(xr,ea),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Gu(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Gu(t,e)}xe(xr),ye(xr,t)}function go(){xe(xr),xe(Ci),xe(Ti)}function ly(e){es(Ti.current);var t=es(xr.current),r=Gu(t,e.type);t!==r&&(ye(Ci,e),ye(xr,r))}function Hh(e){Ci.current===e&&(xe(xr),xe(Ci))}var ke=In(0);function Nl(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var lu=[];function Vh(){for(var e=0;e<lu.length;e++)lu[e]._workInProgressVersionPrimary=null;lu.length=0}var el=Kr.ReactCurrentDispatcher,cu=Kr.ReactCurrentBatchConfig,fs=0,Ce=null,Ue=null,ze=null,jl=!1,ai=!1,Ri=0,O_=0;function Ye(){throw Error(O(321))}function Wh(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!nr(e[r],t[r]))return!1;return!0}function Kh(e,t,r,n,s,o){if(fs=o,Ce=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,el.current=e===null||e.memoizedState===null?M_:D_,e=r(n,s),ai){o=0;
vendor: 6,592 bytes, line 38
38do{if(ai=!1,Ri=0,25<=o)throw Error(O(301));o+=1,ze=Ue=null,t.updateQueue=null,el.current=U_,e=r(n,s)}while(ai)}if(el.current=Ol,t=Ue!==null&&Ue.next!==null,fs=0,ze=Ue=Ce=null,jl=!1,t)throw Error(O(300));return e}function qh(){var e=Ri!==0;return Ri=0,e}function hr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ze===null?Ce.memoizedState=ze=e:ze=ze.next=e,ze}function Mt(){if(Ue===null){var e=Ce.alternate;e=e!==null?e.memoizedState:null}else e=Ue.next;var t=ze===null?Ce.memoizedState:ze.next;if(t!==null)ze=t,Ue=e;else{if(e===null)throw Error(O(310));Ue=e,e={memoizedState:Ue.memoizedState,baseState:Ue.baseState,baseQueue:Ue.baseQueue,queue:Ue.queue,next:null},ze===null?Ce.memoizedState=ze=e:ze=ze.next=e}return ze}function Pi(e,t){return typeof t=="function"?t(e):t}function uu(e){var t=Mt(),r=t.queue;if(r===null)throw Error(O(311));r.lastRenderedReducer=e;var n=Ue,s=n.baseQueue,o=r.pending;if(o!==null){if(s!==null){var i=s.next;s.next=o.next,o.next=i}n.baseQueue=s=o,r.pending=null}if(s!==null){o=s.next,n=n.baseState;var a=i=null,l=null,c=o;do{var u=c.lane;if((fs&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),n=c.hasEagerState?c.eagerState:e(n,c.action);else{var d={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=d,i=n):l=l.next=d,Ce.lanes|=u,ps|=u}c=c.next}while(c!==null&&c!==o);l===null?i=n:l.next=a,nr(n,t.memoizedState)||(pt=!0),t.memoizedState=n,t.baseState=i,t.baseQueue=l,r.lastRenderedState=n}if(e=r.interleaved,e!==null){s=e;do o=s.lane,Ce.lanes|=o,ps|=o,s=s.next;while(s!==e)}else s===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function du(e){var t=Mt(),r=t.queue;if(r===null)throw Error(O(311));r.lastRenderedReducer=e;var n=r.dispatch,s=r.pending,o=t.memoizedState;if(s!==null){r.pending=null;var i=s=s.next;do o=e(o,i.action),i=i.next;while(i!==s);nr(o,t.memoizedState)||(pt=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),r.lastRenderedState=o}return[o,n]}function cy(){}function uy(e,t){var r=Ce,n=Mt(),s=t(),o=!nr(n.memoizedState,s);if(o&&(n.memoizedState=s,pt=!0),n=n.queue,Gh(fy.bind(null,r,n,e),[e]),n.getSnapshot!==t||o||ze!==null&&ze.memoizedState.tag&1){if(r.flags|=2048,Ai(9,hy.bind(null,r,n,s,t),void 0,null),He===null)throw Error(O(349));fs&30||dy(r,t,s)}return s}function dy(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Ce.updateQueue,t===null?(t={lastEffect:null,stores:null},Ce.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function hy(e,t,r,n){t.value=r,t.getSnapshot=n,py(t)&&my(e)}function fy(e,t,r){return r(function(){py(t)&&my(e)})}function py(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!nr(e,r)}catch{return!0}}function my(e){var t=zr(e,1);t!==null&&rr(t,e,1,-1)}function Rp(e){var t=hr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Pi,lastRenderedState:e},t.queue=e,e=e.dispatch=$_.bind(null,Ce,e),[t.memoizedState,e]}function Ai(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=Ce.updateQueue,t===null?(t={lastEffect:null,stores:null},Ce.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function gy(){return Mt().memoizedState}function tl(e,t,r,n){var s=hr();Ce.flags|=e,s.memoizedState=Ai(1|t,r,void 0,n===void 0?null:n)}function lc(e,t,r,n){var s=Mt();n=n===void 0?null:n;var o=void 0;if(Ue!==null){var i=Ue.memoizedState;if(o=i.destroy,n!==null&&Wh(n,i.deps)){s.memoizedState=Ai(t,r,o,n);return}}Ce.flags|=e,s.memoizedState=Ai(1|t,r,o,n)}function Pp(e,t){return tl(8390656,8,e,t)}function Gh(e,t){return lc(2048,8,e,t)}function vy(e,t){return lc(4,2,e,t)}function yy(e,t){return lc(4,4,e,t)}function wy(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function by(e,t,r){return r=r!=null?r.concat([e]):null,lc(4,4,wy.bind(null,t,e),r)}function Jh(){}function xy(e,t){var r=Mt();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Wh(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function Sy(e,t){var r=Mt();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Wh(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function _y(e,t,r){return fs&21?(nr(r,t)||(r=Rv(),Ce.lanes|=r,ps|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,pt=!0),e.memoizedState=r)}function I_(e,t){var r=fe;fe=r!==0&&4>r?r:4,e(!0);var n=cu.transition;cu.transition={};try{e(!1),t()}finally{fe=r,cu.transition=n}}function Ey(){return Mt().memoizedState}function L_(e,t,r){var n=_n(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},ky(e))Cy(t,r);else if(r=iy(e,t,r,n),r!==null){var s=at();rr(r,e,n,s),Ty(r,t,n)}}function $_(e,t,r){var n=_n(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(ky(e))Cy(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,r);if(s.hasEagerState=!0,s.eagerState=a,nr(a,i)){var l=t.interleaved;l===null?(s.next=s,Fh(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}r=iy(e,t,s,n),r!==null&&(s=at(),rr(r,e,n,s),Ty(r,t,n))}}function ky(e){var t=e.alternate;return e===Ce||t!==null&&t===Ce}function Cy(e,t){ai=jl=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Ty(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Ch(e,r)}}var Ol={readContext:$t,useCallback:Ye,useContext:Ye,useEffect:Ye,useImperativeHandle:Ye,useInsertionEffect:Ye,useLayoutEffect:Ye,useMemo:Ye,useReducer:Ye,useRef:Ye,useState:Ye,useDebugValue:Ye,useDeferredValue:Ye,useTransition:Ye,useMutableSource:Ye,useSyncExternalStore:Ye,useId:Ye,unstable_isNewReconciler:!1},M_={readContext:$t,useCallback:function(e,t){return hr().memoizedState=[e,t===void 0?null:t],e},useContext:$t,useEffect:Pp,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,tl(4194308,4,wy.bind(null,t,e),r)},useLayoutEffect:function(e,t){return tl(4194308,4,e,t)},useInsertionEffect:function(e,t){return tl(4,2,e,t)},useMemo:function(e,t){var r=hr();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=hr();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=L_.bind(null,Ce,e),[n.memoizedState,e]}
vendor: 5,922 bytes, lines 38-40
38,useRef:function(e){var t=hr();return e={current:e},t.memoizedState=e},useState:Rp,useDebugValue:Jh,useDeferredValue:function(e){return hr().memoizedState=e},useTransition:function(){var e=Rp(!1),t=e[0];return e=I_.bind(null,e[1]),hr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Ce,s=hr();if(Ee){if(r===void 0)throw Error(O(407));r=r()}else{if(r=t(),He===null)throw Error(O(349));fs&30||dy(n,t,r)}s.memoizedState=r;var o={value:r,getSnapshot:t};return s.queue=o,Pp(fy.bind(null,n,o,e),[e]),n.flags|=2048,Ai(9,hy.bind(null,n,o,r,t),void 0,null),r},useId:function(){var e=hr(),t=He.identifierPrefix;if(Ee){var r=Dr,n=Mr;r=(n&~(1<<32-tr(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Ri++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=O_++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},D_={readContext:$t,useCallback:xy,useContext:$t,useEffect:Gh,useImperativeHandle:by,useInsertionEffect:vy,useLayoutEffect:yy,useMemo:Sy,useReducer:uu,useRef:gy,useState:function(){return uu(Pi)},useDebugValue:Jh,useDeferredValue:function(e){var t=Mt();return _y(t,Ue.memoizedState,e)},useTransition:function(){var e=uu(Pi)[0],t=Mt().memoizedState;return[e,t]},useMutableSource:cy,useSyncExternalStore:uy,useId:Ey,unstable_isNewReconciler:!1},U_={readContext:$t,useCallback:xy,useContext:$t,useEffect:Gh,useImperativeHandle:by,useInsertionEffect:vy,useLayoutEffect:yy,useMemo:Sy,useReducer:du,useRef:gy,useState:function(){return du(Pi)},useDebugValue:Jh,useDeferredValue:function(e){var t=Mt();return Ue===null?t.memoizedState=e:_y(t,Ue.memoizedState,e)},useTransition:function(){var e=du(Pi)[0],t=Mt().memoizedState;return[e,t]},useMutableSource:cy,useSyncExternalStore:uy,useId:Ey,unstable_isNewReconciler:!1};function qt(e,t){if(e&&e.defaultProps){t=Te({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function md(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:Te({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var cc={isMounted:function(e){return(e=e._reactInternals)?bs(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=at(),s=_n(e),o=Ur(n,s);o.payload=t,r!=null&&(o.callback=r),t=xn(e,o,s),t!==null&&(rr(t,e,s,n),Za(t,e,s))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=at(),s=_n(e),o=Ur(n,s);o.tag=1,o.payload=t,r!=null&&(o.callback=r),t=xn(e,o,s),t!==null&&(rr(t,e,s,n),Za(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=at(),n=_n(e),s=Ur(r,n);s.tag=2,t!=null&&(s.callback=t),t=xn(e,s,n),t!==null&&(rr(t,e,n,r),Za(t,e,n))}};function Ap(e,t,r,n,s,o,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,o,i):t.prototype&&t.prototype.isPureReactComponent?!Si(r,n)||!Si(s,o):!0}function Ry(e,t,r){var n=!1,s=Rn,o=t.contextType;return typeof o=="object"&&o!==null?o=$t(o):(s=gt(t)?ds:rt.current,n=t.contextTypes,o=(n=n!=null)?fo(e,s):Rn),t=new t(r,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=cc,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=o),t}function Np(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&cc.enqueueReplaceState(t,t.state,null)}function gd(e,t,r,n){var s=e.stateNode;s.props=r,s.state=e.memoizedState,s.refs={},Bh(e);var o=t.contextType;typeof o=="object"&&o!==null?s.context=$t(o):(o=gt(t)?ds:rt.current,s.context=fo(e,o)),s.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(md(e,t,o,r),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&cc.enqueueReplaceState(s,s.state,null),Al(e,r,s,n),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function vo(e,t){try{var r="",n=t;do r+=fS(n),n=n.return;while(n);var s=r}catch(o){s=`
39Error generating stack: `+o.message+`
40`+o.stack}return{value:e,source:t,stack:s,digest:null}}function hu(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function vd(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var F_=typeof WeakMap=="function"?WeakMap:Map;function Py(e,t,r){r=Ur(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Ll||(Ll=!0,Td=n),vd(e,t)},r}function Ay(e,t,r){r=Ur(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var s=t.value;r.payload=function(){return n(s)},r.callback=function(){vd(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(r.callback=function(){vd(e,t),typeof n!="function"&&(Sn===null?Sn=new Set([this]):Sn.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),r}function jp(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new F_;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(r)||(s.add(r),e=eE.bind(null,e,t,r),t.then(e,e))}function Op(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Ip(e,t,r,n,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Ur(-1,1),t.tag=2,xn(r,t,1))),r.lanes|=1),e)}var B_=Kr.ReactCurrentOwner,pt=!1;function ot(e,t,r,n){t.child=e===null?oy(t,null,r,n):mo(t,e.child,r,n)}function Lp(e,t,r,n,s){r=r.render;var o=t.ref;
vendor: 6,220 bytes, line 40
40return Ys(t,s),n=Kh(e,t,r,n,o,s),r=qh(),e!==null&&!pt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Hr(e,t,s)):(Ee&&r&&Ih(t),t.flags|=1,ot(e,t,n,s),t.child)}function $p(e,t,r,n,s){if(e===null){var o=r.type;return typeof o=="function"&&!nf(o)&&o.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=o,Ny(e,t,o,n,s)):(e=ol(r.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&s)){var i=o.memoizedProps;if(r=r.compare,r=r!==null?r:Si,r(i,n)&&e.ref===t.ref)return Hr(e,t,s)}return t.flags|=1,e=En(o,n),e.ref=t.ref,e.return=t,t.child=e}function Ny(e,t,r,n,s){if(e!==null){var o=e.memoizedProps;if(Si(o,n)&&e.ref===t.ref)if(pt=!1,t.pendingProps=n=o,(e.lanes&s)!==0)e.flags&131072&&(pt=!0);else return t.lanes=e.lanes,Hr(e,t,s)}return yd(e,t,r,n,s)}function jy(e,t,r){var n=t.pendingProps,s=n.children,o=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ye(Ws,xt),xt|=r;else{if(!(r&1073741824))return e=o!==null?o.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ye(Ws,xt),xt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=o!==null?o.baseLanes:r,ye(Ws,xt),xt|=n}else o!==null?(n=o.baseLanes|r,t.memoizedState=null):n=r,ye(Ws,xt),xt|=n;return ot(e,t,s,r),t.child}function Oy(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function yd(e,t,r,n,s){var o=gt(r)?ds:rt.current;return o=fo(t,o),Ys(t,s),r=Kh(e,t,r,n,o,s),n=qh(),e!==null&&!pt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Hr(e,t,s)):(Ee&&n&&Ih(t),t.flags|=1,ot(e,t,r,s),t.child)}function Mp(e,t,r,n,s){if(gt(r)){var o=!0;kl(t)}else o=!1;if(Ys(t,s),t.stateNode===null)rl(e,t),Ry(t,r,n),gd(t,r,n,s),n=!0;else if(e===null){var i=t.stateNode,a=t.memoizedProps;i.props=a;var l=i.context,c=r.contextType;typeof c=="object"&&c!==null?c=$t(c):(c=gt(r)?ds:rt.current,c=fo(t,c));var u=r.getDerivedStateFromProps,d=typeof u=="function"||typeof i.getSnapshotBeforeUpdate=="function";d||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==n||l!==c)&&Np(t,i,n,c),nn=!1;var h=t.memoizedState;i.state=h,Al(t,n,i,s),l=t.memoizedState,a!==n||h!==l||mt.current||nn?(typeof u=="function"&&(md(t,r,u,n),l=t.memoizedState),(a=nn||Ap(t,r,a,n,h,l,c))?(d||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=l),i.props=n,i.state=l,i.context=c,n=a):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{i=t.stateNode,ay(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:qt(t.type,a),i.props=c,d=t.pendingProps,h=i.context,l=r.contextType,typeof l=="object"&&l!==null?l=$t(l):(l=gt(r)?ds:rt.current,l=fo(t,l));var f=r.getDerivedStateFromProps;(u=typeof f=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==d||h!==l)&&Np(t,i,n,l),nn=!1,h=t.memoizedState,i.state=h,Al(t,n,i,s);var x=t.memoizedState;a!==d||h!==x||mt.current||nn?(typeof f=="function"&&(md(t,r,f,n),x=t.memoizedState),(c=nn||Ap(t,r,c,n,h,x,l)||!1)?(u||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(n,x,l),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(n,x,l)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=x),i.props=n,i.state=x,i.context=l,n=c):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),n=!1)}return wd(e,t,r,n,o,s)}function wd(e,t,r,n,s,o){Oy(e,t);var i=(t.flags&128)!==0;if(!n&&!i)return s&&Sp(t,r,!1),Hr(e,t,o);n=t.stateNode,B_.current=t;var a=i&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&i?(t.child=mo(t,e.child,null,o),t.child=mo(t,null,a,o)):ot(e,t,a,o),t.memoizedState=n.state,s&&Sp(t,r,!0),t.child}function Iy(e){var t=e.stateNode;t.pendingContext?xp(e,t.pendingContext,t.pendingContext!==t.context):t.context&&xp(e,t.context,!1),zh(e,t.containerInfo)}function Dp(e,t,r,n,s){return po(),$h(s),t.flags|=256,ot(e,t,r,n),t.child}var bd={dehydrated:null,treeContext:null,retryLane:0};function xd(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ly(e,t,r){var n=t.pendingProps,s=ke.current,o=!1,i=(t.flags&128)!==0,a;if((a=i)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),ye(ke,s&1),e===null)return fd(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=n.children,e=n.fallback,o?(n=t.mode,o=t.child,i={mode:"hidden",children:i},!(n&1)&&o!==null?(o.childLanes=0,o.pendingProps=i):o=hc(i,n,0,null),e=us(e,n,r,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=xd(r),t.memoizedState=bd,e):Qh(t,i));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return z_(e,t,i,n,a,s,r);if(o){o=n.fallback,i=t.mode,s=e.child,a=s.sibling;var l={mode:"hidden",children:n.children};return!(i&1)&&t.child!==s?(n=t.child,n.childLanes=0,n.pendingProps=l,t.deletions=null):(n=En(s,l),n.subtreeFlags=s.subtreeFlags&14680064),a!==null?o=En(a,o):(o=us(o,i,r,null),o.flags|=2),o.return=t,n.return=t,n.sibling=o,t.child=n,n=o,o=t.child,i=e.child.memoizedState,i=i===null?xd(r):{base
vendor: 8,213 bytes, line 40
40Lanes:i.baseLanes|r,cachePool:null,transitions:i.transitions},o.memoizedState=i,o.childLanes=e.childLanes&~r,t.memoizedState=bd,n}return o=e.child,e=o.sibling,n=En(o,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function Qh(e,t){return t=hc({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ka(e,t,r,n){return n!==null&&$h(n),mo(t,e.child,null,r),e=Qh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function z_(e,t,r,n,s,o,i){if(r)return t.flags&256?(t.flags&=-257,n=hu(Error(O(422))),ka(e,t,i,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=n.fallback,s=t.mode,n=hc({mode:"visible",children:n.children},s,0,null),o=us(o,s,i,null),o.flags|=2,n.return=t,o.return=t,n.sibling=o,t.child=n,t.mode&1&&mo(t,e.child,null,i),t.child.memoizedState=xd(i),t.memoizedState=bd,o);if(!(t.mode&1))return ka(e,t,i,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var a=n.dgst;return n=a,o=Error(O(419)),n=hu(o,n,void 0),ka(e,t,i,n)}if(a=(i&e.childLanes)!==0,pt||a){if(n=He,n!==null){switch(i&-i){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(n.suspendedLanes|i)?0:s,s!==0&&s!==o.retryLane&&(o.retryLane=s,zr(e,s),rr(n,e,s,-1))}return rf(),n=hu(Error(O(421))),ka(e,t,i,n)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=tE.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,Et=bn(s.nextSibling),kt=t,Ee=!0,Zt=null,e!==null&&(jt[Ot++]=Mr,jt[Ot++]=Dr,jt[Ot++]=hs,Mr=e.id,Dr=e.overflow,hs=t),t=Qh(t,n.children),t.flags|=4096,t)}function Up(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),pd(e.return,t,r)}function fu(e,t,r,n,s){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=n,o.tail=r,o.tailMode=s)}function $y(e,t,r){var n=t.pendingProps,s=n.revealOrder,o=n.tail;if(ot(e,t,n.children,r),n=ke.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Up(e,r,t);else if(e.tag===19)Up(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(ye(ke,n),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(r=t.child,s=null;r!==null;)e=r.alternate,e!==null&&Nl(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),fu(t,!1,s,r,o);break;case"backwards":for(r=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Nl(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}fu(t,!0,r,null,o);break;case"together":fu(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function rl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Hr(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),ps|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(O(153));if(t.child!==null){for(e=t.child,r=En(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=En(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function H_(e,t,r){switch(t.tag){case 3:Iy(t),po();break;case 5:ly(t);break;case 1:gt(t.type)&&kl(t);break;case 4:zh(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,s=t.memoizedProps.value;ye(Rl,n._currentValue),n._currentValue=s;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(ye(ke,ke.current&1),t.flags|=128,null):r&t.child.childLanes?Ly(e,t,r):(ye(ke,ke.current&1),e=Hr(e,t,r),e!==null?e.sibling:null);ye(ke,ke.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return $y(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),ye(ke,ke.current),n)break;return null;case 22:case 23:return t.lanes=0,jy(e,t,r)}return Hr(e,t,r)}var My,Sd,Dy,Uy;My=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Sd=function(){};Dy=function(e,t,r,n){var s=e.memoizedProps;if(s!==n){e=t.stateNode,es(xr.current);var o=null;switch(r){case"input":s=Vu(e,s),n=Vu(e,n),o=[];break;case"select":s=Te({},s,{value:void 0}),n=Te({},n,{value:void 0}),o=[];break;case"textarea":s=qu(e,s),n=qu(e,n),o=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=_l)}Ju(r,n);var i;r=null;for(c in s)if(!n.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var a=s[c];for(i in a)a.hasOwnProperty(i)&&(r||(r={}),r[i]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(mi.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in n){var l=n[c];if(a=s!=null?s[c]:void 0,n.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(i in a)!a.hasOwnProperty(i)||l&&l.hasOwnProperty(i)||(r||(r={}),r[i]="");for(i in l)l.hasOwnProperty(i)&&a[i]!==l[i]&&(r||(r={}),r[i]=l[i])}else r||(o||(o=[]),o.push(c,r)),r=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(o=o||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(o=o||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(mi.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&be("scroll",e),o||a===l||(o=[])):(o=o||[]).push(c,l))}r&&(o=o||[]).push("style",r);var c=o;(t.updateQueue=c)&&(t.flags|=4)}};Uy=function(e,t,r,n){r!==n&&(t.flags|=4)};function Uo(e,t){if(!Ee)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Xe(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags&14680064,n|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function V_(e,t,r){var n=t.pendingProps;switch(Lh(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xe(t),null;case 1:return gt(t.type)&&El(),Xe(t),null;case 3:return n=t.stateNode,go(),xe(mt),xe(rt),Vh(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(_a(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Zt!==null&&(Ad(Zt),Zt=null))),Sd(e,t),Xe(t),null;case 5:Hh(t);var s=es(Ti.current);if(r=t.type,e!==null&&t.stateNode!=null)Dy(e,t,r,n,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(O(166));return Xe(t),null}if(e=es(xr.current),_a(t)){n=t.stateNode,r=t.type;var o=t.memoizedProps;switch(n[yr]=t,n[ki]=o,e=(t.mode&1)!==0,r){case"dialog":be("cancel",n),be("close",n);break;case"iframe":case"object":case"embed":be("load",n);break;case"video":case"audio":for(s=0;s<qo.length;s++)be(qo[s],n);break;case"source":be("error",n);break;case"img":case"image":case"link":be("error",n),be("load",n);break;case"details":be("toggle",n);break;case"input":Gf(n,o),be("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!o.multiple},be("invalid",n);break;case"textarea":Qf(n,o),be("invalid",n)}Ju(r,o),s=null;for(var i in o)if(o.hasOwnProperty(i)){var a=o[i];
vendor: 31,695 bytes, line 40
40i==="children"?typeof a=="string"?n.textContent!==a&&(o.suppressHydrationWarning!==!0&&Sa(n.textContent,a,e),s=["children",a]):typeof a=="number"&&n.textContent!==""+a&&(o.suppressHydrationWarning!==!0&&Sa(n.textContent,a,e),s=["children",""+a]):mi.hasOwnProperty(i)&&a!=null&&i==="onScroll"&&be("scroll",n)}switch(r){case"input":pa(n),Jf(n,o,!0);break;case"textarea":pa(n),Yf(n);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(n.onclick=_l)}n=s,t.updateQueue=n,n!==null&&(t.flags|=4)}else{i=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=fv(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=i.createElement(r,{is:n.is}):(e=i.createElement(r),r==="select"&&(i=e,n.multiple?i.multiple=!0:n.size&&(i.size=n.size))):e=i.createElementNS(e,r),e[yr]=t,e[ki]=n,My(e,t,!1,!1),t.stateNode=e;e:{switch(i=Qu(r,n),r){case"dialog":be("cancel",e),be("close",e),s=n;break;case"iframe":case"object":case"embed":be("load",e),s=n;break;case"video":case"audio":for(s=0;s<qo.length;s++)be(qo[s],e);s=n;break;case"source":be("error",e),s=n;break;case"img":case"image":case"link":be("error",e),be("load",e),s=n;break;case"details":be("toggle",e),s=n;break;case"input":Gf(e,n),s=Vu(e,n),be("invalid",e);break;case"option":s=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},s=Te({},n,{value:void 0}),be("invalid",e);break;case"textarea":Qf(e,n),s=qu(e,n),be("invalid",e);break;default:s=n}Ju(r,s),a=s;for(o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="style"?gv(e,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&pv(e,l)):o==="children"?typeof l=="string"?(r!=="textarea"||l!=="")&&gi(e,l):typeof l=="number"&&gi(e,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(mi.hasOwnProperty(o)?l!=null&&o==="onScroll"&&be("scroll",e):l!=null&&bh(e,o,l,i))}switch(r){case"input":pa(e),Jf(e,n,!1);break;case"textarea":pa(e),Yf(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Tn(n.value));break;case"select":e.multiple=!!n.multiple,o=n.value,o!=null?qs(e,!!n.multiple,o,!1):n.defaultValue!=null&&qs(e,!!n.multiple,n.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=_l)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Xe(t),null;case 6:if(e&&t.stateNode!=null)Uy(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(O(166));if(r=es(Ti.current),es(xr.current),_a(t)){if(n=t.stateNode,r=t.memoizedProps,n[yr]=t,(o=n.nodeValue!==r)&&(e=kt,e!==null))switch(e.tag){case 3:Sa(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Sa(n.nodeValue,r,(e.mode&1)!==0)}o&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[yr]=t,t.stateNode=n}return Xe(t),null;case 13:if(xe(ke),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ee&&Et!==null&&t.mode&1&&!(t.flags&128))ny(),po(),t.flags|=98560,o=!1;else if(o=_a(t),n!==null&&n.dehydrated!==null){if(e===null){if(!o)throw Error(O(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(O(317));o[yr]=t}else po(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Xe(t),o=!1}else Zt!==null&&(Ad(Zt),Zt=null),o=!0;if(!o)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||ke.current&1?Fe===0&&(Fe=3):rf())),t.updateQueue!==null&&(t.flags|=4),Xe(t),null);case 4:return go(),Sd(e,t),e===null&&_i(t.stateNode.containerInfo),Xe(t),null;case 10:return Uh(t.type._context),Xe(t),null;case 17:return gt(t.type)&&El(),Xe(t),null;case 19:if(xe(ke),o=t.memoizedState,o===null)return Xe(t),null;if(n=(t.flags&128)!==0,i=o.rendering,i===null)if(n)Uo(o,!1);else{if(Fe!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=Nl(e),i!==null){for(t.flags|=128,Uo(o,!1),n=i.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)o=r,e=n,o.flags&=14680066,i=o.alternate,i===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,o.type=i.type,e=i.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return ye(ke,ke.current&1|2),t.child}e=e.sibling}o.tail!==null&&je()>yo&&(t.flags|=128,n=!0,Uo(o,!1),t.lanes=4194304)}else{if(!n)if(e=Nl(i),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Uo(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!Ee)return Xe(t),null}else 2*je()-o.renderingStartTime>yo&&r!==1073741824&&(t.flags|=128,n=!0,Uo(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(r=o.last,r!==null?r.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=je(),t.sibling=null,r=ke.current,ye(ke,n?r&1|2:r&1),t):(Xe(t),null);case 22:case 23:return tf(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?xt&1073741824&&(Xe(t),t.subtreeFlags&6&&(t.flags|=8192)):Xe(t),null;case 24:return null;case 25:return null}throw Error(O(156,t.tag))}function W_(e,t){switch(Lh(t),t.tag){case 1:return gt(t.type)&&El(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return go(),xe(mt),xe(rt),Vh(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Hh(t),null;case 13:if(xe(ke),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(O(340));po()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return xe(ke),null;case 4:return go(),null;case 10:return Uh(t.type._context),null;case 22:case 23:return tf(),null;case 24:return null;default:return null}}var Ca=!1,tt=!1,K_=typeof WeakSet=="function"?WeakSet:Set,H=null;function Vs(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Ne(e,t,n)}else r.current=null}function _d(e,t,r){try{r()}catch(n){Ne(e,t,n)}}var Fp=!1;function q_(e,t){if(id=bl,e=Vv(),Oh(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break e}var i=0,a=-1,l=-1,c=0,u=0,d=e,h=null;t:for(;;){for(var f;d!==r||s!==0&&d.nodeType!==3||(a=i+s),d!==o||n!==0&&d.nodeType!==3||(l=i+n),d.nodeType===3&&(i+=d.nodeValue.length),(f=d.firstChild)!==null;)h=d,d=f;for(;;){if(d===e)break t;if(h===r&&++c===s&&(a=i),h===o&&++u===n&&(l=i),(f=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=f}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(ad={focusedElem:e,selectionRange:r},bl=!1,H=t;H!==null;)if(t=H,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,H=e;else for(;H!==null;){t=H;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 g=x.memoizedProps,b=x.memoizedState,v=t.stateNode,m=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:qt(t.type,g),b);v.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(O(163))}}catch(S){Ne(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,H=e;break}H=t.return}return x=Fp,Fp=!1,x}function li(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var o=s.destroy;s.destroy=void 0,o!==void 0&&_d(t,r,o)}s=s.next}while(s!==n)}}function uc(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Ed(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function Fy(e){var t=e.alternate;t!==null&&(e.alternate=null,Fy(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[yr],delete t[ki],delete t[ud],delete t[P_],delete t[A_])),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 By(e){return e.tag===5||e.tag===3||e.tag===4}function Bp(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||By(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 kd(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=_l));else if(n!==4&&(e=e.child,e!==null))for(kd(e,t,r),e=e.sibling;e!==null;)kd(e,t,r),e=e.sibling}function Cd(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Cd(e,t,r),e=e.sibling;e!==null;)Cd(e,t,r),e=e.sibling}var Ve=null,Xt=!1;function Yr(e,t,r){for(r=r.child;r!==null;)zy(e,t,r),r=r.sibling}function zy(e,t,r){if(br&&typeof br.onCommitFiberUnmount=="function")try{br.onCommitFiberUnmount(rc,r)}catch{}switch(r.tag){case 5:tt||Vs(r,t);case 6:var n=Ve,s=Xt;Ve=null,Yr(e,t,r),Ve=n,Xt=s,Ve!==null&&(Xt?(e=Ve,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ve.removeChild(r.stateNode));break;case 18:Ve!==null&&(Xt?(e=Ve,r=r.stateNode,e.nodeType===8?iu(e.parentNode,r):e.nodeType===1&&iu(e,r),bi(e)):iu(Ve,r.stateNode));break;case 4:n=Ve,s=Xt,Ve=r.stateNode.containerInfo,Xt=!0,Yr(e,t,r),Ve=n,Xt=s;break;case 0:case 11:case 14:case 15:if(!tt&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var o=s,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&_d(r,t,i),s=s.next}while(s!==n)}Yr(e,t,r);break;case 1:if(!tt&&(Vs(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){Ne(r,t,a)}Yr(e,t,r);break;case 21:Yr(e,t,r);break;case 22:r.mode&1?(tt=(n=tt)||r.memoizedState!==null,Yr(e,t,r),tt=n):Yr(e,t,r);break;default:Yr(e,t,r)}}function zp(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new K_),t.forEach(function(n){var s=rE.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function zt(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var s=r[n];try{var o=e,i=t,a=i;e:for(;a!==null;){switch(a.tag){case 5:Ve=a.stateNode,Xt=!1;break e;case 3:Ve=a.stateNode.containerInfo,Xt=!0;break e;case 4:Ve=a.stateNode.containerInfo,Xt=!0;break e}a=a.return}if(Ve===null)throw Error(O(160));zy(o,i,s),Ve=null,Xt=!1;var l=s.alternate;l!==null&&(l.return=null),s.return=null}catch(c){Ne(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Hy(t,e),t=t.sibling}function Hy(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(zt(t,e),cr(e),n&4){try{li(3,e,e.return),uc(3,e)}catch(g){Ne(e,e.return,g)}try{li(5,e,e.return)}catch(g){Ne(e,e.return,g)}}break;case 1:zt(t,e),cr(e),n&512&&r!==null&&Vs(r,r.return);break;case 5:if(zt(t,e),cr(e),n&512&&r!==null&&Vs(r,r.return),e.flags&32){var s=e.stateNode;try{gi(s,"")}catch(g){Ne(e,e.return,g)}}if(n&4&&(s=e.stateNode,s!=null)){var o=e.memoizedProps,i=r!==null?r.memoizedProps:o,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&o.type==="radio"&&o.name!=null&&dv(s,o),Qu(a,i);var c=Qu(a,o);for(i=0;i<l.length;i+=2){var u=l[i],d=l[i+1];u==="style"?gv(s,d):u==="dangerouslySetInnerHTML"?pv(s,d):u==="children"?gi(s,d):bh(s,u,d,c)}switch(a){case"input":Wu(s,o);break;case"textarea":hv(s,o);break;case"select":var h=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!o.multiple;var f=o.value;f!=null?qs(s,!!o.multiple,f,!1):h!==!!o.multiple&&(o.defaultValue!=null?qs(s,!!o.multiple,o.defaultValue,!0):qs(s,!!o.multiple,o.multiple?[]:"",!1))}s[ki]=o}catch(g){Ne(e,e.return,g)}}break;case 6:if(zt(t,e),cr(e),n&4){if(e.stateNode===null)throw Error(O(162));s=e.stateNode,o=e.memoizedProps;try{s.nodeValue=o}catch(g){Ne(e,e.return,g)}}break;case 3:if(zt(t,e),cr(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{bi(t.containerInfo)}catch(g){Ne(e,e.return,g)}break;case 4:zt(t,e),cr(e);break;case 13:zt(t,e),cr(e),s=e.child,s.flags&8192&&(o=s.memoizedState!==null,s.stateNode.isHidden=o,!o||s.alternate!==null&&s.alternate.memoizedState!==null||(Zh=je())),n&4&&zp(e);break;case 22:if(u=r!==null&&r.memoizedState!==null,e.mode&1?(tt=(c=tt)||u,zt(t,e),tt=c):zt(t,e),cr(e),n&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&e.mode&1)for(H=e,u=e.child;u!==null;){for(d=H=u;H!==null;){switch(h=H,f=h.child,h.tag){case 0:case 11:case 14:case 15:li(4,h,h.return);break;case 1:Vs(h,h.return);var x=h.stateNode;if(typeof x.componentWillUnmount=="function"){n=h,r=h.return;try{t=n,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(g){Ne(n,r,g)}}break;case 5:Vs(h,h.return);break;case 22:if(h.memoizedState!==null){Vp(d);continue}}f!==null?(f.return=h,H=f):Vp(d)}u=u.sibling}e:for(u=null,d=e;;){if(d.tag===5){if(u===null){u=d;try{s=d.stateNode,c?(o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(a=d.stateNode,l=d.memoizedProps.style,i=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=mv("display",i))}catch(g){Ne(e,e.return,g)}}}else if(d.tag===6){if(u===null)try{d.stateNode.nodeValue=c?"":d.memoizedProps}catch(g){Ne(e,e.return,g)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;u===d&&(u=null),d=d.return}u===d&&(u=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:zt(t,e),cr(e),n&4&&zp(e);break;case 21:break;default:zt(t,e),cr(e)}}function cr(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(By(r)){var n=r;break e}r=r.return}throw Error(O(160))}switch(n.tag){case 5:var s=n.stateNode;n.flags&32&&(gi(s,""),n.flags&=-33);var o=Bp(e);Cd(e,o,s);break;case 3:case 4:var i=n.stateNode.containerInfo,a=Bp(e);kd(e,a,i);break;default:throw Error(O(161))}}catch(l){Ne(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function G_(e,t,r){H=e,Vy(e)}function Vy(e,t,r){for(var n=(e.mode&1)!==0;H!==null;){var s=H,o=s.child;if(s.tag===22&&n){var i=s.memoizedState!==null||Ca;if(!i){var a=s.alternate,l=a!==null&&a.memoizedState!==null||tt;a=Ca;var c=tt;if(Ca=i,(tt=l)&&!c)for(H=s;H!==null;)i=H,l=i.child,i.tag===22&&i.memoizedState!==null?Wp(s):l!==null?(l.return=i,H=l):Wp(s);for(;o!==null;)H=o,Vy(o),o=o.sibling;H=s,Ca=a,tt=c}Hp(e)}else s.subtreeFlags&8772&&o!==null?(o.return=s,H=o):Hp(e)}}function Hp(e){for(;H!==null;){var t=H;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:tt||uc(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!tt)if(r===null)n.componentDidMount();else{var s=t.elementType===t.type?r.memoizedProps:qt(t.type,r.memoizedProps);n.componentDidUpdate(s,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&Tp(t,o,n);break;case 3:var i=t.updateQueue;if(i!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Tp(t,i,r)}break;case 5:var a=t.stateNode;if(r===null&&t.flags&4){r=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&r.focus();break;case"img":l.src&&(r.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var d=u.dehydrated;d!==null&&bi(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(O(163))}tt||t.flags&512&&Ed(t)}catch(h){Ne(t,t.return,h)}}if(t===e){H=null;break}if(r=t.sibling,r!==null){r.return=t.return,H=r;break}H=t.return}}function Vp(e){for(;H!==null;){var t=H;if(t===e){H=null;break}var r=t.sibling;if(r!==null){r.return=t.return,H=r;break}H=t.return}}function Wp(e){for(;H!==null;){var t=H;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{uc(4,t)}catch(l){Ne(t,r,l)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var s=t.return;try{n.componentDidMount()}catch(l){Ne(t,s,l)}}var o=t.return;try{Ed(t)}catch(l){Ne(t,o,l)}break;case 5:var i=t.return;try{Ed(t)}catch(l){Ne(t,i,l)}}}catch(l){Ne(t,t.return,l)}if(t===e){H=null;break}var a=t.sibling;if(a!==null){a.return=t.return,H=a;break}H=t.return}}var J_=Math.ceil,Il=Kr.ReactCurrentDispatcher,Yh=Kr.ReactCurrentOwner,Lt=Kr.ReactCurrentBatchConfig,ce=0,He=null,Me=null,Ke=0,xt=0,Ws=In(0),Fe=0,Ni=null,ps=0,dc=0,Xh=0,ci=null,ft=null,Zh=0,yo=1/0,Nr=null,Ll=!1,Td=null,Sn=null,Ta=!1,mn=null,$l=0,ui=0,Rd=null,nl=-1,sl=0;function at(){return ce&6?je():nl!==-1?nl:nl=je()}function _n(e){return e.mode&1?ce&2&&Ke!==0?Ke&-Ke:j_.transition!==null?(sl===0&&(sl=Rv()),sl):(e=fe,e!==0||(e=window.event,e=e===void 0?16:Lv(e.type)),e):1}function rr(e,t,r,n){if(50<ui)throw ui=0,Rd=null,Error(O(185));Yi(e,r,n),(!(ce&2)||e!==He)&&(e===He&&(!(ce&2)&&(dc|=r),Fe===4&&on(e,Ke)),vt(e,n),r===1&&ce===0&&!(t.mode&1)&&(yo=je()+500,ac&&Ln()))}function vt(e,t){var r=e.callbackNode;jS(e,t);var n=wl(e,e===He?Ke:0);if(n===0)r!==null&&ep(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&ep(r),t===1)e.tag===0?N_(Kp.bind(null,e)):ey(Kp.bind(null,e)),T_(function(){!(ce&6)&&Ln()}),r=null;else{switch(Pv(n)){case 1:r=kh;break;case 4:r=Cv;break;case 16:r=yl;break;case 536870912:r=Tv;break;default:r=yl}r=Xy(r,Wy.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Wy(e,t){if(nl=-1,sl=0,ce&6)throw Error(O(327));var r=e.callbackNode;if(Xs()&&e.callbackNode!==r)return null;var n=wl(e,e===He?Ke:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=Ml(e,n);else{t=n;var s=ce;ce|=2;var o=qy();(He!==e||Ke!==t)&&(Nr=null,yo=je()+500,cs(e,t));do try{X_();break}catch(a){Ky(e,a)}while(!0);Dh(),Il.current=o,ce=s,Me!==null?t=0:(He=null,Ke=0,t=Fe)}if(t!==0){if(t===2&&(s=td(e),s!==0&&(n=s,t=Pd(e,s))),t===1)throw r=Ni,cs(e,0),on(e,n),vt(e,je()),r;if(t===6)on(e,n);else{if(s=e.current.alternate,!(n&30)&&!Q_(s)&&(t=Ml(e,n),t===2&&(o=td(e),o!==0&&(n=o,t=Pd(e,o))),t===1))throw r=Ni,cs(e,0),on(e,n),vt(e,je()),r;switch(e.finishedWork=s,e.finishedLanes=n,t){case 0:case 1:throw Error(O(345));case 2:Qn(e,ft,Nr);break;case 3:if(on(e,n),(n&130023424)===n&&(t=Zh+500-je(),10<t)){if(wl(e,0)!==0)break;if(s=e.suspendedLanes,(s&n)!==n){at(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=cd(Qn.bind(null,e,ft,Nr),t);break}Qn(e,ft,Nr);break;case 4:if(on(e,n),(n&4194240)===n)break;for(t=e.eventTimes,s=-1;0<n;){var i=31-tr(n);o=1<<i,i=t[i],i>s&&(s=i),n&=~o}if(n=s,n=je()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*J_(n/1960))-n,10<n){e.timeoutHandle=cd(Qn.bind(null,e,ft,Nr),n);break}Qn(e,ft,Nr);break;case 5:Qn(e,ft,Nr);break;default:throw Error(O(329))}}}return vt(e,je()),e.callbackNode===r?Wy.bind(null,e):null}function Pd(e,t){var r=ci;return e.current.memoizedState.isDehydrated&&(cs(e,t).flags|=256),e=Ml(e,t),e!==2&&(t=ft,ft=r,t!==null&&Ad(t)),e}function Ad(e){ft===null?ft=e:ft.push.apply(ft,e)}function Q_(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var s=r[n],o=s.getSnapshot;s=s.value;try{if(!nr(o(),s))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function on(e,t){for(t&=~Xh,t&=~dc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-tr(t),n=1<<r;e[r]=-1,t&=~n}}function Kp(e){if(ce&6)throw Error(O(327));Xs();var t=wl(e,0);if(!(t&1))return vt(e,je()),null;var r=Ml(e,t);if(e.tag!==0&&r===2){var n=td(e);n!==0&&(t=n,r=Pd(e,n))}if(r===1)throw r=Ni,cs(e,0),on(e,t),vt(e,je()),r;if(r===6)throw Error(O(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Qn(e,ft,Nr),vt(e,je()),null}function ef(e,t){var r=ce;ce|=1;try{return e(t)}finally{ce=r,ce===0&&(yo=je()+500,ac&&Ln())}}function ms(e){mn!==null&&mn.tag===0&&!(ce&6)&&Xs();var t=ce;ce|=1;var r=Lt.transition,n=fe;try{if(Lt.transition=null,fe=1,e)return e()}finally{fe=n,Lt.transition=r,ce=t,!(ce&6)&&Ln()}}function tf(){xt=Ws.current,xe(Ws)}function cs(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,C_(r)),Me!==null)for(r=Me.return;r!==null;){var n=r;switch(Lh(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&El();break;case 3:go(),xe(mt),xe(rt),Vh();break;case 5:Hh(n);break;case 4:go();break;case 13:xe(ke);break;case 19:xe(ke);break;case 10:Uh(n.type._context);break;case 22:case 23:tf()}r=r.return}if(He=e,Me=e=En(e.current,null),Ke=xt=t,Fe=0,Ni=null,Xh=dc=ps=0,ft=ci=null,Zn!==null){for(t=0;t<Zn.length;t++)if(r=Zn[t],n=r.interleaved,n!==null){r.interleaved=null;var s=n.next,o=r.pending;if(o!==null){var i=o.next;o.next=s,n.next=i}r.pending=n}Zn=null}return e}function Ky(e,t){do{var r=Me;try{if(Dh(),el.current=Ol,jl){for(var n=Ce.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}jl=!1}if(fs=0,ze=Ue=Ce=null,ai=!1,Ri=0,Yh.current=null,r===null||r.return===null){Fe=1,Ni=t,Me=null;break}e:{var o=e,i=r.return,a=r,l=t;if(t=Ke,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,d=u.tag;if(!(u.mode&1)&&(d===0||d===11||d===15)){var h=u.alternate;h?(u.updateQueue=h.updateQueue,u.memoizedState=h.memoizedState,u.lanes=h.lanes):(u.updateQueue=null,u.memoizedState=null)}var f=Op(i);if(f!==null){f.flags&=-257,Ip(f,i,a,o,t),f.mode&1&&jp(o,c,t),t=f,l=c;var x=t.updateQueue;if(x===null){var g=new Set;g.add(l),t.updateQueue=g}else x.add(l);break e}else{if(!(t&1)){jp(o,c,t),rf();break e}l=Error(O(426))}}else if(Ee&&a.mode&1){var b=Op(i);if(b!==null){!(b.flags&65536)&&(b.flags|=256),Ip(b,i,a,o,t),$h(vo(l,a));break e}}o=l=vo(l,a),Fe!==4&&(Fe=2),ci===null?ci=[o]:ci.push(o),o=i;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var v=Py(o,l,t);Cp(o,v);break e;case 1:a=l;var m=o.type,y=o.stateNode;if(!(o.flags&128)&&(typeof m.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Sn===null||!Sn.has(y)))){o.flags|=65536,t&=-t,o.lanes|=t;var S=Ay(o,a,t);Cp(o,S);break e}}o=o.return}while(o!==null)}Jy(r)}catch(E){t=E,Me===r&&r!==null&&(Me=r=r.return);continue}break}while(!0)}function qy(){var e=Il.current;return Il.current=Ol,e===null?Ol:e}function rf(){(Fe===0||Fe===3||Fe===2)&&(Fe=4),He===null||!(ps&268435455)&&!(dc&268435455)||on(He,Ke)}function Ml(e,t){var r=ce;ce|=2;var n=qy();(He!==e||Ke!==t)&&(Nr=null,cs(e,t));do try{Y_();break}catch(s){Ky(e,s)}while(!0);if(Dh(),ce=r,Il.current=n,Me!==null)throw Error(O(261));return He=null,Ke=0,Fe}function Y_(){for(;Me!==null;)Gy(Me)}function X_(){for(;Me!==null&&!_S();)Gy(Me)}function Gy(e){var t=Yy(e.alternate,e,xt);e.memoizedProps=e.pendingProps,t===null?Jy(e):Me=t,Yh.current=null}function Jy(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=W_(r,t),r!==null){r.flags&=32767,Me=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Fe=6,Me=null;return}}else if(r=V_(r,t,xt),r!==null){Me=r;return}if(t=t.sibling,t!==null){Me=t;return}Me=t=e}while(t!==null);Fe===0&&(Fe=5)}function Qn(e,t,r){var n=fe,s=Lt.transition;try{Lt.transition=null,fe=1,Z_(e,t,r,n)}finally{Lt.transition=s,fe=n}return null}function Z_(e,t,r,n){do Xs();while(mn!==null);if(ce&6)throw Error(O(327));r=e.finishedWork;var s=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(O(177));e.callbackNode=null,e.callbackPriority=0;var o=r.lanes|r.childLanes;if(OS(e,o),e===He&&(Me=He=null,Ke=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Ta||(Ta=!0,Xy(yl,function(){return Xs(),null})),o=(r.flags&15990)!==0,r.subtreeFlags&15990||o){o=Lt.transition,Lt.transition=null;var i=fe;fe=1;var a=ce;ce|=4,Yh.current=null,q_(e,r),Hy(r,e),w_(ad),bl=!!id,ad=id=null,e.current=r,G_(r),ES(),ce=a,fe=i,Lt.transition=o}else e.current=r;if(Ta&&(Ta=!1,mn=e,$l=s),o=e.pendingLanes,o===0&&(Sn=null),TS(r.stateNode),vt(e,je()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)s=t[r],n(s.value,{componentStack:s.stack,digest:s.digest});if(Ll)throw Ll=!1,e=Td,Td=null,e;return $l&1&&e.tag!==0&&Xs(),o=e.pendingLanes,o&1?e===Rd?ui++:(ui=0,Rd=e):ui=0,Ln(),null}function Xs(){if(mn!==null){var e=Pv($l),t=Lt.transition,r=fe;try{if(Lt.transition=null,fe=16>e?16:e,mn===null)var n=!1;else{if(e=mn,mn=null,$l=0,ce&6)throw Error(O(331));var s=ce;for(ce|=4,H=e.current;H!==null;){var o=H,i=o.child;if(H.flags&16){var a=o.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(H=c;H!==null;){var u=H;switch(u.tag){case 0:case 11:case 15:li(8,u,o)}var d=u.child;if(d!==null)d.return=u,H=d;else for(;H!==null;){u=H;var h=u.sibling,f=u.return;if(Fy(u),u===c){H=null;break}if(h!==null){h.return=f,H=h;break}H=f}}}var x=o.alternate;if(x!==null){var g=x.child;if(g!==null){x.child=null;do{var b=g.sibling;g.sibling=null,g=b}while(g!==null)}}H=o}}if(o.subtreeFlags&2064&&i!==null)i.return=o,H=i;else e:for(;H!==null;){if(o=H,o.flags&2048)switch(o.tag){case 0:case 11:case 15:li(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,H=v;break e}H=o.return}}var m=e.current;for(H=m;H!==null;){i=H;var y=i.child;if(i.subtreeFlags&2064&&y!==null)y.return=i,H=y;else e:for(i=m;H!==null;){if(a=H,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:uc(9,a)}}catch(E){Ne(a,a.return,E)}if(a===i){H=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,H=S;break e}H=a.return}}if(ce=s,Ln(),br&&typeof br.onPostCommitFiberRoot=="function")try{br.onPostCommitFiberRoot(rc,e)}catch{}n=!0}return n}finally{fe=r,Lt.transition=t}}return!1}function qp(e,t,r){t=vo(r,t),t=Py(e,t,1),e=xn(e,t,1),t=at(),e!==null&&(Yi(e,1,t),vt(e,t))}function Ne(e,t,r){if(e.tag===3)qp(e,e,r);else for(;t!==null;){if(t.tag===3){qp(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Sn===null||!Sn.has(n))){e=vo(r,e),e=Ay(t,e,1),t=xn(t,e,1),e=at(),t!==null&&(Yi(t,1,e),vt(t,e));break}}t=t.return}}function eE(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=at(),e.pingedLanes|=e.suspendedLanes&r,He===e&&(Ke&r)===r&&(Fe===4||Fe===3&&(Ke&130023424)===Ke&&500>je()-Zh?cs(e,0):Xh|=r),vt(e,t)}function Qy(e,t){t===0&&(e.mode&1?(t=va,va<<=1,!(va&130023424)&&(va=4194304)):t=1);var r=at();e=zr(e,t),e!==null&&(Yi(e,t,r),vt(e,r))}function tE(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Qy(e,r)}function rE(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(O(314))}n!==null&&n.delete(t),Qy(e,r)}var Yy;Yy=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||mt.current)pt=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return pt=!1,H_(e,t,r);pt=!!(e.flags&131072)}else pt=!1,Ee&&t.flags&1048576&&ty(t,Tl,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;rl(e,t),e=t.pendingProps;var s=fo(t,rt.current);Ys(t,r),s=Kh(null,t,n,e,s,r);var o=qh();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,gt(n)?(o=!0,kl(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Bh(t),s.updater=cc,t.stateNode=s,s._reactInternals=t,gd(t,n,e,r),t=wd(null,t,n,!0,o,r)):(t.tag=0,Ee&&o&&Ih(t),ot(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(rl(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=sE(n),e=qt(n,e),s){case 0:t=yd(null,t,n,e,r);break e;case 1:t=Mp(null,t,n,e,r);break e;case 11:t=Lp(null,t,n,e,r);break e;case 14:t=$p(null,t,n,qt(n.type,e),r);break e}throw Error(O(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:qt(n,s),yd(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:qt(n,s),Mp(e,t,n,s,r);case 3:e:{if(Iy(t),e===null)throw Error(O(387));n=t.pendingProps,o=t.memoizedState,s=o.element,ay(e,t),Al(t,n,null,r);var i=t.memoizedState;if(n=i.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){s=vo(Error(O(423)),t),t=Dp(e,t,n,r,s);break e}else if(n!==s){s=vo(Error(O(424)),t),t=Dp(e,t,n,r,s);break e}else for(Et=bn(t.stateNode.containerInfo.firstChild),kt=t,Ee=!0,Zt=null,r=oy(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(po(),n===s){t=Hr(e,t,r);break e}ot(e,t,n,r)}t=t.child}return t;case 5:return ly(t),e===null&&fd(t),n=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,i=s.children,ld(n,s)?i=null:o!==null&&ld(n,o)&&(t.flags|=32),Oy(e,t),ot(e,t,i,r),t.child;case 6:return e===null&&fd(t),null;case 13:return Ly(e,t,r);case 4:return zh(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=mo(t,null,n,r):ot(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:qt(n,s),Lp(e,t,n,s,r);case 7:return ot(e,t,t.pendingProps,r),t.child;case 8:return ot(e,t,t.pendingProps.children,r),t.child;case 12:return ot(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,s=t.pendingProps,o=t.memoizedProps,i=s.value,ye(Rl,n._currentValue),n._currentValue=i,o!==null)if(nr(o.value,i)){if(o.children===s.children&&!mt.current){t=Hr(e,t,r);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===n){if(o.tag===1){l=Ur(-1,r&-r),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),pd(o.return,r,t),a.lanes|=r;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(O(341));i.lanes|=r,a=i.alternate,a!==null&&(a.lanes|=r),pd(i,r,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}ot(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,Ys(t,r),s=$t(s),n=n(s),t.flags|=1,ot(e,t,n,r),t.child;case 14:return n=t.type,s=qt(n,t.pendingProps),s=qt(n.type,s),$p(e,t,n,s,r);case 15:return Ny(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:qt(n,s),rl(e,t),t.tag=1,gt(n)?(e=!0,kl(t)):e=!1,Ys(t,r),Ry(t,n,s),gd(t,n,s,r),wd(null,t,n,!0,e,r);case 19:return $y(e,t,r);case 22:return jy(e,t,r)}throw Error(O(156,t.tag))};function Xy(e,t){return kv(e,t)}function nE(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.t
vendor: 7,566 bytes, line 40
40ype=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function It(e,t,r,n){return new nE(e,t,r,n)}function nf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sE(e){if(typeof e=="function")return nf(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Sh)return 11;if(e===_h)return 14}return 2}function En(e,t){var r=e.alternate;return r===null?(r=It(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function ol(e,t,r,n,s,o){var i=2;if(n=e,typeof e=="function")nf(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Ls:return us(r.children,s,o,t);case xh:i=8,s|=8;break;case Fu:return e=It(12,r,t,s|2),e.elementType=Fu,e.lanes=o,e;case Bu:return e=It(13,r,t,s),e.elementType=Bu,e.lanes=o,e;case zu:return e=It(19,r,t,s),e.elementType=zu,e.lanes=o,e;case lv:return hc(r,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case iv:i=10;break e;case av:i=9;break e;case Sh:i=11;break e;case _h:i=14;break e;case rn:i=16,n=null;break e}throw Error(O(130,e==null?e:typeof e,""))}return t=It(i,r,t,s),t.elementType=e,t.type=n,t.lanes=o,t}function us(e,t,r,n){return e=It(7,e,n,t),e.lanes=r,e}function hc(e,t,r,n){return e=It(22,e,n,t),e.elementType=lv,e.lanes=r,e.stateNode={isHidden:!1},e}function pu(e,t,r){return e=It(6,e,null,t),e.lanes=r,e}function mu(e,t,r){return t=It(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function oE(e,t,r,n,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=Jc(0),this.expirationTimes=Jc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Jc(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function sf(e,t,r,n,s,o,i,a,l){return e=new oE(e,t,r,a,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=It(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Bh(o),e}function iE(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Is,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function Zy(e){if(!e)return Rn;e=e._reactInternals;e:{if(bs(e)!==e||e.tag!==1)throw Error(O(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(gt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(O(171))}if(e.tag===1){var r=e.type;if(gt(r))return Zv(e,r,t)}return t}function ew(e,t,r,n,s,o,i,a,l){return e=sf(r,n,!0,e,s,o,i,a,l),e.context=Zy(null),r=e.current,n=at(),s=_n(r),o=Ur(n,s),o.callback=t??null,xn(r,o,s),e.current.lanes=s,Yi(e,s,n),vt(e,n),e}function fc(e,t,r,n){var s=t.current,o=at(),i=_n(s);return r=Zy(r),t.context===null?t.context=r:t.pendingContext=r,t=Ur(o,i),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=xn(s,t,i),e!==null&&(rr(e,s,i,o),Za(e,s,i)),i}function Dl(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Gp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function of(e,t){Gp(e,t),(e=e.alternate)&&Gp(e,t)}function aE(){return null}var tw=typeof reportError=="function"?reportError:function(e){console.error(e)};function af(e){this._internalRoot=e}pc.prototype.render=af.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(O(409));fc(e,t,null,null)};pc.prototype.unmount=af.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ms(function(){fc(null,e,null,null)}),t[Br]=null}};function pc(e){this._internalRoot=e}pc.prototype.unstable_scheduleHydration=function(e){if(e){var t=jv();e={blockedOn:null,target:e,priority:t};for(var r=0;r<sn.length&&t!==0&&t<sn[r].priority;r++);sn.splice(r,0,e),r===0&&Iv(e)}};function lf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function mc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Jp(){}function lE(e,t,r,n,s){if(s){if(typeof n=="function"){var o=n;n=function(){var c=Dl(i);o.call(c)}}var i=ew(t,n,e,0,null,!1,!1,"",Jp);return e._reactRootContainer=i,e[Br]=i.current,_i(e.nodeType===8?e.parentNode:e),ms(),i}for(;s=e.lastChild;)e.removeChild(s);if(typeof n=="function"){var a=n;n=function(){var c=Dl(l);a.call(c)}}var l=sf(e,0,!1,null,null,!1,!1,"",Jp);return e._reactRootContainer=l,e[Br]=l.current,_i(e.nodeType===8?e.parentNode:e),ms(function(){fc(t,l,r,n)}),l}function gc(e,t,r,n,s){var o=r._reactRootContainer;if(o){var i=o;if(typeof s=="function"){var a=s;s=function(){var l=Dl(i);a.call(l)}}fc(t,i,e,s)}else i=lE(r,t,e,s,n);return Dl(i)}Av=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Ko(t.pendingLanes);r!==0&&(Ch(t,r|1),vt(t,je()),!(ce&6)&&(yo=je()+500,Ln()))}break;case 13:ms(function(){var n=zr(e,1);if(n!==null){var s=at();rr(n,e,1,s)}}),of(e,1)}};Th=function(e){if(e.tag===13){var t=zr(e,134217728);if(t!==null){var r=at();rr(t,e,134217728,r)}of(e,134217728)}};Nv=function(e){if(e.tag===13){var t=_n(e),r=zr(e,t);if(r!==null){var n=at();rr(r,e,t,n)}of(e,t)}};jv=function(){return fe};Ov=function(e,t){var r=fe;try{return fe=e,t()}finally{fe=r}};Xu=function(e,t,r){switch(t){case"input":if(Wu(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var s=ic(n);if(!s)throw Error(O(90));uv(n),Wu(n,s)}}}break;case"textarea":hv(e,r);break;case"select":t=r.value,t!=null&&qs(e,!!r.multiple,t,!1)}};wv=ef;bv=ms;var cE={usingClientEntryPoint:!1,Events:[Zi,Us,ic,vv,yv,ef]},Fo={findFiberByHostInstance:Xn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},uE={bundleType:Fo.bundleType,version:Fo.version,rendererPackageName:Fo.rendererPackageName,rendererConfig:Fo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Kr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=_v(e),e===null?null:e.stateNode},findFiberByHostInstance:Fo.findFiberByHostInstance||aE,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};
40if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ra=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ra.isDisabled&&Ra.supportsFiber)try{rc=Ra.inject(uE),br=Ra}catch{}}Rt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=cE;Rt.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!lf(t))throw Error(O(200));return iE(e,t,null,r)};Rt.createRoot=function(e,t){if(!lf(e))throw Error(O(299));var r=!1,n="",s=tw;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=sf(e,1,!1,null,null,r,!1,n,s),e[Br]=t.current,_i(e.nodeType===8?e.parentNode:e),new af(t)};Rt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(O(188)):(e=Object.keys(e).join(","),Error(O(268,e)));return e=_v(t),e=e===null?null:e.stateNode,e};Rt.flushSync=function(e){return ms(e)};Rt.hydrate=function(e,t,r){if(!mc(t))throw Error(O(200));return gc(null,e,t,!0,r)};Rt.hydrateRoot=function(e,t,r){if(!lf(e))throw Error(O(405));var n=r!=null&&r.hydratedSources||null,s=!1,o="",i=tw;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(o=r.identifierPrefix),r.onRecoverableError!==void 0&&(i=r.onRecoverableError)),t=ew(t,null,e,1,r??null,s,!1,o,i),e[Br]=t.current,_i(e),n)for(e=0;e<n.length;e++)r=n[e],s=r._getVersion,s=s(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,s]:t.mutableSourceEagerHydrationData.push(r,s);return new pc(t)};Rt.render=function(e,t,r){if(!mc(t))throw Error(O(200));return gc(null,e,t,!1,r)};Rt.unmountComponentAtNode=function(e){if(!mc(e))throw Error(O(40));return e._reactRootContainer?(ms(function(){gc(null,null,e,!1,function(){e._reactRootContainer=null,e[Br]=null})}),!0):!1};Rt.unstable_batchedUpdates=ef;Rt.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!mc(r))throw Error(O(200));if(e==null||e._reactInternals===void 0)throw Error(O(38));return gc(e,t,r,!1,n)};Rt.version="18.3.1-next-f1338f8080-20240426";function rw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(rw)}catch(e){console.error(e)}}rw(),rv.exports=Rt;var $n=rv.exports;const nw=Vg($n);var sw,Qp=$n;sw=Qp.createRoot,Qp.hydrateRoot;const dE=1,hE=1e6;let gu=0;function fE(){return gu=(gu+1)%Number.MAX_SAFE_INTEGER,gu.toString()}const vu=new Map,Yp=e=>{if(vu.has(e))return;const t=setTimeout(()=>{vu.delete(e),di({type:"REMOVE_TOAST",toastId:e})},hE);vu.set(e,t)},pE=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,dE)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=t;return r?Yp(r):e.toasts.forEach(n=>{Yp(n.id)}),{...e,toasts:e.toasts.map(n=>
vendor: 13,572 bytes, line 40
40n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},il=[];let al={toasts:[]};function di(e){al=pE(al,e),il.forEach(t=>{t(al)})}function mE({...e}){const t=fE(),r=s=>di({type:"UPDATE_TOAST",toast:{...s,id:t}}),n=()=>di({type:"DISMISS_TOAST",toastId:t});return di({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||n()}}}),{id:t,dismiss:n,update:r}}function ow(){const[e,t]=w.useState(al);return w.useEffect(()=>(il.push(t),()=>{const r=il.indexOf(t);r>-1&&il.splice(r,1)}),[e]),{...e,toast:mE,dismiss:r=>di({type:"DISMISS_TOAST",toastId:r})}}function X(e,t,{checkForDefaultPrevented:r=!0}={}){return function(s){if(e==null||e(s),r===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function Xp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function iw(...e){return t=>{let r=!1;const n=e.map(s=>{const o=Xp(s,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let s=0;s<n.length;s++){const o=n[s];typeof o=="function"?o():Xp(e[s],null)}}}}function Se(...e){return w.useCallback(iw(...e),e)}function Mn(e,t=[]){let r=[];function n(o,i){const a=w.createContext(i),l=r.length;r=[...r,i];const c=d=>{var v;const{scope:h,children:f,...x}=d,g=((v=h==null?void 0:h[e])==null?void 0:v[l])||a,b=w.useMemo(()=>x,Object.values(x));return p.jsx(g.Provider,{value:b,children:f})};c.displayName=o+"Provider";function u(d,h){var g;const f=((g=h==null?void 0:h[e])==null?void 0:g[l])||a,x=w.useContext(f);if(x)return x;if(i!==void 0)return i;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[c,u]}const s=()=>{const o=r.map(i=>w.createContext(i));return function(a){const l=(a==null?void 0:a[e])||o;return w.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return s.scopeName=e,[n,gE(s,...t)]}function gE(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=n.reduce((a,{useScope:l,scopeName:c})=>{const d=l(o)[`__scope${c}`];return{...a,...d}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function ji(e){const t=yE(e),r=w.forwardRef((n,s)=>{const{children:o,...i}=n,a=w.Children.toArray(o),l=a.find(bE);if(l){const c=l.props.children,u=a.map(d=>d===l?w.Children.count(c)>1?w.Children.only(null):w.isValidElement(c)?c.props.children:null:d);return p.jsx(t,{...i,ref:s,children:w.isValidElement(c)?w.cloneElement(c,void 0,u):null})}return p.jsx(t,{...i,ref:s,children:o})});return r.displayName=`${e}.Slot`,r}var vE=ji("Slot");function yE(e){const t=w.forwardRef((r,n)=>{const{children:s,...o}=r;if(w.isValidElement(s)){const i=SE(s),a=xE(o,s.props);return s.type!==w.Fragment&&(a.ref=n?iw(n,i):i),w.cloneElement(s,a)}return w.Children.count(s)>1?w.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var aw=Symbol("radix.slottable");function wE(e){const t=({children:r})=>p.jsx(p.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=aw,t}function bE(e){return w.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===aw}function xE(e,t){const r={...t};for(const n in t){const s=e[n],o=t[n];/^on[A-Z]/.test(n)?s&&o?r[n]=(...a)=>{const l=o(...a);return s(...a),l}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function SE(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function cf(e){const t=e+"CollectionProvider",[r,n]=Mn(t),[s,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=g=>{const{scope:b,children:v}=g,m=M.useRef(null),y=M.useRef(new Map).current;return p.jsx(s,{scope:b,itemMap:y,collectionRef:m,children:v})};i.displayName=t;const a=e+"CollectionSlot",l=ji(a),c=M.forwardRef((g,b)=>{const{scope:v,children:m}=g,y=o(a,v),S=Se(b,y.collectionRef);return p.jsx(l,{ref:S,children:m})});c.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",h=ji(u),f=M.forwardRef((g,b)=>{const{scope:v,children:m,...y}=g,S=M.useRef(null),E=Se(b,S),_=o(u,v);return M.useEffect(()=>(_.itemMap.set(S,{ref:S,...y}),()=>void _.itemMap.delete(S))),p.jsx(h,{[d]:"",ref:E,children:m})});f.displayName=u;function x(g){const b=o(e+"CollectionConsumer",g);return M.useCallback(()=>{const m=b.collectionRef.current;if(!m)return[];const y=Array.from(m.querySelectorAll(`[${d}]`));return Array.from(b.itemMap.values()).sort((_,T)=>y.indexOf(_.ref.current)-y.indexOf(T.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:i,Slot:c,ItemSlot:f},x,n]}var _E=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],re=_E.reduce((e,t)=>{const r=ji(`Primitive.${t}`),n=w.forwardRef((s,o)=>{const{asChild:i,...a}=s,l=i?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(l,{...a,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function lw(e,t){e&&$n.flushSync(()=>e.dispatchEvent(t))}function Dt(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function EE(e,t=globalThis==null?void 0:globalThis.document){const r=Dt(e);w.useEffect(()=>{const n=s=>{s.key==="Escape"&&r(s)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var kE="DismissableLayer",Nd="dismissableLayer.update",CE="dismissableLayer.pointerDownOutside",TE="dismissableLayer.focusOutside",Zp,cw=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),vc=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:a,...l}=e,c=w.useContext(cw),[u,d]=w.useState(null),h=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,f]=w.useState({}),x=Se(t,T=>d(T)),g=Array.from(c.layers),[b]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(b),m=u?g.indexOf(u):-1,y=c.layersWithOutsidePointerEventsDisabled.size>0,S=m>=v,E=PE(T=>{const R=T.target,P=[...c.branches].some(j=>j.contains(R));!S||P||(s==null||s(T),i==null||i(T),T.defaultPrevented||a==null||a())},h),_=AE(T=>{const R=T.target;[...c.branches].some(j=>j.contains(R))||(o==null||o(T),i==null||i(T),T.defaultPrevented||a==null||a())},h);return EE(T=>{m===c.layers.size-1&&(n==null||n(T),!T.defaultPrevented&&a&&(T.preventDefault(),a()))},h),w.useEffect(()=>{if(u)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Zp=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),em(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Zp)}},[u,h,r,c]),w.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),em())},[u,c]),w.useEffect(()=>{const T=()=>f({});return document.addEventListener(Nd,T),()=>document.removeEventListener(Nd,T)},[]),p.jsx(re.div,{...l,ref:x,style:{pointerEvents:y?S?"auto":"none":void 0,...e.style},onFocusCapture:X(e.onFocusCapture,_.onFocusCapture),onBlurCapture:X(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:X(e.onPointerDownCapture,E.onPointerDownCapture)})});vc.displayName=kE;var RE="DismissableLayerBranch",uw=w.forwardRef((e,t)=>{const r=w.useContext(cw),n=w.useRef(null),s=Se(t,n);return w.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),p.jsx(re.div,{...e,ref:s})});uw.displayName=RE;function PE(e,t=globalThis==null?void 0:globalThis.document){const r=Dt(e),n=w.useRef(!1),s=w.useRef(()=>{});return w.useEffect(()=>{const o=a=>{if(a.target&&!n.current){let l=function(){dw(CE,r,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);n.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",o),t.removeEventListener("click",s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function AE(e,t=globalThis==null?void 0:globalThis.document){const r=Dt(e),n=w.useRef(!1);return w.useEffect(()=>{const s=o=>{o.target&&!n.current&&dw(TE,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function em(){const e=new CustomEvent(Nd);document.dispatchEvent(e)}function dw(e,t,r,{discrete:n}){const s=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?lw(s,o):s.dispatchEvent(o)}var NE=vc,jE=uw,Ge=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},OE="Portal",uf=w.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[s,o]=w.useState(!1);Ge(()=>o(!0),[]);const i=r||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?nw.createPortal(p.jsx(re.div,{...n,ref:t}),i):null});uf.displayName=OE;function IE(e,t){return w.useReducer((r,n)=>t[r][n]??r,e)}var ta=e=>{const{present:t,children:r}=e,n=LE(t),s=typeof r=="function"?r({present:n.isPresent}):w.Children.only(r),o=Se(n.ref,$E(s));return typeof r=="function"||n.isPresent?w.cloneElement(s,{ref:o}):null};ta.displayName="Presence";function LE(e){const[t,r]=w.useState(),n=w.useRef(null),s=w.useRef(e),o=w.useRef("none"),i=e?"mounted":"unmounted",[a,l]=IE(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const c=Pa(n.current);o.current=a==="mounted"?c:"none"},[a]),Ge(()=>{const c=n.current,u=s.current;if(u!==e){const h=o.current,f=Pa(c);e?l("MOUNT"):f==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&h!==f?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,l]),Ge(()=>{if(t){let c;const u=t.ownerDocument.defaultView??window,d=f=>{const g=Pa(n.current).includes(f.animationName);if(f.target===t&&g&&(l("ANIMATION_END"),!s.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",c=u.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=f=>{f.target===t&&(o.current=Pa(n.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{u.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:w.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function Pa(e){return(e==null?void 0:e.animationName)||"none"}function $E(e){var n,s;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var ME=vh[" useInsertionEffect ".trim().toString()]||Ge;function wo({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[s,o,i]=DE({defaultProp:t,onChange:r}),a=e!==void 0,l=a?e:s;{const u=w.useRef(e!==void 0);w.useEffect(()=>{const d=u.current;d!==a&&console.warn(`${n} is changing from ${d?"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.`),u.current=a},[a,n])}const c=w.useCallback(u=>{var d;if(a){const h=UE(u)?u(e):u;h!==e&&((d=i.current)==null||d.call(i,h))}else o(u)},[a,e,o,i]);return[l,c]}function DE({defaultProp:e,onChange:t}){const[r,n]=w.useState(e),s=w.useRef(r),o=w.useRef(t);return ME(()=>{o.current=t},[t]),w.useEffect(()=>{var i;s.current!==r&&((i=o.current)==null||i.call(o,r),s.current=r)},[r,s]),[r,n,o]}function UE(e){return typeof e=="function"}var hw=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"}),FE="VisuallyHidden",yc=w.forwardRef((e,t)=>p.jsx(re.span,{...e,ref:t,style:{...hw,...e.style}}));yc.displayName=FE;var BE=yc,df="ToastProvider",[hf,zE,HE]=cf("Toast"),[fw,wI]=Mn("Toast",[HE]),[VE,wc]=fw(df),pw=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:o=50,children:i}=e,[a,l]=w.useState(null),[c,u]=w.useState(0),d=w.useRef(!1),h=w.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${df}\`. Expected non-empty \`string\`.`),p.jsx(hf.Provider,{scope:t,children:p.jsx(VE,{scope:t,label:r,duration:n,swipeDirection:s,swipeThreshold:o,toastCount:c,viewport:a,onViewportChange:l,onToastAdd:w.useCallback(()=>u(f=>f+1),[]),onToastRemove:w.useCallback(()=>u(f=>f-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:h,children:i})})};pw.displayName=df;var mw="ToastViewport",WE=["F8"],jd="toast.viewportPause",Od="toast.viewportResume",gw=w.forwardRef((e,t)=>
40{const{__scopeToast:r,hotkey:n=WE,label:s="Notifications ({hotkey})",...o}=e,i=wc(mw,r),a=zE(r),l=w.useRef(null),c=w.useRef(null),u=w.useRef(null),d=w.useRef(null),h=Se(t,d,i.onViewportChange),f=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),x=i.toastCount>0;w.useEffect(()=>{const b=v=>{var y;n.length!==0&&n.every(S=>v[S]||v.code===S)&&((y=d.current)==null||y.focus())};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[n]),w.useEffect(()=>{const b=l.current,v=d.current;if(x&&b&&v){const m=()=>{if(!i.isClosePausedRef.current){const _=new CustomEvent(jd);v.dispatchEvent(_),i.isClosePausedRef.current=!0}},y=()=>{if(i.isClosePausedRef.current){const _=new CustomEvent(Od);v.dispatchEvent(_),i.isClosePausedRef.current=!1}},S=_=>{!b.contains(_.relatedTarget)&&y()},E=()=>{b.contains(document.activeElement)||y()};return b.addEventListener("focusin",m),b.addEventListener("focusout",S),b.addEventListener("pointermove",m),b.addEventListener("pointerleave",E),window.addEventListener("blur",m),window.addEventListener("focus",y),()=>{b.removeEventListener("focusin",m),b.removeEventListener("focusout",S),b.removeEventListener("pointermove",m),b.removeEventListener("pointerleave",E),window.removeEventListener("blur",m),window.removeEventListener("focus",y)}}},[x,i.isClosePausedRef]);const g=w.useCallback(({tabbingDirection:b})=>{const m=a().map(y=>{const S=y.ref.current,E=[S,...sk(S)];return b==="forwards"?E:E.reverse()});return(b==="forwards"?m.reverse():m).flat()},[a]);return w.useEffect(()=>{const b=d.current;if(b){const v=m=>{var E,_,T;const y=m.altKey||m.ctrlKey||m.metaKey;if(m.key==="Tab"&&!y){const R=document.activeElement,P=m.shiftKey;if(m.target===b&&P){(E=c.current)==null||E.focus();return}const I=g({tabbingDirection:P?"backwards":"forwards"}),W=I.findIndex($=>$===R);yu(I.slice(W+1))?m.preventDefault():P?(_=c.current)==null||_.focus():(T=u.current)==null||T.focus()}};return b.addEventListener("keydown",v),()=>b.removeEventListener("keydown",v)}},[a,g]),p.jsxs(jE,{ref:l,role:"region","aria-label":s.replace("{hotkey}",f),tabIndex:-1,style:{pointerEvents:x?void 0:"none"},children:[x&&p.jsx(Id,{ref:c,onFocusFromOutsideViewport:()=>{const b=g({tabbingDirection:"forwards"});yu(b)}}),p.jsx(hf.Slot,{scope:r,children:p.jsx(re.ol,{tabIndex:-1,...o,ref:h})}),x&&p.jsx(Id,{ref:u,onFocusFromOutsideViewport:()=>{const b=g({tabbingDirection:"backwards"});yu(b)}})]})});gw.displayName=mw;var vw="ToastFocusProxy",Id=w.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=e,o=wc(vw,r);return p.jsx(yc,{"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))&&n()}})});Id.displayName=vw;var ra="Toast",KE="toast.swipeStart",qE="toast.swipeMove",GE="toast.swipeCancel",JE="toast.swipeEnd",yw=w.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:o,...i}=e,[a,l]=wo({prop:n,defaultProp:s??!0,onChange:o,caller:ra});return p.jsx(ta,{present:r||a,children:p.jsx(XE,{open:a,...i,ref:t,onClose:()=>l(!1),onPause:Dt(e.onPause),onResume:Dt(e.onResume),onSwipeStart:X(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:X(e.onSwipeMove,c=>{const{x:u,y:d}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:X(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:X(e.onSwipeEnd,c=>{const{x:u,y:d}=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",`${u}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});yw.displayName=ra;var[QE,YE]=fw(ra,{onClose(){}}),XE=w.forwardRef((e,t)=>
40{const{__scopeToast:r,type:n="foreground",duration:s,open:o,onClose:i,onEscapeKeyDown:a,onPause:l,onResume:c,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:h,onSwipeEnd:f,...x}=e,g=wc(ra,r),[b,v]=w.useState(null),m=Se(t,$=>v($)),y=w.useRef(null),S=w.useRef(null),E=s||g.duration,_=w.useRef(0),T=w.useRef(E),R=w.useRef(0),{onToastAdd:P,onToastRemove:j}=g,B=Dt(()=>{var Q;(b==null?void 0:b.contains(document.activeElement))&&((Q=g.viewport)==null||Q.focus()),i()}),I=w.useCallback($=>{!$||$===1/0||(window.clearTimeout(R.current),_.current=new Date().getTime(),R.current=window.setTimeout(B,$))},[B]);w.useEffect(()=>{const $=g.viewport;if($){const Q=()=>{I(T.current),c==null||c()},z=()=>{const q=new Date().getTime()-_.current;T.current=T.current-q,window.clearTimeout(R.current),l==null||l()};return $.addEventListener(jd,z),$.addEventListener(Od,Q),()=>{$.removeEventListener(jd,z),$.removeEventListener(Od,Q)}}},[g.viewport,E,l,c,I]),w.useEffect(()=>{o&&!g.isClosePausedRef.current&&I(E)},[o,E,g.isClosePausedRef,I]),w.useEffect(()=>(P(),()=>j()),[P,j]);const W=w.useMemo(()=>b?kw(b):null,[b]);return g.viewport?p.jsxs(p.Fragment,{children:[W&&p.jsx(ZE,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:W}),p.jsx(QE,{scope:r,onClose:B,children:$n.createPortal(p.jsx(hf.ItemSlot,{scope:r,children:p.jsx(NE,{asChild:!0,onEscapeKeyDown:X(a,()=>{g.isFocusedToastEscapeKeyDownRef.current||B(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:p.jsx(re.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":g.swipeDirection,...x,ref:m,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:X(e.onKeyDown,$=>{$.key==="Escape"&&(a==null||a($.nativeEvent),$.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,B()))}),onPointerDown:X(e.onPointerDown,$=>{$.button===0&&(y.current={x:$.clientX,y:$.clientY})}),onPointerMove:X(e.onPointerMove,$=>{if(!y.current)return;const Q=$.clientX-y.current.x,z=$.clientY-y.current.y,q=!!S.current,C=["left","right"].includes(g.swipeDirection),k=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,N=C?k(0,Q):0,U=C?0:k(0,z),L=$.pointerType==="touch"?10:2,K={x:N,y:U},Y={originalEvent:$,delta:K};q?(S.current=K,Aa(qE,d,Y,{discrete:!1})):tm(K,g.swipeDirection,L)?(S.current=K,Aa(KE,u,Y,{discrete:!1}),$.target.setPointerCapture($.pointerId)):(Math.abs(Q)>L||Math.abs(z)>L)&&(y.current=null)}),onPointerUp:X(e.onPointerUp,$=>{const Q=S.current,z=$.target;if(z.hasPointerCapture($.pointerId)&&z.releasePointerCapture($.pointerId),S.current=null,y.current=null,Q){const q=$.currentTarget,C={originalEvent:$,delta:Q};tm(Q,g.swipeDirection,g.swipeThreshold)?Aa(JE,f,C,{discrete:!0}):Aa(GE,h,C,{discrete:!0}),q.addEventListener("click",k=>k.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),ZE=e=>{const{__scopeToast:t,children:r,...n}=e,s=wc(ra,t),[o,i]=w.useState(!1),[a,l]=w.useState(!1);return rk(()=>i(!0)),w.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:p.jsx(uf,{asChild:!0,children:p.jsx(yc,{...n,children:o&&p.jsxs(p.Fragment,{children:[s.label," ",r]})})})},ek="ToastTitle",ww=w.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return p.jsx(re.div,{...n,ref:t})});ww.displayName=ek;var tk="ToastDescription",bw=w.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return p.jsx(re.div,{...n,ref:t})});bw.displayName=tk;var xw="ToastAction",Sw=w.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?p.jsx(Ew,{altText:r,asChild:!0,children:p.jsx(ff,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${xw}\`. Expected non-empty \`string\`.`),null)});Sw.displayName=xw;var _w="ToastClose",ff=w.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,s=YE(_w,r);return p.jsx(Ew,{asChild:!0,children:p.jsx(re.button,{type:"button",...n,ref:t,onClick:X(e.onClick,s.onClose)})})});ff.displayName=_w;var Ew=w.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...s}=e;return p.jsx(re.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:t})});function kw(e){const t=[];
vendor: 9,338 bytes, lines 40-140
40return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),nk(n)){const s=n.ariaHidden||n.hidden||n.style.display==="none",o=n.dataset.radixToastAnnounceExclude==="";if(!s)if(o){const i=n.dataset.radixToastAnnounceAlt;i&&t.push(i)}else t.push(...kw(n))}}),t}function Aa(e,t,r,{discrete:n}){const s=r.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&s.addEventListener(e,t,{once:!0}),n?lw(s,o):s.dispatchEvent(o)}var tm=(e,t,r=0)=>{const n=Math.abs(e.x),s=Math.abs(e.y),o=n>s;return t==="left"||t==="right"?o&&n>r:!o&&s>r};function rk(e=()=>{}){const t=Dt(e);Ge(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function nk(e){return e.nodeType===e.ELEMENT_NODE}function sk(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function yu(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var ok=pw,Cw=gw,Tw=yw,Rw=ww,Pw=bw,Aw=Sw,Nw=ff;function jw(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(r=jw(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Ow(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=jw(e))&&(n&&(n+=" "),n+=t);return n}const rm=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,nm=Ow,na=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return nm(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:s,defaultVariants:o}=t,i=Object.keys(s).map(c=>{const u=r==null?void 0:r[c],d=o==null?void 0:o[c];if(u===null)return null;const h=rm(u)||rm(d);return s[c][h]}),a=r&&Object.entries(r).reduce((c,u)=>{let[d,h]=u;return h===void 0||(c[d]=h),c},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((c,u)=>{let{class:d,className:h,...f}=u;return Object.entries(f).every(x=>{let[g,b]=x;return Array.isArray(b)?b.includes({...o,...a}[g]):{...o,...a}[g]===b})?[...c,d,h]:c},[]);return nm(e,i,l,r==null?void 0:r.class,r==null?void 0:r.className)};/**
41 * @license lucide-react v0.462.0 - ISC
42 *
43 * This source code is licensed under the ISC license.
44 * See the LICENSE file in the root directory of this source tree.
45 */const ik=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Iw=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
46 * @license lucide-react v0.462.0 - ISC
47 *
48 * This source code is licensed under the ISC license.
49 * See the LICENSE file in the root directory of this source tree.
50 */var ak={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"};/**
51 * @license lucide-react v0.462.0 - ISC
52 *
53 * This source code is licensed under the ISC license.
54 * See the LICENSE file in the root directory of this source tree.
55 */const lk=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:o,iconNode:i,...a},l)=>w.createElement("svg",{ref:l,...ak,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:Iw("lucide",s),...a},[...i.map(([c,u])=>w.createElement(c,u)),...Array.isArray(o)?o:[o]]));/**
56 * @license lucide-react v0.462.0 - ISC
57 *
58 * This source code is licensed under the ISC license.
59 * See the LICENSE file in the root directory of this source tree.
60 */const nt=(e,t)=>{const r=w.forwardRef(({className:n,...s},o)=>w.createElement(lk,{ref:o,iconNode:t,className:Iw(`lucide-${ik(e)}`,n),...s}));return r.displayName=`${e}`,r};/**
61 * @license lucide-react v0.462.0 - ISC
62 *
63 * This source code is licensed under the ISC license.
64 * See the LICENSE file in the root directory of this source tree.
65 */const ck=nt("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
66 * @license lucide-react v0.462.0 - ISC
67 *
68 * This source code is licensed under the ISC license.
69 * See the LICENSE file in the root directory of this source tree.
70 */const sm=nt("CalendarDays",[["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"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);/**
71 * @license lucide-react v0.462.0 - ISC
72 *
73 * This source code is licensed under the ISC license.
74 * See the LICENSE file in the root directory of this source tree.
75 */const Lw=nt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
76 * @license lucide-react v0.462.0 - ISC
77 *
78 * This source code is licensed under the ISC license.
79 * See the LICENSE file in the root directory of this source tree.
80 */const pf=nt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
81 * @license lucide-react v0.462.0 - ISC
82 *
83 * This source code is licensed under the ISC license.
84 * See the LICENSE file in the root directory of this source tree.
85 */const uk=nt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
86 * @license lucide-react v0.462.0 - ISC
87 *
88 * This source code is licensed under the ISC license.
89 * See the LICENSE file in the root directory of this source tree.
90 */const dk=nt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
91 * @license lucide-react v0.462.0 - ISC
92 *
93 * This source code is licensed under the ISC license.
94 * See the LICENSE file in the root directory of this source tree.
95 */const hk=nt("Columns3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
96 * @license lucide-react v0.462.0 - ISC
97 *
98 * This source code is licensed under the ISC license.
99 * See the LICENSE file in the root directory of this source tree.
100 */const fk=nt("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
101 * @license lucide-react v0.462.0 - ISC
102 *
103 * This source code is licensed under the ISC license.
104 * See the LICENSE file in the root directory of this source tree.
105 */const mf=nt("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
106 * @license lucide-react v0.462.0 - ISC
107 *
108 * This source code is licensed under the ISC license.
109 * See the LICENSE file in the root directory of this source tree.
110 */const pk=nt("FileSpreadsheet",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]]);/**
111 * @license lucide-react v0.462.0 - ISC
112 *
113 * This source code is licensed under the ISC license.
114 * See the LICENSE file in the root directory of this source tree.
115 */const om=nt("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/**
116 * @license lucide-react v0.462.0 - ISC
117 *
118 * This source code is licensed under the ISC license.
119 * See the LICENSE file in the root directory of this source tree.
120 */const mk=nt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
121 * @license lucide-react v0.462.0 - ISC
122 *
123 * This source code is licensed under the ISC license.
124 * See the LICENSE file in the root directory of this source tree.
125 */const gk=nt("Printer",[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]]);/**
126 * @license lucide-react v0.462.0 - ISC
127 *
128 * This source code is licensed under the ISC license.
129 * See the LICENSE file in the root directory of this source tree.
130 */const im=nt("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
131 * @license lucide-react v0.462.0 - ISC
132 *
133 * This source code is licensed under the ISC license.
134 * See the LICENSE file in the root directory of this source tree.
135 */const vk=nt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
136 * @license lucide-react v0.462.0 - ISC
137 *
138 * This source code is licensed under the ISC license.
139 * See the LICENSE file in the root directory of this source tree.
140 */const Oi=nt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
vendor: 12,256 bytes, line 140
140],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),gf="-",yk=e=>{const t=bk(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{const a=i.split(gf);return a[0]===""&&a.length!==1&&a.shift(),$w(a,t)||wk(i)},getConflictingClassGroupIds:(i,a)=>{const l=r[i]||[];return a&&n[i]?[...l,...n[i]]:l}}},$w=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?$w(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(gf);return(i=t.validators.find(({validator:a})=>a(o)))==null?void 0:i.classGroupId},am=/^\[(.+)\]$/,wk=e=>{if(am.test(e)){const t=am.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},bk=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return Sk(Object.entries(e.classGroups),r).forEach(([o,i])=>{Ld(i,n,o,t)}),n},Ld=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:lm(t,s);o.classGroupId=r;return}if(typeof s=="function"){if(xk(s)){Ld(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([o,i])=>{Ld(i,lm(t,o),r,n)})})},lm=(e,t)=>{let r=e;return t.split(gf).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},xk=e=>e.isThemeGetter,Sk=(e,t)=>t?e.map(([r,n])=>{const s=n.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([i,a])=>[t+i,a])):o);return[r,s]}):e,_k=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const s=(o,i)=>{r.set(o,i),t++,t>e&&(t=0,n=r,r=new Map)};return{get(o){let i=r.get(o);if(i!==void 0)return i;if((i=n.get(o))!==void 0)return s(o,i),i},set(o,i){r.has(o)?r.set(o,i):s(o,i)}}},Mw="!",Ek=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],o=t.length,i=a=>{const l=[];let c=0,u=0,d;for(let b=0;b<a.length;b++){let v=a[b];if(c===0){if(v===s&&(n||a.slice(b,b+o)===t)){l.push(a.slice(u,b)),u=b+o;continue}if(v==="/"){d=b;continue}}v==="["?c++:v==="]"&&c--}const h=l.length===0?a:a.substring(u),f=h.startsWith(Mw),x=f?h.substring(1):h,g=d&&d>u?d-u:void 0;return{modifiers:l,hasImportantModifier:f,baseClassName:x,maybePostfixModifierPosition:g}};return r?a=>r({className:a,parseClassName:i}):i},kk=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},Ck=e=>({cache:_k(e.cacheSize),parseClassName:Ek(e),...yk(e)}),Tk=/\s+/,Rk=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,o=[],i=e.trim().split(Tk);let a="";for(let l=i.length-1;l>=0;l-=1){const c=i[l],{modifiers:u,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:f}=r(c);let x=!!f,g=n(x?h.substring(0,f):h);if(!g){if(!x){a=c+(a.length>0?" "+a:a);continue}if(g=n(h),!g){a=c+(a.length>0?" "+a:a);continue}x=!1}const b=kk(u).join(":"),v=d?b+Mw:b,m=v+g;if(o.includes(m))continue;o.push(m);const y=s(g,x);for(let S=0;S<y.length;++S){const E=y[S];o.push(v+E)}a=c+(a.length>0?" "+a:a)}return a};function Pk(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Dw(t))&&(n&&(n+=" "),n+=r);return n}const Dw=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Dw(e[n]))&&(r&&(r+=" "),r+=t);return r};function Ak(e,...t){let r,n,s,o=i;function i(l){const c=t.reduce((u,d)=>d(u),e());return r=Ck(c),n=r.cache.get,s=r.cache.set,o=a,a(l)}function a(l){const c=n(l);if(c)return c;const u=Rk(l,r);return s(l,u),u}return function(){return o(Pk.apply(null,arguments))}}const we=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},Uw=/^\[(?:([a-z-]+):)?(.+)\]$/i,Nk=/^\d+\/\d+$/,jk=new Set(["px","full","screen"]),Ok=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ik=/\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$/,Lk=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,$k=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Mk=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Cr=e=>Zs(e)||jk.has(e)||Nk.test(e),Xr=e=>ko(e,"length",Wk),Zs=e=>!!e&&!Number.isNaN(Number(e)),wu=e=>ko(e,"number",Zs),Bo=e=>!!e&&Number.isInteger(Number(e)),Dk=e=>e.endsWith("%")&&Zs(e.slice(0,-1)),te=e=>Uw.test(e),Zr=e=>Ok.test(e),Uk=new Set(["length","size","percentage"]),Fk=e=>ko(e,Uk,Fw),Bk=e=>ko(e,"position",Fw),zk=new Set(["image","url"]),Hk=e=>ko(e,zk,qk),Vk=e=>ko(e,"",Kk),zo=()=>!0,ko=(e,t,r)=>{const n=Uw.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},Wk=e=>Ik.test(e)&&!Lk.test(e),Fw=()=>!1,Kk=e=>$k.test(e),qk=e=>Mk.test(e),Gk=()=>{const e=we("colors"),t=we("spacing"),r=we("blur"),n=we("brightness"),s=we("borderColor"),o=we("borderRadius"),i=we("borderSpacing"),a=we("borderWidth"),l=we("contrast"),c=we("grayscale"),u=we("hueRotate"),d=we("invert"),h=we("gap"),f=we("gradientColorStops"),x=we("gradientColorStopPositions"),g=we("inset"),b=we("margin"),v=we("opacity"),m=we("padding"),y=we("saturate"),S=we("scale"),E=we("sepia"),_=we("skew"),T=we("space"),R=we("translate"),P=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto",te,t],I=()=>[te,t],W=()=>["",Cr,Xr],$=()=>["auto",Zs,te],Q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],z=()=>["solid","dashed","dotted","double","none"],q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],C=()=>["start","end","center","between","around","evenly","stretch"],k=()=>["","0",te],N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],U=()=>[Zs,te];return{cacheSize:500,separator:":",theme:{colors:[zo],spacing:[Cr,Xr],blur:["none","",Zr,te],brightness:U(),borderColor:[e],borderRadius:["none","","full",Zr,te],borderSpacing:I(),borderWidth:W(),contrast:U(),grayscale:k(),hueRotate:U(),invert:k(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[Dk,Xr],inset:B(),margin:B(),opacity:U(),padding:I(),saturate:U(),scale:U(),sepia:k(),skew:U(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",te]}],container:["container"],columns:[{columns:[Zr]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"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:[...Q(),te]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Bo,te]}],basis:[{basis:B()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",te]}],grow:[{grow:k()}],shrink:[{shrink:k()}],order:[{order:["first","last","none",Bo,te]}],"grid-cols":[{"grid-cols":[zo]}],"col-start-end":[{col:["auto",{span:["full",Bo,te]},te]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[zo]}],"row-start-end":[{row:["auto",{span:[Bo,te]},te]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",te]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",te]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...C()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...C(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...C(),"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":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",te,t]}],"min-w":[{"min-w":[te,t,"min","max","fit"]}],"max-w":[{"max-w":[te,t,"none","full","min","max","fit","prose",{screen:[Zr]},Zr]}],h:[{h:[te,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[te,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[te,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[te,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Zr,Xr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",wu]}],"font-family":[{font:[zo]}],"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",te]}],"line-clamp":[{"line-clamp":["none",Zs,wu]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Cr,te]}],"list-image":[{"list-image":["none",te]}],"list-style-type":[{list:["none","disc","decimal",te]}],"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:[...z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Cr,Xr]}],"underline-offset":[{"underline-offset":["auto",Cr,te]}],"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:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",te]}],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",te]}],"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:[...Q(),Bk]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Fk]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Hk]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[x]}
vendor: 5,180 bytes, line 140
140],"gradient-via-pos":[{via:[x]}],"gradient-to-pos":[{to:[x]}],"gradient-from":[{from:[f]}],"gradient-via":[{via:[f]}],"gradient-to":[{to:[f]}],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:[...z(),"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:z()}],"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:["",...z()]}],"outline-offset":[{"outline-offset":[Cr,te]}],"outline-w":[{outline:[Cr,Xr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:W()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[Cr,Xr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Zr,Vk]}],"shadow-color":[{shadow:[zo]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":q()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Zr,te]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[y]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"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",te]}],duration:[{duration:U()}],ease:[{ease:["linear","in","out","in-out",te]}],delay:[{delay:U()}],animate:[{animate:["none","spin","ping","pulse","bounce",te]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Bo,te]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[_]}],"skew-y":[{"skew-y":[_]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",te]}],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",te]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"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"]}
vendor: 4,647 bytes, line 140
140],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",te]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Cr,Xr,wu]}],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"]}}},Jk=Ak(Gk);function le(...e){return Jk(Ow(e))}const Qk=ok,Bw=w.forwardRef(({className:e,...t},r)=>p.jsx(Cw,{ref:r,className:le("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}));Bw.displayName=Cw.displayName;const Yk=na("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"}}),zw=w.forwardRef(({className:e,variant:t,...r},n)=>p.jsx(Tw,{ref:n,className:le(Yk({variant:t}),e),...r}));zw.displayName=Tw.displayName;const Xk=w.forwardRef(({className:e,...t},r)=>p.jsx(Aw,{ref:r,className:le("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}));Xk.displayName=Aw.displayName;const Hw=w.forwardRef(({className:e,...t},r)=>p.jsx(Nw,{ref:r,className:le("absolute right-2 top-2 rounded-md p-1 text-foreground
140/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:p.jsx(Oi,{className:"h-4 w-4"})}));Hw.displayName=Nw.displayName;const Vw=w.forwardRef(({className:e,...t},r)=>p.jsx(Rw,{ref:r,className:le("text-sm font-semibold",e),...t}));Vw.displayName=Rw.displayName;const Ww=w.forwardRef(({className:e,...t},r)=>p.jsx(Pw,{ref:r,className:le("text-sm opacity-90",e),...t}));Ww.displayName=Pw.displayName;function Zk(){const{toasts:e}=ow();return p.jsxs(Qk,{children:[e.map(function({id:t,title:r,description:n,action:s,...o}){return p.jsxs(zw,{...o,children:[p.jsxs("div",{className:"grid gap-1",children:[r&&p.jsx(Vw,{children:r}),n&&p.jsx(Ww,{children:n})]}),s,p.jsx(Hw,{})]},t)}),p.jsx(Bw,{})]})}var cm=["light","dark"],e1="(prefers-color-scheme: dark)",t1=w.createContext(void 0),r1={setTheme:e=>{},themes:[]},n1=()=>{var e;return(e=w.useContext(t1))!=null?e:r1};w.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:s,defaultTheme:o,value:i,attrs:a,nonce:l})=>{let c=o==="system",u=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(x=>`'${x}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,d=s?cm.includes(o)&&o?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${o}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",h=(x,g=!1,b=!0)=>{let v=i?i[x]:x,m=g?x+"|| ''":`'${v}'`,y="";return s&&b&&!g&&cm.includes(x)&&(y+=`d.style.colorScheme = '${x}';`),r==="class"?g||v?y+=`c.add(${m})`:y+="null":v&&(y+=`d[s](n,${m})`),y},f=e?`!function(){${u}${h(e)}}()`:n?`!function(){try{${u}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${c})){var t='${e1}',m=window.matchMedia(t);if(m.media!==t||m.matches){${h("dark")}}else{${h("light")}}}else if(e){${i?`var x=${JSON.stringify(i)};`:""}${h(i?"x[e]":"e",!0)}}${c?"":"else{"+h(o,!1,!1)+"}"}${d}}catch(e){}}()`:`!function(){try{${u}var e=localStorage.getItem('${t}');if(e){${i?`var x=${JSON.stringify(i)};`:""}${h(i?"x[e]":"e",!0)}}else{${h(o,!1,!1)};}${d}}catch(t){}}();`;return w.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:f}})});var s1=e=>{switch(e){case"success":return a1;case"info":return c1;case"warning":return l1;case"error":return u1;default:return null}},o1=Array(12).fill(0),i1=({visible:e,className:t})=>M.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},M.createElement("div",{className:"sonner-spinner"},o1.map((r,n)=>M.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),a1=M.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},M.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"})),l1=M.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},M.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"})),c1=M.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},M.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"})),u1=M.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},M.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"})),d1=M.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"},M.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),M.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),h1=()=>
140{let[e,t]=M.useState(document.hidden);return M.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},$d=1,f1=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:r,...n}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:$d++,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:r}),{...a,...e,id:s,dismissible:i,title:r}):a):this.addToast({title:r,...n,dismissible:i,id:s}),s},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(r=>r({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)=>
140this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;t.loading!==void 0&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let n=e instanceof Promise?e:e(),s=r!==void 0,o,i=n.then(async l=>{if(o=["resolve",l],M.isValidElement(l))s=!1,this.create({id:r,type:"default",message:l});else if(m1(l)&&!l.ok){s=!1;let c=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,u=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description;this.create({id:r,type:"error",message:c,description:u})}else if(t.success!==void 0){s=!1;let c=typeof t.success=="function"?await t.success(l):t.success,u=typeof t.description=="function"?await t.description(l):t.description;this.create({id:r,type:"success",message:c,description:u})}}).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,u=typeof t.description=="function"?await t.description(l):t.description;this.create({id:r,type:"error",message:c,description:u})}}).finally(()=>{var l;s&&(this.dismiss(r),r=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 r!="string"&&typeof r!="number"?{unwrap:a}:Object.assign(r,{unwrap:a})},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||$d++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},ht=new f1,p1=(e,t)=>{let r=(t==null?void 0:t.id)||$d++;return ht.addToast({title:e,...t,id:r}),r},m1=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",g1=p1,v1=()=>ht.toasts,y1=()=>ht.getActiveToasts();Object.assign(g1,{success:ht.success,info:ht.info,warning:ht.warning,error:ht.error,custom:ht.custom,message:ht.message,promise:ht.promise,dismiss:ht.dismiss,loading:ht.loading},{getHistory:v1,getToasts:y1});function w1(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}w1(`: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;
140left: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}
140: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%);
140--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%)}
141`);function Na(e){return e.label!==void 0}var b1=3,x1="32px",S1="16px",um=4e3,_1=356,E1=14,k1=20,C1=200;function Ht(...e){return e.filter(Boolean).join(" ")}function T1(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}var R1=e=>{var t,r,n,s,o,i,a,l,c,u,d;let{invert:h,toast:f,unstyled:x,interacting:g,setHeights:b,visibleToasts:v,heights:m,index:y,toasts:S,expanded:E,removeToast:_,defaultRichColors:T,closeButton:R,style:P,cancelButtonStyle:j,actionButtonStyle:B,className:I="",descriptionClassName:W="",duration:$,position:Q,gap:z,loadingIcon:q,expandByDefault:C,classNames:k,icons:N,closeButtonAriaLabel:U="Close toast",pauseWhenPageIsHidden:L}
vendor: 8,060 bytes, line 141
141=e,[K,Y]=M.useState(null),[he,me]=M.useState(null),[F,de]=M.useState(!1),[ge,ie]=M.useState(!1),[ne,G]=M.useState(!1),[ae,oe]=M.useState(!1),[Oe,Re]=M.useState(!1),[ut,kr]=M.useState(0),[ir,ua]=M.useState(0),Je=M.useRef(f.duration||$||um),Fn=M.useRef(null),ar=M.useRef(null),Uc=y===0,Fc=y+1<=v,Ie=f.type,yt=f.dismissible!==!1,No=f.className||"",Df=f.descriptionClassName||"",qr=M.useMemo(()=>m.findIndex(Z=>Z.toastId===f.id)||0,[m,f.id]),Uf=M.useMemo(()=>{var Z;return(Z=f.closeButton)!=null?Z:R},[f.closeButton,R]),Bc=M.useMemo(()=>f.duration||$||um,[f.duration,$]),Bn=M.useRef(0),zn=M.useRef(0),Hn=M.useRef(0),lr=M.useRef(null),[jo,Vn]=Q.split("-"),Wn=M.useMemo(()=>m.reduce((Z,pe,_e)=>_e>=qr?Z:Z+pe.height,0),[m,qr]),Ff=h1(),Mx=f.invert||h,zc=Ie==="loading";zn.current=M.useMemo(()=>qr*z+Wn,[qr,Wn]),M.useEffect(()=>{Je.current=Bc},[Bc]),M.useEffect(()=>{de(!0)},[]),M.useEffect(()=>{let Z=ar.current;if(Z){let pe=Z.getBoundingClientRect().height;return ua(pe),b(_e=>[{toastId:f.id,height:pe,position:f.position},..._e]),()=>b(_e=>_e.filter(Ut=>Ut.toastId!==f.id))}},[b,f.id]),M.useLayoutEffect(()=>{if(!F)return;let Z=ar.current,pe=Z.style.height;Z.style.height="auto";let _e=Z.getBoundingClientRect().height;Z.style.height=pe,ua(_e),b(Ut=>Ut.find(Ft=>Ft.toastId===f.id)?Ut.map(Ft=>Ft.toastId===f.id?{...Ft,height:_e}:Ft):[{toastId:f.id,height:_e,position:f.position},...Ut])},[F,f.title,f.description,b,f.id]);let Gr=M.useCallback(()=>{ie(!0),kr(zn.current),b(Z=>Z.filter(pe=>pe.toastId!==f.id)),setTimeout(()=>{_(f)},C1)},[f,_,b,zn]);M.useEffect(()=>{if(f.promise&&Ie==="loading"||f.duration===1/0||f.type==="loading")return;let Z;return E||g||L&&Ff?(()=>{if(Hn.current<Bn.current){let pe=new Date().getTime()-Bn.current;Je.current=Je.current-pe}Hn.current=new Date().getTime()})():Je.current!==1/0&&(Bn.current=new Date().getTime(),Z=setTimeout(()=>{var pe;(pe=f.onAutoClose)==null||pe.call(f,f),Gr()},Je.current)),()=>clearTimeout(Z)},[E,g,f,Ie,L,Ff,Gr]),M.useEffect(()=>{f.delete&&Gr()},[Gr,f.delete]);function Dx(){var Z,pe,_e;return N!=null&&N.loading?M.createElement("div",{className:Ht(k==null?void 0:k.loader,(Z=f==null?void 0:f.classNames)==null?void 0:Z.loader,"sonner-loader"),"data-visible":Ie==="loading"},N.loading):q?M.createElement("div",{className:Ht(k==null?void 0:k.loader,(pe=f==null?void 0:f.classNames)==null?void 0:pe.loader,"sonner-loader"),"data-visible":Ie==="loading"},q):M.createElement(i1,{className:Ht(k==null?void 0:k.loader,(_e=f==null?void 0:f.classNames)==null?void 0:_e.loader),visible:Ie==="loading"})}return M.createElement("li",{tabIndex:0,ref:ar,className:Ht(I,No,k==null?void 0:k.toast,(t=f==null?void 0:f.classNames)==null?void 0:t.toast,k==null?void 0:k.default,k==null?void 0:k[Ie],(r=f==null?void 0:f.classNames)==null?void 0:r[Ie]),"data-sonner-toast":"","data-rich-colors":(n=f.richColors)!=null?n:T,"data-styled":!(f.jsx||f.unstyled||x),"data-mounted":F,"data-promise":!!f.promise,"data-swiped":Oe,"data-removed":ge,"data-visible":Fc,"data-y-position":jo,"data-x-position":Vn,"data-index":y,"data-front":Uc,"data-swiping":ne,"data-dismissible":yt,"data-type":Ie,"data-invert":Mx,"data-swipe-out":ae,"data-swipe-direction":he,"data-expanded":!!(E||C&&F),style:{"--index":y,"--toasts-before":y,"--z-index":S.length-y,"--offset":`${ge?ut:zn.current}px`,"--initial-height":C?"auto":`${ir}px`,...P,...f.style},onDragEnd:()=>{G(!1),Y(null),lr.current=null},onPointerDown:Z=>{zc||!yt||(Fn.current=new Date,kr(zn.current),Z.target.setPointerCapture(Z.pointerId),Z.target.tagName!=="BUTTON"&&(G(!0),lr.current={x:Z.clientX,y:Z.clientY}))},onPointerUp:()=>{var Z,pe,_e,Ut;if(ae||!yt)return;lr.current=null;let Ft=Number(((Z=ar.current)==null?void 0:Z.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Jr=Number(((pe=ar.current)==null?void 0:pe.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Kn=new Date().getTime()-((_e=Fn.current)==null?void 0:_e.getTime()),Bt=K==="x"?Ft:Jr,Qr=Math.abs(Bt)/Kn;if(Math.abs(Bt)>=k1||Qr>.11){kr(zn.current),(Ut=f.onDismiss)==null||Ut.call(f,f),me(K==="x"?Ft>0?"right":"left":Jr>0?"down":"up"),Gr(),oe(!0),Re(!1);return}G(!1),Y(null)},onPointerMove:Z=>{var pe,_e,Ut,Ft;if(!lr.current||!yt||((pe=window.getSelection())==null?void 0:pe.toString().length)>0)return;let Jr=Z.clientY-lr.current.y,Kn=Z.clientX-lr.current.x,Bt=(_e=e.swipeDirections)!=null?_e:T1(Q);!K&&(Math.abs(Kn)>1||Math.abs(Jr)>1)&&Y(Math.abs(Kn)>Math.abs(Jr)?"x":"y");let Qr={x:0,y:0};K==="y"?(Bt.includes("top")||Bt.includes("bottom"))&&(Bt.includes("top")&&Jr<0||Bt.includes("bottom")&&Jr>0)&&(Qr.y=Jr):K==="x"&&(Bt.includes("left")||Bt.includes("right"))&&(Bt.includes("left")&&Kn<0||Bt.includes("right")&&Kn>0)&&(Qr.x=Kn),(Math.abs(Qr.x)>0||Math.abs(Qr.y)>0)&&Re(!0),(Ut=ar.current)==null||Ut.style.setProperty("--swipe-amount-x",`${Qr.x}px`),(Ft=ar.current)==null||Ft.style.setProperty("--swipe-amount-y",`${Qr.y}px`)}},Uf&&!f.jsx?M.createElement("button",{"aria-label":U,"data-disabled":zc,"data-close-button":!0,onClick:zc||!yt?()=>{}:()=>{var Z;Gr(),(Z=f.onDismiss)==null||Z.call(f,f)},className:Ht(k==null?void 0:k.closeButton,(s=f==null?void 0:f.classNames)==null?void 0:s.closeButton)},(o=N==null?void 0:N.close)!=null?o:d1):null,f.jsx||w.isValidElement(f.title)?f.jsx?f.jsx:typeof f.title=="function"?f.title():f.title:M.createElement(M.Fragment,null,Ie||f.icon||f.promise?M.createElement("div",{"data-icon":"",className:Ht(k==null?void 0:k.icon,(i=f==null?void 0:f.classNames)==null?void 0:i.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||Dx():null,f.type!=="loading"?f.icon||(N==null?void 0:N[Ie])||s1(Ie):null):null,M.createElement("div",{"data-content":"",className:Ht(k==null?void 0:k.content,(a=f==null?void 0:f.classNames)==null?void 0:a.content)},M.createElement("div",{"data-title":"",className:Ht(k==null?void 0:k.title,(l=f==null?void 0:f.classNames)==null?void 0:l.title)},typeof f.title=="function"?f.title():f.title),f.description?M.createElement("div",{"data-description":"",className:Ht(W,Df,k==null?void 0:k.description,(c=f==null?void 0:f.classNames)==null?void 0:c.description)},typeof f.description=="function"?f.description():f.description):null),w.isValidElement(f.cancel)?f.cancel:f.cancel&&Na(f.cancel)?M.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||j,onClick:Z=>{var pe,_e;Na(f.cancel)&&yt&&((_e=(pe=f.cancel).onClick)==null||_e.call(pe,Z),Gr())},className:Ht(k==null?void 0:k.cancelButton,(u=f==null?void 0:f.classNames)==null?void 0:u.cancelButton)},f.cancel.label):null,w.isValidElement(f.action)?f.action:f.action&&Na(f.action)?M.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||B,onClick:Z=>{var pe,_e;Na(f.action)&&((_e=(pe=f.action).onClick)==null||_e.call(pe,Z),!Z.defaultPrevented&&Gr())},className:Ht(k==null?void 0:k.actionButton,(d=f==null?void 0:f.classNames)==null?void 0:d.actionButton)},f.action.label):null))};function dm(){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 P1(e,t){let r={};return[e,t].forEach((n,s)=>{let o=s===1,i=o?"--mobile-offset":"--offset",a=o?S1:x1;function l(c){["top","right","bottom","left"].forEach(u=>{r[`${i}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof n=="number"||typeof n=="string"?l(n):typeof n=="object"?["top","right","bottom","left"].forEach(c=>{n[c]===void 0?r[`${i}-${c}`]=a:r[`${i}-${c}`]=typeof n[c]=="number"?`${n[c]}px`:n[c]}):l(a)}),r}var A1=w.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:o,closeButton:i,className:a,offset:l,mobileOffset:c,theme:u="light",richColors:d,duration:h,style:f,visibleToasts:x=b1,toastOptions:g,dir:b=dm(),gap:v=E1,loadingIcon:m,icons:y,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:E}=e,[_,T]=M.useState([]),R=M.useMemo(()=>Array.from(new Set([n].concat(_.filter(L=>L.position).map(L=>L.position)))),[_,n]),[P,j]=M.useState([]),[B,I]=M.useState(!1),[W,$]=M.use
vendor: 4,241 bytes, line 141
141State(!1),[Q,z]=M.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),q=M.useRef(null),C=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),k=M.useRef(null),N=M.useRef(!1),U=M.useCallback(L=>{T(K=>{var Y;return(Y=K.find(he=>he.id===L.id))!=null&&Y.delete||ht.dismiss(L.id),K.filter(({id:he})=>he!==L.id)})},[]);return M.useEffect(()=>ht.subscribe(L=>{if(L.dismiss){T(K=>K.map(Y=>Y.id===L.id?{...Y,delete:!0}:Y));return}setTimeout(()=>{nw.flushSync(()=>{T(K=>{let Y=K.findIndex(he=>he.id===L.id);return Y!==-1?[...K.slice(0,Y),{...K[Y],...L},...K.slice(Y+1)]:[L,...K]})})})}),[]),M.useEffect(()=>{if(u!=="system"){z(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window>"u")return;let L=window.matchMedia("(prefers-color-scheme: dark)");try{L.addEventListener("change",({matches:K})=>{z(K?"dark":"light")})}catch{L.addListener(({matches:Y})=>{try{z(Y?"dark":"light")}catch(he){console.error(he)}})}},[u]),M.useEffect(()=>{_.length<=1&&I(!1)},[_]),M.useEffect(()=>{let L=K=>{var Y,he;s.every(me=>K[me]||K.code===me)&&(I(!0),(Y=q.current)==null||Y.focus()),K.code==="Escape"&&(document.activeElement===q.current||(he=q.current)!=null&&he.contains(document.activeElement))&&I(!1)};return document.addEventListener("keydown",L),()=>document.removeEventListener("keydown",L)},[s]),M.useEffect(()=>{if(q.current)return()=>{k.current&&(k.current.focus({preventScroll:!0}),k.current=null,N.current=!1)}},[q.current]),M.createElement("section",{ref:t,"aria-label":`${S} ${C}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((L,K)=>{var Y;let[he,me]=L.split("-");return _.length?M.createElement("ol",{key:L,dir:b==="auto"?dm():b,tabIndex:-1,ref:q,className:a,"data-sonner-toaster":!0,"data-theme":Q,"data-y-position":he,"data-lifted":B&&_.length>1&&!o,"data-x-position":me,style:{"--front-toast-height":`${((Y=P[0])==null?void 0:Y.height)||0}px`,"--width":`${_1}px`,"--gap":`${v}px`,...f,...P1(l,c)},onBlur:F=>{N.current&&!F.currentTarget.contains(F.relatedTarget)&&(N.current=!1,k.current&&(k.current.focus({preventScroll:!0}),k.current=null))},onFocus:F=>{F.target instanceof HTMLElement&&F.target.dataset.dismissible==="false"||N.current||(N.current=!0,k.current=F.relatedTarget)},onMouseEnter:()=>I(!0),onMouseMove:()=>I(!0),onMouseLeave:()=>{W||I(!1)},onDragEnd:()=>I(!1),onPointerDown:F=>{F.target instanceof HTMLElement&&F.target.dataset.dismissible==="false"||$(!0)},onPointerUp:()=>$(!1)},_.filter(F=>!F.position&&K===0||F.position===L).map((F,de)=>{var ge,ie;return M.createElement(R1,{key:F.id,icons:y,index:de,toast:F,defaultRichColors:d,duration:(ge=g==null?void 0:g.duration)!=null?ge:h,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:r,visibleToasts:x,closeButton:(ie=g==null?void 0:g.closeButton)!=null?ie:i,interacting:W,position:L,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:U,toasts:_.filter(ne=>ne.position==F.position),heights:P.filter(ne=>ne.position==F.position),setHeights:j,expandByDefault:o,gap:v,loadingIcon:m,expanded:B,pauseWhenPageIsHidden:E,swipeDirections:e.swipeDirections})})):null}))});const N1=({...e})=>{const{theme:t="system"}=n1();return p.jsx(A1,{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})};var j1=vh[" useId ".trim().toString()]||(()=>{}),O1=0;function sa(e){const[t,r]=w.useState(j1());return Ge(()=>{r(n=>n??String(O1++))},[e]),t?`radix-${t}`:""}const I1=["top","right","bottom","left"],Pn=Math.min,St=Math.max,Ul=Math.round,ja=Math.floor,An=e=>({x:e,y:e}
vendor: 2,280 bytes, line 141
141),L1={left:"right",right:"left",bottom:"top",top:"bottom"},$1={start:"end",end:"start"};function Md(e,t,r){return St(e,Pn(t,r))}function Vr(e,t){return typeof e=="function"?e(t):e}function Wr(e){return e.split("-")[0]}function Co(e){return e.split("-")[1]}function vf(e){return e==="x"?"y":"x"}function yf(e){return e==="y"?"height":"width"}function Nn(e){return["top","bottom"].includes(Wr(e))?"y":"x"}function wf(e){return vf(Nn(e))}function M1(e,t,r){r===void 0&&(r=!1);const n=Co(e),s=wf(e),o=yf(s);let i=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=Fl(i)),[i,Fl(i)]}function D1(e){const t=Fl(e);return[Dd(e),t,Dd(t)]}function Dd(e){return e.replace(/start|end/g,t=>$1[t])}function U1(e,t,r){const n=["left","right"],s=["right","left"],o=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return r?t?s:n:t?n:s;case"left":case"right":return t?o:i;default:return[]}}function F1(e,t,r,n){const s=Co(e);let o=U1(Wr(e),r==="start",n);return s&&(o=o.map(i=>i+"-"+s),t&&(o=o.concat(o.map(Dd)))),o}function Fl(e){return e.replace(/left|right|bottom|top/g,t=>L1[t])}function B1(e){return{top:0,right:0,bottom:0,left:0,...e}}function Kw(e){return typeof e!="number"?B1(e):{top:e,right:e,bottom:e,left:e}}function Bl(e){const{x:t,y:r,width:n,height:s}=e;return{width:n,height:s,top:r,left:t,right:t+n,bottom:r+s,x:t,y:r}}function hm(e,t,r){let{reference:n,floating:s}=e;const o=Nn(t),i=wf(t),a=yf(i),l=Wr(t),c=o==="y",u=n.x+n.width/2-s.width/2,d=n.y+n.height/2-s.height/2,h=n[a]/2-s[a]/2;let f;switch(l){case"top":f={x:u,y:n.y-s.height};break;case"bottom":f={x:u,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:d};break;case"left":f={x:n.x-s.width,y:d};break;default:f={x:n.x,y:n.y}}switch(Co(t)){case"start":f[i]-=h*(r&&c?-1:1);break;case"end":f[i]+=h*(r&&c?-1:1);break}return f}const z1=async(e,t,r)=>{const{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:i}=r,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:u,y:d}=hm(c,n,l),h=n,f={},x=0;for(let g=0;g<a.length;g++){const{name:b,fn:v}=a[g],{x:m,y,data:S,reset:E}=await v({x:u,y:d,initialPlacement:n,placement:h,strategy:s,middlewareData:f,re
vendor: 9,374 bytes, line 141
141cts:c,platform:i,elements:{reference:e,floating:t}});u=m??u,d=y??d,f={...f,[b]:{...f[b],...S}},E&&x<=50&&(x++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(c=E.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:s}):E.rects),{x:u,y:d}=hm(c,h,l)),g=-1)}return{x:u,y:d,placement:h,strategy:s,middlewareData:f}};async function Ii(e,t){var r;t===void 0&&(t={});const{x:n,y:s,platform:o,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:f=0}=Vr(t,e),x=Kw(f),b=a[h?d==="floating"?"reference":"floating":d],v=Bl(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(b)))==null||r?b:b.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),m=d==="floating"?{x:n,y:s,width:i.floating.width,height:i.floating.height}:i.reference,y=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),S=await(o.isElement==null?void 0:o.isElement(y))?await(o.getScale==null?void 0:o.getScale(y))||{x:1,y:1}:{x:1,y:1},E=Bl(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:m,offsetParent:y,strategy:l}):m);return{top:(v.top-E.top+x.top)/S.y,bottom:(E.bottom-v.bottom+x.bottom)/S.y,left:(v.left-E.left+x.left)/S.x,right:(E.right-v.right+x.right)/S.x}}const H1=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:s,rects:o,platform:i,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Vr(e,t)||{};if(c==null)return{};const d=Kw(u),h={x:r,y:n},f=wf(s),x=yf(f),g=await i.getDimensions(c),b=f==="y",v=b?"top":"left",m=b?"bottom":"right",y=b?"clientHeight":"clientWidth",S=o.reference[x]+o.reference[f]-h[f]-o.floating[x],E=h[f]-o.reference[f],_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let T=_?_[y]:0;(!T||!await(i.isElement==null?void 0:i.isElement(_)))&&(T=a.floating[y]||o.floating[x]);const R=S/2-E/2,P=T/2-g[x]/2-1,j=Pn(d[v],P),B=Pn(d[m],P),I=j,W=T-g[x]-B,$=T/2-g[x]/2+R,Q=Md(I,$,W),z=!l.arrow&&Co(s)!=null&&$!==Q&&o.reference[x]/2-($<I?j:B)-g[x]/2<0,q=z?$<I?$-I:$-W:0;return{[f]:h[f]+q,data:{[f]:Q,centerOffset:$-Q-q,...z&&{alignmentOffset:q}},reset:z}}}),V1=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:s,middlewareData:o,rects:i,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:g=!0,...b}=Vr(e,t);if((r=o.arrow)!=null&&r.alignmentOffset)return{};const v=Wr(s),m=Nn(a),y=Wr(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),E=h||(y||!g?[Fl(a)]:D1(a)),_=x!=="none";!h&&_&&E.push(...F1(a,g,x,S));const T=[a,...E],R=await Ii(t,b),P=[];let j=((n=o.flip)==null?void 0:n.overflows)||[];if(u&&P.push(R[v]),d){const $=M1(s,i,S);P.push(R[$[0]],R[$[1]])}if(j=[...j,{placement:s,overflows:P}],!P.every($=>$<=0)){var B,I;const $=(((B=o.flip)==null?void 0:B.index)||0)+1,Q=T[$];if(Q)return{data:{index:$,overflows:j},reset:{placement:Q}};let z=(I=j.filter(q=>q.overflows[0]<=0).sort((q,C)=>q.overflows[1]-C.overflows[1])[0])==null?void 0:I.placement;if(!z)switch(f){case"bestFit":{var W;const q=(W=j.filter(C=>{if(_){const k=Nn(C.placement);return k===m||k==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(k=>k>0).reduce((k,N)=>k+N,0)]).sort((C,k)=>C[1]-k[1])[0])==null?void 0:W[0];q&&(z=q);break}case"initialPlacement":z=a;break}if(s!==z)return{reset:{placement:z}}}return{}}}};function fm(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function pm(e){return I1.some(t=>e[t]>=0)}const W1=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...s}=Vr(e,t);switch(n){case"referenceHidden":{const o=await Ii(t,{...s,elementContext:"reference"}),i=fm(o,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:pm(i)}}}case"escaped":{const o=await Ii(t,{...s,altBoundary:!0}),i=fm(o,r.floating);return{data:{escapedOffsets:i,escaped:pm(i)}}}default:return{}}}}};async function K1(e,t){const{placement:r,platform:n,elements:s}=e,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),i=Wr(r),a=Co(r),l=Nn(r)==="y",c=["left","top"].includes(i)?-1:1,u=o&&l?-1:1,d=Vr(t,e);let{mainAxis:h,crossAxis:f,alignmentAxis:x}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof x=="number"&&(f=a==="end"?x*-1:x),l?{x:f*u,y:h*c}:{x:h*c,y:f*u}}const q1=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:s,y:o,placement:i,middlewareData:a}=t,l=await K1(t,e);return i===((r=a.offset)==null?void 0:r.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:s+l.x,y:o+l.y,data:{...l,placement:i}}}}},G1=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,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}=Vr(e,t),c={x:r,y:n},u=await Ii(t,l),d=Nn(Wr(s)),h=vf(d);let f=c[h],x=c[d];if(o){const b=h==="y"?"top":"left",v=h==="y"?"bottom":"right",m=f+u[b],y=f-u[v];f=Md(m,f,y)}if(i){const b=d==="y"?"top":"left",v=d==="y"?"bottom":"right",m=x+u[b],y=x-u[v];x=Md(m,x,y)}const g=a.fn({...t,[h]:f,[d]:x});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[h]:o,[d]:i}}}}}},J1=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:s,rects:o,middlewareData:i}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Vr(e,t),u={x:r,y:n},d=Nn(s),h=vf(d);let f=u[h],x=u[d];const g=Vr(a,t),b=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const y=h==="y"?"height":"width",S=o.reference[h]-o.floating[y]+b.mainAxis,E=o.reference[h]+o.reference[y]-b.mainAxis;f<S?f=S:f>E&&(f=E)}if(c){var v,m;const y=h==="y"?"width":"height",S=["top","left"].includes(Wr(s)),E=o.reference[d]-o.floating[y]+(S&&((v=i.offset)==null?void 0:v[d])||0)+(S?0:b.crossAxis),_=o.reference[d]+o.reference[y]+(S?0:((m=i.offset)==null?void 0:m[d])||0)-(S?b.crossAxis:0);x<E?x=E:x>_&&(x=_)}return{[h]:f,[d]:x}}}},Q1=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:s,rects:o,platform:i,elements:a}=t,{apply:l=()=>{},...c}=Vr(e,t),u=await Ii(t,c),d=Wr(s),h=Co(s),f=Nn(s)==="y",{width:x,height:g}=o.floating;let b,v;d==="top"||d==="bottom"?(b=d,v=h===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(v=d,b=h==="end"?"top":"bottom");const m=g-u.top-u.bottom,y=x-u.left-u.right,S=Pn(g-u[b],m),E=Pn(x-u[v],y),_=!t.middlewareData.shift;let T=S,R=E;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(R=y),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(T=m),_&&!h){const j=St(u.left,0),B=St(u.right,0),I=St(u.top,0),W=St(u.bottom,0);f?R=x-2*(j!==0||B!==0?j+B:St(u.left,u.right)):T=g-2*(I!==0||W!==0?I+W:St(u.top,u.bottom))}await l({...t,availableWidth:R,availableHeight:T});const P=await i.getDimensions(a.floating);return x!==P.width||g!==P.height?{reset:{rects:!0}}:{}}}};function bc(){return typeof window<"u"}function To(e){return qw(e)?(e.nodeName||"").toLowerCase():"#document"}function Ct(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function _r(e){var t;return(t=(qw(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function qw(e){return bc()?e instanceof Node||e instanceof Ct(e).Node:!1}function sr(e){return bc()?e instanceof Element||e instanceof Ct(e).Element:!1}function Sr(e){return bc()?e instanceof HTMLElement||e instanceof Ct(e).HTMLElement:!1}function mm(e){return!bc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ct(e).ShadowRoot}function oa(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=or(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(s)}function Y1(e){return["table","td","th"].includes(To(e))}function xc(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function bf(e){const t=xf(),r=sr(e)?or(e):e;return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function X1(e){let t=jn(e);for(;Sr(t)&&!bo(t);){if(bf(t))return t;if(xc(t))return null;t=jn(t)}return null}function xf(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function bo(e){return["html","body","#document"].includes(To(e))}function or(e){return Ct(e).getComputedStyle(e)}function Sc(e){return sr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function jn(e){if(To(e)==="html")return e;const t=e.assignedSlot||e.parentNode||mm(e)&&e.host||_r(e);return mm(t)?t.host:t}function Gw(e){const t=jn(e);return bo(t)?e.ownerDocument?e.ownerDocument.body:e.body:Sr(t)&&oa(t)?t:Gw(t)}function Li(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=Gw(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),i=Ct(s);if(o){const a=Ud(i);
vendor: 3,215 bytes, line 141
141return t.concat(i,i.visualViewport||[],oa(s)?s:[],a&&r?Li(a):[])}return t.concat(s,Li(s,[],r))}function Ud(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Jw(e){const t=or(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=Sr(e),o=s?e.offsetWidth:r,i=s?e.offsetHeight:n,a=Ul(r)!==o||Ul(n)!==i;return a&&(r=o,n=i),{width:r,height:n,$:a}}function Sf(e){return sr(e)?e:e.contextElement}function eo(e){const t=Sf(e);if(!Sr(t))return An(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:o}=Jw(t);let i=(o?Ul(r.width):r.width)/n,a=(o?Ul(r.height):r.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Z1=An(0);function Qw(e){const t=Ct(e);return!xf()||!t.visualViewport?Z1:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function eC(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Ct(e)?!1:t}function gs(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),o=Sf(e);let i=An(1);t&&(n?sr(n)&&(i=eo(n)):i=eo(e));const a=eC(o,r,n)?Qw(o):An(0);let l=(s.left+a.x)/i.x,c=(s.top+a.y)/i.y,u=s.width/i.x,d=s.height/i.y;if(o){const h=Ct(o),f=n&&sr(n)?Ct(n):n;let x=h,g=Ud(x);for(;g&&n&&f!==x;){const b=eo(g),v=g.getBoundingClientRect(),m=or(g),y=v.left+(g.clientLeft+parseFloat(m.paddingLeft))*b.x,S=v.top+(g.clientTop+parseFloat(m.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,d*=b.y,l+=y,c+=S,x=Ct(g),g=Ud(x)}}return Bl({width:u,height:d,x:l,y:c})}function tC(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const o=s==="fixed",i=_r(n),a=t?xc(t.floating):!1;if(n===i||a&&o)return r;let l={scrollLeft:0,scrollTop:0},c=An(1);const u=An(0),d=Sr(n);if((d||!d&&!o)&&((To(n)!=="body"||oa(i))&&(l=Sc(n)),Sr(n))){const h=gs(n);c=eo(n),u.x=h.x+n.clientLeft,u.y=h.y+n.clientTop}return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x,y:r.y*c.y-l.scrollTop*c.y+u.y}}function rC(e){return Array.from(e.getClientRects())}function Fd(e,t){const r=Sc(e).scrollLeft;return t?t.left+r:gs(_r(e)).left+r}function nC(e){const t=_r(e),r=Sc(e),n=e.ownerDocument.body,s=St(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=St(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Fd(e);const a=-r.scrollTop;return or(n).direction==="rtl"&&(i+=St(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:i,y:a}}function sC(e,t){const r=Ct(e),n=_r(e),s=r.visualViewport;let o=n.clientWidth,i=n.clientHeight,a=0,l=0;if(s){o=s.width,i=s.height;const c=xf();(!c||c&&t==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:i,x:a,y:l}}function oC(e,t){const r=gs(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,o=Sr(e)?eo(e):An(1),i=e.clientWidth*o.x,a=e.clientHeight*o.y,l=s*o.x,c=n*o.y;return{width:i,height:a,x:l,y:c}}function gm(e,t,r){let n;if(t==="viewport")n=sC(e,r);else if(t==="document")n=nC(_r(e));else if(sr(t))n=oC(t,r);else{const s=Qw(e);n={...t,x:t.x-s.x,y:t.y-s.y}}return Bl(n)}function Yw(e,t){const r=jn(e);return r===t||!sr(r)||bo(r)?!1:or(r).position==="fixed"||Yw(r,t)}function iC(e,t){const r=t.get(e);if(r)return r;let n=Li(e,[],!1).filter(a=>sr(a)&&To(a)!=="body"),s=null;const o=or(e).position==="fixed";let i=o?jn(e):e;for(;
vendor: 10,421 bytes, line 141
141sr(i)&&!bo(i);){const a=or(i),l=bf(i);!l&&a.position==="fixed"&&(s=null),(o?!l&&!s:!l&&a.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||oa(i)&&!l&&Yw(e,i))?n=n.filter(u=>u!==i):s=a,i=jn(i)}return t.set(e,n),n}function aC(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const i=[...r==="clippingAncestors"?xc(t)?[]:iC(t,this._c):[].concat(r),n],a=i[0],l=i.reduce((c,u)=>{const d=gm(t,u,s);return c.top=St(d.top,c.top),c.right=Pn(d.right,c.right),c.bottom=Pn(d.bottom,c.bottom),c.left=St(d.left,c.left),c},gm(t,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function lC(e){const{width:t,height:r}=Jw(e);return{width:t,height:r}}function cC(e,t,r){const n=Sr(t),s=_r(t),o=r==="fixed",i=gs(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=An(0);if(n||!n&&!o)if((To(t)!=="body"||oa(s))&&(a=Sc(t)),n){const f=gs(t,!0,o,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else s&&(l.x=Fd(s));let c=0,u=0;if(s&&!n&&!o){const f=s.getBoundingClientRect();u=f.top+a.scrollTop,c=f.left+a.scrollLeft-Fd(s,f)}const d=i.left+a.scrollLeft-l.x-c,h=i.top+a.scrollTop-l.y-u;return{x:d,y:h,width:i.width,height:i.height}}function bu(e){return or(e).position==="static"}function vm(e,t){if(!Sr(e)||or(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return _r(e)===r&&(r=r.ownerDocument.body),r}function Xw(e,t){const r=Ct(e);if(xc(e))return r;if(!Sr(e)){let s=jn(e);for(;s&&!bo(s);){if(sr(s)&&!bu(s))return s;s=jn(s)}return r}let n=vm(e,t);for(;n&&Y1(n)&&bu(n);)n=vm(n,t);return n&&bo(n)&&bu(n)&&!bf(n)?r:n||X1(e)||r}const uC=async function(e){const t=this.getOffsetParent||Xw,r=this.getDimensions,n=await r(e.floating);return{reference:cC(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function dC(e){return or(e).direction==="rtl"}const hC={convertOffsetParentRelativeRectToViewportRelativeRect:tC,getDocumentElement:_r,getClippingRect:aC,getOffsetParent:Xw,getElementRects:uC,getClientRects:rC,getDimensions:lC,getScale:eo,isElement:sr,isRTL:dC};function fC(e,t){let r=null,n;const s=_r(e);function o(){var a;clearTimeout(n),(a=r)==null||a.disconnect(),r=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const{left:c,top:u,width:d,height:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;const f=ja(u),x=ja(s.clientWidth-(c+d)),g=ja(s.clientHeight-(u+h)),b=ja(c),m={rootMargin:-f+"px "+-x+"px "+-g+"px "+-b+"px",threshold:St(0,Pn(1,l))||1};let y=!0;function S(E){const _=E[0].intersectionRatio;if(_!==l){if(!y)return i();_?i(!1,_):n=setTimeout(()=>{i(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(S,{...m,root:s.ownerDocument})}catch{r=new IntersectionObserver(S,m)}r.observe(e)}return i(!0),o}function pC(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=Sf(e),u=s||o?[...c?Li(c):[],...Li(t)]:[];u.forEach(v=>{s&&v.addEventListener("scroll",r,{passive:!0}),o&&v.addEventListener("resize",r)});const d=c&&a?fC(c,r):null;let h=-1,f=null;i&&(f=new ResizeObserver(v=>{let[m]=v;m&&m.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var y;(y=f)==null||y.observe(t)})),r()}),c&&!l&&f.observe(c),f.observe(t));let x,g=l?gs(e):null;l&&b();function b(){const v=gs(e);g&&(v.x!==g.x||v.y!==g.y||v.width!==g.width||v.height!==g.height)&&r(),g=v,x=requestAnimationFrame(b)}return r(),()=>{var v;u.forEach(m=>{s&&m.removeEventListener("scroll",r),o&&m.removeEventListener("resize",r)}),d==null||d(),(v=f)==null||v.disconnect(),f=null,l&&cancelAnimationFrame(x)}}const mC=q1,gC=G1,vC=V1,yC=Q1,wC=W1,ym=H1,bC=J1,xC=(e,t,r)=>{const n=new Map,s={platform:hC,...r},o={...s.platform,_c:n};return z1(e,t,{...s,platform:o})};var ll=typeof document<"u"?w.useLayoutEffect:w.useEffect;function zl(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 r,n,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!zl(e[n],t[n]))return!1;return!0}if(s=Object.keys(e),r=s.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,s[n]))return!1;for(n=r;n--!==0;){const o=s[n];if(!(o==="_owner"&&e.$$typeof)&&!zl(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Zw(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function wm(e,t){const r=Zw(e);return Math.round(t*r)/r}function xu(e){const t=w.useRef(e);return ll(()=>{t.current=e}),t}function SC(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:s,elements:{reference:o,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=w.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,f]=w.useState(n);zl(h,n)||f(n);const[x,g]=w.useState(null),[b,v]=w.useState(null),m=w.useCallback(C=>{C!==_.current&&(_.current=C,g(C))},[]),y=w.useCallback(C=>{C!==T.current&&(T.current=C,v(C))},[]),S=o||x,E=i||b,_=w.useRef(null),T=w.useRef(null),R=w.useRef(u),P=l!=null,j=xu(l),B=xu(s),I=xu(c),W=w.useCallback(()=>{if(!_.current||!T.current)return;const C={placement:t,strategy:r,middleware:h};B.current&&(C.platform=B.current),xC(_.current,T.current,C).then(k=>{const N={...k,isPositioned:I.current!==!1};$.current&&!zl(R.current,N)&&(R.current=N,$n.flushSync(()=>{d(N)}))})},[h,t,r,B,I]);ll(()=>{c===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,d(C=>({...C,isPositioned:!1})))},[c]);const $=w.useRef(!1);ll(()=>($.current=!0,()=>{$.current=!1}),[]),ll(()=>{if(S&&(_.current=S),E&&(T.current=E),S&&E){if(j.current)return j.current(S,E,W);W()}},[S,E,W,j,P]);const Q=w.useMemo(()=>({reference:_,floating:T,setReference:m,setFloating:y}),[m,y]),z=w.useMemo(()=>({reference:S,floating:E}),[S,E]),q=w.useMemo(()=>{const C={position:r,left:0,top:0};if(!z.floating)return C;const k=wm(z.floating,u.x),N=wm(z.floating,u.y);return a?{...C,transform:"translate("+k+"px, "+N+"px)",...Zw(z.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:k,top:N}},[r,a,z.floating,u.x,u.y]);return w.useMemo(()=>({...u,update:W,refs:Q,elements:z,floatingStyles:q}),[u,W,Q,z,q])}const _C=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:s}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?ym({element:n.current,padding:s}).fn(r):{}:n?ym({element:n,padding:s}).fn(r):{}}}},EC=(e,t)=>({...mC(e),options:[e,t]}),kC=(e,t)=>({...gC(e),options:[e,t]}),CC=(e,t)=>({...bC(e),options:[e,t]}),TC=(e,t)=>({...vC(e),options:[e,t]}),RC=(e,t)=>({...yC(e),options:[e,t]}),PC=(e,t)=>({...wC(e),options:[e,t]}),AC=(e,t)=>({..._C(e),options:[e,t]});var NC="Arrow",e0=w.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...o}=e;return p.jsx(re.svg,{...o,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});e0.displayName=NC;var jC=e0;function t0(e){const[t,r]=w.useState(void 0);return Ge(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=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;r({width:i,height:a})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var _f="Popper",[r0,_c]=Mn(_f),[OC,n0]=r0(_f),s0=e=>{const{__scopePopper:t,children:r}=e,[n,s]=w.useState(null);return p.jsx(OC,{scope:t,anchor:n,onAnchorChange:s,children:r})};s0.displayName=_f;var o0="PopperAnchor",i0=w.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,o=n0(o0,r),i=w.useRef(null),a=Se(t,i);return w.useEffect(()=>{o.onAnchorChange((n==null?void 0:n.current)||i.current)}),n?null:p.jsx(re.div,{...s,ref:a})});i0.displayName=o0;var Ef="PopperContent",[IC,LC]=r0(Ef),a0=w.forwardRef((e,t)=>{var F,de,ge,ie,ne,G;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:o="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:d="partial",hideWhenDetached:h=!1,updatePositionStrategy:f="optimized",onPlaced:x,...g}=e,b=n0(Ef,r),[v,m]=w.useState(null),y=Se(t,ae=>m(ae)),[S,E]=w.useState(null),_=t0(S),T=(_==null?void 0:_.width)??0,R=(_==null?void 0:_.height)??0,P=n+(o!=="center"?"-"+o:""),j=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},B=Array.isArray(c)?c:[c],I=B.length>0,W={padding:j,boundary:B.filter(MC),altBoundary:I},{refs:$,floatingStyles:Q,placement:z,isPositioned:q,middlewareData:C}=SC({strategy:"fixed",placement:P,whileElementsMounted:(...ae)=>pC(...ae,{animationFrame:f==="always"}),elements:{reference:b.anchor},middleware:[EC({mainAxis:s+R,alignmentAxis:i}),l&&kC({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?CC():void 0,...W}),l&&TC({...W}),RC({...W,apply:({elements:ae,rects:oe,availableWidth:Oe,availableHeight:Re})=>{const{width:ut,height:kr}=oe.reference,ir=ae.floating.style;ir.setProperty("--radix-popper-available-width",`${Oe}px`),ir.setProperty("--radix-popper-available-height",`${Re}px`),ir.setProperty("--radix-popper-anchor-width",`${ut}px`),ir.setProperty("--radix-popper-anchor-height",`${kr}px`)}}),S&&AC({element:S,padding:a}),DC({arrowWidth:T,arrowHeight:R}),h&&PC({strategy:"referenceHidden",...W})]}),[k,N]=u0(z),U=Dt(x);Ge(()=>{q&&(U==null||U())},[q,U]);const L=(F=C.arrow)==null?void 0:F.x,K=(de=C.arrow)==null?void 0:de.y,Y=((ge=C.arrow)==null?void 0:ge.centerOffset)!==0,[he,me]=w.useState();return Ge(()=>{v&&me(window.getComputedStyle(v).zIndex)},[v]),p.jsx("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...Q,transform:q?Q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:he,"--radix-popper-transform-origin":[(ie=C.transformOrigin)==null?void 0:ie.x,(ne=C.transformOrigin)==null?void 0:ne.y].join(" "),...((G=C.hide)==null?void 0:G.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(IC,{scope:r,placedSide:k,onArrowChange:E,arrowX:L,arrowY:K,shouldHideArrow:Y,children:p.jsx(re.div,{"data-side":k,"data-align":N,...g,ref:y,style:{...g.style,animation:q?void 0:"none"}})})})});a0.displayName=Ef;var l0="PopperArrow",$C={top:"bottom",right:"left",bottom:"top",left:"r
141ight"},c0=w.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,o=LC(l0,n),i=$C[o.placedSide];return p.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:p.jsx(jC,{...s,ref:r,style:{...s.style,display:"block"}})})});c0.displayName=l0;function MC(e){return e!==null}var DC=e=>({name:"transformOrigin",options:e,fn(t){var b,v,m;const{placement:r,rects:n,middlewareData:s}=t,i=((b=s.arrow)==null?void 0:b.centerOffset)!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[c,u]=u0(r),d={start:"0%",center:"50%",end:"100%"}[u],h=(((v=s.arrow)==null?void 0:v.x)??0)+a/2,f=(((m=s.arrow)==null?void 0:m.y)??0)+l/2;let x="",g="";return c==="bottom"?(x=i?d:`${h}px`,g=`${-l}px`):c==="top"?(x=i?d:`${h}px`,g=`${n.floating.height+l}px`):c==="right"?(x=`${-l}px`,g=i?d:`${f}px`):c==="left"&&(x=`${n.floating.width+l}px`,g=i?d:`${f}px`),{data:{x,y:g}}}});function u0(e){const[t,r="center"]=e.split("-");return[t,r]}var UC=s0,d0=i0,h0=a0,f0=c0,[Ec,bI]=Mn("Tooltip",[_c]),kf=_c(),p0="TooltipProvider",FC=700,bm="tooltip.open",[BC,m0]=Ec(p0),g0=e=>{const{__scopeTooltip:t,delayDuration:r=FC,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:o}=e,i=w.useRef(!0),a=w.useRef(!1),l=w.useRef(0);return w.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),p.jsx(BC,{scope:t,isOpenDelayedRef:i,delayDuration:r,onOpen:w.useCallback(()=>{window.clearTimeout(l.current),i.current=!1},[]),onClose:w.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.current=!0,n)},[n]),isPointerInTransitRef:a,onPointerInTransitChange:w.useCallback(c=>{a.current=c},[]),disableHoverableContent:s,children:o})};g0.displayName=p0;var v0="Tooltip",[xI,kc]=Ec(v0),Bd="TooltipTrigger",zC=w.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=kc(Bd,r),o=m0(Bd,r),i=kf(r),a=w.useRef(null),l=Se(t,a,s.onTriggerChange),c=w.useRef(!1),u=w.useRef(!1),d=w.useCallback(()=>c.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),p.jsx(d0,{asChild:!0,...i,children:p.jsx(re.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:l,onPointerMove:X(e.onPointerMove,h=>{h.pointerType!=="touch"&&!u.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),u.current=!0)}),onPointerLeave:X(e.onPointerLeave,()=>{s.onTriggerLeave(),u.current=!1}),onPointerDown:X(e.onPointerDown,()=>{s.open&&s.onClose(),c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:X(e.onFocus,()=>{c.current||s.onOpen()}),onBlur:X(e.onBlur,s.onClose),onClick:X(e.onClick,s.onClose)})})});zC.displayName=Bd;var HC="TooltipPortal",[SI,VC]=Ec(HC,{forceMount:void 0}),xo="TooltipContent",y0=w.forwardRef((e,t)=>{const r=VC(xo,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...o}=e,i=kc(xo,e.__scopeTooltip);return p.jsx(ta,{present:n||i.open,children:i.disableHoverableContent?p.jsx(w0,{side:s,...o,ref:t}):p.jsx(WC,{side:s,...o,ref:t})})}),WC=w.forwardRef((e,t)=>{const r=kc(xo,e.__scopeTooltip),n=m0(xo,e.__scopeTooltip),s=w.useRef(null),o=Se(t,s),[i,a]=w.useState(null),{trigger:l,onClose:c}=r,u=s.current,{onPointerInTransitChange:d}=n,h=w.useCallback(()=>{a(null),d(!1)},[d]),f=w.useCallback((x,g)=>{const b=x.currentTarget,v={x:x.clientX,y:x.clientY},m=QC(v,b.getBoundingClientRect()),y=YC(v,m),S=XC(g.getBoundingClientRect()),E=eT([...y,...S]);a(E),d(!0)},[d]);return w.useEffect(()=>()=>h(),[h]),w.useEffect(()=>{if(l&&u){const x=b=>f(b,u),g=b=>f(b,l);return l.addEventListener("pointerleave",x),u.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",x),u.removeEventListener("pointerleave",g)}}},[l,u,f,h]),w.useEffect(()=>{if(i){const x=g=>{const b=g.target,v={x:g.clientX,y:g.clientY},m=(l==null?void 0:l.contains(b))||(u==null?void 0:u.contains(b)),y=!ZC(v,i);m?h():y&&(h(),c())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[l,u,i,c,h]),p.jsx(w0,{...e,ref:o})}),[KC,qC]=Ec(v0,{isInside:!1}),GC=wE("TooltipContent"),w0=w.forwardRef((e,t)=>
141{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:i,...a}=e,l=kc(xo,r),c=kf(r),{onClose:u}=l;return w.useEffect(()=>(document.addEventListener(bm,u),()=>document.removeEventListener(bm,u)),[u]),w.useEffect(()=>{if(l.trigger){const d=h=>{const f=h.target;f!=null&&f.contains(l.trigger)&&u()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,u]),p.jsx(vc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:d=>d.preventDefault(),onDismiss:u,children:p.jsxs(h0,{"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:[p.jsx(GC,{children:n}),p.jsx(KC,{scope:r,isInside:!0,children:p.jsx(BE,{id:l.contentId,role:"tooltip",children:s||n})})]})})});y0.displayName=xo;var b0="TooltipArrow",JC=w.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=kf(r);return qC(b0,r).isInside?null:p.jsx(f0,{...s,...n,ref:t})});JC.displayName=b0;function QC(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,s,o)){case o:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function YC(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function XC(e){const{top:t,right:r,bottom:n,left:s}=e;return[{x:s,y:t},{x:r,y:t},{x:r,y:n},{x:s,y:n}]}function ZC(e,t){const{x:r,y:n}=e;let s=!1;for(let o=0,i=t.length-1;o<t.length;i=o++){const a=t[o],l=t[i],c=a.x,u=a.y,d=l.x,h=l.y;u>n!=h>n&&r<(d-c)*(n-u)/(h-u)+c&&(s=!s)}return s}function eT(e){const t=e.slice();return t.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),tT(t)}function tT(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const s=e[n];for(;t.length>=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 r=[];for(let n=e.length-1;n>=0;n--){const s=e[n];for(;r.length>=2;){const o=r[r.length-1],i=r[r.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.x))r.pop();else break}r.push(s)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var rT=g0,x0=y0;const nT=rT,sT=w.forwardRef(({className:e,sideOffset:t=4,...r},n)=>p.jsx(x0,{ref:n,sideOffset:t,className:le("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),...r}));sT.displayName=x0.displayName;var Cc=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(){}},Tc=typeof window>"u"||"Deno"in globalThis;function Gt(){}function oT(e,t){return typeof e=="function"?e(t):e}function iT(e){return typeof e=="number"&&e>=0&&e!==1/0}function aT(e,t){return Math.max(e+(t||0)-Date.now(),0)}function zd(e,t){return typeof e=="function"?e(t):e}function lT(e,t){return typeof e=="function"?e(t):e}function xm(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:o,queryKey:i,stale:a}=e;if(i){if(n){if(t.queryHash!==Cf(i,t.options))return!1}else if(!Mi(t.queryKey,i))return!1}if(r!=="all"){const l=t.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||s&&s!==t.state.fetchStatus||o&&!o(t))}function Sm(e,t){const{exact:r,status:n,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if($i(t.options.mutationKey)!==$i(o))return!1}else if(!Mi(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function Cf(e,t){return((t==null?void 0:t.queryKeyHashFn)||$i)(e)}function $i(e){return JSON.stringify(e,(t,r)=>Hd(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}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(r=>Mi(e[r],t[r])):!1}function S0(e,t){if(e===t)return e;const r=_m(e)&&_m(t);if(r||Hd(e)&&Hd(t)){const n=r?e:Object.keys(e),s=n.length,o=r?t:Object.keys(t),i=o.length,a=r?[]:{},l=new Set(n);let c=0;for(let u=0;u<i;u++){const d=r?u:o[u];(!r&&l.has(d)||r)&&e[d]===void 0&&t[d]===void 0?(a[d]=void 0,c++):(a[d]=S0(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&c++)}return s===i&&c===s?e:a}return t}function _m(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Hd(e){if(!Em(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!Em(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Em(e){return Object.prototype.toString.call(e)==="[object Object]"}function cT(e){return new Promise(t=>{setTimeout(t,e)})}function uT(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?S0(e,t):t}function dT(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function hT(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Tf=Symbol();function _0(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Tf?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var ns,cn,no,$g,fT=($g=class extends Cc{constructor(){super();ue(this,ns);ue(this,cn);ue(this,no);ee(this,no,t=>{if(!Tc&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){A(this,cn)||this.setEventListener(A(this,no))}onUnsubscribe(){var t;this.hasListeners()||((t=A(this,cn))==null||t.call(this),ee(this,cn,void 0))}setEventListener(t){var r;ee(this,no,t),(r=A(this,cn))==null||r.call(this),ee(this,cn,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){A(this,ns)!==t&&(ee(this,ns,t),this.onFocus())}onFocus(){const t=this.isFocused();
vendor: 4,924 bytes, line 141
141this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof A(this,ns)=="boolean"?A(this,ns):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},ns=new WeakMap,cn=new WeakMap,no=new WeakMap,$g),E0=new fT,so,un,oo,Mg,pT=(Mg=class extends Cc{constructor(){super();ue(this,so,!0);ue(this,un);ue(this,oo);ee(this,oo,t=>{if(!Tc&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){A(this,un)||this.setEventListener(A(this,oo))}onUnsubscribe(){var t;this.hasListeners()||((t=A(this,un))==null||t.call(this),ee(this,un,void 0))}setEventListener(t){var r;ee(this,oo,t),(r=A(this,un))==null||r.call(this),ee(this,un,t(this.setOnline.bind(this)))}setOnline(t){A(this,so)!==t&&(ee(this,so,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return A(this,so)}},so=new WeakMap,un=new WeakMap,oo=new WeakMap,Mg),Hl=new pT;function mT(){let e,t;const r=new Promise((s,o)=>{e=s,t=o});r.status="pending",r.catch(()=>{});function n(s){Object.assign(r,s),delete r.resolve,delete r.reject}return r.resolve=s=>{n({status:"fulfilled",value:s}),e(s)},r.reject=s=>{n({status:"rejected",reason:s}),t(s)},r}function gT(e){return Math.min(1e3*2**e,3e4)}function k0(e){return(e??"online")==="online"?Hl.isOnline():!0}var C0=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Su(e){return e instanceof C0}function T0(e){let t=!1,r=0,n=!1,s;const o=mT(),i=g=>{var b;n||(h(new C0(g)),(b=e.abort)==null||b.call(e))},a=()=>{t=!0},l=()=>{t=!1},c=()=>E0.isFocused()&&(e.networkMode==="always"||Hl.isOnline())&&e.canRun(),u=()=>k0(e.networkMode)&&e.canRun(),d=g=>{var b;n||(n=!0,(b=e.onSuccess)==null||b.call(e,g),s==null||s(),o.resolve(g))},h=g=>{var b;n||(n=!0,(b=e.onError)==null||b.call(e,g),s==null||s(),o.reject(g))},f=()=>new Promise(g=>{var b;s=v=>{(n||c())&&g(v)},(b=e.onPause)==null||b.call(e)}).then(()=>{var g;s=void 0,n||(g=e.onContinue)==null||g.call(e)}),x=()=>{if(n)return;let g;const b=r===0?e.initialPromise:void 0;try{g=b??e.fn()}catch(v){g=Promise.reject(v)}Promise.resolve(g).then(d).catch(v=>{var _;if(n)return;const m=e.retry??(Tc?0:3),y=e.retryDelay??gT,S=typeof y=="function"?y(r,v):y,E=m===!0||typeof m=="number"&&r<m||typeof m=="function"&&m(r,v);if(t||!E){h(v);return}r++,(_=e.onFail)==null||_.call(e,r,v),cT(S).then(()=>c()?void 0:f()).then(()=>{t?h(v):x()})})};return{promise:o,cancel:i,continue:()=>(s==null||s(),o),cancelRetry:a,continueRetry:l,canStart:u,start:()=>(u()?x():f().then(x),o)}}var vT=e=>setTimeout(e,0);function yT(){let e=[],t=0,r=a=>{a()},n=a=>{a()},s=vT;const o=a=>{t?e.push(a):s(()=>{r(a)})},i=()=>{const a=e;e=[],a.length&&s(()=>{n(()=>{a.forEach(l=>{r(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=>{r=a},setBatchNotifyFunction:a=>{n=a},setScheduler:a=>{s=a}}}var it=yT(),ss,Dg,R0=(Dg=class{constructor(){ue(this,ss)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),iT(this.gcTime)&&ee(this,ss,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Tc?1/0:5*60*1e3))}clearGcTimeout(){A(this,ss)&&(clearTimeout(A(this,ss)),ee(this,ss,void 0))}},ss=new WeakMap,Dg),io,os,Nt,is,et,Gi,as,Qt,Ar,Ug,wT=(Ug=class extends R0{constructor(t){super();ue(this,Qt);ue(this,io);ue(this,os);ue(this,Nt);ue(this,is);ue(this,et);ue(this,Gi);ue(this,as);ee(this,as,!1),ee(this,Gi,t.defaultOptions),this.setOptions(t.options),this.observers=[],ee(this,is,t.client),ee(this,Nt,A(this,is).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ee(this,io,xT(this.options)),this.state=t.state??A(this,io),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=A(this,et))==null?void 0:t.promise}setOptions(t){this.options={...A(this,Gi),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&A(this,Nt).remove(this)}setData(t,r){const n=uT(this.state.data,t,this.options);return Qe(this,Qt,Ar).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){Qe(this,Qt,Ar).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,s;const r=(n=A(this,et))==null?void 0:n.promise;return(s=A(this,et))==null||s.cancel(t),r?r.then(Gt).catch(Gt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(A(this,io))}isActive(){return this.observers.some(t=>lT(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Tf||this.state.dataUpdateCount+this.state.errorUpdate
141Count===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>zd(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:!aT(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=A(this,et))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=A(this,et))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),A(this,Nt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(A(this,et)&&(A(this,as)?A(this,et).cancel({revert:!0}):A(this,et).cancelRetry()),this.scheduleGc()),A(this,Nt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Qe(this,Qt,Ar).call(this,{type:"invalidate"})}fetch(t,r){var c,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(A(this,et))return A(this,et).continueRetry(),A(this,et).promise}if(t&&this.setOptions(t),!this.options.queryFn){const h=this.observers.find(f=>f.options.queryFn);h&&this.setOptions(h.options)}const n=new AbortController,s=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(ee(this,as,!0),n.signal)})},o=()=>{const h=_0(this.options,r),x=(()=>{const g={client:A(this,is),queryKey:this.queryKey,meta:this.meta};return s(g),g})();return ee(this,as,!1),this.options.persister?this.options.persister(h,x,this):h(x)},a=(()=>{const h={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:A(this,is),state:this.state,fetchFn:o};return s(h),h})();(c=this.options.behavior)==null||c.onFetch(a,this),ee(this,os,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=a.fetchOptions)==null?void 0:u.meta))&&Qe(this,Qt,Ar).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta});const l=h=>{var f,x,g,b;Su(h)&&h.silent||Qe(this,Qt,Ar).call(this,{type:"error",error:h}),Su(h)||((x=(f=A(this,Nt).config).onError)==null||x.call(f,h,this),(b=(g=A(this,Nt).config).onSettled)==null||b.call(g,this.state.data,h,this)),this.scheduleGc()};return ee(this,et,T0({initialPromise:r==null?void 0:r.initialPromise,fn:a.fetchFn,abort:n.abort.bind(n),onSuccess:h=>{var f,x,g,b;if(h===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(h)}catch(v){l(v);return}(x=(f=A(this,Nt).config).onSuccess)==null||x.call(f,h,this),(b=(g=A(this,Nt).config).onSettled)==null||b.call(g,h,this.state.error,this),this.scheduleGc()},onError:l,onFail:(h,f)=>{Qe(this,Qt,Ar).call(this,{type:"failed",failureCount:h,error:f})},onPause:()=>{Qe(this,Qt,Ar).call(this,{type:"pause"})},onContinue:()=>{Qe(this,Qt,Ar).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),A(this,et).start()}},io=new WeakMap,os=new WeakMap,Nt=new WeakMap,is=new WeakMap,et=new WeakMap,Gi=new WeakMap,as=new WeakMap,Qt=new WeakSet,Ar=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...bT(n.data,this.options),fetchMeta:t.meta??null};case"success":return ee(this,os,void 0),{...n,data:t.data,dataUpdateCount:n.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 Su(s)&&s.revert&&A(this,os)?{...A(this,os),fetchStatus:"idle"}
vendor: 5,105 bytes, line 141
141:{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),it.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),A(this,Nt).notify({query:this,type:"updated",action:t})})},Ug);function bT(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:k0(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function xT(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var pr,Fg,ST=(Fg=class extends Cc{constructor(t={}){super();ue(this,pr);this.config=t,ee(this,pr,new Map)}build(t,r,n){const s=r.queryKey,o=r.queryHash??Cf(s,r);let i=this.get(o);return i||(i=new wT({client:t,queryKey:s,queryHash:o,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(i)),i}add(t){A(this,pr).has(t.queryHash)||(A(this,pr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=A(this,pr).get(t.queryHash);r&&(t.destroy(),r===t&&A(this,pr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){it.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return A(this,pr).get(t)}getAll(){return[...A(this,pr).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>xm(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>xm(t,n)):r}notify(t){it.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){it.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){it.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},pr=new WeakMap,Fg),mr,st,ls,gr,en,Bg,_T=(Bg=class extends R0{constructor(t){super();ue(this,gr);ue(this,mr);ue(this,st);ue(this,ls);this.mutationId=t.mutationId,ee(this,st,t.mutationCache),ee(this,mr,[]),this.state=t.state||ET(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){A(this,mr).includes(t)||(A(this,mr).push(t),this.clearGcTimeout(),A(this,st).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ee(this,mr,A(this,mr).filter(r=>r!==t)),this.scheduleGc(),A(this,st).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){A(this,mr).length||(this.state.status==="pending"?this.scheduleGc():A(this,st).remove(this))}continue(){var t;return((t=A(this,ls))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,a,l,c,u,d,h,f,x,g,b,v,m,y,S,E,_,T,R;const r=()=>{Qe(this,gr,en).call(this,{type:"continue"})};ee(this,ls,T0({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(P,j)=>{Qe(this,gr,en).call(this,{type:"failed",failureCount:P,error:j})},onPause:()=>{Qe(this,gr,en).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>A(this,st).canRun(this)}));const n=this.state.status==="pending",s=!A(this,ls).canStart();try{if(n)r();else{Qe(this,gr,en).call(this,{type:"pending",variables:t,isPaused:s}),await((i=(o=A(this,st).config).onMutate)==null?void 0:i.call(o,t,this));const j=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,t));j!==this.state.context&&Qe(this,gr,en).call(this,{type:"pending",context:j,variables:t,isPaused:s})}const P=await A(this,ls).start();return await((u=(c=A(this,st).config).onSuccess)==null?void 0:u.call(c,P,t,this.state.context,this)),await((h=(d=this.options).onSuccess)==null?void 0:h.call(d,P,t,this.state.context)),await((x=(f=A(this,st).config).onSettled)==null?void 0:x.call(f,P,null,this.state.variables,this.state.context,this)),await((b=(g=this.options).onSettled)==null?void 0:b.call(g,P,null,t,this.state.context)),Qe(this,gr,en).call(this,{type:"success",data:P}),P}catch(P){try{throw await((m=(v=A(this,st).config).onError)==null?void 0:m.call(v,P,t,this.state.context,this)),await((S=(y=this.options).onError)==null?void 0:S.call(y,P,t,this.state.context)),await((_=(E=A(this,st).config).onSettled)==null?void 0:_.call(E,void 0,P,this.state.variables,this.state.context,this)),await((R=(T=this.options).onSettled)==null?void 0:R.call(T,void 0,P,t,this.state.context)),P}finally{Qe(this,gr,en).call(this,{type:"error",error:P})}}finally{A(this,st).runNext(this)}}},mr=new WeakMap,st=new WeakMap,ls=new WeakMap,gr=new WeakSet,en=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};
141case"pending":return{...n,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{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),it.batch(()=>{A(this,mr).forEach(n=>{n.onMutationUpdate(t)}),A(this,st).notify({mutation:this,type:"updated",action:t})})},Bg);function ET(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $r,Yt,Ji,zg,kT=(zg=class extends Cc{constructor(t={}){super();ue(this,$r);ue(this,Yt);ue(this,Ji);this.config=t,ee(this,$r,new Set),ee(this,Yt,new Map),ee(this,Ji,0)}build(t,r,n){const s=new _T({mutationCache:this,mutationId:++da(this,Ji)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){A(this,$r).add(t);const r=Oa(t);if(typeof r=="string"){const n=A(this,Yt).get(r);n?n.push(t):A(this,Yt).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(A(this,$r).delete(t)){const r=Oa(t);if(typeof r=="string"){const n=A(this,Yt).get(r);if(n)if(n.length>1){const s=n.indexOf(t);s!==-1&&n.splice(s,1)}else n[0]===t&&A(this,Yt).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Oa(t);if(typeof r=="string"){const n=A(this,Yt).get(r),s=n==null?void 0:n.find(o=>o.state.status==="pending");return!s||s===t}else return!0}runNext(t){var n;const r=Oa(t);if(typeof r=="string"){const s=(n=A(this,Yt).get(r))==null?void 0:n.find(o=>o!==t&&o.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){it.batch(()=>{A(this,$r).forEach(t=>{this.notify({type:"removed",mutation:t})}),A(this,$r).clear(),A(this,Yt).clear()})}getAll(){return Array.from(A(this,$r))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Sm(r,n))}findAll(t={}){return this.getAll().filter(r=>Sm(t,r))}notify(t){it.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>
vendor: 4,731 bytes, line 141
141r.state.isPaused);return it.batch(()=>Promise.all(t.map(r=>r.continue().catch(Gt))))}},$r=new WeakMap,Yt=new WeakMap,Ji=new WeakMap,zg);function Oa(e){var t;return(t=e.options.scope)==null?void 0:t.id}function km(e){return{onFetch:(t,r)=>{var u,d,h,f,x;const n=t.options,s=(h=(d=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:d.fetchMore)==null?void 0:h.direction,o=((f=t.state.data)==null?void 0:f.pages)||[],i=((x=t.state.data)==null?void 0:x.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let g=!1;const b=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},v=_0(t.options,t.fetchOptions),m=async(y,S,E)=>{if(g)return Promise.reject();if(S==null&&y.pages.length)return Promise.resolve(y);const T=(()=>{const B={client:t.client,queryKey:t.queryKey,pageParam:S,direction:E?"backward":"forward",meta:t.options.meta};return b(B),B})(),R=await v(T),{maxPages:P}=t.options,j=E?hT:dT;return{pages:j(y.pages,R,P),pageParams:j(y.pageParams,S,P)}};if(s&&o.length){const y=s==="backward",S=y?CT:Cm,E={pages:o,pageParams:i},_=S(n,E);a=await m(E,_,y)}else{const y=e??o.length;do{const S=l===0?i[0]??n.initialPageParam:Cm(n,a);if(l>0&&S==null)break;a=await m(a,S),l++}while(l<y)}return a};t.options.persister?t.fetchFn=()=>{var g,b;return(b=(g=t.options).persister)==null?void 0:b.call(g,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=c}}}function Cm(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function CT(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var Pe,dn,hn,ao,lo,fn,co,uo,Hg,TT=(Hg=class{constructor(e={}){ue(this,Pe);ue(this,dn);ue(this,hn);ue(this,ao);ue(this,lo);ue(this,fn);ue(this,co);ue(this,uo);ee(this,Pe,e.queryCache||new ST),ee(this,dn,e.mutationCache||new kT),ee(this,hn,e.defaultOptions||{}),ee(this,ao,new Map),ee(this,lo,new Map),ee(this,fn,0)}mount(){da(this,fn)._++,A(this,fn)===1&&(ee(this,co,E0.subscribe(async e=>{e&&(await this.resumePausedMutations(),A(this,Pe).onFocus())})),ee(this,uo,Hl.subscribe(async e=>{e&&(await this.resumePausedMutations(),A(this,Pe).onOnline())})))}unmount(){var e,t;da(this,fn)._--,A(this,fn)===0&&((e=A(this,co))==null||e.call(this),ee(this,co,void 0),(t=A(this,uo))==null||t.call(this),ee(this,uo,void 0))}isFetching(e){return A(this,Pe).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return A(this,dn).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=A(this,Pe).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=A(this,Pe).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(zd(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return A(this,Pe).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),s=A(this,Pe).get(n.queryHash),o=s==null?void 0:s.state.data,i=oT(t,o);if(i!==void 0)return A(this,Pe).build(this,n).setData(i,{...r,manual:!0})}setQueriesData(e,t,r){return it.batch(()=>A(this,Pe).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=A(this,Pe).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=A(this,Pe);it.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=A(this,Pe);return it.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=it.batch(()=>A(this,Pe).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(Gt).catch(Gt)}invalidateQueries(e,t={}){return it.batch(()=>(A(this,Pe).findAll(e).forEach(r=>{r.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 r={...t,cancelRefetch:t.cancelRefetch??!0},n=it.batch(()=>A(this,Pe).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,r);return r.throwOnError||(o=o.catch(Gt)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(Gt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=A(this,Pe).build(this,t);return r.isStaleByTime(zd(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Gt).catch(Gt)}
141fetchInfiniteQuery(e){return e.behavior=km(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Gt).catch(Gt)}ensureInfiniteQueryData(e){return e.behavior=km(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Hl.isOnline()?A(this,dn).resumePausedMutations():Promise.resolve()}getQueryCache(){return A(this,Pe)}getMutationCache(){return A(this,dn)}getDefaultOptions(){return A(this,hn)}setDefaultOptions(e){ee(this,hn,e)}setQueryDefaults(e,t){A(this,ao).set($i(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...A(this,ao).values()],r={};return t.forEach(n=>{Mi(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){A(this,lo).set($i(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...A(this,lo).values()],r={};return t.forEach(n=>{Mi(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...A(this,hn).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Cf(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===Tf&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...A(this,hn).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){A(this,Pe).clear(),A(this,dn).clear()}},Pe=new WeakMap,dn=new WeakMap,hn=new WeakMap,ao=new WeakMap,lo=new WeakMap,fn=new WeakMap,co=new WeakMap,uo=new WeakMap,Hg),RT=w.createContext(void 0),PT=({client:e,children:t})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),p.jsx(RT.Provider,{value:e,children:t}));/**
142 * @remix-run/router v1.23.0
143 *
144 * Copyright (c) Remix Software Inc.
145 *
146 * This source code is licensed under the MIT license found in the
147 * LICENSE.md file in the root directory of this source tree.
148 *
149 * @license MIT
150 */function Di(){return Di=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Di.apply(this,arguments)}var gn;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(gn||(gn={}));const Tm="popstate";function AT(e){e===void 0&&(e={});function t(n,s){let{pathname:o,search:i,hash:a}=n.location;return Vd("",{pathname:o,search:i,hash:a},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function r(n,s){return typeof s=="string"?s:Vl(s)}return jT(t,r,null,e)}function De(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function P0(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function NT(){return Math.random().toString(36).substr(2,8)}function Rm(e,t){return{usr:e.state,key:e.key,idx:t}}function Vd(e,t,r,n){return r===void 0&&(r=null),Di({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ro(t):t,{state:r,key:t&&t.key||n||NT()})}function Vl(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Ro(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function jT(e,t,r,n){n===void 0&&(n={});let{window:s=document.defaultView,v5Compat:o=!1}=n,i=s.history,a=gn.Pop,l=null,c=u();c==null&&(c=0,i.replaceState(Di({},i.state,{idx:c}),""));function u(){return(i.state||{idx:null}).idx}function d(){a=gn.Pop;let b=u(),v=b==null?null:b-c;c=b,l&&l({action:a,location:g.location,delta:v})}function h(b,v){a=gn.Push;let m=Vd(g.location,b,v);c=u()+1;let y=Rm(m,c),S=g.createHref(m);try{i.pushState(y,"",S)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;s.location.assign(S)}o&&l&&l({action:a,location:g.location,delta:1})}function f(b,v){a=gn.Replace;let m=Vd(g.location,b,v);c=u();let y=Rm(m,c),S=g.createHref(m);i.replaceState(y,"",S),o&&l&&l({action:a,location:g.location,delta:0})}function x(b){let v=s.location.origin!=="null"?s.location.origin:s.location.href,m=typeof b=="string"?b:Vl(b);return m=m.replace(/ $/,"%20"),De(v,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,v)}let g={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(Tm,d),l=b,()=>{s.removeEventListener(Tm,d),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:h,replace:f,go(b){return i.go(b)}};return g}var Pm;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Pm||(Pm={}));function OT(e,t,r){return r===void 0&&(r="/"),IT(e,t,r,!1)}function IT(e,t,r,n){let s=typeof t=="string"?Ro(t):t,o=Rf(s.pathname||"/",r);if(o==null)return null;let i=A0(e);LT(i);let a=null;for(let l=0;a==null&&l<i.length;++l){let c=KT(o);a=VT(i[l],c,n)}return a}function A0(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let s=(o,i,a)=>{let l={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};l.relativePath.startsWith("/")&&(De(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not val
150id. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let c=kn([n,l.relativePath]),u=r.concat(l);o.children&&o.children.length>0&&(De(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),A0(o.children,t,u,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:zT(c,o.index),routesMeta:u})};return e.forEach((o,i)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))s(o,i);else for(let l of N0(o.path))s(o,i,l)}),t}function N0(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,s=r.endsWith("?"),o=r.replace(/\?$/,"");if(n.length===0)return s?[o,""]:[o];let i=N0(n.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 LT(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:HT(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const $T=/^:[\w-]+$/,MT=3,DT=2,UT=1,FT=10,BT=-2,Am=e=>e==="*";function zT(e,t){let r=e.split("/"),n=r.length;return r.some(Am)&&(n+=BT),t&&(n+=DT),r.filter(s=>!Am(s)).reduce((s,o)=>s+($T.test(o)?MT:o===""?UT:FT),n)}function HT(e,t){return e.length===t.length&&e.slice(0,-1).every((n,s)=>n===t[s])?e[e.length-1]-t[t.length-1]:0}function VT(e,t,r){let{routesMeta:n}=e,s={},o="/",i=[];for(let a=0;a<n.length;++a){let l=n[a],c=a===n.length-1,u=o==="/"?t:t.slice(o.length)||"/",d=Nm({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u),h=l.route;if(!d&&c&&r&&!n[n.length-1].route.index&&(d=Nm({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},u)),!d)return null;
vendor: 8,713 bytes, lines 150-159
150Object.assign(s,d.params),i.push({params:s,pathname:kn([o,d.pathname]),pathnameBase:QT(kn([o,d.pathnameBase])),route:h}),d.pathnameBase!=="/"&&(o=kn([o,d.pathnameBase]))}return i}function Nm(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=WT(e.path,e.caseSensitive,e.end),s=t.match(r);if(!s)return null;let o=s[0],i=o.replace(/(.)\/+$/,"$1"),a=s.slice(1);return{params:n.reduce((c,u,d)=>{let{paramName:h,isOptional:f}=u;if(h==="*"){let g=a[d]||"";i=o.slice(0,o.length-g.length).replace(/(.)\/+$/,"$1")}const x=a[d];return f&&!x?c[h]=void 0:c[h]=(x||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:i,pattern:e}}function WT(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),P0(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 n=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,a,l)=>(n.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),n]}function KT(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return P0(!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 r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function qT(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:s=""}=typeof e=="string"?Ro(e):e;return{pathname:r?r.startsWith("/")?r:GT(r,t):t,search:YT(n),hash:XT(s)}}function GT(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?r.length>1&&r.pop():s!=="."&&r.push(s)}),r.length>1?r.join("/"):"/"}function _u(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"].  Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function JT(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function j0(e,t){let r=JT(e);return t?r.map((n,s)=>s===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function O0(e,t,r,n){n===void 0&&(n=!1);let s;typeof e=="string"?s=Ro(e):(s=Di({},e),De(!s.pathname||!s.pathname.includes("?"),_u("?","pathname","search",s)),De(!s.pathname||!s.pathname.includes("#"),_u("#","pathname","hash",s)),De(!s.search||!s.search.includes("#"),_u("#","search","hash",s)));let o=e===""||s.pathname==="",i=o?"/":s.pathname,a;if(i==null)a=r;else{let d=t.length-1;if(!n&&i.startsWith("..")){let h=i.split("/");for(;h[0]==="..";)h.shift(),d-=1;s.pathname=h.join("/")}a=d>=0?t[d]:"/"}let l=qT(s,a),c=i&&i!=="/"&&i.endsWith("/"),u=(o||i===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const kn=e=>e.join("/").replace(/\/\/+/g,"/"),QT=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),YT=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,XT=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function ZT(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const I0=["post","put","patch","delete"];new Set(I0);const eR=["get",...I0];new Set(eR);/**
151 * React Router v6.30.1
152 *
153 * Copyright (c) Remix Software Inc.
154 *
155 * This source code is licensed under the MIT license found in the
156 * LICENSE.md file in the root directory of this source tree.
157 *
158 * @license MIT
159 */function Ui(){return Ui=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ui.apply(this,arguments)}const Pf=w.createContext(null),tR=w.createContext(null),xs=w.createContext(null),Rc=w.createContext(null),Ss=w.createContext({outlet:null,matches:[],isDataRoute:!1}),L0=w.createContext(null);function rR(e,t){let{relative:r}=t===void 0?{}:t;ia()||De(!1);let{basename:n,navigator:s}=w.useContext(xs),{hash:o,pathname:i,search:a}=M0(e,{relative:r}),l=i;return n!=="/"&&(l=i==="/"?n:kn([n,i])),s.createHref({pathname:l,search:a,hash:o})}function ia(){return w.useContext(Rc)!=null}function aa(){return ia()||De(!1),w.useContext(Rc).location}function $0(e){w.useContext(xs).static||w.useLayoutEffect(e)}function nR(){let{isDataRoute:e}=w.useContext(Ss);return e?gR():sR()}function sR(){ia()||De(!1);let e=w.useContext(Pf),{basename:t,future:r,navigator:n}=w.useContext(xs),{matches:s}=w.useContext(Ss),{pathname:o}=aa(),i=JSON.stringify(j0(s,r.v7_relativeSplatPath)),a=w.useRef(!1);return $0(()=>{a.current=!0}),w.useCallback(function(c,u){if(u===void 0&&(u={}),!a.current)return;if(typeof c=="number"){n.go(c);return}let d=O0(c,JSON.parse(i),o,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:kn([t,d.pathname])),(u.replace?n.replace:n.push)(d,u.state,u)},[t,n,i,o,e])}function M0(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=w.useContext(xs),{matches:s}=w.useContext(Ss),{pathname:o}=aa(),i=JSON.stringify(j0(s,n.v7_relativeSplatPath));return w.useMemo(()=>O0(e,JSON.parse(i),o,r==="path"),[e,i,o,r])}function oR(e,t){return iR(e,t)}function iR(e,t,r,n){ia()||De(!1);let{navigator:s}=w.useContext(xs),{matches:o}=w.useContext(Ss),i=o[o.length-1],a=i?i.params:{};i&&i.pathname;let l=i?i.pathnameBase:"/";i&&i.route;let c=aa(),u;if(t){var d;let b=typeof t=="string"?Ro(t):t;l==="/"||(d=b.pathname)!=null&&d.startsWith(l)||De(!1),u=b}else u=c;let h=u.pathname||"/",f=h;if(l!=="/"){let b=l.replace(/^\//,"").split("/");f="/"+h.replace(/^\//,"").split("/").slice(b.length).join("/")}let x=OT(e,{pathname:f}),g=dR(x&&x.map(b=>Object.assign({},b,{params:Object.assign({},a,b.params),pathname:kn([l,s.encodeLocation?s.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?l:kn([l,s.encodeLocation?s.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),o,r,n);return t&&g?w.createElement(Rc.Provider,{value:{location:Ui({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:gn.Pop}},g):g}function aR(){let e=mR(),t=ZT(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),r?w.createElement("pre",{style:s},r):null,null)}const lR=w.createElement(aR,null);class cR extends w.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,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?w.createElement(Ss.Provider,{value:this.props.routeContext},w.createElement(L0.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function uR(e){let{routeContext:t,match:r,children:n}=e,s=w.useContext(Pf);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),w.createElement(Ss.Provider,{value:t},n)}function dR(e,t,r,n){var s;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var o;if(!r)return null;if(r.errors)e=r.matches;else if((o=n)!=null&&o.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=(s=r)==null?void 0:s.errors;if(a!=null){let u=i.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id])!==void 0);u>=0||De(!1),i=i.slice(0,Math.min(i.length,u+1))}let l=!1,c=-1;if(r&&n&&n.v7_partialHydration)for(let u=0;u<i.length;u++){let d=i[u];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(c=u),d.route.id){let{loaderData:h,errors:f}=r,x=d.route.loader&&h[d.route.id]===void 0&&(!f||f[d.route.id]===void 0);
159if(d.route.lazy||x){l=!0,c>=0?i=i.slice(0,c+1):i=[i[0]];break}}}return i.reduceRight((u,d,h)=>{let f,x=!1,g=null,b=null;r&&(f=a&&d.route.id?a[d.route.id]:void 0,g=d.route.errorElement||lR,l&&(c<0&&h===0?(x=!0,b=null):c===h&&(x=!0,b=d.route.hydrateFallbackElement||null)));let v=t.concat(i.slice(0,h+1)),m=()=>{let y;return f?y=g:x?y=b:d.route.Component?y=w.createElement(d.route.Component,null):d.route.element?y=d.route.element:y=u,w.createElement(uR,{match:d,routeContext:{outlet:u,matches:v,isDataRoute:r!=null},children:y})};return r&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?w.createElement(cR,{location:r.location,revalidation:r.revalidation,component:g,error:f,children:m(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):m()},null)}var D0=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(D0||{}),Wl=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}(Wl||{});function hR(e){let t=w.useContext(Pf);return t||De(!1),t}function fR(e){let t=w.useContext(tR);return t||De(!1),t}function pR(e){let t=w.useContext(Ss);return t||De(!1),t}function U0(e){let t=pR(),r=t.matches[t.matches.length-1];return r.route.id||De(!1),r.route.id}function mR(){var e;let t=w.useContext(L0),r=fR(Wl.UseRouteError),n=U0(Wl.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function gR(){let{router:e}=hR(D0.UseNavigateStable),t=U0(Wl.UseNavigateStable),r=w.useRef(!1);return $0(()=>{r.current=!0}),w.useCallback(function(s,o){o===void 0&&(o={}),r.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,Ui({fromRouteId:t},o)))},[e,t])}function vR(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function cl(e){De(!1)}function yR(e){let{basename:t="/",children:r=null,location:n,navigationType:s=gn.Pop,navigator:o,static:i=!1,future:a}=e;ia()&&De(!1);let l=t.replace(/^\/*/,"/"),c=w.useMemo(()=>({basename:l,navigator:o,static:i,future:Ui({v7_relativeSplatPath:!1},a)}),[l,a,o,i]);typeof n=="string"&&(n=Ro(n));let{pathname:u="/",search:d="",hash:h="",state:f=null,key:x="default"}=n,g=w.useMemo(()=>{let b=Rf(u,l);return b==null?null:{location:{pathname:b,search:d,hash:h,state:f,key:x},navigationType:s}},[l,u,d,h,f,x,s]);return g==null?null:w.createElement(xs.Provider,{value:c},w.createElement(Rc.Provider,{children:r,value:g}))}function wR(e){let{children:t,location:r}=e;return oR(Wd(t),r)}new Promise(()=>{});function Wd(e,t){t===void 0&&(t=[]);let r=[];return w.Children.forEach(e,(n,s)=>{if(!w.isValidElement(n))return;let o=[...t,s];if(n.type===w.Fragment){r.push.apply(r,Wd(n.props.children,o));return}n.type!==cl&&De(!1),!n.props.index||!n.props.children||De(!1);let i={id:n.props.id||o.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(i.children=Wd(n.props.children,o)),r.push(i)}),r}/**
160 * React Router DOM v6.30.1
161 *
162 * Copyright (c) Remix Software Inc.
163 *
164 * This source code is licensed under the MIT license found in the
165 * LICENSE.md file in the root directory of this source tree.
166 *
167 * @license MIT
168 */function Kd(){return Kd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Kd.apply(this,arguments)}function bR(e,t){if(e==null)return{};var r={},n=Object.keys(e),s,o;for(o=0;o<n.length;o++)s=n[o],!(t.indexOf(s)>=0)&&(r[s]=e[s]);return r}function xR(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function SR(e,t){return e.button===0&&(!t||t==="_self")&&!xR(e)}const _R=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],ER="6";try{window.__reactRouterVersion=ER}catch{}const kR="startTransition",jm=vh[kR];function CR(e){let{basename:t,children:r,future:n,window:s}=e,o=w.useRef();o.current==null&&(o.current=AT({window:s,v5Compat:!0}));let i=o.current,[a,l]=w.useState({action:i.action,location:i.location}),{v7_startTransition:c}=n||{},u=w.useCallback(d=>{c&&jm?jm(()=>l(d)):l(d)},[l,c]);return w.useLayoutEffect(()=>i.listen(u),[i,u]),w.useEffect(()=>vR(n),[n]),w.createElement(yR,{basename:t,children:r,location:a.location,navigationType:a.action,navigator:i,future:n})}const TR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",RR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,PR=w.forwardRef(function(t,r){let{onClick:n,relative:s,reloadDocument:o,replace:i,state:a,target:l,to:c,preventScrollReset:u,viewTransition:d}=t,h=bR(t,_R),{basename:f}=w.useContext(xs),x,g=!1;if(typeof c=="string"&&RR.test(c)&&(x=c,TR))try{let y=new URL(window.location.href),S=c.startsWith("//")?new URL(y.protocol+c):new URL(c),E=Rf(S.pathname,f);S.origin===y.origin&&E!=null?c=E+S.search+S.hash:g=!0}catch{}let b=rR(c,{relative:s}),v=AR(c,{replace:i,state:a,target:l,preventScrollReset:u,relative:s,viewTransition:d});function m(y){n&&n(y),y.defaultPrevented||v(y)}return w.createElement("a",Kd({},h,{href:x||b,onClick:g||o?n:m,ref:r,target:l}))});var Om;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Om||(Om={}));var Im;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Im||(Im={}));function AR(e,t){let{target:r,replace:n,state:s,preventScrollReset:o,relative:i,viewTransition:a}=t===void 0?{}:t,l=nR(),c=aa(),u=M0(e,{relative:i});return w.useCallback(d=>
168{if(SR(d,r)){d.preventDefault();let h=n!==void 0?n:Vl(c)===Vl(u);l(e,{replace:h,state:s,preventScrollReset:o,relative:i,viewTransition:a})}},[c,l,u,n,s,r,e,o,i,a])}const ts=w.forwardRef(({className:e,type:t,...r},n)=>p.jsx("input",{type:t,className:le("flex h-10 w-full rounded-md border border-input bg-background px-3 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:n,...r}));ts.displayName="Input";const NR=na("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"}}),We=w.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},o)=>{const i=n?vE:"button";return p.jsx(i,{className:le(NR({variant:t,size:r,className:e})),ref:o,...s})});We.displayName="Button";const jR=na("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 F0({className:e,variant:t,...r}){return p.jsx("div",{className:le(jR({variant:t}),e),...r})}function B0(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Pc="Checkbox",[OR,_I]=Mn(Pc),[IR,Af]=OR(Pc);function LR(e){const{__scopeCheckbox:t,checked:r,children:n,defaultChecked:s,disabled:o,form:i,name:a,onCheckedChange:l,required:c,value:u="on",internal_do_not_use_render:d}=e,[h,f]=wo({prop:r,defaultProp:s??!1,onChange:l,caller:Pc}),[x,g]=w.useState(null),[b,v]=w.useState(null),m=w.useRef(!1),y=x?!!i||!!x.closest("form"):!0,S={checked:h,disabled:o,setChecked:f,control:x,setControl:g,name:a,form:i,value:u,hasConsumerStoppedPropagationRef:m,required:c,defaultChecked:Cn(s)?!1:s,isFormControl:y,bubbleInput:b,setBubbleInput:v};return p.jsx(IR,{scope:t,...S,children:$R(d)?d(S):n})}var z0="CheckboxTrigger",H0=w.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...n},s)=>{const{control:o,value:i,disabled:a,checked:l,required:c,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:h,isFormControl:f,bubbleInput:x}=Af(z0,e),g=Se(s,u),b=w.useRef(l);return w.useEffect(()=>{const v=o==null?void 0:o.form;if(v){const m=()=>d(b.current);return v.addEventListener("reset",m),()=>v.removeEventListener("reset",m)}},[o,d]),p.jsx(re.button,{type:"button",role:"checkbox","aria-checked":Cn(l)?"mixed":l,"aria-required":c,"data-state":G0(l),"data-disabled":a?"":void 0,disabled:a,value:i,...n,ref:g,onKeyDown:X(t,v=>{v.key==="Enter"&&v.preventDefault()}),onClick:X(r,v=>{d(m=>Cn(m)?!0:!m),x&&f&&(h.current=v.isPropagationStopped(),h.current||v.stopPropagation())})})});H0.displayName=z0;var Nf=w.forwardRef((e,t)=>
168{const{__scopeCheckbox:r,name:n,checked:s,defaultChecked:o,required:i,disabled:a,value:l,onCheckedChange:c,form:u,...d}=e;return p.jsx(LR,{__scopeCheckbox:r,checked:s,defaultChecked:o,disabled:a,required:i,onCheckedChange:c,name:n,form:u,value:l,internal_do_not_use_render:({isFormControl:h})=>p.jsxs(p.Fragment,{children:[p.jsx(H0,{...d,ref:t,__scopeCheckbox:r}),h&&p.jsx(q0,{__scopeCheckbox:r})]})})});Nf.displayName=Pc;var V0="CheckboxIndicator",W0=w.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...s}=e,o=Af(V0,r);return p.jsx(ta,{present:n||Cn(o.checked)||o.checked===!0,children:p.jsx(re.span,{"data-state":G0(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});W0.displayName=V0;var K0="CheckboxBubbleInput",q0=w.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:n,hasConsumerStoppedPropagationRef:s,checked:o,defaultChecked:i,required:a,disabled:l,name:c,value:u,form:d,bubbleInput:h,setBubbleInput:f}=Af(K0,e),x=Se(r,f),g=B0(o),b=t0(n);w.useEffect(()=>{const m=h;if(!m)return;const y=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(y,"checked").set,_=!s.current;if(g!==o&&E){const T=new Event("click",{bubbles:_});m.indeterminate=Cn(o),E.call(m,Cn(o)?!1:o),m.dispatchEvent(T)}},[h,g,o,s]);const v=w.useRef(Cn(o)?!1:o);return p.jsx(re.input,{type:"checkbox","aria-hidden":!0,defaultChecked:i??v.current,required:a,disabled:l,name:c,value:u,form:d,...t,tabIndex:-1,ref:x,style:{...t.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});q0.displayName=K0;function $R(e){return typeof e=="function"}function Cn(e){return e==="indeterminate"}function G0(e){return Cn(e)?"indeterminate":e?"checked":"unchecked"}const ul=w.forwardRef(({className:e,...t},r)=>p.jsx(Nf,{ref:r,className:le("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-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),...t,children:p.jsx(W0,{className:le("flex items-center justify-center text-current"),children:p.jsx(Lw,{className:"h-4 w-4"})})}));ul.displayName=Nf.displayName;const MR=[{label:"Show Ballet Company",phrase:"Ballet Company"},{label:"Show Special Preparatory Ballet Company",phrase:"Special Preparatory Ballet"},{label:"Show Junior Preparatory Ballet Company",phrase:"Junior Preparatory Ballet"},{label:"Show Ballet Variations",phrase:"Variations"},{label:"Show Acro",phrase:"Acro"}],DR=[{label:"Ballet",placeholder:"e.g., IA, IIB, III"},{label:"Pointe",placeholder:"Pre-pointe, Beg, Int, Adv"},{label:"Jazz",placeholder:"1, 2, 3, 4, 5"},{label:"Contemporary",placeholder:"3,4,5"},{label:"Lyrical",placeholder:"1, 2"},{label:"Tap",placeholder:"1,2,3,4,5"},{label:"Conditioning",placeholder:"Teen, Senior"},{label:"Hip-Hop",placeholder:"1, 2, 3, Adv"},{label:"Company Class",placeholder:"Mini, Junior, Teen, Senior"},{label:"Rehearsal",placeholder:"Enter PC group #s separated by commas"}],UR=({onFilterChange:e,availableTypes:t,availableDays:r})=>{const[n,s]=w.useState(!0),[o,i]=w.useState({type:[],age:"",keyword:"",className:"",showAdultClasses:!1,days:[],personalLevels:{},companies:[]}),a=h=>{const f={...o,...h};i(f),e(f)},l=h=>{const f=o.type.includes(h)?o.type.filter(x=>x!==h):[...o.type,h];a({type:f})},c=h=>{const f=o.days.includes(h)?o.days.filter(x=>x!==h):[...o.days,h];a({days:f})},u=()=>{const h={type:[],age:"",keyword:"",className:"",showAdultClasses:!1,days:[],personalLevels:{},companies:[]};i(h),e(h)},d=o.type.length>0||o.age||o.keyword||o.className||o.showAdultClasses||o.days.length>0||Object.values(o.personalLevels).some(h=>h&&h.trim())||o.companies.length>0;return p.jsxs("div",{className:"bg-background border border-border rounded-lg p-6 mb-6",children:[p.jsxs("div",{className:"flex items-center justify-between mb-1",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(vk,{className:"h-5 w-5 text-muted-foreground"}),p.jsx("h2",{className:"font-manrope text-lg font-bold tracking-wider",children:"FIND THE PERFECT CLASS!"})]}),p.jsx("button",{type:"button",onClick:()=>
168s(!n),className:"text-sm font-semibold text-white bg-[#367588] hover:bg-[#2a5c6b] font-manrope flex items-center gap-1 px-3 py-1 rounded-full transition-colors",children:n?"Hide filters":"Show filters"})]}),p.jsx("p",{className:"text-sm text-muted-foreground mb-4 font-manrope",children:"Use the text fields or the buttons to filter the schedule for your needs!"}),p.jsxs("div",{className:n?"space-y-4":"hidden",children:[p.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[p.jsxs("div",{children:[p.jsx("label",{className:"text-sm font-medium text-foreground mb-2 block",children:"Class name:"}),p.jsx(ts,{placeholder:"Search class names...",value:o.className,onChange:h=>a({className:h.target.value}),className:"font-manrope"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"text-sm font-medium text-foreground mb-2 block",children:"Keyword:"}),p.jsx(ts,{placeholder:"Search keywords or instructor...",value:o.keyword,onChange:h=>a({keyword:h.target.value}),className:"font-manrope"})]}),p.jsxs("div",{children:[p.jsx("label",{className:"text-sm font-medium text-foreground mb-2 block",children:"Age:"}),p.jsx(ts,{placeholder:"Enter age (e.g., 7)",value:o.age,onChange:h=>a({age:h.target.value}),className:"font-manrope"})]})]}),p.jsxs("div",{children:[p.jsx("label",{className:"text-sm font-medium text-foreground mb-2 block",children:"Class types:"}),p.jsx("div",{className:"flex flex-wrap gap-2",children:t.map(h=>{const f=o.type.includes(h);return p.jsx(F0,{variant:"outline",className:`
169                    cursor-pointer font-manrope font-normal text-sm rounded-[4px] px-2 py-[3px]
170                    ${f?"!bg-schedule-button !text-white !border-schedule-button hover:!bg-schedule-button-hover":"bg-background text-foreground border-border hover:bg-muted"}
171                  `,onClick:()=>l(h),children:h},h)})})]}),p.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-3 md:mt-6",children:[p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(ul,{id:"show-adult-classes",checked:o.showAdultClasses,onCheckedChange:h=>a({showAdultClasses:h===!0})}),p.jsx("label",{htmlFor:"show-adult-classes",className:"text-sm font-medium text-foreground cursor-pointer font-manrope whitespace-nowrap",children:"Show adult classes"})]}),p.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[p.jsx("span",{className:"text-sm font-medium text-foreground font-manrope whitespace-nowrap",children:"Filter by day:"}),r.map(h=>p.jsxs("div",{className:"flex items-center gap-1.5",children:[p.jsx(ul,{id:`day-filter-${h}`,checked:o.days.includes(h),onCheckedChange:f=>c(h)}),p.jsx("label",{htmlFor:`day-filter-${h}`,className:"text-sm font-medium text-foreground cursor-pointer font-manrope whitespace-nowrap",children:h})]},h))]})]}),p.jsxs("div",{className:"pt-8 border-t-2 border-schedule-day-line",children:[p.jsxs("h3",{className:"text-lg font-bold tracking-wider mb-3 font-manrope",style:{color:"#367588"},children:[p.jsx("span",{className:"text-pink-500",children:"✱ ✱"})," RETURNING FAMILIES ",p.jsx("span",{className:"text-pink-500",children:"✱ ✱"})]}),p.jsx("label",{className:"text-sm font-semibold text-foreground mb-1 block font-manrope uppercase tracking-wider",children:"Create your personalized schedule"}),p.jsx("p",{className:"text-sm text-muted-foreground mb-1 font-manrope",children:"Enter the level for any category to show only matching classes. Use commas to search multiple values."}),p.jsx("p",{className:"text-sm text-muted-foreground mb-3 font-manrope italic",children:"The schedule will automatically filter below. If you want to create a final view of your personal schedule before registering, click the X on any class you don't want, and you can print (or save to PDF) a copy."}),p.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-x-2 gap-y-1 md:gap-x-3 md:gap-y-2",children:DR.map(({label:h,placeholder:f})=>p.jsxs("div",{className:"min-w-0",children:[p.jsxs("label",{className:"text-xs md:text-sm font-medium text-foreground mb-0 block font-manrope leading-tight",children:[h,":"]}),p.jsx(ts,{placeholder:f,value:o.personalLevels[h]||"",onChange:x=>a({personalLevels:{...o.personalLevels,[h]:x.target.value}}),className:"font-manrope h-7 md:h-9 text-sm px-2"})]},h))}),p.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-2 mt-4",children:MR.map(({label:h,phrase:f})=>{const x=`company-${f.replace(/\s+/g,"-").toLowerCase()}`,g=o.companies.includes(f);return p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx(ul,{id:x,checked:g,onCheckedChange:b=>{const v=b===!0?[...o.companies,f]:o.companies.filter(m=>m!==f);a({companies:v})}}),p.jsx("label",{htmlFor:x,className:"text-xs font-medium text-foreground cursor-pointer font-manrope",children:h})]},f)})})]})]}),d&&p.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-border",children:[p.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[p.jsx("span",{children:"Active filters:"}),o.type.length>0&&p.jsxs("span",{className:"font-medium",children:[o.type.length," type(s)"]}),o.age&&p.jsxs("span",{className:"font-medium",children:["Age: ",o.age]}),o.keyword&&p.jsxs("span",{className:"font-medium",children:['"',o.keyword,'"']}
171),o.className&&p.jsxs("span",{className:"font-medium",children:['Class: "',o.className,'"']}),o.days.length>0&&p.jsxs("span",{className:"font-medium",children:[o.days.length," day(s)"]})]}),p.jsxs(We,{variant:"ghost",size:"sm",onClick:u,className:"text-muted-foreground hover:text-foreground font-manrope",children:[p.jsx(Oi,{className:"h-4 w-4 mr-1"}),"Clear all"]})]})]})},FR=({day:e,date:t,isExpanded:r,onToggle:n,itemCount:s})=>p.jsxs(We,{variant:"ghost",className:"relative w-full justify-center py-2 px-4 h-auto bg-schedule-header-bg text-schedule-header-text hover:bg-schedule-header-bg/90 font-bebas text-xl font-normal rounded-none focus-visible:outline-none focus-visible:ring-0 border-b-4 border-schedule-day-line",onClick:n,children:[p.jsx("div",{className:"text-xl font-bebas tracking-wider uppercase",children:e}),p.jsxs("div",{className:"absolute right-4 flex items-center gap-3",children:[s>0&&p.jsxs("span",{className:"text-sm bg-schedule-header-text/20 px-2 py-1 rounded font-manrope",children:[s," class",s!==1?"es":""]}),r?p.jsx(pf,{className:"h-5 w-5"}):p.jsx(uk,{className:"h-5 w-5"})]})]}),BR="https://app.jackrabbitclass.com/jr4.0/ParentPortal/Login?orgId=558513",Lm=e=>/krew|dcdt|connector/i.test(`${e.name||""} ${e.type||""}`),$m=({item:e,isEven:t,variant:r="both",visibleCols:n={type:!0,age:!0,price:!0,register:!0},gridTemplate:s,dayAbbrev:o,onRemove:i})=>{const a=e.notes&&e.notes.trim().length>0,l=e.openings>0,u=!!e.registerUrl?l?"register":"waitlist":"none",d=`font-manrope ${l?"text-foreground":"text-schedule-warning"}`,h=e.startTime&&e.endTime?`${e.startTime} - ${e.endTime}`:e.startTime||e.time||"",f=(e.room||"").trim(),x=(e.instructor||"").trim(),g=(f||x)&&p.jsxs("div",{className:"text-xs text-muted-foreground mt-1 font-manrope leading-snug",children:[f&&p.jsxs(p.Fragment,{children:["in ",p.jsx("strong",{children:f})]}),f&&x&&" ",x&&p.jsxs(p.Fragment,{children:["with ",p.jsx("strong",{children:x})]})]}),b=E=>{if(u==="none")return p.jsx("span",{className:"text-xs text-muted-foreground font-manrope italic",children:Lm(e)?"By invitation - contact us":"Please email us for placement"});const _=u==="waitlist"?"Join Waitlist":"Register";return p.jsx(We,{size:"sm",className:`${E} text-xs font-manrope bg-schedule-button text-white hover:bg-schedule-button-hover`,asChild:!0,children:p.jsxs("a",{href:BR,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1",children:[_,p.jsx(mf,{className:"w-3 h-3"})]})})},v=r==="both"||r==="desktop",m=r==="both"||r==="mobile",y=r==="desktop"?"grid":r==="mobile"?"hidden":"hidden md:grid",S=r==="mobile"?"block":r==="desktop"?"hidden":"md:hidden";return p.jsxs(p.Fragment,{children:[v&&p.jsxs("div",{className:`${y} items-start px-4 py-3 hover:bg-muted/30 transition-colors gap-3 border-b border-border/60 ${t?"bg-background":"bg-muted/10"}`,style:{gridTemplateColumns:s},children:[p.jsx("div",{className:"whitespace-nowrap font-semibold text-foreground font-manrope text-sm",children:o||""}),p.jsx("div",{className:"whitespace-nowrap font-medium text-foreground font-manrope text-sm",children:h}),p.jsxs("div",{className:"min-w-0 pl-6",children:[p.jsx("div",{className:`${d} font-medium break-words text-sm`,title:e.name,children:e.name}),g,a&&p.jsxs("div",{className:"text-xs text-muted-foreground mt-1 pr-2 font-manrope leading-relaxed break-words",children:[p.jsx("span",{className:"font-semibold",children:"Description/Requirements: "}),e.notes]})]}),n.type&&p.jsx("div",{className:"flex items-center justify-center",children:e.type&&p.jsx(F0,{variant:"secondary",className:"font-manrope font-normal text-sm justify-center text-center",children:e.type})}),n.age&&p.jsx("div",{className:"whitespace-nowrap text-muted-foreground font-manrope text-sm",children:e.age}),n.price&&p.jsx("div",{className:"whitespace-nowrap text-muted-foreground font-manrope text-sm pl-5",children:e.price||""}),n.register&&p.jsx("div",{className:"whitespace-nowrap",children:b("h-7")}),i&&p.jsx("div",{className:"flex items-center justify-end",children:p.jsx("button",{type:"button",onClick:i,"aria-label":`Remove ${e.name} from my schedule`,title:"Remove from my schedule",className:"text-muted-foreground hover:text-schedule-warning transition-colors p-1 rounded",children:p.jsx(Oi,{className:"w-4 h-4"})})})]}),m&&p.jsx("div",{className:`${S} p-4 hover:bg-muted/30 transition-colors ${t?"bg-background":"bg-muted/10"}`,children:p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"flex justify-between items-start gap-2",children:[p.jsx("div",{className:`font-manrope font-medium text-sm ${d}`,children:e.name}),p.jsxs("div",{className:"flex items-start gap-2",children:[p.jsx("div",{className:"text-sm text-muted-foreground font-manrope whitespace-nowrap",children:h}),i&&p.jsx("button",{type:"button",onClick:i,"aria-label":`Remove ${e.name} from my schedule`,className:"text-muted-foreground hover:text-schedule-warning transition-colors -mt-0.5",children:p.jsx(Oi,{className:"w-4 h-4"})})]})]}),p.jsxs("div",{className:"flex flex-wrap gap-2 text-sm text-muted-foreground font-manrope items-center",children:[e.age&&p.jsxs("span",{children:["Age: ",e.age]}),e.type&&p.jsxs("span",{children:["Type: ",e.type]}),e.price&&p.jsx("span",{children:e.price})]}),g,a&&p.jsx("div",{className:"text-xs text-muted-foreground font-manrope leading-relaxed",children:e.notes}),u!=="none"?p.jsx("div",{children:b("h-8")}):p.jsx("div",{className:"text-xs text-muted-foreground font-manrope italic",children:Lm(e)?"By invitation - contact us":"Please email us for placement"})]})})]})},zR={ballet:{bg:"#EDE7F6",border:"#7E57C2",text:"#4527A0"},pointe:{bg:"#E8EAF6",border:"#3F51B5",text:"#283593"}
171,jazz:{bg:"#FFF3E0",border:"#FB8C00",text:"#E65100"},lyrical:{bg:"#E0F2F1",border:"#26A69A",text:"#00695C"},contemporary:{bg:"#E1F5FE",border:"#0288D1",text:"#01579B"},"hip-hop":{bg:"#FFEBEE",border:"#E53935",text:"#B71C1C"},hiphop:{bg:"#FFEBEE",border:"#E53935",text:"#B71C1C"},tap:{bg:"#F9FBE7",border:"#AFB42B",text:"#827717"},acro:{bg:"#E8F5E9",border:"#43A047",text:"#1B5E20"},"company class":{bg:"#FCE4EC",border:"#AD1457",text:"#880E4F"},rehearsal:{bg:"#ECEFF1",border:"#90A4AE",text:"#37474F"},exercise:{bg:"#E8F5E9",border:"#2E7D32",text:"#1B5E20"},conditioning:{bg:"#E8F5E9",border:"#2E7D32",text:"#1B5E20"},preschool:{bg:"#FFF8E1",border:"#F9A825",text:"#F57F17"},kinder:{bg:"#FCE4EC",border:"#EC407A",text:"#AD1457"},"parent & me":{bg:"#EFEBE9",border:"#8D6E63",text:"#4E342E"}},HR={bg:"#F1F5F9",border:"#64748B",text:"#334155"},J0=e=>{const t=(e||"").trim().toLowerCase();return zR[t]||HR},Mm=e=>{if(!e)return null;const r=e.trim().toLowerCase().replace(/\s+/g,"").match(/^(\d{1,2})(?::(\d{2}))?(am|pm)?$/);if(!r)return null;let n=parseInt(r[1],10);const s=r[2]?parseInt(r[2],10):0,o=r[3];return o==="pm"&&n<12&&(n+=12),o==="am"&&n===12&&(n=0),n*60+s},VR=e=>{const t=(e+11)%12+1,r=e<12||e===24?"a":"p";return`${t}${r}`},Ia=e=>{const t=Math.floor(e/60),r=e%60,n=(t+11)%12+1,s=t<12?"a":"p";return r===0?`${n}${s}`:`${n}:${String(r).padStart(2,"0")}${s}`},WR=e=>{const t=e.map(i=>{const a=Mm(i.startTime||i.time);let l=Mm(i.endTime);return a==null?null:((l==null||l<=a)&&(l=a+45),{item:i,start:a,end:l})}).filter(i=>!!i).sort((i,a)=>i.start-a.start||i.end-a.end),r=[];let n=[],s=-1;const o=()=>{const i=n.reduce((a,l)=>Math.max(a,l.col+1),0);n.forEach(a=>{r.push({...a,cols:i})}),n=[],s=-1};for(const i of t){n.length>0&&i.start>=s&&o();const a=[];n.forEach(c=>{a[c.col]=Math.max(a[c.col]??0,c.rawEnd)});let l=0;for(;a[l]!=null&&a[l]>i.start;)l++;n.push({item:i.item,start:i.start,end:i.end,col:l,cols:0,rawEnd:i.end}),s=Math.max(s,i.end)}return o(),r},La=80,KR=70,qR="https://app.jackrabbitclass.com/jr4.0/ParentPortal/Login?orgId=558513",Dm=e=>/krew|dcdt|connector/i.test(`${e.name||""} ${e.type||""}`),GR=e=>{const t=(e.room||"").trim(),r=(e.instructor||"").trim(),n=[];return t&&n.push(`in ${t}`),r&&n.push(`with ${r}`),n.join(" ")},JR=({item:e})=>{const t=(e.room||"").trim(),r=(e.instructor||"").trim();return!t&&!r?null:p.jsxs("span",{className:"text-[10px] font-manrope leading-tight opacity-70 truncate",children:[t&&p.jsxs(p.Fragment,{children:["in ",p.jsx("span",{className:"font-bold",children:t})]}),t&&r&&" ",r&&p.jsxs(p.Fragment,{children:["with ",p.jsx("span",{className:"font-bold",children:r})]})]})},QR=({items:e,onRemove:t})=>{const{positioned:r,startHour:n,endHour:s}=w.useMemo(()=>{const l=WR(e);if(l.length===0)return{positioned:l,startHour:9,endHour:21};const c=Math.min(...l.map(d=>d.start)),u=Math.max(...l.map(d=>d.end));return{positioned:l,startHour:Math.floor(c/60),endHour:Math.ceil(u/60)}},[e]);if(r.length===0)return p.jsx("div",{className:"p-6 text-center text-sm text-muted-foreground font-manrope",children:"No classes to display."});const o=s-n,i=o*La,a=48;return p.jsx("div",{className:"p-2 md:p-3 overflow-x-hidden md:overflow-x-auto w-full max-w-full",children:p.jsxs("div",{className:"relative w-full min-w-0 md:min-w-[600px]",style:{height:i},children:[Array.from({length:o+1}).map((l,c)=>{const u=n+c,d=c*La;return p.jsxs("div",{children:[p.jsx("div",{className:"absolute left-0 right-0 border-t border-border/60",style:{to
171p:d}}),p.jsx("div",{className:"absolute left-0 text-xs text-muted-foreground font-manrope -translate-y-1/2",style:{top:d,width:a-8},children:VR(u)})]},c)}),p.jsx("div",{className:"absolute top-0 bottom-0",style:{left:a,right:0},children:r.map((l,c)=>{const u=(l.start-n*60)/60*La,d=Math.max(KR,(l.end-l.start)/60*La-4),h=100/l.cols,f=l.col*h,x=J0(l.item.type),g=l.item.price&&String(l.item.price).trim()?`${String(l.item.price).trim()}/month`:"",b=[l.item.age,g].filter(R=>R&&String(R).trim()).join(" · "),v=!!b&&d>=40,m=!!(l.item.room||l.item.instructor),y=m&&d>=40,S=!!l.item.registerUrl,E=S&&!(Number(l.item.openings)>0),_=S,T=!S;return p.jsxs("div",{className:"absolute rounded-md px-2 py-1 overflow-hidden shadow-sm flex flex-col",style:{top:u,height:d,left:`calc(${f}% + 2px)`,width:`calc(${h}% - 4px)`,background:x.bg,borderLeft:`3px solid ${x.border}`,color:x.text},title:`${l.item.name} • ${Ia(l.start)}–${Ia(l.end)}${m?` • ${GR(l.item)}`:""}${l.item.type?` • ${l.item.type}`:""}${l.item.age?` • ${l.item.age}`:""}${g?` • ${g}`:""}${S?` • ${E?"Waitlist":"Registration open"}`:` • ${Dm(l.item)?"By invitation - contact us":"Email us for placement"}`}${l.item.notes?`
172
173${l.item.notes}`:""}`,children:[t&&p.jsx("button",{type:"button",onClick:R=>{R.stopPropagation(),t(l.item)},"aria-label":`Remove ${l.item.name} from my schedule`,title:"Remove from my schedule",className:"absolute top-0 right-0 z-10 p-0 m-0 leading-none text-sm font-bold h-6 w-6 flex items-center justify-center rounded-md bg-white/90 shadow-sm opacity-75 hover:opacity-100 focus:opacity-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-current cursor-pointer",style:{color:x.text,pointerEvents:"auto"},children:"×"}),p.jsxs("div",{className:"pr-6 text-xs font-manrope font-semibold leading-tight break-words",children:[p.jsx("span",{children:l.item.name}),p.jsxs("span",{className:"ml-1 whitespace-nowrap opacity-80",children:[Ia(l.start),"–",Ia(l.end)]})]}),y&&p.jsx(JR,{item:l.item}),v&&p.jsx("div",{className:"text-[10px] font-manrope leading-tight opacity-75 truncate",children:b}),T&&p.jsx("div",{className:"text-[9px] font-manrope italic opacity-90 truncate",children:Dm(l.item)?"By invitation - contact us":"Please email us for placement"}),_&&p.jsx("a",{href:qR,target:"_blank",rel:"noopener noreferrer",onClick:R=>R.stopPropagation(),className:"mt-auto self-end inline-block rounded-full px-1.5 py-[2px] text-[9px] font-manrope font-bold uppercase tracking-wide no-underline bg-[#367588] text-white hover:bg-[#2b5f6f]",children:E?"Waitlist ↗":"Register ↗"})]},c)})})]})})},YR=({types:e})=>e.length===0?null:p.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-2 p-3 border border-border rounded-md bg-background mb-3",children:e.map(t=>{const r=J0(t);return p.jsxs("div",{className:"flex items-center gap-2 text-sm font-manrope",children:[p.jsx("span",{className:"inline-block w-3 h-3 rounded-sm",style:{background:r.border}}),p.jsx("span",{className:"text-foreground",children:t})]},t)})}),XR=e=>/krew|dcdt|connector/i.test(`${e.name||""} ${e.type||""}`),ZR=({days:e,visibleCols:t})=>{const r=new Date().toLocaleDateString(void 0,{month:"long",day:"numeric",year:"numeric"}),n=p.jsxs("div",{id:"print-schedule",className:"hidden print:block",children:[p.jsx("h1",{className:"print-title",children:"My Schedule"}),p.jsxs("p",{className:"print-subtitle",children:["Printed ",r]}),e.map(s=>p.jsxs("div",{className:"print-day",children:[p.jsxs("h2",{className:"print-day-title",children:[s.day,s.date?` — ${s.date}`:""]}),p.jsxs("table",{className:"print-table",children:[p.jsx("thead",{children:p.jsxs("tr",{children:[p.jsx("th",{children:"Time"}),p.jsx("th",{children:"Class Name"}),t.type&&p.jsx("th",{children:"Type"}),t.age&&p.jsx("th",{children:"Age"}),t.price&&p.jsx("th",{children:"Monthly Rate"}),t.register&&p.jsx("th",{children:"Registration"})]})}),p.jsx("tbody",{children:s.items.map((o,i)=>p.jsxs("tr",{children:[p.jsx("td",{className:"print-nowrap",children:o.startTime&&o.endTime?`${o.startTime} – ${o.endTime}`:o.startTime||o.time||""}),p.jsx("td",{children:o.name}),t.type&&p.jsx("td",{children:o.type}),t.age&&p.jsx("td",{children:o.age}),t.price&&p.jsx("td",{children:o.price||""}),t.register&&p.jsx("td",{className:"print-nowrap",children:o.registerUrl?Number(o.openings)>0?"Register":"Waitlist":XR(o)?"By invitation - contact us":"Please email us for placement"})]},`${o.name}-${o.startTime}-${i}`))})]})]},s.date?`${s.day}|${s.date}`:s.day)),e.length===0&&p.jsx("p",{children:"No classes selected."})]});return typeof document<"u"?$n.createPortal(n,document.body):null},eP="https://app.jackrabbitclass.com/jr4.0/ParentPortal/Login?orgId=558513",tP=e=>/krew|dcdt|connector/i.test(`${e.name||""} ${e.type||""}`),rP=e=>e.startTime&&e.endTime?`${e.startTime} – ${e.endTime}`:e.startTime||e.time||"",nP=({item:e})=>
173{const t=(e.room||"").trim(),r=(e.instructor||"").trim();return!t&&!r?null:p.jsxs("div",{className:"text-xs text-muted-foreground leading-snug",children:[t&&p.jsxs(p.Fragment,{children:["in ",p.jsx("strong",{children:t})]}),t&&r&&" ",r&&p.jsxs(p.Fragment,{children:["with ",p.jsx("strong",{children:r})]})]})},sP=({days:e,onRemove:t})=>p.jsx("div",{className:"w-full overflow-x-auto overscroll-x-contain pb-2",children:p.jsx("div",{className:"grid min-w-max grid-flow-col auto-cols-[minmax(220px,1fr)] gap-2 lg:min-w-full lg:auto-cols-fr",children:e.map(r=>p.jsxs("section",{className:"w-[220px] lg:w-auto border border-schedule-item-border bg-background",children:[p.jsxs("header",{className:"border-b-4 border-schedule-day-line bg-schedule-header-bg px-3 py-2 text-center text-schedule-header-text",children:[p.jsx("h2",{className:"font-bebas text-xl uppercase tracking-wider",children:r.day}),p.jsxs("div",{className:"font-manrope text-xs opacity-80",children:[r.items.length," ",r.items.length===1?"class":"classes"]})]}),p.jsx("div",{className:"divide-y divide-border",children:r.items.map((n,s)=>{const o=!!n.registerUrl,i=o&&!(Number(n.openings)>0),a=n.price&&String(n.price).trim()?`${String(n.price).trim()}/month`:"",l=[n.age,a].filter(Boolean).join(" · ");return p.jsxs("article",{className:"relative min-h-[118px] p-3 pr-9 font-manrope odd:bg-muted/10",children:[p.jsx(We,{type:"button",size:"icon",variant:"ghost",className:"absolute right-1 top-1 h-7 w-7 text-muted-foreground hover:text-schedule-warning",onClick:()=>t(r.day,n),"aria-label":`Remove ${n.name} from my schedule`,title:"Remove from my schedule",children:p.jsx(Oi,{className:"h-4 w-4"})}),p.jsxs("div",{className:"text-sm font-semibold leading-snug text-foreground",children:[n.name," ",p.jsxs("span",{className:"whitespace-nowrap",children:["· ",rP(n)]})]}),p.jsx(nP,{item:n}),l&&p.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:l}),o?p.jsx(We,{size:"sm",className:"mt-2 h-7 px-2 text-xs bg-schedule-button text-primary-foreground hover:bg-schedule-button-hover",asChild:!0,children:p.jsxs("a",{href:eP,target:"_blank",rel:"noopener noreferrer",children:[i?"Join Waitlist":"Register"," ",p.jsx(mf,{className:"ml-1 h-3 w-3"})]})}):p.jsx("div",{className:"mt-1 text-[11px] italic text-muted-foreground",children:tP(n)?"By invitation - contact us":"Please email us for placement"})]},`${n.name}-${n.startTime}-${s}`)})})]},r.date?`${r.day}|${r.date}`:r.day))})}),Um=(e,t)=>`${e}|${t.startTime||t.time||""}|${t.name}`,Q0=({scheduleData:e,embedded:t=!1})=>{const[r,n]=w.useState(new Set),[s,o]=w.useState("calendar"),[i,a]=w.useState(new Set),[l,c]=w.useState({}),[u,d]=w.useState({type:[],age:"",keyword:"",className:"",showAdultClasses:!1,days:[],personalLevels:{},companies:[]}),h=w.useMemo(()=>{const C=new Set;return e.forEach(k=>{k.items.forEach(N=>{C.add(N.type)})}),Array.from(C).sort()},[e]),f=w.useMemo(()=>{const C=k=>e.some(N=>N.items.some(U=>{const L=k(U);return typeof L=="string"?L.trim().length>0:!!L}));return{type:C(k=>k.type),age:C(k=>k.age),price:C(k=>k.price),register:C(k=>k.registerUrl)||e.some(k=>k.items.length>0)}},[e]),x=w.useMemo(()=>["45px","150px","minmax(280px,1fr)",f.type&&"110px",f.age&&"90px",f.price&&"150px",f.register&&"130px","36px"].filter(
173Boolean).join(" "),[f]),g=C=>{const k=(C||"").trim().slice(0,3).toLowerCase();return{mon:"M",tue:"Tu",wed:"W",thu:"Th",fri:"F",sat:"Sa",sun:"Su"}[k]||C},b={1:"i",2:"ii",3:"iii",4:"iv",5:"v",6:"vi",7:"vii",8:"viii",9:"ix",10:"x"},v=C=>{const k=/^(\d+)([a-z]*)$/i.exec(C);if(!k)return[C];const N=b[k[1]];return N?[C,N+(k[2]||"").toLowerCase()]:[C]},m=C=>{const k=C.toLowerCase().replace(/[^a-z0-9]/g,"");return k.startsWith("ballet")&&k!=="balletcompany"?"ballet":k},y=(C,k,N)=>{const U=C.toLowerCase().trim(),L=`${k} ${N}`.toLowerCase();return U==="ballet company"?!(!L.includes("ballet company")||/special\s*prep|junior\s*prep/.test(L)||/\bdcpc\b|\bdcdt\b|krew/.test(L)||/(?:^|\b)pc\s*#/.test(L)):U.startsWith("special preparatory")?/special\s*prep/.test(L):U.startsWith("junior preparatory")?/junior\s*prep/.test(L):U==="variations"?L.includes("variations"):L.includes(U)},S=(C,k)=>{if(k!=="ballet")return C.split(/\s+/).filter(Boolean);const N=C.toLowerCase().replace(/\s+/g,"");return/^(?:\d+|[ivx]+)[ab](?:\/[ab])?$/.test(N)?[N]:C.split(/\s+/).filter(Boolean)},E=(C,k,N=!1)=>{var Y,he;if(!C)return!1;const U=C.toLowerCase().trim(),L=((Y=U.match(/#\s*(\d+)/))==null?void 0:Y[1])||((he=U.match(/^\d+$/))==null?void 0:he[0]);if(N&&L)return new RegExp(`(?:pc\\s*)?#\\s*${L}(?!\\d)`,"i").test(k);const K=U.split(/\s+/).filter(Boolean);return K.length>0&&K.every(me=>k.toLowerCase().includes(me))},_=w.useMemo(()=>{const C=new Set;return e.forEach(k=>{C.add(k.day)}),Array.from(C).sort((k,N)=>{const U=["mon","tue","wed","thu","fri","sat","sun"],L=U.indexOf(k.slice(0,3).toLowerCase()),K=U.indexOf(N.slice(0,3).toLowerCase());return L!==-1&&K!==-1?L-K:L!==-1?-1:K!==-1?1:k.localeCompare(N)})},[e]),T=(C,k)=>{var ie,ne;const N=(k.name||"").toLowerCase(),U=(k.type||"").toLowerCase(),L=/krew|dcdt|connector/i.test(k.name||""),K=(k.name||"").replace(/\([^)]*\)/g," "),Y=!L&&(U.includes("rehearsal")||K.toLowerCase().includes("rehearsal")||/(?:^|\b)pc\s*#/i.test(K)),he=U.includes("company class")||N.includes("company class"),me=!!(((ie=u.personalLevels)==null?void 0:ie.Rehearsal)||"").trim(),F=!!(((ne=u.personalLevels)==null?void 0:ne["Company Class"])||"").trim()||(u.companies||[]).length>0,de=(u.companies||[]).some(G=>y(G,k.name||"",k.type||"")),ge=(()=>{const G=(u.keyword||"").trim().toLowerCase();if(!G)return!1;const ae=(k.instructor||"").toLowerCase(),oe=/\b(solo|duet|duo|trio)\b/i.test(k.name||""),Oe=`${ae} ${oe?(k.name||"").toLowerCase().replace(/[\/,]/g," "):""}`.trim();return Oe?G.split(",").map(Re=>Re.trim()).filter(Boolean).some(Re=>{const ut=Re.split(/\s+/).filter(Boolean);return ut.length>0&&ut.some(kr=>Oe.includes(kr))}):!1})();if(Y&&!me&&!de&&!ge||he&&!F&&!ge||u.days.length>0&&!u.days.includes(C)||u.type.length>0&&!u.type.includes(k.type))return!1;if(u.showAdultClasses){const G=/adult/i.test(k.name||""),ae=u.type.length>0||!!u.age||!!u.keyword||!!u.className||u.days.length>0||Object.values(u.personalLevels||{}).some(oe=>oe&&oe.trim())||(u.companies||[]).length>0;if(G)return!0;if(!ae)return!1}if(u.age){const G=parseInt(u.age);if(!isNaN(G)){const ae=k.age.toLowerCase();if(ae.includes("+")){const oe=parseInt(ae);if(G<oe)return!1}else if(ae.includes("-")){const[oe,Oe]=ae.split("-").map(Re=>parseInt(Re.trim()));if(G<oe||G>Oe)return!1}else{const oe=parseInt(ae);if(G!==oe)return!1}}}if(u.className){const G=k.name.toLowerCase(),ae=(k.type||"").toLowerCase().includes("rehearsal")||G.includes("rehearsal")||/(?:^|\b)pc\s*#/i.test(k.name),oe=u.className.toLowerCase().split(",").map(Oe=>Oe.trim()).filter(Boolean);if(oe.length>0&&!oe.some(Re=>E(Re,k.name,ae)))return!1}if(u.keyword){const G=`${k.name} ${k.instructor} ${k.type} ${k.age} ${k.notes}`.toLowerCase(),ae=u.keyword.toLowerCase().split(",").map(oe=>oe.trim()).filter(Boolean);if(ae.length>0&&!ae.some(Oe=>{const Re=Oe.split(/\s+/).filter(Boolean);return Re.length>0&&Re.every(ut=>G.includes(ut))})&&!ge)return!1}if(u.personalLevels||u.companies){const G=Object.entries(u.personalLevels||{}).filter(([,oe])=>oe&&oe.trim()),ae=u.companies||[];if(G.length>0||ae.length>0){const oe=k.name.toLowerCase(),Oe=(k.type||"").toLowerCase(),Re=`${oe} ${Oe}`,ut=G.some(([ir,ua])=>{const Je=m(ir),Fn=ua.toLowerCase().split(",").map(Ie=>
173Ie.trim()).filter(Boolean);if(Fn.length===0)return!1;if(Je==="rehearsal"){const Ie=`${k.name} ${k.notes||""}`;return Fn.some(yt=>E(yt,Ie,!0))}if(Je==="companyclass")return Oe.includes("company class")?Fn.some(Ie=>Ie.split(/\s+/).filter(Boolean).every(yt=>oe.includes(yt))):!1;const ar=(k.type||"").toLowerCase().replace(/[^a-z0-9]/g,"");if(ar==="rehearsal"&&Je!=="rehearsal")return!1;const Uc=ar===Je,Fc=new RegExp(`(?:^|[^a-z0-9])${Je}(?:[^a-z0-9]|$)`,"i").test(oe);return!Uc&&!Fc?!1:Fn.some(Ie=>{const yt=S(Ie,Je);return yt.length===0?!1:yt.every(No=>Je==="pointe"&&No==="adv"&&/(?:^|[^a-z0-9])(iv|v|vi)(?![a-hj-z0-9])/i.test(Re)?!0:(Je==="ballet"?v(No):[No]).some(qr=>{let Bn=`(?:^|[^a-z0-9])${qr.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}${Je==="ballet"?"(?![ivx0-9])":"(?![a-z0-9])"}`;if(Je==="ballet"){const Hn=/^([ivx]+)([ab])\/([ab])$/i.exec(qr),lr=/^([ivx]+)([ab]+)$/i.exec(qr);if(Hn){const jo=Hn[1].replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Vn=Hn[2].toLowerCase(),Wn=Hn[3].toLowerCase();Bn=`(?:^|[^a-z0-9])${jo}\\s*(?:${Vn}\\s*/\\s*${Wn}|${Wn}\\s*/\\s*${Vn})(?![ivx0-9])`}else if(lr){const jo=lr[1].replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),Vn=lr[2].toLowerCase(),Wn=Vn==="b"?"(?:\\s*b|\\s*a\\s*/\\s*b)":`\\s*${Vn}`;Bn=`(?:^|[^a-z0-9])${jo}${Wn}(?![ivx0-9])`}}return new RegExp(Bn,"i").test(Re)}))})}),kr=ae.some(ir=>y(ir,k.name||"",k.type||""));if(!ut&&!kr)return!1}}return!0},R=w.useMemo(()=>e.map(C=>({...C,items:C.items.filter(k=>T(C.day,k))})).filter(C=>C.items.length>0),[e,u]),P=w.useMemo(()=>i.size===0?R:R.map(C=>({...C,items:C.items.filter(k=>!i.has(Um(C.day,k)))})).filter(C=>C.items.length>0),[R,i]),j=w.useMemo(()=>R.reduce((C,k)=>C+k.items.length,0),[R]),B=w.useMemo(()=>P.reduce((C,k)=>C+k.items.length,0),[P]),I=j-B,W=(C,k)=>{a(N=>{const U=new Set(N);return U.add(Um(C,k)),U})},$=()=>a(new Set),Q=C=>{a(k=>{const N=new Set;return k.forEach(U=>{U.startsWith(`${C}|`)||N.add(U)}),N})},z=w.useMemo(()=>{const C={};return i.forEach(k=>{const N=k.split("|")[0];C[N]=(C[N]||0)+1}),C},[i]);w.useEffect(()=>{const C=P.map(k=>k.date?`${k.day}|${k.date}`:k.day);n(new Set(C))},[P]);const q=C=>{const k=new Set(r);k.has(C)?k.delete(C):k.add(C),n(k)};return p.jsxs("div",{className:"w-full max-w-6xl mx-auto bg-schedule-container-bg",children:[p.jsxs("div",{className:"p-4",children:[p.jsx(UR,{onFilterChange:d,availableTypes:h,availableDays:_}),p.jsxs("div",{className:"mt-3 flex flex-wrap items-center justify-between gap-2",children:[p.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[p.jsxs("span",{className:"text-sm text-foreground font-manrope font-semibold",children:[B," ",B===1?"class":"classes",I>0&&p.jsxs("span",{className:"text-muted-foreground font-normal",children:[" (",I," removed)"]})]}),p.jsxs(We,{type:"button",size:"sm",variant:"outline",className:"h-8 px-3 font-manrope",onClick:$,disabled:I===0,children:[p.jsx(im,{className:"w-4 h-4 mr-1"})," Restore all"]}),p.jsxs(We,{type:"button",size:"sm",className:"h-8 px-3 font-manrope bg-schedule-button text-white hover:bg-schedule-button-hover",onClick:()=>window.print(),disabled:B===0,children:[p.jsx(gk,{className:"w-4 h-4 mr-1"})," Print schedule"]})]}),p.jsxs("div",{className:"flex items-center gap-2",children:[p.jsx("span",{className:"text-sm text-muted-foreground font-manrope mr-1",children:"View:"}),p.jsxs("div",{className:"inline-flex rounded-md border border-border overflow-hidden",children:[p.jsxs(We,{type:"button",size:"sm",variant:s==="calendar"?"default":"ghost",className:"rounded-none h-8 px-3 font-manrope",onClick:()=>{o("calendar"),c({})},children:[p.jsx(sm,{className:"w-4 h-4 mr-1"})," Calendar"]}),p.jsxs(We,{type:"button",size:"sm",variant:s==="list"?"default":"ghost",className:"rounded-none h-8 px-3 font-manrope",onClick:()=>{o("list"),c({})},children:[p.jsx(om,{className:"w-4 h-4 mr-1"})," List"]}),p.jsxs(We,{type:"button",size:"sm",variant:s==="week"?"default":"ghost",className:"rounded-none h-8 px-3 font-manrope",onClick:()=>{o("week"),c({})},children:[p.jsx(hk,{className:"w-4 h-4 mr-1"})," Week"]})]})]})]})]}),p.jsxs("div",{className:"px-4 pb-4 space-y-1",children:[s==="calendar"&&P.length>0&&p.jsx(YR,{types:h}),s==="week"?p.jsx(sP,{days:P,onRemove:W}):P.map(C=>{const k=C.date?`${C.day}|${C.date}`:C.day,N=r.has(k),U=l[k]??s;return p.jsxs("div",{className:"bg-background border border-schedule-item-border overflow-hidden",children:[p.jsx(FR,{day:C.day,date:C.date,isExpanded:N,onToggle:()=>q(k),itemCount:C.items.length}),N&&p.jsxs("div",{className:"bg-background",children:[p.jsxs("div",{className:"flex items-center justify-end gap-2 px-4 pt-2",children:[(z[C.day]||0)>0&&p.jsxs("button",{type:"button",className:"px-2 py-1 text-xs font-manrope rounded-md border border-border bg-background text-foreground hover:bg-muted flex items-center gap-1",onClick:()=>Q(C.day),children:[p.jsx(im,{className:"w-3 h-3"})," Restore ",C.day]}),p.jsxs("div",{className:"inline-flex rounded-md border border-border overflow-hidden text-xs",children:[p.jsxs("button",{type:"button",className:`px-2 py-1 font-manrope flex items-center gap-1 ${U==="calendar"?"bg-schedule-day-line text-white":"bg-background text-foreground"}`,onClick:()=>c(L=>({...L,[k]:"calendar"})),children:[p.jsx(sm,{className:"w-3 h-3"})," Calendar"]}),p.jsxs("button",{type:"button",className:`px-2 py-1 font-manrope flex items-center gap-1 ${U==="list"?"bg-schedule-day-line text-white":"bg-background text-foreground"}`,onClick:()=>c(L=>({...L,[k]:"list"})),children:[p.jsx(om,{className:"w-3 h-3"})," List"]})]})]}),U==="calendar"?p.jsx(QR,{items:C.items,onRemove:L=>W(C.day,L)}):p.jsxs(p.Fragment,{children:[p.jsx("div",{className:"hidden md:block overflow-x-auto",children:p.jsxs("div",{className:"min-w-[900px]",children:[p.jsxs("div",{className:"grid px-4 py-2 bg-schedule-day-line text-white text-sm font-semibold uppercase tracking-wider border-t-2 border-b border-schedule-day-line gap-3",style:{gridTemplateColumns:x},children:[p.jsx("div",{className:"whitespace-nowrap",children:"Day"}),p.jsx("div",{className:"whitespace-nowrap",children:"Time"}),p.jsx("div",{className:"whitespace-nowrap pl-6",children:"Class Name"}),f.type&&p.jsx("div",{className:"whitespace-nowrap text-center",children:"Type"}),f.age&&p.jsx("div",{className:"whitespace-nowrap",children:"Age"}),f.price&&p.jsx("div",{className:"pl-5 whitespace-nowrap",children:"Monthly Rate"}),f.register&&p.jsx("div",{className:"whitespace-nowrap",children:"Register"}),p.jsx("div",{"aria-hidden":"true"})]}),p.jsx("div",{children:C.items.map((L,K)=>p.jsx($m,{item:L,isEven:K%2===0,variant:"desktop",visibleCols:f,gridTemplate:x,dayAbbrev:g(C.day),onRemove:()=>W(C.day,L)},`d-${K}`))})]})}),p.jsx("div",{className:"md:hidden",children:C.items.map((L,K)=>p.jsx($m,{item:L,isEven:K%2===0,variant:"mobile",onRemove:()=>W(C.day,L)},`m-${K}`))})]})]})]},k)}),P.length===0&&p.jsxs("div",{className:"text-center py-12 bg-background border border-schedule-item-border",children:[p.jsx("p",{className:"text-muted-foreground text-lg",children:I>0?"You removed every class from your schedule.":"No classes found matching your filters."}),p.jsx("p",{className:"text-muted-foreground text-sm mt-2",children:I>0?'Use "Restore all" to bring them back.':"Try adjusting your search criteria."})]})]}),p.jsx(ZR,{days:P,visibleCols:f}),P.length>0&&p.jsxs("div",{className:"text-center p-4 text-sm text-muted-foreground border-t border-schedule-item-border",children:["Showing ",B," classes across ",P.length," days"]})]})},Fm=[{day:"Monday",date:"January 15, 2024",items:[{time:"9:00 AM - 10:00 AM",startTime:"9:00 AM",endTime:"10:00 AM",
173name:"Pre-Ballet (Ages 3-5)",age:"3-5",type:"Ballet",instructor:"Sarah Johnson",openings:5,notes:"A gentle introduction to ballet for young dancers.",registerUrl:"#pre-ballet",link:"#pre-ballet"},{time:"10:30 AM - 11:30 AM",startTime:"10:30 AM",endTime:"11:30 AM",name:"Beginning Hip Hop - Waitlist",age:"6-8",type:"Hip Hop",instructor:"Marcus Williams",openings:0,notes:"Waitlist only. High-energy intro to hip hop.",registerUrl:"#hip-hop-begin",link:"#hip-hop-begin"},{time:"12:00 PM - 1:00 PM",startTime:"12:00 PM",endTime:"1:00 PM",name:"Intermediate Jazz",age:"9-12",type:"Jazz",instructor:"Emily Chen",openings:4,notes:"Builds on jazz fundamentals with choreography.",registerUrl:"#jazz-intermediate",link:"#jazz-intermediate"},{time:"2:00 PM - 3:00 PM",startTime:"2:00 PM",endTime:"3:00 PM",name:"Contemporary Dance - Full",age:"13-18",type:"Contemporary",instructor:"David Rodriguez",openings:0,notes:"Class is currently full. No openings available.",registerUrl:"#contemporary",link:"#contemporary"},{time:"4:00 PM - 5:00 PM",startTime:"4:00 PM",endTime:"5:00 PM",name:"Adult Beginner Ballet",age:"18+",type:"Ballet",instructor:"Sarah Johnson",openings:8,notes:"No experience necessary. Beginner-friendly ballet class.",registerUrl:"#adult-ballet",link:"#adult-ballet"}]},{day:"Tuesday",date:"January 16, 2024",items:[{time:"9:30 AM - 10:15 AM",startTime:"9:30 AM",endTime:"10:15 AM",name:"Toddler Movement",age:"2-3",type:"Movement",instructor:"Lisa Park",openings:6,notes:"Creative movement for toddlers and caregivers.",registerUrl:"#toddler-movement",link:"#toddler-movement"},{time:"11:00 AM - 12:00 PM",startTime:"11:00 AM",endTime:"12:00 PM",name:"Primary Ballet - Pending",age:"4-6",type:"Ballet",instructor:"Sarah Johnson",openings:2,notes:"Pending opening confirmation. Check back soon.",registerUrl:"#primary-ballet",link:"#primary-ballet"},{time:"1:00 PM - 2:00 PM",startTime:"1:00 PM",endTime:"2:00 PM",name:"Advanced Tap",age:"10-15",type:"Tap",instructor:"Robert Kim",openings:3,notes:"Advanced tap technique and rhythm work.",registerUrl:"#tap-advanced",link:"#tap-advanced"},{time:"3:30 PM - 4:30 PM",startTime:"3:30 PM",endTime:"4:30 PM",name:"Teen Musical Theater",age:"13-18",type:"Musical Theater",instructor:"Amanda Foster",openings:7,notes:"Singing, acting, and dance for teens.",registerUrl:"#teen-musical",link:"#teen-musical"}]},{day:"Wednesday",date:"January 17, 2024",items:[{time:"10:00 AM - 11:00 AM",startTime:"10:00 AM",endTime:"11:00 AM",
173name:"Creative Movement",age:"3-4",type:"Movement",instructor:"Lisa Park",openings:5,notes:"Exploration of movement and rhythm through play.",registerUrl:"#creative-movement",link:"#creative-movement"},{time:"11:30 AM - 12:30 PM",startTime:"11:30 AM",endTime:"12:30 PM",name:"Elementary Ballet",age:"5-7",type:"Ballet",instructor:"Sarah Johnson",openings:4,notes:"Foundational ballet for elementary ages.",registerUrl:"#elem-ballet",link:"#elem-ballet"},{time:"1:30 PM - 2:30 PM",startTime:"1:30 PM",endTime:"2:30 PM",name:"Intermediate Hip Hop - Full",age:"8-12",type:"Hip Hop",instructor:"Marcus Williams",openings:0,notes:"Class is full. Waitlist available.",registerUrl:"#hip-hop-inter",link:"#hip-hop-inter"},{time:"3:00 PM - 4:00 PM",startTime:"3:00 PM",endTime:"4:00 PM",name:"Advanced Contemporary",age:"14-18",type:"Contemporary",instructor:"David Rodriguez",openings:3,notes:"Advanced contemporary technique and improvisation.",registerUrl:"#contemporary-adv",link:"#contemporary-adv"},{time:"5:00 PM - 6:00 PM",startTime:"5:00 PM",endTime:"6:00 PM",name:"Adult Jazz - Waitlist",age:"18+",type:"Jazz",instructor:"Emily Chen",openings:0,notes:"Waitlist only for this popular adult class.",registerUrl:"#adult-jazz",link:"#adult-jazz"}]}],oP=na("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),jf=w.forwardRef(({className:e,variant:t,...r},n)=>p.jsx("div",{ref:n,role:"alert",className:le(oP({variant:t}),e),...r}));jf.displayName="Alert";const iP=w.forwardRef(({className:e,...t},r)=>p.jsx("h5",{ref:r,className:le("mb-1 font-medium leading-none tracking-tight",e),...t}));iP.displayName="AlertTitle";const Of=w.forwardRef(({className:e,...t},r)=>p.jsx("div",{ref:r,className:le("text-sm [&_p]:leading-relaxed",e),...t}));Of.displayName="AlertDescription";function aP(e,t,r,n){function s(o){return o instanceof r?o:new r(function(i){i(o)})}return new(r||(r=Promise))(function(o,i){function a(u){try{c(n.next(u))}catch(d){i(d)}}function l(u){try{c(n.throw(u))}catch(d){i(d)}}function c(u){u.done?o(u.value):s(u.value).then(a,l)}c((n=n.apply(e,t||[])).next())})}const lP=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class If extends Error{constructor(t,r="FunctionsError",n){super(t),this.name=r,this.context=n}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class cP extends If{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class Bm extends If{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class zm extends If{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var qd;(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"})(qd||(qd={}));class uP{constructor(t,{headers:r={},customFetch:n,region:s=qd.Any}={}){this.url=t,this.headers=r,this.region=s,this.fetch=lP(n)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return aP(this,arguments,void 0,function*(r,n={}){var s;let o,i;try{const{headers:a,method:l,body:c,signal:u,timeout:d}=n;let h={},{region:f}=n;f||(f=this.region);const x=new URL(`${this.url}/${r}`);f&&f!=="any"&&(h["x-region"]=f,x.searchParams.set("forceFunctionRegion",f));let g;const b=!!a&&Object.keys(a).some(_=>_.toLowerCase()==="content-type");c&&!b?typeof Blob<"u"&&c instanceof Blob||c instanceof ArrayBuffer?(h["Content-Type"]="application/octet-stream",g=c):typeof c=="string"?(h["Content-Type"]="text/plain",g=c):typeof FormData<"u"&&c instanceof FormData?g=c:(h["Content-Type"]="application/json",g=JSON.stringify(c)):c&&typeof c!="string"&&!(typeof Blob<"u"&&c instanceof Blob)&&!(c instanceof ArrayBuffer)&&!(typeof FormData<"u"&&c instanceof FormData)?g=JSON.stringify(c):g=c;let v=u;d&&(i=new AbortController,o=setTimeout(()=>i.abort(),d),u?(v=i.signal,u.addEventListener("abort",()=>i.abort())):v=i.signal);const m=yield this.fetch(x.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},h),this.headers),a),body:g,signal:v}).catch(_=>{throw new cP(_)}),y=m.headers.get("x-relay-error");
173if(y&&y==="true")throw new Bm(m);if(!m.ok)throw new zm(m);let S=((s=m.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),E;return S==="application/json"?E=yield m.json():S==="application/octet-stream"||S==="application/pdf"?E=yield m.blob():S==="text/event-stream"?E=m:S==="multipart/form-data"?E=yield m.formData():E=yield m.text(),{data:E,error:null,response:m}}catch(a){return{data:null,error:a,response:a instanceof zm||a instanceof Bm?a.context:void 0}}finally{o&&clearTimeout(o)}})}}const Y0=3,Hm=e=>Math.min(1e3*2**e,3e4),dP=[520,503],X0=["GET","HEAD","OPTIONS"];var Vm=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function Wm(e,t){return new Promise(r=>{if(t!=null&&t.aborted){r();return}const n=setTimeout(()=>{t==null||t.removeEventListener("abort",s),r()},e);function s(){clearTimeout(n),r()}t==null||t.addEventListener("abort",s)})}function hP(e,t,r,n){return!(!n||r>=Y0||!X0.includes(e)||!dP.includes(t))}var fP=class{constructor(e){var t,r,n,s,o;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(r=e.isMaybeSingle)!==null&&r!==void 0?r:!1,this.shouldStripNulls=(n=e.shouldStripNulls)!==null&&n!==void 0?n:!1,this.urlLengthLimit=(s=e.urlLengthLimit)!==null&&s!==void 0?s:8e3,this.retryEnabled=(o=e.retry)!==null&&o!==void 0?o:!0,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}retry(e){return this.retryEnabled=e,this}then(e,t){var r=this;if(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"),this.shouldStripNulls){const i=this.headers.get("Accept");i==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!i||i==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const n=this.fetch;let o=(async()=>{let i=0;for(;;){const c={};r.headers.forEach((d,h)=>{c[h]=d}),i>0&&(c["X-Retry-Count"]=String(i));let u;try{u=await n(r.url.toString(),{method:r.method,headers:c,body:JSON.stringify(r.body,(d,h)=>typeof h=="bigint"?h.toString():h),signal:r.signal})}catch(d){if((d==null?void 0:d.name)==="AbortError"||(d==null?void 0:d.code)==="ABORT_ERR"||!X0.includes(r.method))throw d;if(r.retryEnabled&&i<Y0){const h=Hm(i);i++,await Wm(h,r.signal);continue}throw d}if(hP(r.method,u.status,i,r.retryEnabled)){var a,l;const d=(a=(l=u.headers)===null||l===void 0?void 0:l.get("Retry-After"))!==null&&a!==void 0?a:null,h=d!==null?Math.max(0,parseInt(d,10)||0)*1e3:Hm(i);await u.text(),i++,await Wm(h,r.signal);continue}return await r.processResponse(u)}})();return this.shouldThrowOnError||(o=o.catch(i=>{var a;let l="",c="",u="";const d=i==null?void 0:i.cause;if(d){var h,f,x,g;const m=(h=d==null?void 0:d.message)!==null&&h!==void 0?h:"",y=(f=d==null?void 0:d.code)!==null&&f!==void 0?f:"";l=`${(x=i==null?void 0:i.name)!==null&&x!==void 0?x:"FetchError"}: ${i==null?void 0:i.message}`,l+=`
174
175Caused by: ${(g=d==null?void 0:d.name)!==null&&g!==void 0?g:"Error"}: ${m}`,y&&(l+=` (${y})`),d!=null&&d.stack&&(l+=`
176${d.stack}`)}else{var b;l=(b=i==null?void 0:i.stack)!==null&&b!==void 0?b:""}const v=this.url.toString().length;return(i==null?void 0:i.name)==="AbortError"||(i==null?void 0:i.code)==="ABORT_ERR"?(u="",c="Request was aborted (timeout or manual cancellation)",v>this.urlLengthLimit&&(c+=`. Note: Your request URL is ${v} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((d==null?void 0:d.name)==="HeadersOverflowError"||(d==null?void 0:d.code)==="UND_ERR_HEADERS_OVERFLOW")&&(u="",c="HTTP headers exceeded server limits (typically 16KB)",v>this.urlLengthLimit&&(c+=`. Your request URL is ${v} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(a=i==null?void 0:i.name)!==null&&a!==void 0?a:"FetchError"}: ${i==null?void 0:i.message}`,details:l,hint:c,code:u},data:null,count:null,status:0,statusText:""}}
176)),o.then(e,t)}async processResponse(e){var t=this;let r=null,n=null,s=null,o=e.status,i=e.statusText;if(e.ok){var a,l;if(t.method!=="HEAD"){var c;const h=await e.text();if(h!=="")if(t.headers.get("Accept")==="text/csv")n=h;else if(t.headers.get("Accept")&&(!((c=t.headers.get("Accept"))===null||c===void 0)&&c.includes("application/vnd.pgrst.plan+text")))n=h;else try{n=JSON.parse(h)}catch{if(r={message:h},n=null,t.shouldThrowOnError)throw new Vm({message:h,details:"",hint:"",code:""})}}const u=(a=t.headers.get("Prefer"))===null||a===void 0?void 0:a.match(/count=(exact|planned|estimated)/),d=(l=e.headers.get("content-range"))===null||l===void 0?void 0:l.split("/");u&&d&&d.length>1&&(s=parseInt(d[1])),t.isMaybeSingle&&Array.isArray(n)&&(n.length>1?(r={code:"PGRST116",details:`Results contain ${n.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},n=null,s=null,o=406,i="Not Acceptable"):n.length===1?n=n[0]:n=null)}else{const u=await e.text();try{r=JSON.parse(u),Array.isArray(r)&&e.status===404&&(n=[],r=null,o=200,i="OK")}catch{e.status===404&&u===""?(o=204,i="No Content"):r={message:u}}if(r&&t.shouldThrowOnError)throw new Vm(r)}return{success:r===null,error:r,data:n,count:s,status:o,statusText:i}}returns(){return this}overrideTypes(){return this}},pP=class extends fP{throwOnError(){return super.throwOnError()}select(e){let t=!1;const r=(e??"*").split("").map(n=>/\s/.test(n)&&!t?"":(n==='"'&&(t=!t),n)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:r,foreignTable:n,referencedTable:s=n}={}){const o=s?`${s}.order`:"order",i=this.url.searchParams.get(o);return this.url.searchParams.set(o,`${i?`${i},`:""}${e}.${t?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:r=t}={}){const n=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${e}`),this}range(e,t,{foreignTable:r,referencedTable:n=r}={}){const s=typeof n>"u"?"offset":`${n}.offset`,o=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(s,`${e}`),this.url.searchParams.set(o,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return 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:e=!1,verbose:t=!1,settings:r=!1,buffers:n=!1,wal:s=!1,format:o="text"}={}){var i;const a=[e?"analyze":null,t?"verbose":null,r?"settings":null,n?"buffers":null,s?"wal":null].filter(Boolean).join("|"),l=(i=this.headers.get("Accept"))!==null&&i!==void 0?i:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${o}; for="${l}"; options=${a};`),o==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const Km=new RegExp("[,()]");var Ns=class extends pP{throwOnError(){return super.throwOnError()}eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const r=Array.from(new Set(t)).map(n=>typeof n=="string"&&Km.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(e,`in.(${r})`),this}notIn(e,t){const r=Array.from(new Set(t)).map(n=>typeof n=="string"&&Km.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(e,`not.in.(${r})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:r,type:n}={}){let s="";n==="plain"?s="pl":n==="phrase"?s="ph":n==="websearch"&&(s="w");const o=r===void 0?"":`(${r})`;return this.url.searchParams.append(e,`${s}fts${o}.${t}`),this}match(e){return Object.entries(e).filter(([t,r])=>
176r!==void 0).forEach(([t,r])=>{this.url.searchParams.append(t,`eq.${r}`)}),this}not(e,t,r){return this.url.searchParams.append(e,`not.${t}.${r}`),this}or(e,{foreignTable:t,referencedTable:r=t}={}){const n=r?`${r}.or`:"or";return this.url.searchParams.append(n,`(${e})`),this}filter(e,t,r){return this.url.searchParams.append(e,`${t}.${r}`),this}},mP=class{constructor(e,{headers:t={},schema:r,fetch:n,urlLengthLimit:s=8e3,retry:o}){this.url=e,this.headers=new Headers(t),this.schema=r,this.fetch=n,this.urlLengthLimit=s,this.retry=o}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:r=!1,count:n}=t??{},s=r?"HEAD":"GET";let o=!1;const i=(e??"*").split("").map(c=>/\s/.test(c)&&!o?"":(c==='"'&&(o=!o),c)).join(""),{url:a,headers:l}=this.cloneRequestState();return a.searchParams.set("select",i),n&&l.append("Prefer",`count=${n}`),new Ns({method:s,url:a,headers:l,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(e,{count:t,defaultToNull:r=!0}={}){var n;const s="POST",{url:o,headers:i}=this.cloneRequestState();if(t&&i.append("Prefer",`count=${t}`),r||i.append("Prefer","missing=default"),Array.isArray(e)){const a=e.reduce((l,c)=>l.concat(Object.keys(c)),[]);if(a.length>
1760){const l=[...new Set(a)].map(c=>`"${c}"`);o.searchParams.set("columns",l.join(","))}}return new Ns({method:s,url:o,headers:i,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(e,{onConflict:t,ignoreDuplicates:r=!1,count:n,defaultToNull:s=!0}={}){var o;const i="POST",{url:a,headers:l}=this.cloneRequestState();if(l.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),t!==void 0&&a.searchParams.set("on_conflict",t),n&&l.append("Prefer",`count=${n}`),s||l.append("Prefer","missing=default"),Array.isArray(e)){const c=e.reduce((u,d)=>u.concat(Object.keys(d)),[]);if(c.length>0){const u=[...new Set(c)].map(d=>`"${d}"`);a.searchParams.set("columns",u.join(","))}}return new Ns({method:i,url:a,headers:l,schema:this.schema,body:e,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(e,{count:t}={}){var r;const n="PATCH",{url:s,headers:o}=this.cloneRequestState();return t&&o.append("Prefer",`count=${t}`),new Ns({method:n,url:s,headers:o,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:e}={}){var t;const r="DELETE",{url:n,headers:s}=this.cloneRequestState();return e&&s.append("Prefer",`count=${e}`),new Ns({method:r,url:n,headers:s,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function Fi(e){"@babel/helpers - typeof";return Fi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fi(e)}function gP(e,t){if(Fi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Fi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function vP(e){var t=gP(e,"string");return Fi(t)=="symbol"?t:t+""}function yP(e,t,r){return(t=vP(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qm(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function $a(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?qm(Object(r),!0).forEach(function(n){yP(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qm(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var wP=class Z0{constructor(t,{headers:r={},schema:n,fetch:s,timeout:o,urlLengthLimit:i=8e3,retry:a}={}){this.url=t,this.headers=new Headers(r),this.schemaName=n,this.urlLengthLimit=i;const l=s??globalThis.fetch;o!==void 0&&o>0?this.fetch=(c,u)=>{const d=new AbortController,h=setTimeout(()=>d.abort(),o),f=u==null?void 0:u.signal;if(f){if(f.aborted)return clearTimeout(h),l(c,u);const x=()=>{clearTimeout(h),d.abort()};return f.addEventListener("abort",x,{once:!0}),l(c,$a($a({},u),{},{signal:d.signal})).finally(()=>{clearTimeout(h),f.removeEventListener("abort",x)})}return l(c,$a($a({},u),{},{signal:d.signal})).finally(()=>clearTimeout(h))}:this.fetch=l,this.retry=a}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new mP(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(t){return new Z0(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(t,r={},{head:n=!1,get:s=!1,count:o}={}){var i;let a;const l=new URL(`${this.url}/rpc/${t}`);let c;const u=f=>f!==null&&typeof f=="object"&&(!Array.isArray(f)||f.some(u)),d=n&&Object.values(r).some(u);d?(a="POST",c=r):n||s?(a=n?"HEAD":"GET",Object.entries(r).filter(([f,x])=>x!==void 0).map(([f,x])=>[f,Array.isArray(x)?`{${x.join(",")}}`:`${x}
176`]).forEach(([f,x])=>{l.searchParams.append(f,x)})):(a="POST",c=r);const h=new Headers(this.headers);return d?h.set("Prefer",o?`count=${o},return=minimal`:"return=minimal"):o&&h.set("Prefer",`count=${o}`),new Ns({method:a,url:l,headers:h,schema:this.schemaName,body:c,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class bP{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};const r=globalThis;if(typeof globalThis<"u"&&typeof r.WebSocket<"u")return{type:"native",wsConstructor:r.WebSocket};const n=typeof global<"u"?global:void 0;if(n&&typeof n.WebSocket<"u")return{type:"native",wsConstructor:n.WebSocket};if(typeof globalThis<"u"&&typeof r.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"&&r.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."};const s=globalThis.process;if(s){const o=s.versions;if(o&&o.node)return{type:"unsupported",error:"Node.js detected but native WebSocket not found.",workaround:"Ensure you are running Node.js 22+ or provide a WebSocket implementation via the transport option."}}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.wsConstructor)return t.wsConstructor;let r=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(r+=`
177
178Suggested solution: ${t.workaround}`),new Error(r)}static isWebSocketSupported(){try{return this.detectEnvironment().type==="native"}catch{return!1}}}const xP="2.110.6",SP=`realtime-js/${xP}`,_P="1.0.0",eb="2.0.0",EP=eb,kP=1e4,CP=100,an={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},tb={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave",access_token:"access_token"},Gd={connecting:"connecting",open:"open",closing:"closing",closed:"closed"};class TP{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,r){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(t));let n=[t.join_ref,t.ref,t.topic,t.event,t.payload];return r(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(t){var r;return this._isArrayBuffer((r=t.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var r,n;const s=(n=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,s)}_encodeJsonUserBroadcastPush(t){var r,n;const s=(n=(r=t.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:{},i=new TextEncoder().encode(JSON.stringify(s)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,i)}_encodeUserBroadcastPush(t,r,n){var s,o;const i=new TextEncoder,a=i.encode(t.topic),l=i.encode((s=t.ref)!==null&&s!==void 0?s:""),c=i.encode((o=t.join_ref)!==null&&o!==void 0?o:""),u=i.encode(t.payload.event),d=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},h=i.encode(Object.keys(d).length===0?"":JSON.stringify(d));if(c.length>255)throw new Error(`joinRef length ${c.length} exceeds maximum of 255`);if(l.length>255)throw new Error(`ref length ${l.length} exceeds maximum of 255`);if(a.length>255)throw new Error(`topic length ${a.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`userEvent length ${u.length} exceeds maximum of 255`);if(h.length>255)throw new Error(`metadata length ${h.length} exceeds maximum of 255`);const f=this.USER_BROADCAST_PUSH_META_LENGTH+c.length+l.length+a.length+u.length+h.length,x=new ArrayBuffer(this.HEADER_LENGTH+f),g=new DataView(x),b=new Uint8Array(x);let v=0;g.setUint8(v++,this.KINDS.userBroadcastPush),g.setUint8(v++,c.length),g.setUint8(v++,l.length),g.setUint8(v++,a.length),g.setUint8(v++,u.length),g.setUint8(v++,h.length),g.setUint8(v++,r),b.set(c,v),v+=c.length,b.set(l,v),v+=l.length,b.set(a,v),v+=a.length,b.set(u,v),v+=u.length,b.set(h,v),v+=h.length;var m=new Uint8Array(x.byteLength+n.byteLength);return m.set(new Uint8Array(x),0),m.set(new Uint8Array(n),x.byteLength),m.buffer}decode(t,r){if(this._isArrayBuffer(t)){let n=this._binaryDecode(t);return r(n)}if(typeof t=="string"){const n=JSON.parse(t),[s,o,i,a,l]=n;return r({join_ref:s,ref:o,topic:i,event:a,payload:l})}return r({})}_binaryDecode(t){const r=new DataView(t),n=r.getUint8(0),s=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,r,s)}}_decodeUserBroadcast(t,r,n){const s=r.getUint8(1),o=r.getUint8(2),i=r.getUint8(3),a=r.getUint8(4);let l=this.HEADER_LENGTH+4;const c=n.decode(t.slice(l,l+s));l=l+s;
178const u=n.decode(t.slice(l,l+o));l=l+o;const d=n.decode(t.slice(l,l+i));l=l+i;const h=t.slice(l,t.byteLength),f=a===this.JSON_ENCODING?JSON.parse(n.decode(h)):h,x={type:this.BROADCAST_EVENT,event:u,payload:f};return i>0&&(x.meta=JSON.parse(d)),{join_ref:null,ref:null,topic:c,event:this.BROADCAST_EVENT,payload:x}}_isArrayBuffer(t){var r;return t instanceof ArrayBuffer||((r=t==null?void 0:t.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(t,r){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([n])=>r.includes(n)))}}var ve;(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"})(ve||(ve={}));const Gm=(e,t,r={})=>{var n;const s=(n=r.skipTypes)!==null&&n!==void 0?n:[];return t?Object.keys(t).reduce((o,i)=>(o[i]=RP(i,e,t,s),o),{}):{}},RP=(e,t,r,n)=>{const s=t.find(a=>a.name===e),o=s==null?void 0:s.type,i=r[e];return o&&!n.includes(o)?rb(o,i):Jd(i)},rb=(e,t)=>{if(e.charAt(0)==="_"){const r=e.slice(1,e.length);return jP(t,r)}switch(e){case ve.bool:return PP(t);
vendor: 5,328 bytes, line 178
178case ve.float4:case ve.float8:case ve.int2:case ve.int4:case ve.int8:case ve.numeric:case ve.oid:return AP(t);case ve.json:case ve.jsonb:return NP(t);case ve.timestamp:return OP(t);case ve.abstime:case ve.date:case ve.daterange:case ve.int4range:case ve.int8range:case ve.money:case ve.reltime:case ve.text:case ve.time:case ve.timestamptz:case ve.timetz:case ve.tsrange:case ve.tstzrange:return Jd(t);default:return Jd(t)}},Jd=e=>e,PP=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},AP=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},NP=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},jP=(e,t)=>{if(typeof e!="string")return e;const r=e.length-1,n=e[r];if(e[0]==="{"&&n==="}"){let o;const i=e.slice(1,r);try{o=JSON.parse("["+i+"]")}catch{o=i?i.split(","):[]}return o.map(a=>rb(t,a))}return e},OP=e=>typeof e=="string"?e.replace(" ","T"):e,nb=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};var hi=e=>typeof e=="function"?e:function(){return e},IP=typeof self<"u"?self:null,js=typeof window<"u"?window:null,fr=IP||js||globalThis,LP="2.0.0",$P=1e4,MP=1e3,vr={connecting:0,open:1,closing:2,closed:3},dt={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},jr={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},Qd={longpoll:"longpoll",websocket:"websocket"},DP={complete:4},Yd="base64url.bearer.phx.",Ma=class{constructor(e,t,r,n){this.channel=e,this.event=t,this.payload=r||function(){return{}},this.receivedResp=null,this.timeout=n,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(e){this.timeout=e,this.reset(),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()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:e,response:t,_ref:r}){this.recHooks.filter(n=>n.status===e).forEach(n=>n.callback(t))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},sb=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},UP=class{constructor(e,t,r){this.state=dt.closed,this.topic=e,this.params=hi(t||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new Ma(this,jr.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new sb(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=dt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(n=>n.send()),this.pushBuffer=[]}),this.joinPush.receive("error",n=>{this.state=dt.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=dt.closed,this.socket.remove(this)}),this.onError(n=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.isJoining()&&this.joinPush.reset(),this.state=dt.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new Ma(this,jr.leave,hi({}),this.timeout).send(),this.state=dt.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(jr.reply,(n,s)=>{this.trigger(this.replyEventName(s),n)})}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}
vendor: 5,263 bytes, line 178
178teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=dt.closed,this.bindings=[]}onClose(e){this.on(jr.close,e)}onError(e){return this.on(jr.error,t=>e(t))}on(e,t){let r=this.bindingRef++;return this.bindings.push({event:e,ref:r,callback:t}),r}off(e,t){this.bindings=this.bindings.filter(r=>!(r.event===e&&(typeof t>"u"||t===r.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,r=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let n=new Ma(this,e,function(){return t},r);return this.canPush()?n.send():(n.startTimeout(),this.pushBuffer.push(n)),n}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=dt.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(jr.close,"leave")},r=new Ma(this,jr.leave,hi({}),e);return r.receive("ok",()=>t()).receive("timeout",()=>t()),r.send(),this.canPush()||r.trigger("ok",{}),r}onMessage(e,t,r){return t}filterBindings(e,t,r){return!0}isMember(e,t,r,n){return this.topic!==e?!1:n&&n!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:r,joinRef:n}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=dt.joining,this.joinPush.resend(e))}trigger(e,t,r,n){let s=this.onMessage(e,t,r,n);if(t&&!s)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let o=this.bindings.filter(i=>i.event===e&&this.filterBindings(i,t,r));for(let i=0;i<o.length;i++)o[i].callback(s,r,n||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===dt.closed}isErrored(){return this.state===dt.errored}isJoined(){return this.state===dt.joined}isJoining(){return this.state===dt.joining}isLeaving(){return this.state===dt.leaving}},Kl=class{static request(e,t,r,n,s,o,i){if(fr.XDomainRequest){let a=new fr.XDomainRequest;return this.xdomainRequest(a,e,t,n,s,o,i)}else if(fr.XMLHttpRequest){let a=new fr.XMLHttpRequest;return this.xhrRequest(a,e,t,r,n,s,o,i)}else{if(fr.fetch&&fr.AbortController)return this.fetchRequest(e,t,r,n,s,o,i);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(e,t,r,n,s,o,i){let a={method:e,headers:r,body:n},l=null;return s&&(l=new AbortController,setTimeout(()=>l.abort(),s),a.signal=l.signal),fr.fetch(t,a).then(c=>c.text()).then(c=>this.parseJSON(c)).then(c=>i&&i(c)).catch(c=>{c.name==="AbortError"&&o?o():i&&i(null)}),l}static xdomainRequest(e,t,r,n,s,o,i){return e.timeout=s,e.open(t,r),e.onload=()=>{let a=this.parseJSON(e.responseText);i&&i(a)},o&&(e.ontimeout=o),e.onprogress=()=>{},e.send(n),e}static xhrRequest(e,t,r,n,s,o,i,a){e.open(t,r,!0),e.timeout=o;for(let[l,c]of Object.entries(n))e.setRequestHeader(l,c);return e.onerror=()=>a&&a(null),e.onreadystatechange=()=>{if(e.readyState===DP.complete&&a){let l=this.parseJSON(e.responseText);a(l)}},i&&(e.ontimeout=i),e.send(s),e}static parseJSON(e){if(!e||e==="")return null;try{return JSON.parse(e)}catch{return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let r=[];for(var n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;let s=t?`${t}[${n}]`:n,o=e[n];typeof o=="object"?r.push(this.serialize(o,s)):r.push(encodeURIComponent(s)+"="+encodeURIComponent(o))}return r.join("&")}static appendParams(e,t){if(Object.keys(t).length===0)return e;let r=e.match(/\?/)?"&":"?";return`${e}${r}${this.serialize(t)}`}},FP=e=>{let t="",r=new Uint8Array(e),n=r.byteLength;for(let s=0;s<n;s++)t+=String.fromCharCode(r[s]);return btoa(t)},Es=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(Yd)&&(this.authToken=atob(t[1].slice(Yd.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=vr.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+Qd.websocket),"$1/"+Qd.longpoll)}endpointURL(){return Kl.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,r){this.close(e,t,r),this.readyState=vr.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===vr.open||this.readyState===vr.connecting}poll(){const e={Accept:"application/json"};this.authToken&&(e["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",e,null,()=>this.ontimeout(),t=>{if(t){var{status:r,token:n,messages:s}=t;if(r===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=n}else r=0;switch(r){case 200:s.forEach(o=>{setTimeout(()=>this.onmessage({data:o}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=vr.open,this.onopen({}),this.poll();break;
178case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${r}`)}})}send(e){typeof e!="string"&&(e=FP(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(e){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},e.join(`
179`),()=>this.onerror("timeout"),t=>{this.awaitingBatchAck=!1,!t||t.status!==200?(this.onerror(t&&t.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(e,t,r){for(let s of this.reqs)s.abort();this.readyState=vr.closed;let n=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:r});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",n)):this.onclose(n)}ajax(e,t,r,n,s){let o,i=()=>{this.reqs.delete(o),n()};o=Kl.request(e,this.endpointURL(),t,r,this.timeout,i,a=>{this.reqs.delete(o),this.isActive()&&s(a)}),this.reqs.add(o)}},BP=class Go{constructor(t,r={}){let n=r.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=t,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(n.state,s=>{let{onJoin:o,onLeave:i,onSync:a}=this.caller;this.joinRef=this.channel.joinRef(),this.state=Go.syncState(this.state,s,o,i),this.pendingDiffs.forEach(l=>{this.state=Go.syncDiff(this.state,l,o,i)}),this.pendingDiffs=[],a()}),this.channel.on(n.diff,s=>{let{onJoin:o,onLeave:i,onSync:a}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=Go.syncDiff(this.state,s,o,i),a())})}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}list(t){return Go.list(this.state,t)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(t,r,n,s){let o=this.clone(t),i={},a={};return this.map(o,(l,c)=>{r[l]||(a[l]=c)}),this.map(r,(l,c)=>{let u=o[l];if(u){let d=c.metas.map(g=>g.phx_ref),h=u.metas.map(g=>g.phx_ref),f=c.metas.filter(g=>h.indexOf(g.phx_ref)<0),x=u.metas.filter(g=>d.indexOf(g.phx_ref)<0);f.length>0&&(i[l]=c,i[l].metas=f),x.length>0&&(a[l]=this.clone(u),a[l].metas=x)}else i[l]=c}),this.syncDiff(o,{joins:i,leaves:a},n,s)}static syncDiff(t,r,n,s){let{joins:o,leaves:i}=this.clone(r);return n||(n=function(){}),s||(s=function(){}),this.map(o,(a,l)=>{let c=t[a];if(t[a]=this.clone(l),c){let u=t[a].metas.map(h=>h.phx_ref),d=c.metas.filter(h=>u.indexOf(h.phx_ref)<0);t[a].metas.unshift(...d)}n(a,c,l)}),this.map(i,(a,l)=>{let c=t[a];if(!c)return;let u=l.metas.map(d=>d.phx_ref);c.metas=c.metas.filter(d=>u.indexOf(d.phx_ref)<0),s(a,c,l),c.metas.length===0&&delete t[a]}),t}static list(t,r){return r||(r=function(n,s){return s}),this.map(t,(n,s)=>r(n,s))}static map(t,r){return Object.getOwnPropertyNames(t).map(n=>r(n,t[n]))}static clone(t){return JSON.parse(JSON.stringify(t))}},Da={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let r=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(r))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[r,n,s,o,i]=JSON.parse(e);return t({join_ref:r,ref:n,topic:s,event:o,payload:i})}},binaryEncode(e){let{join_ref:t,ref:r,event:n,topic:s,payload:o}=e,i=this.META_LENGTH+t.length+r.length+s.length+n.length,a=new ArrayBuffer(this.HEADER_LENGTH+i),l=new DataView(a),c=0;l.setUint8(c++,this.KINDS.push),l.setUint8(c++,t.length),l.setUint8(c++,r.length),l.setUint8(c++,s.length),l.setUint8(c++,n.length),Array.from(t,d=>l.setUint8(c++,d.charCodeAt(0))),Array.from(r,d=>l.setUint8(c++,d.charCodeAt(0))),Array.from(s,d=>l.setUint8(c++,d.charCodeAt(0))),Array.from(n,d=>l.setUint8(c++,d.charCodeAt(0)));var u=new Uint8Array(a.byteLength+o.byteLength);return u.set(new Uint8Array(a),0),u.set(new Uint8Array(o),a.byteLength),u.buffer},binaryDecode(e){let t=new DataView(e),r=t.getUint8(0),n=new TextDecoder;
vendor: 8,661 bytes, line 179
179switch(r){case this.KINDS.push:return this.decodePush(e,t,n);case this.KINDS.reply:return this.decodeReply(e,t,n);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,n)}},decodePush(e,t,r){let n=t.getUint8(1),s=t.getUint8(2),o=t.getUint8(3),i=this.HEADER_LENGTH+this.META_LENGTH-1,a=r.decode(e.slice(i,i+n));i=i+n;let l=r.decode(e.slice(i,i+s));i=i+s;let c=r.decode(e.slice(i,i+o));i=i+o;let u=e.slice(i,e.byteLength);return{join_ref:a,ref:null,topic:l,event:c,payload:u}},decodeReply(e,t,r){let n=t.getUint8(1),s=t.getUint8(2),o=t.getUint8(3),i=t.getUint8(4),a=this.HEADER_LENGTH+this.META_LENGTH,l=r.decode(e.slice(a,a+n));a=a+n;let c=r.decode(e.slice(a,a+s));a=a+s;let u=r.decode(e.slice(a,a+o));a=a+o;let d=r.decode(e.slice(a,a+i));a=a+i;let h=e.slice(a,e.byteLength),f={status:d,response:h};return{join_ref:l,ref:c,topic:u,event:jr.reply,payload:f}},decodeBroadcast(e,t,r){let n=t.getUint8(1),s=t.getUint8(2),o=this.HEADER_LENGTH+2,i=r.decode(e.slice(o,o+n));o=o+n;let a=r.decode(e.slice(o,o+s));o=o+s;let l=e.slice(o,e.byteLength);return{join_ref:null,ref:null,topic:i,event:a,payload:l}}},zP=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||$P,this.transport=t.transport||fr.WebSocket||Es,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null;let r=null;try{r=fr&&fr.sessionStorage}catch{}this.sessionStore=t.sessionStorage||r,this.establishedConnections=0,this.defaultEncoder=Da.encode.bind(Da),this.defaultDecoder=Da.decode.bind(Da),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==Es?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;js&&js.addEventListener&&(js.addEventListener("pagehide",s=>{this.conn&&(this.disconnect(),n=this.connectClock)}),js.addEventListener("pageshow",s=>{n===this.connectClock&&(n=null,this.connect())}),js.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=t.autoSendHeartbeat??!0,this.heartbeatCallback=t.heartbeatCallback??(()=>{}),this.rejoinAfterMs=s=>t.rejoinAfterMs?t.rejoinAfterMs(s):[1e3,2e3,5e3][s-1]||1e4,this.reconnectAfterMs=s=>t.reconnectAfterMs?t.reconnectAfterMs(s):[10,50,100,150,200,250,500,1e3,2e3][s-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(s,o,i)=>{console.log(`${s}: ${o}`,i)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=hi(t.params||{}),this.endPoint=`${e}/${Qd.websocket}`,this.vsn=t.vsn||LP,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new sb(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{t.beforeReconnect&&await t.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=t.authToken}getLongPollTransport(){return Es}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=Kl.appendParams(Kl.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return e.charAt(0)!=="/"?e:e.charAt(1)==="/"?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,r){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,e&&e()},t,r)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=hi(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Es?this.connectWithFallback(Es,this.longPollFallbackMs):this.transportConnect())}log(e,t,r){this.logger&&this.logger(e,t,r)}hasLogger(){return this.logger!==null}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}onHeartbeat(e){this.heartbeatCallback=e}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),r=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let n=this.onMessage(s=>{s.ref===t&&(this.off([n]),e(Date.now()-r))});return!0}transportName(e){switch(e){case Es:return"LongPoll";default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=["phoenix",`${Yd}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),e),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,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)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let r=!1,n=!0,s,o,i=this.transportName(e),a=l=>{this.log("transport",`falling back to ${i}...`,l),this.off([s,o]),n=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${i}`))return a("memorized");this.fallbackTimer=setTimeout(a,t),o=this.onError(l=>{this.log("transport","error",l),n&&!r&&(clearTimeout(this.fallbackTimer),a(l))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(r=!0,!n){let l=this.transportName(e);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${l}`,"true"),this.log("transport",`established ${l} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(a,t),this.ping(l=>{this.log("transport","connected to primary after",l),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(e){this.log("error","error in heartbeat callback",e)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),MP,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(e,t,r){if(!this.conn)return e&&e();const n=this.conn;this.waitForBufferDone(n,()=>{t?n.close(t,r||""):n.close(),this.waitForSocketClosed(n,()=>{this.conn===n&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()})})}waitForBufferDone(e,t,r=1){if(r===5||!e.bufferedAmount){t();return}setTimeout(()=>{this.waitForBufferDone(e,t,r+1)},150*r)}waitForSocketClosed(e,t,r=1){if(r===5||e.readyState===vr.closed){t();return}setTimeout(()=>{this.waitForSocketClosed(e,t,r+1)},150*r)}onConnClose(e){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(e),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",e)}onConnError(e){this.hasLogger()&&this.log("transport","error",e);let t=this.transport,r=this.establishedConnections;this.triggerStateCallbacks("error",e,t,r),(t===this.transport||r>0)&&this.triggerChanError(e)}
vendor: 4,126 bytes, line 179
179triggerChanError(e){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(jr.error,e)})}connectionState(){switch(this.conn&&this.conn.readyState){case vr.connecting:return"connecting";case vr.open:return"open";case vr.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter(t=>t!==e)}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter(([r])=>e.indexOf(r)===-1)}channel(e,t={}){let r=new UP(e,t,this);return this.channels.push(r),r}push(e){if(this.hasLogger()){let{topic:t,event:r,payload:n,ref:s,join_ref:o}=e;this.log("push",`${t} ${r} (${o}, ${s})`,n)}this.isConnected()?this.encode(e,t=>this.conn.send(t)):this.sendBuffer.push(()=>this.encode(e,t=>this.conn.send(t)))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(e){this.log("error","error in heartbeat callback",e)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(e){this.log("error","error in heartbeat callback",e)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,t=>{let{topic:r,event:n,payload:s,ref:o,join_ref:i}=t;if(o&&o===this.pendingHeartbeatRef){const a=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(s.status==="ok"?"ok":"error",a)}catch(l){this.log("error","error in heartbeat callback",l)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${s.status||""} ${r} ${n} ${o&&"("+o+")"||""}`.trim(),s);for(let a=0;a<this.channels.length;a++){const l=this.channels[a];l.isMember(r,n,s,i)&&l.trigger(n,s,o,i)}this.triggerStateCallbacks("message",t)})}triggerStateCallbacks(e,...t){try{this.stateChangeCallbacks[e].forEach(([r,n])=>{try{n(...t)}catch(s){this.log("error",`error in ${e} callback`,s)}})}catch(r){this.log("error",`error triggering ${e} callbacks`,r)}}leaveOpenTopic(e){let t=this.channels.find(r=>r.topic===e&&(r.isJoined()||r.isJoining()));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}};class fi{constructor(t,r){const n=VP(r);this.presence=new BP(t.getChannel(),n),this.presence.onJoin((s,o,i)=>{const a=fi.onJoinPayload(s,o,i);t.getChannel().trigger("presence",a)}),this.presence.onLeave((s,o,i)=>{const a=fi.onLeavePayload(s,o,i);t.getChannel().trigger("presence",a)}),this.presence.onSync(()=>{t.getChannel().trigger("presence",{event:"sync"})})}get state(){return fi.transformState(this.presence.state)}static transformState(t){return t=HP(t),Object.getOwnPropertyNames(t).reduce((r,n)=>{const s=t[n];return r[n]=dl(s),r},{})}static onJoinPayload(t,r,n){const s=Jm(r),o=dl(n);return{event:"join",key:t,currentPresences:s,newPresences:o}}static onLeavePayload(t,r,n){const s=Jm(r),o=dl(n);return{event:"leave",key:t,currentPresences:s,leftPresences:o}}}function dl(e){return e.metas.map(t=>(t.presence_ref=t.phx_ref,delete t.phx_ref,delete t.phx_ref_prev,t))}function HP(e){return JSON.parse(JSON.stringify(e))}function VP(e){return(e==null?void 0:e.events)&&{events:e.events}}function Jm(e){return e!=null&&e.metas?dl(e):[]}var Qm;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(Qm||(Qm={}));class WP{get state(){return this.presenceAdapter.state}constructor(t,r){this.channel=t,this.presenceAdapter=new fi(this.channel.channelAdapter,r)}}function KP(e){if(e instanceof Error)return e;if(typeof e=="string")return new Error(e);
179if(e&&typeof e=="object"){const t=e;if(typeof t.code=="number"){const r=typeof t.reason=="string"&&t.reason?` (${t.reason})`:"";return new Error(`socket closed: ${t.code}${r}`,{cause:e})}return new Error("channel error: transport failure",{cause:e})}return new Error("channel error: connection lost")}class qP{constructor(t,r,n){const s=GP(n);this.channel=t.getSocket().channel(r,s),this.socket=t}get state(){return this.channel.state}set state(t){this.channel.state=t}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(t,r){return this.channel.on(t,r)}off(t,r){this.channel.off(t,r)}subscribe(t){return this.channel.join(t)}unsubscribe(t){return this.channel.leave(t)}teardown(){this.channel.teardown()}onClose(t){this.channel.onClose(t)}onError(t){return this.channel.onError(t)}push(t,r,n){let s;try{s=this.channel.push(t,r,n)}catch{throw new Error(`tried to push '${t}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>CP){const o=this.channel.pushBuffer.shift();o.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${o.event}`,o.payload())}return s}updateJoinPayload(t){const r=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},r),t)}canPush(){return this.socket.isConnected()&&this.state===an.joined}isJoined(){return this.state===an.joined}isJoining(){return this.state===an.joining}isClosed(){return this.state===an.closed}isLeaving(){return this.state===an.leaving}updateFilterBindings(t){this.channel.filterBindings=t}updatePayloadTransform(t){this.channel.onMessage=t}getChannel(){return this.channel}}function GP(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},e.config)}}const JP=/[,()"\\]/,QP=e=>JP.test(e)||e!==e.trim(),YP=e=>`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`,Ym=e=>{const t=e===null?"null":String(e);return QP(t)?YP(t):t},XP=e=>e===null?"null":String(e),ZP=(e,t)=>{if(e==="in"){const r=Array.isArray(t)?t:[t];if(r.length===0)throw new Error("Realtime `in` filter requires at least one value.");return`in.(${Array.from(new Set(r)).map(s=>Ym(s)).join(",")})`}return e==="is"?`is.${XP(t)}`:`${e}.${Ym(t)}`};class eA{constructor(){this.filters=[]}add(t,r,n,s=!1){const o=s?"not.":"";return this.filters.push(`${t}=${o}${ZP(r,n)}`),this}eq(t,r){return this.add(t,"eq",r)}neq(t,r){return this.add(t,"neq",r)}gt(t,r){return this.add(t,"gt",r)}gte(t,r){return this.add(t,"gte",r)}lt(t,r){return this.add(t,"lt",r)}lte(t,r){return this.add(t,"lte",r)}in(t,r){return this.add(t,"in",r)}like(t,r){return this.add(t,"like",r)}ilike(t,r){return this.add(t,"ilike",r)}match(t,r){return this.add(t,"match",r)}imatch(t,r){return this.add(t,"imatch",r)}is(t,r){return this.add(t,"is",r)}isDistinct(t,r){return this.add(t,"isdistinct",r)}not(t,r,n){return this.add(t,r,n,!0)}build(){return this.filters.join(",")}toString(){return this.build()}}var Xm;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(Xm||(Xm={}));var Ks;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(Ks||(Ks={}));var Or;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Or||(Or={}));class pi{get state(){return this.channelAdapter.state}set state(t){this.channelAdapter.state=t}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(t,r={config:{}},n){var s,o;if(this.topic=t,this.params=r,this.socket=n,this.bindings={},this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.channelAdapter=new qP(this.socket.socketAdapter,t,this.params),this.presence=new WP(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=nb(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((o=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||o===void 0)&&o.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(t,r=this.timeout){var n,s,o;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:i,presence:a,private:l}}=this.params,c=(s=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(f=>f.filter))!==null&&s!==void 0?s:[],u=!!this.bindings[Ks.PRESENCE]&&this.bindings[Ks.PRESENCE].length>0||((o=this.params.config.presence)===null||o===void 0?void 0:o.enabled)===!0,d={},h={broadcast:i,presence:Object.assign(Object.assign({},a),{enabled:u}),postgres_changes:c,private:l};this.socket.accessTokenValue&&(d.access_token=this.socket.accessTokenValue),this._onError(f=>{t==null||t(Or.CHANNEL_ERROR,KP(f))}),this._onClose(()=>t==null?void 0:t(Or.CLOSED)),this.updateJoinPayload(Object.assign({config:h},d)),this._updateFilterMessage(),this.channelAdapter.subscribe(r).receive("ok",async({postgres_changes:f})=>{if(this.socket._isManualToken()||this.socket.setAuth(),f===void 0){t==null||t(Or.SUBSCRIBED);return}this._updatePostgresBindings(f,t)}).receive("error",f=>{this.state=an.errored;const x=Object.values(f).join(", ")||"error";t==null||t(Or.CHANNEL_ERROR,new Error(x,{cause:f}))}).receive("timeout",()=>{t==null||t(Or.TIMED_OUT)})}return this}_updatePostgresBindings(t,r){var n;const s=this.bindings.postgres_changes,o=(n=s==null?void 0:s.length)!==null&&n!==void 0?n:0,i=[];for(let a=0;a<o;a++){const l=s[a],{filter:{event:c,schema:u,table:d,filter:h}}=l,f=t&&t[a];if(f&&f.event===c&&pi.isFilterValueEqual(f.schema,u)&&pi.isFilterValueEqual(f.table,d)&&pi.isFilterValueEqual(f.filter,h))i.push(Object.assign(Object.assign({},l),{id:f.id}));else{this.unsubscribe(),this.state=an.errored,r==null||r(Or.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=i,this.state!=an.errored&&r&&r(Or.SUBSCRIBED)}presenceState(){return this.presence.state}async track(t,r={}){return await this.send({type:"presence",event:"track",payload:t},r)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,r,n){const s=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),o=t===Ks.PRESENCE||t===Ks.PO
179STGRES_CHANGES;if(s&&o)throw this.socket.log("channel",`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${t}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(t,r,n)}async httpSend(t,r,n={}){var s;if(r==null)return Promise.reject(new Error("Payload is required for httpSend()"));const o=r instanceof ArrayBuffer||ArrayBuffer.isView(r),i={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":o?"application/octet-stream":"application/json"};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);const a=new URL(this.broadcastEndpointURL);a.pathname+=`/${encodeURIComponent(this.subTopic)}/events/${encodeURIComponent(t)}`,this.private&&a.searchParams.set("private","true");const l={method:"POST",headers:i,body:o?r:JSON.stringify(r)},c=await this._fetchWithTimeout(a.toString(),l,(s=n.timeout)!==null&&s!==void 0?s:this.timeout);if(c.status===202)return{success:!0};if(c.status===404)return Promise.reject(new Error("httpSend() requires Realtime server v2.97.0 or newer; the endpoint returned 404. Update your Supabase CLI to a recent version, or upgrade the Realtime server in your self-hosted setup. See https://github.com/supabase/supabase-js/blob/master/packages/core/realtime-js/migrations/httpsend-server-version.md"));let u=c.statusText;try{const d=await c.json();u=d.error||d.message||u}catch{}return Promise.reject(new Error(u))}async send(t,r={}){var n,s;if(!this.channelAdapter.canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated 
179in the future. Please use httpSend() explicitly for REST delivery.");const{event:o,payload:i}=t,a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);const l={method:"POST",headers:a,body:JSON.stringify({messages:[{topic:this.subTopic,event:o,payload:i,private:this.private}]})};try{const c=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((s=c.body)===null||s===void 0?void 0:s.cancel()),c.ok?"ok":"error"}catch(c){return c instanceof Error&&c.name==="AbortError"?"timed out":"error"}}else return new Promise(o=>{var i,a,l;const c=this.channelAdapter.push(t.type,t,r.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.channelAdapter.updateJoinPayload(t)}async unsubscribe(t=this.timeout){return new Promise(r=>{this.channelAdapter.unsubscribe(t).receive("ok",()=>r("ok")).receive("timeout",()=>r("timed out")).receive("error",()=>r("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(t,r,n){const s=new AbortController,o=setTimeout(()=>s.abort(),n),i=await this.socket.fetch(t,Object.assign(Object.assign({},r),{signal:s.signal}));return clearTimeout(o),i}_on(t,r,n){const s=t.toLocaleLowerCase(),o=r==null?void 0:r.filter;(o instanceof eA||typeof o=="object"&&o!==null&&typeof o.build=="function")&&(r=Object.assign(Object.assign({},r),{filter:o.build()}));const i=this.channelAdapter.on(t,n),a={type:s,filter:r,callback:n,ref:i};return this.bindings[s]?this.bindings[s].push(a):this.bindings[s]=[a],this._updateFilterMessage(),this}_onClose(t){this.channelAdapter.onClose(t)}_onError(t){this.channelAdapter.onError(t)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((t,r,n)=>{var s,o,i,a,l,c,u;const d=t.event.toLocaleLowerCase();if(this._notThisChannelEvent(d,n))return!1;const h=(s=this.bindings[d])===null||s===void 0?void 0:s.find(f=>f.ref===t.ref);if(!h)return!0;if(["broadcast","presence","postgres_changes"].includes(d))if("id"in h){const f=h.id,x=(o=h.filter)===null||o===void 0?void 0:o.event;return f&&((i=r.ids)===null||i===void 0?void 0:i.includes(f))&&(x==="*"||(x==null?void 0:x.toLocaleLowerCase())===((a=r.data)===null||a===void 0?void 0:a.type.toLocaleLowerCase()))}else{const f=(c=(l=h==null?void 0:h.filter)===null||l===void 0?void 0:l.event)===null||c===void 0?void 0:c.toLocaleLowerCase();return f==="*"||f===((u=r==null?void 0:r.event)===null||u===void 0?void 0:u.toLocaleLowerCase())}else return h.type.toLocaleLowerCase()===d})}_notThisChannelEvent(t,r){const{close:n,error:s,leave:o,join:i}=tb;return r&&[n,s,o,i].includes(t)&&r!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((t,r,n)=>{if(typeof r=="object"&&"ids"in r){const s=r.data,{schema:o,table:i,commit_timestamp:a,type:l,errors:c}=s;return Object.assign(Object.assign({},{schema:o,table:i,commit_timestamp:a,eventType:l,new:{},old:{},errors:c}),this._getPayloadRecords(s))}return r})}copyBindings(t){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const r in t.bindings)for(const n of t.bindings[r])this._on(n.type,n.filter,n.callback)}static isFilterValueEqual(t,r){return(t??void 0)===(r??void 0)}_getPayloadRecords(t){const r={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(r.new=Gm(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(r.old=Gm(t.columns,t.old_record)),r}}class tA{constructor(t,r){this.socket=new zP(t,r)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(t){this.socket.heartbeatCallback=t}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(t,r,n,s=1e4){return new Promise(o=>{setTimeout(()=>
179o("timeout"),s),this.socket.disconnect(()=>{t(),o("ok")},r,n)})}push(t){this.socket.push(t)}log(t,r,n){this.socket.log(t,r,n)}makeRef(){return this.socket.makeRef()}onOpen(t){this.socket.onOpen(t)}onClose(t){this.socket.onClose(t)}onError(t){this.socket.onError(t)}onMessage(t){this.socket.onMessage(t)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==Gd.connecting}isDisconnecting(){return this.socket.connectionState()==Gd.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const Zm={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},rA=[1e3,2e3,5e3,1e4],nA=1e4;function sA(){const e=new Map;return{get length(){return e.size},clear(){e.clear()},getItem(t){return e.has(t)?e.get(t):null},key(t){var r;return(r=Array.from(e.keys())[t])!==null&&r!==void 0?r:null},removeItem(t){e.delete(t)},setItem(t,r){e.set(t,String(r))}}}function oA(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return sA()}const iA=`
180  addEventListener("message", (e) => {
181    if (e.data.event === "start") {
182      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
183    }
184  });`;class aA{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(t,r){var n;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={},this.ref=0,this.serializer=new TP,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=o=>o?(...i)=>o(...i):(...i)=>fetch(...i),!(!((n=r==null?void 0:r.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey;const s=this._initializeOptions(r);this.socketAdapter=new tA(t,s),this.httpEndpoint=nb(t),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(t){const r=t.message;throw new Error(`WebSocket not available: ${r}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(t,r){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},t,r)}getChannels(){return this.channels}async removeChannel(t){const r=await t.unsubscribe();return r==="ok"&&t.teardown(),r}async removeAllChannels(){const t=this.channels.map(async n=>{const s=await n.unsubscribe();return n.teardown(),s}),r=await Promise.all(t);return await this.disconnect(),r}log(t,r,n){this.socketAdapter.log(t,r,n)}connectionState(){return this.socketAdapter.connectionState()||Gd.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(t,r={config:{}}){const n=`realtime:${t}`,s=this.getChannels().find(o=>o.topic===n);if(s)return s;{const o=new pi(`realtime:${t}`,r,this);return this._cancelPendingDisconnect(),this.channels.push(o),o}}push(t){this.socketAdapter.push(t)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(t){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(t)}_makeRef(){return this.socketAdapter.makeRef()}_remove(t){this.channels=this.channels.filter(r=>r.topic!==t.topic),this.channels.length===0&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}
184this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(t=null){let r,n=!1;if(t)r=t,n=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(s){this.log("error","Error fetching access token from callback",s),r=this.accessTokenValue}else r=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(s=>{const o={access_token:r,version:SP};r&&s.updateJoinPayload(o),s.joinedOnce&&s.channelAdapter.isJoined()&&s.channelAdapter.push(tb.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(r=>{this.log("error",`Error setting auth in ${t}`,r)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(r=>{this.log("error","error waiting for auth on connect",r)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(t=>{t.ref&&t.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(t){return(r,n)=>{r!=="disconnected"&&(r=="sent"&&this._setAuthSafely(),t&&t(r,n))}}_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=r=>{this.log("worker","worker error",r.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(t){let r;if(t)r=t;else{const n=new Blob([iA],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_initializeOptions(t){var r,n,s,o,i,a,l,c,u,d,h,f;this.worker=(r=t==null?void 0:t.worker)!==null&&r!==void 0?r:!1,this.accessToken=(n=t==null?void 0:t.accessToken)!==null&&n!==void 0?n:null;const x={};x.timeout=(s=t==null?void 0:t.timeout)!==null&&s!==void 0?s:kP,x.heartbeatIntervalMs=(o=t==null?void 0:t.heartbeatIntervalMs)!==null&&o!==void 0?o:Zm.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(i=t==null?void 0:t.disconnectOnEmptyChannelsAfterMs)!==null&&i!==void 0?i:2*((a=t==null?void 0:t.heartbeatIntervalMs)!==null&&a!==void 0?a:Zm.HEARTBEAT_INTERVAL),x.transport=(l=t==null?void 0:t.transport)!==null&&l!==void 0?l:bP.getWebSocketConstructor(),x.params=t==null?void 0:t.params,x.logger=t==null?void 0:t.logger,x.heartbeatCallback=this._wrapHeartbeatCallback(t==null?void 0:t.heartbeatCallback),x.sessionStorage=(c=t==null?void 0:t.sessionStorage)!==null&&c!==void 0?c:oA(),x.reconnectAfterMs=(u=t==null?void 0:t.reconnectAfterMs)!==null&&u!==void 0?u:m=>rA[m-1]||nA;let g,b;const v=(d=t==null?void 0:t.vsn)!==null&&d!==void 0?d:EP;switch(v){case _P:g=(m,y)=>y(JSON.stringify(m)),b=(m,y)=>y(JSON.parse(m));break;case eb:g=this.serializer.encode.bind(this.serializer),b=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${x.vsn}`)}if(x.vsn=v,x.encode=(h=t==null?void 0:t.encode)!==null&&h!==void 0?h:g,x.decode=(f=t==null?void 0:t.decode)!==null&&f!==void 0?f:b,x.beforeReconnect=this._reconnectAuth.bind(this),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,x.params=Object.assign(Object.assign({},x.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl,x.autoSendHeartbeat=!this.worker}return x}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}
184var Bi=class extends Error{constructor(e,t){var r;super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&((r=t.icebergType)==null?void 0:r.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function lA(e,t,r){const n=new URL(t,e);if(r)for(const[s,o]of Object.entries(r))o!==void 0&&n.searchParams.set(s,o);return n.toString()}async function cA(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function uA(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:s,body:o,headers:i}){const a=lA(e.baseUrl,n,s),l=await cA(e.auth),c=await t(a,{method:r,headers:{...o?{"Content-Type":"application/json"}:{},...l,...i},body:o?JSON.stringify(o):void 0}),u=await c.text(),d=(c.headers.get("content-type")||"").includes("application/json"),h=d&&u?JSON.parse(u):u;if(!c.ok){const f=d?h:void 0,x=f==null?void 0:f.error;throw new Bi((x==null?void 0:x.message)??`Request failed with status ${c.status}`,{status:c.status,icebergType:x==null?void 0:x.type,icebergCode:x==null?void 0:x.code,details:f})}return{status:c.status,headers:c.headers,data:h}}}}function Ua(e){return e.join("�")}var dA=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:Ua(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(n=>({namespace:n}))}async createNamespace(e,t){const r={namespace:e.namespace,properties:t==null?void 0:t.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Ua(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Ua(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Ua(e.namespace)}`}),!0}catch(t){if(t instanceof Bi&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(r){if(r instanceof Bi&&r.status===409)return;throw r}}};function ks(e){return e.join("�")}var hA=class{constructor(e,t="",r){this.client=e,this.prefix=t,this.accessDelegation=r}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${ks(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${ks(e.namespace)}/tables`,body:t,headers:r})).data.metadata}async updateTable(e,t){const r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${ks(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${ks(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String((t==null?void 0:t.purge)??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${ks(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${ks(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(r){if(r instanceof Bi&&r.status===404)return!1;throw r}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(r){if(r instanceof Bi&&r.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw r}}},fA=class{constructor(e){var n;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const r=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=uA({baseUrl:r,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(n=e.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new dA(this.client,t),this.tableOps=new hA(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}
184async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}};function zi(e){"@babel/helpers - typeof";return zi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zi(e)}function pA(e,t){if(zi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(zi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function mA(e){var t=pA(e,"string");return zi(t)=="symbol"?t:t+""}function gA(e,t,r){return(t=mA(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function eg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function J(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?eg(Object(r),!0).forEach(function(n){gA(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Ac=class extends Error{constructor(e,t="storage",r,n){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t==="vectors"?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function Nc(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var Xd=class extends Ac{constructor(e,t,r,n="storage"){super(e,n,t,r),this.name=n==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=r}toJSON(){return J({},super.toJSON())}},ob=class extends Ac{constructor(e,t,r="storage"){super(e,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};function ql(e,t,r){const n=J({},e),s=t.toLowerCase();for(const o of Object.keys(n))o.toLowerCase()===s&&delete n[o];return n[s]=r,n}function vA(e){const t={};for(const[r,n]of Object.entries(e))t[r.toLowerCase()]=n;return t}const yA=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),wA=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)},Zd=e=>{if(Array.isArray(e))return e.map(r=>Zd(r));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([r,n])=>{const s=r.replace(/([-_][a-z])/gi,o=>o.toUpperCase().replace(/[-_]/g,""));t[s]=Zd(n)}),t},bA=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),tg=e=>{if(typeof e=="object"&&e!==null){const t=e;if(typeof t.msg=="string")return t.msg;if(typeof t.message=="string")return t.message;if(typeof t.error_description=="string")return t.error_description;if(typeof t.error=="string")return t.error;if(typeof t.error=="object"&&t.error!==null){const r=t.error;if(typeof r.message=="string")return r.message}}return JSON.stringify(e)},xA=async(e,t,r,n)=>{if(e!==null&&typeof e=="object"&&"json"in e&&typeof e.json=="function"){const s=e;let o=parseInt(String(s.status),10);Number.isFinite(o)||(o=500),s.json().then(i=>{const a=(i==null?void 0:i.statusCode)||(i==null?void 0:i.code)||o+"";t(new Xd(tg(i),o,a,n))}).catch(()=>{const i=o+"";t(new Xd(s.statusText||`HTTP ${o} error`,o,i,n))})}else t(new ob(tg(e),e,n))},SA=(e,t,r,n)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};if(e==="GET"||e==="HEAD"||!n)return J(J({},s),r);if(wA(n)){var o;const i=(t==null?void 0:t.headers)||{};let a;for(const[l,c]of Object.entries(i))l.toLowerCase()==="content-type"&&(a=c);s.headers=ql(i,"Content-Type",(o=a)!==null&&o!==void 0?o:"application/json"),s.body=JSON.stringify(n)}else s.body=n;return t!=null&&t.duplex&&(s.duplex=t.duplex),J(J({},s),r)};async function Ho(e,t,r,n,s,o,i){return new Promise((a,l)=>{e(r,SA(t,n,s,o)).then(c=>{if(!c.ok)throw c;if(n!=null&&n.noResolveJson)return c;if(i==="vectors"){const u=c.headers.get("content-type");if(c.headers.get("content-length")==="0"||c.status===204)return{};if(!u||!u.includes("application/json"))return{}}return c.json()}).then(c=>a(c)).catch(c=>xA(c,l,n,i))})}function ib(e="storage"){return{get:async(t,r,n,s)=>Ho(t,"GET",r,n,s,void 0,e),post:async(t,r,n,s,o)=>Ho(t,"POST",r,s,o,n,e),put:async(t,r,n,s,o)=>Ho(t,"PUT",r,s,o,n,e),head:async(t,r,n,s)=>Ho(t,"HEAD",r,J(J({},n),{},{noResolveJson:!0}),s,void 0,e),remove:async(t,r,n,s,o)=>Ho(t,"DELETE",r,s,o,n,e)}}const _A=ib("storage"),{get:Hi,post:Jt,put:eh,head:EA,remove:Vi}=_A,_t=ib("vectors");var Po=class{constructor(e,t={},r,n="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=vA(t),this.fetch=yA(r),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=ql(this.headers,e,t),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(Nc(r))return{data:null,error:r};throw r}}};let ab;ab=Symbol.toStringTag;var kA=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[ab]="StreamDownloadBuilder",this.promise=null}
184then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(Nc(t))return{data:null,error:t};throw t}}};let lb;lb=Symbol.toStringTag;var CA=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[lb]="BlobDownloadBuilder",this.promise=null}asStream(){return new kA(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(Nc(t))return{data:null,error:t};throw t}}};const Eu={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},rg={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var TA=class extends Po{constructor(e,t={},r,n){super(e,t,n,"storage"),this.bucketId=r}async uploadOrUpdate(e,t,r,n){var s=this;return s.handleOperation(async()=>{let o;const i=J(J({},rg),n);let a=J(J({},s.headers),e==="POST"&&{"x-upsert":String(i.upsert)});const l=i.metadata;if(typeof Blob<"u"&&r instanceof Blob?(o=new FormData,o.append("cacheControl",i.cacheControl),l&&o.append("metadata",s.encodeMetadata(l)),o.append("",r)):typeof FormData<"u"&&r instanceof FormData?(o=r,o.has("cacheControl")||o.append("cacheControl",i.cacheControl),l&&!o.has("metadata")&&o.append("metadata",s.encodeMetadata(l))):(o=r,a["cache-control"]=`max-age=${i.cacheControl}`,a["content-type"]=i.contentType,l&&(a["x-metadata"]=s.toBase64(s.encodeMetadata(l))),(typeof ReadableStream<"u"&&o instanceof ReadableStream||o&&typeof o=="object"&&"pipe"in o&&typeof o.pipe=="function")&&!i.duplex&&(i.duplex="half")),n!=null&&n.headers)for(const[h,f]of Object.entries(n.headers))a=ql(a,h,f);const c=s._removeEmptyFolders(t),u=s._getFinalPath(c),d=await(e=="PUT"?eh:Jt)(s.fetch,`${s.url}/object/${u}`,o,J({headers:a},i!=null&&i.duplex?{duplex:i.duplex}:{}));return{path:c,id:d.Id,fullPath:d.Key}})}async upload(e,t,r){return this.uploadOrUpdate("POST",e,t,r)}async uploadToSignedUrl(e,t,r,n){var s=this;const o=s._removeEmptyFolders(e),i=s._getFinalPath(o),a=new URL(s.url+`/object/upload/sign/${i}`);return a.searchParams.set("token",t),s.handleOperation(async()=>{let l;const c=J(J({},rg),n);let u=J(J({},s.headers),{"x-upsert":String(c.upsert)});const d=c.metadata;if(typeof Blob<"u"&&r instanceof Blob?(l=new FormData,l.append("cacheControl",c.cacheControl),d&&l.append("metadata",s.encodeMetadata(d)),l.append("",r)):typeof FormData<"u"&&r instanceof FormData?(l=r,l.has("cacheControl")||l.append("cacheControl",c.cacheControl),d&&!l.has("metadata")&&l.append("metadata",s.encodeMetadata(d))):(l=r,u["cache-control"]=`max-age=${c.cacheControl}`,u["content-type"]=c.contentType,d&&(u["x-metadata"]=s.toBase64(s.encodeMetadata(d))),(typeof ReadableStream<"u"&&l instanceof ReadableStream||l&&typeof l=="object"&&"pipe"in l&&typeof l.pipe=="function")&&!c.duplex&&(c.duplex="half")),n!=null&&n.headers)for(const[h,f]of Object.entries(n.headers))u=ql(u,h,f);return{path:o,fullPath:(await eh(s.fetch,a.toString(),l,J({headers:u},c!=null&&c.duplex?{duplex:c.duplex}:{}))).Key}})}async createSignedUploadUrl(e,t){var r=this;return r.handleOperation(async()=>{let n=r._getFinalPath(e);const s=J({},r.headers);t!=null&&t.upsert&&(s["x-upsert"]="true");const o=await Jt(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:s}),i=new URL(r.url+o.url),a=i.searchParams.get("token");if(!a)throw new Ac("No token returned by API");return{signedUrl:i.toString(),path:e,token:a}})}async update(e,t,r){return this.uploadOrUpdate("PUT",e,t,r)}async move(e,t,r){var n=this;return n.handleOperation(async()=>await Jt(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,de
184stinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers}))}async copy(e,t,r){var n=this;return n.handleOperation(async()=>({path:(await Jt(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers})).Key}))}async createSignedUrl(e,t,r){var n=this;return n.handleOperation(async()=>{let s=n._getFinalPath(e);const o=typeof(r==null?void 0:r.transform)=="object"&&r.transform!==null&&Object.keys(r.transform).length>0;let i=await Jt(n.fetch,`${n.url}/object/sign/${s}`,J({expiresIn:t},o?{transform:r.transform}:{}),{headers:n.headers});const a=new URLSearchParams;r!=null&&r.download&&a.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&a.set("cacheNonce",String(r.cacheNonce));const l=a.toString();return{signedUrl:encodeURI(`${n.url}${i.signedURL}${l?`&${l}`:""}`)}})}async createSignedUrls(e,t,r){var n=this;return n.handleOperation(async()=>{const s=await Jt(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:t,paths:e},{headers:n.headers}),o=new URLSearchParams;r!=null&&r.download&&o.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&o.set("cacheNonce",String(r.cacheNonce));const i=o.toString();return s.map(a=>J(J({},a),{},{signedUrl:a.signedURL?encodeURI(`${n.url}${a.signedURL}${i?`&${i}`:""}`):null}))})}download(e,t,r){const n=typeof(t==null?void 0:t.transform)=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image/authenticated":"object",s=new URLSearchParams;t!=null&&t.transform&&this.applyTransformOptsToQuery(s,t.transform),(t==null?void 0:t.cacheNonce)!=null&&s.set("cacheNonce",String(t.cacheNonce));const o=s.toString(),i=this._getFinalPath(e),a=()=>Hi(this.fetch,`${this.url}/${n}/${i}${o?`?${o}`:""}`,{headers:this.headers,noResolveJson:!0},r);return new CA(a,this.shouldThrowOnError)}async info(e){var t=this;const r=t._getFinalPath(e);return t.handleOperation(async()=>Zd(await Hi(t.fetch,`${t.url}/object/info/${r}`,{headers:t.headers})))}async exists(e){var t=this;const r=t._getFinalPath(e);try{return await EA(t.fetch,`${t.url}/object/${r}`,{headers:t.headers}),{data:!0,error:null}}catch(s){if(t.shouldThrowOnError)throw s;if(Nc(s)){var n;const o=s instanceof Xd?s.status:s instanceof ob?(n=s.originalError)===null||n===void 0?void 0:n.status:void 0;if(o!==void 0&&[400,404].includes(o))return{data:!1,error:s}}throw s}}getPublicUrl(e,t){const r=this._getFinalPath(e),n=new URLSearchParams;t!=null&&t.download&&n.set("download",t.download===!0?"":t.download),t!=null&&t.transform&&this.applyTransformOptsToQuery(n,t.transform),(t==null?void 0:t.cacheNonce)!=null&&n.set("cacheNonce",String(t.cacheNonce));const s=n.toString(),o=typeof(t==null?void 0:t.transform)=="object"&&t.transform!==null&&Object.keys(t.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${o}/public/${r}`)+(s?`?${s}`:"")}}}async remove(e){var t=this;return t.handleOperation(async()=>await Vi(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async purgeCache(e,t,r){var n=this;return n.handleOperation(async()=>{const s=n._getFinalPath(e),o=new URLSearchParams;t!=null&&t.transformations&&o.set("transformations","true");const i=o.toString();return await Vi(n.fetch,`${n.url}/cdn/${s}${i?`?${i}`:""}`,{},{headers:n.headers},r)})}async list(e,t,r){var n=this;return n.handleOperation(async()=>{const s=t!=null&&t.sortBy?J(J({},Eu.sortBy),t.sortBy):Eu.sortBy,o=J(J(J({},Eu),t),{},{sortBy:s,prefix:e||""});return await Jt(n.fetch,`${n.url}/object/list/${n.bucketId}`,o,{headers:n.headers},r)})}async listV2(e,t){var r=this;return r.handleOperation(async()=>{const n=J({},e);return await Jt(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,n,{headers:r.headers},t)})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(e,t){return t.width&&e.set("width",t.width.toString()),t.height&&e.set("height",t.height.toString()),t.resize&&e.set("resize",t.resize),t.format&&e.set("format",t.format),t.quality&&e.set("qual
184ity",t.quality.toString()),e}};const RA="2.110.6",la={"X-Client-Info":`storage-js/${RA}`};var PA=class extends Po{constructor(e,t={},r,n){const s=new URL(e);n!=null&&n.useNewHostname&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase."));const o=s.href.replace(/\/$/,""),i=J(J({},la),t);super(o,i,r,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const r=t.listBucketOptionsToQueryString(e);return await Hi(t.fetch,`${t.url}/bucket${r}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Hi(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var r=this;return r.handleOperation(async()=>await Jt(r.fetch,`${r.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}))}async updateBucket(e,t){var r=this;return r.handleOperation(async()=>await eh(r.fetch,`${r.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:r.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await Jt(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Vi(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}async purgeBucketCache(e,t,r){var n=this;return n.handleOperation(async()=>{const s=new URLSearchParams;t!=null&&t.transformations&&s.set("transformations","true");const o=s.toString();return await Vi(n.fetch,`${n.url}/cdn/${e}${o?`?${o}`:""}`,{},{headers:n.headers},r)})}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},AA=class extends Po{constructor(e,t={},r){const n=e.replace(/\/$/,""),s=J(J({},la),t);super(n,s,r,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Jt(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const r=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&r.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&r.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&r.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&r.set("sortOrder",e.sortOrder),e!=null&&e.search&&r.set("search",e.search);const n=r.toString(),s=n?`${t.url}/bucket?${n}`:`${t.url}/bucket`;return await Hi(t.fetch,s,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Vi(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!bA(e))throw new Ac("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const r=new fA({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(r,{get(s,o){const i=s[o];return typeof i!="function"?i:async(...a)=>{try{return{data:await i.apply(s,a),error:null}}catch(l){if(n)throw l;return{data:null,error:l}}}}})}},NA=class extends Po{constructor(e,t={},r){const n=e.replace(/\/$/,""),s=J(J({},la),{},{"Content-Type":"application/json"},t);super(n,s,r,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await _t.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var r=this;return r.handleOperation(async()=>await _t.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await _t.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var r=this;return r.handleOperation(async()=>await _t.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:r.headers})||{})}},jA=class extends Po{constructor(e,t={},r){const n=e.replace(/\/$/,""),s=J(J({},la),{},{"Content-Type":"application/json"},t);super(n,s,r,"vectors")}async putVectors(e){var t=this;if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return t.handleOperation(async()=>await _t.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await _t.post(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}))}async listVectors(e){var t=this;if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");
184if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return t.handleOperation(async()=>await _t.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await _t.post(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}))}async deleteVectors(e){var t=this;if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return t.handleOperation(async()=>await _t.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},OA=class extends Po{constructor(e,t={},r){const n=e.replace(/\/$/,""),s=J(J({},la),{},{"Content-Type":"application/json"},t);super(n,s,r,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await _t.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await _t.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await _t.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await _t.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},IA=class extends OA{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new LA(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,r=this;return t().call(r,e)}async getBucket(e){var t=()=>super.getBucket,r=this;return t().call(r,e)}async listBuckets(e={}){var t=()=>super.listBuckets,r=this;return t().call(r,e)}async deleteBucket(e){var t=()=>super.deleteBucket,r=this;return t().call(r,e)}},LA=class extends NA{constructor(e,t,r,n){super(e,t,n),this.vectorBucketName=r}async createIndex(e){var t=()=>super.createIndex,r=this;return t().call(r,J(J({},e),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,r=this;return t().call(r,J(J({},e),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,r=this;return t().call(r,r.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,r=this;return t().call(r,r.vectorBucketName,e)}index(e){return new $A(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},$A=class extends jA{constructor(e,t,r,n,s){super(e,t,s),this.vectorBucketName=r,this.indexName=n}async putVectors(e){var t=()=>super.putVectors,r=this;return t().call(r,J(J({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(e){var t=()=>super.getVectors,r=this;return t().call(r,J(J({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,r=this;return t().call(r,J(J({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,r=this;return t().call(r,J(J({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,r=this;return t().call(r,J(J({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},MA=class extends PA{constructor(e,t={},r,n){super(e,t,r,n)}from(e){return new TA(this.url,this.headers,e,this.fetch)}get vectors(){return new IA(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new AA(this.url+"/iceberg",this.headers,this.fetch)}};function jc(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}const cb="2.110.6",Ir=30*1e3,Jo=3,ku=Jo*Ir,DA=2*Ir,UA="http://localhost:9999",FA="supabase.auth.token",BA={"X-Client-Info":`gotrue-js/${cb}`},th="X-Supabase-Api-Version",ub={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},zA=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,HA=10*60*1e3;
184class Wi extends Error{constructor(t,r,n){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function D(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class VA extends Wi{constructor(t,r,n){super(t,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function WA(e){return D(e)&&e.name==="AuthApiError"}class er extends Wi{constructor(t,r){super(t),this.name="AuthUnknownError",this.originalError=r}}class Er extends Wi{constructor(t,r,n,s){super(t,n,s),this.name=r,this.status=n}}class Be extends Er{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function Fa(e){return D(e)&&e.name==="AuthSessionMissingError"}class Cs extends Er{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class Ba extends Er{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class za extends Er{constructor(t,r=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function KA(e){return D(e)&&e.name==="AuthImplicitGrantRedirectError"}class ng extends Er{constructor(t,r=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class qA extends Er{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class rh extends Er{constructor(t,r){super(t,"AuthRetryableFetchError",r,void 0)}}function sg(e){return D(e)&&e.name==="AuthRetryableFetchError"}class og extends Er{constructor(t="Refresh result discarded: session state changed mid-flight (e.g., concurrent signOut)"){super(t,"AuthRefreshDiscardedError",409,void 0)}}function GA(e){return D(e)&&e.name==="AuthRefreshDiscardedError"}class ig extends Er{constructor(t,r,n){super(t,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class Gl extends Er{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const Jl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),ag=` 	
185\r=`.split(""),JA=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<ag.length;t+=1)e[ag[t].charCodeAt(0)]=-2;for(let t=0;t<Jl.length;t+=1)e[Jl[t].charCodeAt(0)]=t;return e})();function lg(e,t,r){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const n=t.queue>>t.queuedBits-6&63;r(Jl[n]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const n=t.queue>>t.queuedBits-6&63;r(Jl[n]),t.queuedBits-=6}}function db(e,t,r){const n=JA[e];if(n>-1)for(t.queue=t.queue<<6|n,t.queuedBits+=6;t.queuedBits>=8;)r(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(n===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function cg(e){const t=[],r=i=>{t.push(String.fromCodePoint(i))},n={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},o=i=>{XA(i,n,r)};for(let i=0;i<e.length;i+=1)db(e.charCodeAt(i),s,o);return t.join("")}function QA(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>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 YA(e,t){for(let r=0;r<e.length;r+=1){let n=e.charCodeAt(r);if(n>55295&&n<=56319){const s=(n-55296)*1024&65535;n=(e.charCodeAt(r+1)-56320&65535|s)+65536,r+=1}QA(n,t)}}function XA(e,t,r){if(t.utf8seq===0){if(e<=127){r(e);return}for(let n=1;n<6;n+=1)if(!(e>>7-n&1)){t.utf8seq=n;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&&r(t.codepoint)}}function to(e){const t=[],r={queue:0,queuedBits:0},n=s=>{t.push(s)};for(let s=0;s<e.length;
185s+=1)db(e.charCodeAt(s),r,n);return new Uint8Array(t)}function ZA(e){const t=[];return YA(e,r=>t.push(r)),new Uint8Array(t)}function rs(e){const t=[],r={queue:0,queuedBits:0},n=s=>{t.push(s)};return e.forEach(s=>lg(s,r,n)),lg(null,r,n),t.join("")}function eN(e){return Math.round(Date.now()/1e3)+e}function tN(){return Symbol("auth-callback")}const Ze=()=>typeof window<"u"&&typeof document<"u",qn={tested:!1,writable:!1},hb=()=>{if(!Ze())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(qn.tested)return qn.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),qn.tested=!0,qn.writable=!0}catch{qn.tested=!0,qn.writable=!1}return qn.writable};function rN(e){const t={},r=new URL(e);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((s,o)=>{t[o]=s})}catch{}return r.searchParams.forEach((n,s)=>{t[s]=n}),t}const fb=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),nN=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Os=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},Vt=async(e,t)=>{const r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch{return null}},Le=async(e,t)=>{await e.removeItem(t)};class Oc{constructor(){this.promise=new Oc.promiseConstructor((t,r)=>{this.resolve=t,this.reject=r})}}Oc.promiseConstructor=Promise;function Ha(e){const t=e.split(".");if(t.length!==3)throw new Gl("Invalid JWT structure");for(let n=0;n<t.length;n++)if(!zA.test(t[n]))throw new Gl("JWT not in base64url format");return{header:JSON.parse(cg(t[0])),payload:JSON.parse(cg(t[1])),signature:to(t[2]),raw:{header:t[0],payload:t[1]}}}async function sN(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function oN(e,t){return new Promise((n,s)=>{(async()=>{for(let o=0;o<1/0;o++)try{const i=await e(o);if(!t(o,null,i)){n(i);return}}catch(i){if(!t(o,i)){s(i);return}}})()})}function iN(e){return("0"+e.toString(16)).substr(-2)}function aN(){const t=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length;let s="";for(let o=0;o<56;o++)s+=r.charAt(Math.floor(Math.random()*n));return s}return crypto.getRandomValues(t),Array.from(t,iN).join("")}async function lN(e){const r=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",r),s=new Uint8Array(n);return Array.from(s).map(o=>String.fromCharCode(o)).join("")}async function cN(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 r=await lN(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Gn(e,t,r=!1){const n=aN();let s=n;r&&(s+="/recovery"),await Os(e,`${t}-code-verifier`,s);const o=await cN(n);return[o,n===o?"plain":"s256"]}const uN=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function dN(e){const t=e.headers.get(th);if(!t||!t.match(uN))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function hN(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 fN(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 pN=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Tr(e){if(!pN.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Wt(e){if(!e.passkey)throw new Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function Cu(){const e={};return new Proxy(e,{get:(t,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const n=r.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function mN(e,t){return new Proxy(e,{get:(r,n,s)=>{if(n==="__isInsecureUserWarningProxy")return!0;
185if(typeof n=="symbol"){const o=n.toString();if(o==="Symbol(Symbol.toPrimitive)"||o==="Symbol(Symbol.toStringTag)"||o==="Symbol(util.inspect.custom)"||o==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,n,s)}return!t.value&&typeof n=="string"&&(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."),t.value=!0),Reflect.get(r,n,s)}})}function ug(e){return JSON.parse(JSON.stringify(e))}const Yn=e=>{if(typeof e=="object"&&e!==null){const t=e;if(typeof t.msg=="string")return t.msg;if(typeof t.message=="string")return t.message;if(typeof t.error_description=="string")return t.error_description;if(typeof t.error=="string")return t.error}return JSON.stringify(e)},gN=[500,501,502,503,504,520,521,522,523,524,525,526,527,528,529,530];async function dg(e){var t;if(!nN(e))throw new rh(Yn(e),0);if(gN.includes(e.status))throw new rh(Yn(e),e.status);let r;try{r=await e.json()}catch(o){throw new er(Yn(o),o)}let n;const s=dN(e);if(s&&s.getTime()>=ub["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new ig(Yn(r),e.status,((t=r.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(n==="session_not_found")throw new Be}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((o,i)=>o&&typeof i=="string",!0))throw new ig(Yn(r),e.status,r.weak_password.reasons);throw new VA(Yn(r),e.status||500,n)}const vN=(e,t,r,n)=>{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(n),Object.assign(Object.assign({},s),r))};async function V(e,t,r,n){var s;const o=Object.assign({},n==null?void 0:n.headers);o[th]||(o[th]=ub["2024-01-01"].name),n!=null&&n.jwt&&(o.Authorization=`Bearer ${n.jwt}`);const i=(s=n==null?void 0:n.query)!==null&&s!==void 0?s:{};n!=null&&n.redirectTo&&(i.redirect_to=n.redirectTo);const a=Object.keys(i).length?"?"+new URLSearchParams(i).toString():"",l=await yN(e,t,r+a,{headers:o,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(l):{data:Object.assign({},l),error:null}}async function yN(e,t,r,n,s,o){const i=vN(t,n,s,o);let a;try{a=await e(r,Object.assign({},i))}catch(l){throw console.error(l),new rh(Yn(l),0)}if(a.ok||await dg(a),n!=null&&n.noResolveJson)return a;try{return await a.json()}catch(l){await dg(l)}}function At(e){var t;let r=null;xN(e)&&(r=Object.assign({},e),e.expires_at||(r.expires_at=eN(e.expires_in)));const n=(t=e.user)!==null&&t!==void 0?t:typeof(e==null?void 0:e.id)=="string"?e:null;return{data:{session:r,user:n},error:null}}function hg(e){const t=At(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((r,n)=>r&&typeof n=="string",!0)&&(t.data.weak_password=e.weak_password),t}function ln(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function wN(e){return{data:e,error:null}}function bN(e){const{action_link:t,email_otp:r,hashed_token:n,redirect_to:s,verification_type:o}=e,i=jc(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:t,email_otp:r,hashed_token:n,redirect_to:s,verification_type:o},l=Object.assign({},i);return{data:{properties:a,user:l},error:null}}function fg(e){return e}function xN(e){return!!e.access_token&&!!e.refresh_token&&!!e.expires_in}const Tu=["global","local","others"];class SN{constructor({url:t="",headers:r={},fetch:n,experimental:s}){this.url=t,this.headers=r,this.fetch=fb(n),this.experimental=s??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(t,r=Tu[0]){if(Tu.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Tu.join(", ")}`);try{return await V(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(n){if(D(n))return{data:null,error:n};throw n}}async inviteUserByEmail(t,r={}){try{return await V(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:ln})}catch(n){if(D(n))return{data:{user:null},error:n};throw n}}async generateLink(t){try{const{options:r}=t,n=jc(t,["options"]),s=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(s.new_email=n==null?void 0:n.newEmail,delete s.newEmail),await V(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:bN,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(D(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(t){try{return await V(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:ln})}catch(r){if(D(r))return{data:{user:null},error:r};throw r}}async listUsers(t){var r,n,s,o,i,a,l;try{const c={nextPage:null,lastPage:0,total:0},u=await V(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=t==null?void 0:t.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(o=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&o!==void 0?o:""},xform:fg});if(u.error)throw u.error;const d=await u.json(),h=(i=u.headers.get("x-total-count"))!==null&&i!==void 0?i:0,f=(l=(a=u.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&l!==void 0?l:[];return f.length>0&&(f.forEach(x=>{const g=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(x.split(";")[1].split("=")[1]);c[`${b}Page`]=g}),c.total=parseInt(h)),{data:Object.assign(Object.assign({},d),c),error:null}}catch(c){if(D(c))return{data:{users:[]},error:c};throw c}}async getUserById(t){Tr(t);try{return await V(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:ln})}catch(r){if(D(r))return{data:{user:null},error:r};throw r}}async updateUserById(t,r){Tr(t);try{return await V(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:r,headers:this.headers,xform:ln})}catch(n){if(D(n))return{data:{user:null},error:n};throw n}}async deleteUser(t,r=!1){Tr(t);
185try{return await V(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:r},xform:ln})}catch(n){if(D(n))return{data:{user:null},error:n};throw n}}async _listFactors(t){Tr(t.userId);try{const{data:r,error:n}=await V(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:r,error:n}}catch(r){if(D(r))return{data:null,error:r};throw r}}async _deleteFactor(t){Tr(t.userId),Tr(t.id);try{return{data:await V(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(r){if(D(r))return{data:null,error:r};throw r}}async _listOAuthClients(t){var r,n,s,o,i,a,l;try{const c={nextPage:null,lastPage:0,total:0},u=await V(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=t==null?void 0:t.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(o=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&o!==void 0?o:""},xform:fg});if(u.error)throw u.error;const d=await u.json(),h=(i=u.headers.get("x-total-count"))!==null&&i!==void 0?i:0,f=(l=(a=u.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&l!==void 0?l:[];return f.length>0&&(f.forEach(x=>{const g=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(x.split(";")[1].split("=")[1]);c[`${b}Page`]=g}),c.total=parseInt(h)),{data:Object.assign(Object.assign({},d),c),error:null}}catch(c){if(D(c))return{data:{clients:[]},error:c};throw c}}async _createOAuthClient(t){try{return await V(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(D(r))return{data:null,error:r};throw r}}async _getOAuthClient(t){try{return await V(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(D(r))return{data:null,error:r};throw r}}async _updateOAuthClient(t,r){try{return await V(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(D(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(t){try{return await V(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(D(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(t){try{return await V(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(D(r))return{data:null,error:r};throw r}}async _listCustomProviders(t){try{const r={};return t!=null&&t.type&&(r.type=t.type),await V(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:r,xform:n=>{var s;return{data:{providers:(s=n==null?void 0:n.providers)!==null&&s!==void 0?s:[]},error:null}}})}catch(r){if(D(r))return{data:{providers:[]},error:r};throw r}}async _createCustomProvider(t){try{return await V(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(D(r))return{data:null,error:r};throw r}}async _getCustomProvider(t){try{return await V(this.fetch,"GET",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(D(r))return{data:null,error:r};throw r}}async _updateCustomProvider(t,r){try{return await V(this.fetch,"PUT",`${this.url}/admin/custom-providers/${t}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(D(n))return{data:null,error:n};throw n}}async _deleteCustomProvider(t){try{return await V(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(D(r))return{data:null,error:r};throw r}}async _adminListPasskeys(t){Wt(this.experimental),Tr(t.userId);try{return await V(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/passkeys`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(D(r))return{data:null,error:r};throw r}}async _adminDeletePasskey(t){Wt(this.experimental),Tr(t.userId),Tr(t.passkeyId);
185try{return await V(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/passkeys/${t.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(D(r))return{data:null,error:r};throw r}}}function pg(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}globalThis&&hb()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug");class _N extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}function EN(){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)}}function pb(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function kN(e){return parseInt(e,16)}function CN(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,n=>n.toString(16).padStart(2,"0")).join("")}function TN(e){var t;const{chainId:r,domain:n,expirationTime:s,issuedAt:o=new Date,nonce:i,notBefore:a,requestId:l,resources:c,scheme:u,uri:d,version:h}=e;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(i&&i.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${i}`);if(!d)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(h!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${h}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(`
186`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const f=pb(e.address),x=u?`${u}://${n}`:n,g=e.statement?`${e.statement}
187`:"",b=`${x} wants you to sign in with your Ethereum account:
188${f}
189
190${g}`;let v=`URI: ${d}
191Version: ${h}
192Chain ID: ${r}${i?`
193Nonce: ${i}`:""}
194Issued At: ${o.toISOString()}`;if(s&&(v+=`
195Expiration Time: ${s.toISOString()}`),a&&(v+=`
196Not Before: ${a.toISOString()}`),l&&(v+=`
197Request ID: ${l}`),c){let m=`
198Resources:`;for(const y of c){if(!y||typeof y!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${y}`);m+=`
199- ${y}`}v+=m}return`${b}
200${v}`}class $e extends Error{constructor({message:t,code:r,cause:n,name:s}){var o;super(t,{cause:n}),this.__isWebAuthnError=!0,this.name=(o=s??(n instanceof Error?n.name:void 0))!==null&&o!==void 0?o:"Unknown Error",this.code=r}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class Ql extends $e{constructor(t,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:t}),this.name="WebAuthnUnknownError",this.originalError=r}}function RN({error:e,options:t}){var r,n,s;const{publicKey:o}=t;if(!o)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new $e({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((r=o.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new $e({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((n=o.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new $e({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((s=o.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new $e({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new $e({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new $e({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return o.pubKeyCredParams.filter(a=>a.type==="public-key").length===0?new $e({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new $e({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const i=window.location.hostname;if(mb(i)){if(o.rp.id!==i)return new $e({message:`The RP ID "${o.rp.id}
200" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new $e({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(o.user.id.byteLength<1||o.user.id.byteLength>64)return new $e({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new $e({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new $e({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function PN({error:e,options:t}){const{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new $e({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new $e({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const n=window.location.hostname;if(mb(n)){if(r.rpId!==n)return new $e({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new $e({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new $e({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new $e({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class AN{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const nh=new AN;function mg(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:r,excludeCredentials:n}=e,s=jc(e,["challenge","user","excludeCredentials"]),o=to(t).buffer,i=Object.assign(Object.assign({},r),{id:to(r.id).buffer}),a=Object.assign(Object.assign({},s),{challenge:o,user:i});if(n&&n.length>0){a.excludeCredentials=new Array(n.length);for(let l=0;l<n.length;l++){const c=n[l];a.excludeCredentials[l]=Object.assign(Object.assign({},c),{id:to(c.id).buffer,type:c.type||"public-key",transports:c.transports})}}return a}function gg(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:r}=e,n=jc(e,["challenge","allowCredentials"]),s=to(t).buffer,o=Object.assign(Object.assign({},n),{challenge:s});if(r&&r.length>0){o.allowCredentials=new Array(r.length);for(let i=0;i<r.length;i++){const a=r[i];o.allowCredentials[i]=Object.assign(Object.assign({},a),{id:to(a.id).buffer,type:a.type||"public-key",transports:a.transports})}}return o}function vg(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const r=e;return{id:e.id,rawId:e.id,response:{attestationObject:rs(new Uint8Array(e.response.attestationObject)),clientDataJSON:rs(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function yg(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const r=e,n=e.getClientExtensionResults(),s=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:rs(new Uint8Array(s.authenticatorData)),clientDataJSON:rs(new Uint8Array(s.clientDataJSON)),signature:rs(new Uint8Array(s.signature)),userHandle:s.userHandle?rs(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function mb(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function Yl(){var e,t;return!!(Ze()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.get)=="function")}async function gb(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Ql("Browser returned unexpected credential type",t)}:{data:null,error:new Ql("Empty credential response",t)}}
200catch(t){return{data:null,error:RN({error:t,options:e})}}}async function vb(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Ql("Browser returned unexpected credential type",t)}:{data:null,error:new Ql("Empty credential response",t)}}catch(t){return{data:null,error:PN({error:t,options:e})}}}const NN={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},jN={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Xl(...e){const t=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),r=s=>s instanceof ArrayBuffer||ArrayBuffer.isView(s),n={};for(const s of e)if(s)for(const o in s){const i=s[o];if(i!==void 0)if(Array.isArray(i))n[o]=i;else if(r(i))n[o]=i;else if(t(i)){const a=n[o];t(a)?n[o]=Xl(a,i):n[o]=Xl(i)}else n[o]=i}return n}function ON(e,t){return Xl(NN,e,t||{})}function IN(e,t){return Xl(jN,e,t||{})}class LN{constructor(t){this.client=t,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:r,friendlyName:n,signal:s},o){var i;try{const{data:a,error:l}=await this.client.mfa.challenge({factorId:t,webauthn:r});if(!a)return{data:null,error:l};const c=s??nh.createNewAbortSignal();if(a.webauthn.type==="create"){const{user:u}=a.webauthn.credential_options.publicKey;if(!u.name){const d=n;if(d)u.name=`${u.id}:${d}`;else{const f=(await this.client.getUser()).data.user,x=((i=f==null?void 0:f.user_metadata)===null||i===void 0?void 0:i.name)||(f==null?void 0:f.email)||(f==null?void 0:f.id)||"User";u.name=`${u.id}:${x}`}}u.displayName||(u.displayName=u.name)}switch(a.webauthn.type){case"create":{const u=ON(a.webauthn.credential_options.publicKey,o==null?void 0:o.create),{data:d,error:h}=await gb({publicKey:u,signal:c});return d?{data:{factorId:t,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:d}},error:null}:{data:null,error:h}}case"request":{const u=IN(a.webauthn.credential_options.publicKey,o==null?void 0:o.request),{data:d,error:h}=await vb(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:u,signal:c}));return d?{data:{factorId:t,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:d}},error:null}:{data:null,error:h}}}}catch(a){return D(a)?{data:null,error:a}:{data:null,error:new er("Unexpected error in challenge",a)}}}async _verify({challengeId:t,factorId:r,webauthn:n}){return this.client.mfa.verify({factorId:r,challengeId:t,webauthn:n})}async _authenticate({factorId:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},o){if(!r)return{data:null,error:new Wi("rpId is required for WebAuthn authentication")};try{if(!Yl())return{data:null,error:new er("Browser does not support WebAuthn",null)};const{data:i,error:a}=await this.challenge({factorId:t,webauthn:{rpId:r,rpOrigins:n},signal:s},{request:o});if(!i)return{data:null,error:a};const{webauthn:l}=i;return this._verify({factorId:t,challengeId:i.challengeId,webauthn:{type:l.type,rpId:r,rpOrigins:n,credential_response:l.credential_response}})}catch(i){return D(i)?{data:null,error:i}:{data:null,error:new er("Unexpected error in authenticate",i)}}}async _register({friendlyName:t,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},o){if(!r)return{data:null,error:new Wi("rpId is required for WebAuthn registration")};try{if(!Yl())return{data:null,error:new er("Browser does not support WebAuthn",null)};const{data:i,error:a}=await this._enroll({friendlyName:t});if(!i)return await this.client.mfa.listFactors().then(u=>{var d;return(d=u.data)===null||d===void 0?void 0:d.all.find(h=>h.factor_type==="webauthn"&&h.friendly_name===t&&h.status!=="unverified")}).then(u=>u?this.client.mfa.unenroll({factorId:u==null?void 0:u.id}):void 0),{data:null,error:a};const{data:l,error:c}=await this._challenge({factorId:i.id,friendlyName:i.friendly_name,webauthn:{rpId:r,rpOrigins:n},signal:s},{create:o});return l?this._verify({factorId:i.id,challengeId:l.challengeId,webauthn:{rpId:r,rpOrigins:n,type:l.webauthn.type,credential_response:l.webauthn.credential_response}}):{data:null,error:c}}catch(i){return D(i)?{data:null,error:i}:{data:null,error:new er("Unexpected error in register",i)}}}}EN();const $N={url:UA,storageKey:FA,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:BA,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}},Ts={};class Ki{get jwks(){var t,r;return(r=(t=Ts[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(t){Ts[this.storageKey]=Object.assign(Object.assign({},Ts[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,r;return(r=(t=Ts[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){Ts[this.storageKey]=Object.assign(Object.assign({},Ts[this.storageKey]),{cachedAt:t})}constructor(t){var r,n,s;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.lastRefreshFailure=null,this._sessionRemovalEpoch=0,this.initializePromise=null,this._pendingInitNotifications=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lock=null,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const o=Object.assign(Object.assign({},$N),t);if(this.storageKey=o.storageKey,this.instanceID=(r=Ki.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,Ki.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!o.debug,typeof o.debug=="function"&&(this.logger=o.debug),this.instanceID>0&&Ze()){const i=`${this._logPrefix()} 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.`;console.warn(i),this.logDebugMessages&&console.trace(i)}if(this.persistSession=o.persistSession,this.autoRefreshToken=o.autoRefreshToken,this.experimental=(n=o.experimental)!==null&&n!==void 0?n:{},this.admin=new SN({url:o.url,headers:o.headers,fetch:o.fetch,experimental:this.experimental}),this.url=o.url,this.headers=o.headers,this.fetch=fb(o.fetch),this.detectSessionInUrl=o.detectSessionInUrl,this.flowType=o.flowType,this.hasCustomAuthorizationHeader=o.hasCustomAuthorizationHeader,this.throwOnError=o.throwOnError,this.lockAcquireTimeout=o.lockAcquireTimeout,o.lock!=null&&(this.lock=o.lock),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),webauthn:new LN(this)}
200,this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(o.storage?this.storage=o.storage:hb()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=pg(this.memoryStorage)),o.userStorage&&(this.userStorage=o.userStorage)):(this.memoryStorage={},this.storage=pg(this.memoryStorage)),Ze()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(i){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",i)}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async i=>{this._debug("received broadcast notification from other tab or client",i),(i.data.event==="TOKEN_REFRESHED"||i.data.event==="SIGNED_IN")&&(this.lastRefreshFailure=null);try{await this._notifyAllSubscribers(i.data.event,i.data.session,!1)}catch(a){this._debug("#broadcastChannel","error",a)}})}o.skipAutoInitialize||this.initialize().catch(i=>{this._debug("#initialize()","error",i)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${cb}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){var t;if(this.initializePromise)return await this.initializePromise;this._pendingInitNotifications=[],this.initializePromise=(async()=>this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()):await this._initialize())();
200const r=await this.initializePromise,n=(t=this._pendingInitNotifications)!==null&&t!==void 0?t:[];this._pendingInitNotifications=null;for(const s of n)await this._notifyAllSubscribers(s.event,s.session,s.broadcast);return r}async _initialize(){var t;try{let r={},n="none";if(Ze()&&(r=rN(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),Ze()&&this.detectSessionInUrl&&n!=="none"){const{data:s,error:o}=await this._getSessionFromURL(r,n);if(o){if(this._debug("#_initialize()","error detecting session from URL",o),KA(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{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(r){return D(r)?this._returnResult({error:r}):this._returnResult({error:new er("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var r,n,s;try{const o=await V(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(s=t==null?void 0:t.options)===null||s===void 0?void 0:s.captchaToken}},xform:At}),{data:i,error:a}=o;if(a||!i)return this._returnResult({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)),this._returnResult({data:{user:c,session:l},error:null})}catch(o){if(D(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signUp(t){var r,n,s;try{let o;if("email"in t){const{email:u,password:d,options:h}=t;let f=null,x=null;this.flowType==="pkce"&&([f,x]=await Gn(this.storage,this.storageKey)),o=await V(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:h==null?void 0:h.emailRedirectTo,body:{email:u,password:d,data:(r=h==null?void 0:h.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken},code_challenge:f,code_challenge_method:x},xform:At})}else if("phone"in t){const{phone:u,password:d,options:h}=t;o=await V(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:u,password:d,data:(n=h==null?void 0:h.data)!==null&&n!==void 0?n:{},channel:(s=h==null?void 0:h.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken}},xform:At})}else throw new Ba("You must provide either an email or phone number and a password");const{data:i,error:a}=o;if(a||!i)return await Le(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({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)),this._returnResult({data:{user:c,session:l},error:null})}catch(o){if(await Le(this.storage,`${this.storageKey}-code-verifier`),D(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signInWithPassword(t){try{let r;if("email"in t){const{email:o,password:i,options:a}=t;r=await V(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:hg})}else if("phone"in t){const{phone:o,password:i,options:a}=t;r=await V(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:hg})}else throw new Ba("You must provide either an email or phone number and a password");const{data:n,error:s}=r;if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!n||!n.session||!n.user){const o=new Cs;return this._returnResult({data:{user:null,session:null},error:o})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:s})}catch(r){if(D(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(t){var r,n,s,o;return await this._handleProviderSignIn(t.provider,{redirectTo:(r=t.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=t.options)===null||n===void 0?void 0:n.scopes,queryParams:(s=t.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(o=t.o
200ptions)===null||o===void 0?void 0:o.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this.lock!=null?this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t)):this._exchangeCodeForSession(t)}async signInWithWeb3(t){const{chain:r}=t;switch(r){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(t){var r,n,s,o,i,a,l,c,u,d,h;let f,x;if("message"in t)f=t.message,x=t.signature;else{const{chain:g,wallet:b,statement:v,options:m}=t;let y;if(Ze())if(typeof b=="object")y=b;else{const P=window;if("ethereum"in P&&typeof P.ethereum=="object"&&"request"in P.ethereum&&typeof P.ethereum.request=="function")y=P.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) 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: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof b!="object"||!(m!=null&&m.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");y=b}const S=new URL((r=m==null?void 0:m.url)!==null&&r!==void 0?r:window.location.href),E=await y.request({method:"eth_requestAccounts"}).then(P=>P).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!E||E.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const _=pb(E[0]);let T=(n=m==null?void 0:m.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!T){const P=await y.request({method:"eth_chainId"});T=kN(P)}const R={domain:S.host,address:_,statement:v,uri:S.href,version:"1",chainId:T,nonce:(s=m==null?void 0:m.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(i=(o=m==null?void 0:m.signInWithEthereum)===null||o===void 0?void 0:o.issuedAt)!==null&&i!==void 0?i:new Date,expirationTime:(a=m==null?void 0:m.signInWithEthereum)===null||a===void 0?void 0:a.expirationTime,notBefore:(l=m==null?void 0:m.signInWithEthereum)===null||l===void 0?void 0:l.notBefore,requestId:(c=m==null?void 0:m.signInWithEthereum)===null||c===void 0?void 0:c.requestId,resources:(u=m==null?void 0:m.signInWithEthereum)===null||u===void 0?void 0:u.resources};f=TN(R),x=await y.request({method:"personal_sign",params:[CN(f),_]})}try{const{data:g,error:b}=await V(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:f,signature:x},!((d=t.options)===null||d===void 0)&&d.captchaToken?{gotrue_meta_security:{captcha_token:(h=t.options)===null||h===void 0?void 0:h.captchaToken}}:null),xform:At});if(b)throw b;if(!g||!g.session||!g.user){const v=new Cs;return this._returnResult({data:{user:null,session:null},error:v})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:Object.assign({},g),error:b})}catch(g){if(D(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async signInWithSolana(t){var r,n,s,o,i,a,l,c,u,d,h,f;let x,g;if("message"in t)x=t.message,g=t.signature;else{const{chain:b,wallet:v,statement:m,options:y}=t;let S;if(Ze())if(typeof v=="object")S=v;else{const _=window;if("solana"in _&&typeof _.solana=="object"&&("signIn"in _.solana&&typeof _.solana.signIn=="function"||"signMessage"in _.solana&&typeof _.solana.signMessage=="function"))S=_.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"||!(y!=null&&y.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");S=v}const E=new URL((r=y==null?void 0:y.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in S&&S.signIn){const _=await S.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},y==null?void 0:y.signInWithSolana),{version:"1",domain:E.host,uri:E.href}),m?{statement:m}:null));let T;if(Array.isArray(_)&&_[0]&&typeof _[0]=="object")T=_[0];else if(_&&typeof _=="object"&&"signedMessage"in _&&"signature"in _)T=_;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in T&&"signature"in T&&(typeof T.signedMessage=="string"||T.signedMessage instanceof Uint8Array)&&T.signature instanceof Uint8Array)x=typeof T.signedMessage=="string"?T.signedMessage:new TextDecoder().decode(T.signedMessage),g=T.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in S)||typeof S.signMessage!="function"||!("publicKey"in S)||typeof S!="object"||!S.publicKey||!("toBase58"in S.publicKey)||typeof S.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");x=[`${E.host} wants you to sign in with your Solana account:`,S.publicKey.toBase58(),...m?["",m,""]:[""],"Version: 1",`URI: ${E.href}`,`Issued At: ${(s=(n=y==null?void 0:y.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((o=y==null?void 0:y.signInWithSolana)===null||o===void 0)&&o.notBefore?[`Not Before: ${y.signInWithSolana.notBefore}`]:[],...!((i=y==null?void 0:y.signInWithSolana)===null||i===void 0)&&i.expirationTime?[`Expiration Time: ${y.signInWithSolana.expirationTime}`]:[],...!((a=y==null?void 0:y.signInWithSolana)===null||a===void 0)&&a.chainId?[`Chain ID: ${y.signInWithSolana.chainId}`]:[],...!((l=y==null?void 0:y.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${y.signInWithSolana.nonce}`]:[],...!((c=y==null?void 0:y.signInWithSolana)===null||c===void 0)&&c.requestId?[`Request ID: ${y.signInWithSolana.requestId}`]:[],...!((d=(u=y==null?void 0:y.signInWithSolana)===null||u===void 0?void 0:u.resources)===null||d===void 0)&&d.length?["Resources",...y.signInWithSolana.resources.map(T=>`- ${T}`)]:[]].join(`
201`);const _=await S.signMessage(new TextEncoder().encode(x),"utf8");if(!_||!(_ instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");g=_}}try{const{data:b,error:v}=await V(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:x,signature:rs(g)}
201,!((h=t.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(f=t.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:At});if(v)throw v;if(!b||!b.session||!b.user){const m=new Cs;return this._returnResult({data:{user:null,session:null},error:m})}return b.session&&(await this._saveSession(b.session),await this._notifyAllSubscribers("SIGNED_IN",b.session)),this._returnResult({data:Object.assign({},b),error:v})}catch(b){if(D(b))return this._returnResult({data:{user:null,session:null},error:b});throw b}}async _exchangeCodeForSession(t){const r=await Vt(this.storage,`${this.storageKey}-code-verifier`),[n,s]=(r??"").split("/");try{if(!n&&this.flowType==="pkce")throw new qA;const{data:o,error:i}=await V(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:n},xform:At});if(await Le(this.storage,`${this.storageKey}-code-verifier`),i)throw i;if(!o||!o.session||!o.user){const a=new Cs;return this._returnResult({data:{user:null,session:null,redirectType:null},error:a})}return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers(s==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",o.session)),this._returnResult({data:Object.assign(Object.assign({},o),{redirectType:s??null}),error:i})}catch(o){if(await Le(this.storage,`${this.storageKey}-code-verifier`),D(o))return this._returnResult({data:{user:null,session:null,redirectType:null},error:o});throw o}}async signInWithIdToken(t){try{const{options:r,provider:n,token:s,access_token:o,nonce:i}=t,a=await V(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:s,access_token:o,nonce:i,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:At}),{data:l,error:c}=a;if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!l||!l.session||!l.user){const u=new Cs;return this._returnResult({data:{user:null,session:null},error:u})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:l,error:c})}catch(r){if(D(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(t){var r,n,s,o,i;try{if("email"in t){const{email:a,options:l}=t;let c=null,u=null;this.flowType==="pkce"&&([c,u]=await Gn(this.storage,this.storageKey));const{error:d}=await V(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(r=l==null?void 0:l.data)!==null&&r!==void 0?r:{},create_user:(n=l==null?void 0:l.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},code_challenge:c,code_challenge_method:u},redirectTo:l==null?void 0:l.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:d})}if("phone"in t){const{phone:a,options:l}=t,{data:c,error:u}=await V(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 this._returnResult({data:{user:null,session:null,messageId:c==null?void 0:c.message_id},error:u})}throw new Ba("You must provide either an email or phone number.")}catch(a){if(await Le(this.storage,`${this.storageKey}-code-verifier`),D(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async verifyOtp(t){var r,n;try{let s,o;"options"in t&&(s=(r=t.options)===null||r===void 0?void 0:r.redirectTo,o=(n=t.options)===null||n===void 0?void 0:n.captchaToken);const{data:i,error:a}=await V(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:o}}),redirectTo:s,xform:At});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)),this._returnResult({data:{user:c,session:l},error:null})}catch(s){if(D(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithSSO(t){var r,n,s,o,i;try{let a=null,l=null;this.flowType==="pkce"&&([a,l]=await Gn(this.storage,this.storageKey));const c=await V(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:(n=(r=t.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n: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:a,code_challenge_method:l}),headers:this.headers,xform:wN});return!((o=c.data)===null||o===void 0)&&o.url&&Ze()&&!(!((i=t.options)===null||i===void 0)&&i.skipBrowserRedirect)&&window.location.assign(c.data.url),this._returnResult(c)}catch(a){if(await Le(this.storage,`${this.storageKey}-code-verifier`),D(a))return this._returnResult({data:null,error:a});throw a}}async reauthenticate(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate()):await this._reauthenticate()}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;if(n)throw n;if(!r)throw new Be;const{error:s}=await V(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:s})})}catch(t){if(D(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const r=`${this.url}/resend`;if("email"in t){const{email:n,type:s,options:o}=t;let i=null,a=null;this.flowType==="pkce"&&([i,a]=await Gn(this.storage,this.storageKey));const{error:l}=await V(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:s,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken},code_challenge:i,code_challenge_method:a},redirectTo:o==null?void 0:o.emailRedirectTo});return l&&await Le(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:l})}else if("phone"in t){const{phone:n,type:s,options:o}=t,{data:i,error:a}=await V(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:s,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:i==null?void 0:i.message_id},error:a})}throw new Ba("You must provide either an email or phone number and a type")}catch(r){if(await Le(this.storage,`${this.storageKey}-code-verifier`),D(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async t=>t)):await this._useSession(async t=>t)}async _acquireLock(t,r){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await n,await r()))();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 n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await n}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 r=await this.__loadSession();return await t(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lock!=null&&!this.lockAcquired&&this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const r=await Vt(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?t=r:(this._debug("#getSession()","session from storage is not val
201id"),await this._removeSession())),!t)return{data:{session:null},error:null};const n=t.expires_at?t.expires_at*1e3-Date.now()<ku:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",t.expires_at),!n){if(this.userStorage){const i=await Vt(this.userStorage,this.storageKey+"-user");i!=null&&i.user?t.user=i.user:t.user=Cu()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const i={value:this.suppressGetSessionWarning};t.user=mN(t.user,i),i.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:s,error:o}=await this._callRefreshToken(t.refresh_token);if(o){if(!!(t.expires_at&&t.expires_at*1e3>Date.now())){const a=await Vt(this.storage,this.storageKey);if(a&&a.refresh_token===t.refresh_token)return this._returnResult({data:{session:t},error:null})}return this._returnResult({data:{session:null},error:o})}return this._returnResult({data:{session:s},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;let r;return this.lock!=null?r=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser()):r=await this._getUser(),r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(t){try{return t?await V(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:ln}):await this._useSession(async r=>{var n,s,o;const{data:i,error:a}=r;if(a)throw a;return!(!((n=i.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Be}:await V(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:ln})})}catch(r){if(D(r))return Fa(r)&&(await this._removeSession(),await Le(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(t,r={}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,r)):await this._updateUser(t,r)}async _updateUser(t,r={}){try{return await this._useSession(async n=>{const{data:s,error:o}=n;if(o)throw o;if(!s.session)throw new Be;const i=s.session;let a=null,l=null;this.flowType==="pkce"&&t.email!=null&&([a,l]=await Gn(this.storage,this.storageKey));const{data:c,error:u}=await V(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:a,code_challenge_method:l}),jwt:i.access_token,xform:ln});if(u)throw u;return i.user=c.user,await this._saveSession(i),await this._notifyAllSubscribers("USER_UPDATED",i),this._returnResult({data:{user:i.user},error:null})})}catch(n){if(await Le(this.storage,`${this.storageKey}-code-verifier`),D(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(t){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t)):await this._setSession(t)}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new Be;const r=Date.now()/1e3;let n=r,s=!0,o=null;const{payload:i}=Ha(t.access_token);if(i.exp&&(n=i.exp,s=n<=r),s){const{data:a,error:l}=await this._callRefreshToken(t.refresh_token);if(l)return this._returnResult({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)return this._returnResult({data:{user:null,session:null},error:l});o={access_token:t.access_token,refresh_token:t.refresh_token,user:a.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)}return this._returnResult({data:{user:o.user,session:o},error:null})}catch(r){if(D(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(t){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t)):await this._refreshSession(t)}async _refreshSession(t){try{return await this._useSession(async r=>{var n;if(!t){const{data:i,error:a}=r;if(a)throw a;t=(n=i.session)!==null&&n!==void 0?n:void 0}if(!(t!=null&&t.refresh_token))throw new Be;const{data:s,error:o}=await this._callRefreshToken(t.refresh_token);return o?this._returnResult({data:{user:null,session:null},error:o}):s?this._returnResult({data:{user:s.user,session:s},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(D(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(t,r){var n;
201try{if(!Ze())throw new za("No browser detected.");if(t.error||t.error_description||t.error_code)throw new za(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new ng("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new za("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new ng("No code detected.");const{data:y,error:S}=await this._exchangeCodeForSession(t.code);if(S)throw S;const E=new URL(window.location.href);return E.searchParams.delete("code"),window.history.replaceState(window.history.state,"",E.toString()),{data:{session:y.session,redirectType:(n=y.redirectType)!==null&&n!==void 0?n:null},error:null}}const{provider_token:s,provider_refresh_token:o,access_token:i,refresh_token:a,expires_in:l,expires_at:c,token_type:u}=t;if(!i||!l||!a||!u)throw new za("No session defined in URL");const d=Math.round(Date.now()/1e3),h=parseInt(l);let f=d+h;c&&(f=parseInt(c));const x=f-d;x*1e3<=Ir&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${x}s, should have been closer to ${h}s`);const g=f-h;d-g>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",g,f,d):d-g<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",g,f,d);const{data:b,error:v}=await this._getUser(i);if(v)throw v;const m={provider_token:s,provider_refresh_token:o,access_token:i,expires_in:h,expires_at:f,refresh_token:a,token_type:u,user:b.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:m,redirectType:t.type},error:null})}catch(s){if(D(s))return this._returnResult({data:{session:null,redirectType:null},error:s});throw s}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error||t.error_description||t.error_code)}async _isPKCECallback(t){const r=await Vt(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&r)}async signOut(t={scope:"global"}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t)):await this._signOut(t)}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async r=>{var n;const s=async()=>{await this._removeSession(),await Le(this.storage,`${this.storageKey}-code-verifier`)},{data:o,error:i}=r;if(i&&!Fa(i))return this._returnResult({error:i});const a=(n=o.session)===null||n===void 0?void 0:n.access_token;if(a){const{error:l}=await this.admin.signOut(a,t);if(l&&!(WA(l)&&(l.status===404||l.status===401||l.status===403)||Fa(l)))return t!=="others"&&await s(),this._returnResult({error:l})}return t!=="others"&&await s(),this._returnResult({error:null})})}onAuthStateChange(t){const r=tN(),n={id:r,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(r)}):await this._emitInitialSession(r)))(),{data:{subscription:n}}}async _emitInitialSession(t){return await this._useSession(async r=>{var n,s;try{const{data:{session:o},error:i}=r;if(i)throw i;await((n=this.stateChangeEmitters.get(t))===null||n===void 0?void 0:n.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),Fa(o)?console.warn(o):console.error(o)}})}async resetPasswordForEmail(t,r={}){let n=null,s=null;this.flowType==="pkce"&&([n,s]=await Gn(this.storage,this.storageKey,!0));try{return await V(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:n,code_challenge_method:s,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(o){if(await Le(this.storage,`${this.storageKey}-code-verifier`),D(o))return this._returnResult({data:null,error:o});throw o}}async getUserIdentities(){var t;try{const{data:r,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:(t=r.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(r){if(D(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var r;try{const{data:n,error:s}=await this._useSession(async o=>{var i,a,l,c,u;const{data:d,error:h}=o;if(h)throw h;const f=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 V(this.fetch,"GET",f,{headers:this.headers,jwt:(u=(c=d.session)===null||c===void 0?void 0:c.access_token)!==null&&u!==void 0?u:void 0})});if(s)throw s;return Ze()&&!(!((r=t.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),this._returnResult({data:{provider:t.provider,url:n==null?void 0:n.url},error:null})}catch(n){if(D(n))return this._returnResult({data:{provider:t.provider,url:null},error:n});throw n}}async linkIdentityIdToken(t){return await this._useSession(async r=>{var n;try{const{error:s,data:{session:o}}=r;if(s)throw s;const{options:i,provider:a,token:l,access_token:c,nonce:u}=t,d=await V(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=o==null?void 0:o.access_token)!==null&&n!==void 0?n:void 0,body:{provider:a,id_token:l,access_token:c,nonce:u,link_identity:!0,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},xform:At}),{data:h,error:f}=d;return f?this._returnResult({data:{user:null,session:null},error:f}):!h||!h.session||!h.user?this._returnResult({data:{user:null,session:null},error:new Cs}):(h.session&&(await this._saveSession(h.session),await this._notifyAllSubscribers("USER_UPDATED",h.session)),this._returnResult({data:h,error:f}))}catch(s){if(await Le(this.storage,`${this.storageKey}-code-verifier`),D(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}})}async unlinkIdentity(t){try{return await this._useSession(async r=>{var n,s;const{data:o,error:i}=r;if(i)throw i;
201return await V(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(s=(n=o.session)===null||n===void 0?void 0:n.access_token)!==null&&s!==void 0?s:void 0})})}catch(r){if(D(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(t){const r="#_refreshAccessToken()";this._debug(r,"begin");try{const n=Date.now();return await oN(async s=>(s>0&&await sN(200*Math.pow(2,s-1)),this._debug(r,"refreshing attempt",s),await V(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:At})),(s,o)=>{const i=200*Math.pow(2,s);return o&&sg(o)&&Date.now()+i-n<Ir})}catch(n){if(this._debug(r,"error",n),D(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}finally{this._debug(r,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,r){const n=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",r,"url",n),Ze()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:t,url:n},error:null}}async _recoverAndRefresh(){var t,r;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const s=await Vt(this.storage,this.storageKey);if(s&&this.userStorage){let i=await Vt(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!i&&(i={user:s.user},await Os(this.userStorage,this.storageKey+"-user",i)),s.user=(t=i==null?void 0:i.user)!==null&&t!==void 0?t:Cu()}else if(s&&!s.user&&!s.user){const i=await Vt(this.storage,this.storageKey+"-user");i&&(i!=null&&i.user)?(s.user=i.user,await Le(this.storage,this.storageKey+"-user"),await Os(this.storage,this.storageKey,s)):s.user=Cu()}if(this._debug(n,"session from storage",s),!this._isValidSession(s)){this._debug(n,"session is not valid"),s!==null&&await this._removeSession();return}const o=((r=s.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<ku;if(this._debug(n,`session has${o?"":" not"} expired with margin of ${ku}s`),o){if(this.autoRefreshToken&&s.refresh_token){const{error:i}=await this._callRefreshToken(s.refresh_token);i&&(GA(i)?this._debug(n,"refresh discarded by commit guard",i):this._debug(n,"refresh failed",i))}}else if(s.user&&s.user.__isUserNotAvailableProxy===!0)try{const{data:i,error:a}=await this._getUser(s.access_token);!a&&(i!=null&&i.user)?(s.user=i.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(i){console.error("Error getting user data:",i),this._debug(n,"error getting user data, skipping SIGNED_IN notification",i)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){this._debug(n,"error",s),console.error(s);return}finally{this._debug(n,"end")}}async _callRefreshToken(t){var r,n;if(!t)throw new Be;if(this.refreshingDeferred)return this.refreshingDeferred.promise;if(this.lastRefreshFailure&&this.lastRefreshFailure.refreshToken===t&&Date.now()<this.lastRefreshFailure.expiresAt)return this._debug("#_callRefreshToken()","returning cached failure (cooldown active)"),this.lastRefreshFailure.result;const s="#_callRefreshToken()";this._debug(s,"begin");try{this.refreshingDeferred=new Oc;const o=await Vt(this.storage,this.storageKey),{data:i,error:a}=await this._refreshAccessToken(t);if(a)throw a;if(!i.session)throw new Be;const l=await Vt(this.storage,this.storageKey);if(o!==null&&(l===null||l.refresh_token!==o.refresh_token)){this._debug(s,"commit guard: storage changed since refresh started, discarding rotated tokens",{startedWith:"present",nowHolds:l?"replaced":"cleared"});const h={data:null,error:new og};return this.refreshingDeferred.resolve(h),h}const u=this._sessionRemovalEpoch;if(await this._saveSession(i.session),this._sessionRemovalEpoch!==u){this._debug(s,"commit guard (post-save): _removeSession ran during _saveSession, und
201oing write"),await Le(this.storage,this.storageKey),this.userStorage&&await Le(this.userStorage,this.storageKey+"-user");const h={data:null,error:new og};return this.refreshingDeferred.resolve(h),h}await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const d={data:i.session,error:null};return this.lastRefreshFailure=null,this.refreshingDeferred.resolve(d),d}catch(o){if(this._debug(s,"error",o),D(o)){const i={data:null,error:o};if(!sg(o)){const a=await Vt(this.storage,this.storageKey);!!(a!=null&&a.expires_at&&a.expires_at*1e3>Date.now())?this._debug(s,"proactive refresh failed, access token still valid — preserving session"):await this._removeSession()}return this.lastRefreshFailure={refreshToken:t,result:i,expiresAt:Date.now()+DA},(r=this.refreshingDeferred)===null||r===void 0||r.resolve(i),i}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(o),o}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(t,r,n=!0){if(this._pendingInitNotifications!==null&&n){this._pendingInitNotifications.push({event:t,session:r,broadcast:n});return}const s=`#_notifyAllSubscribers(${t})`;this._debug(s,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:t,session:r});const o=[],i=Array.from(this.stateChangeEmitters.values()).map(async a=>{try{await a.callback(t,r)}catch(l){o.push(l)}});if(await Promise.all(i),o.length>0){for(let a=0;a<o.length;a+=1)console.error(o[a]);throw o[0]}}finally{this._debug(s,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0;const r=Object.assign({},t),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await Os(this.userStorage,this.storageKey+"-user",{user:r.user});const s=Object.assign({},r);delete s.user;const o=ug(s);await Os(this.storage,this.storageKey,o)}else{const s=ug(r);await Os(this.storage,this.storageKey,s)}}async _removeSession(){this._sessionRemovalEpoch+=1,this._debug("#_removeSession()"),this.lastRefreshFailure=null,this.suppressGetSessionWarning=!1,await Le(this.storage,this.storageKey),await Le(this.storage,this.storageKey+"-code-verifier"),await Le(this.storage,this.storageKey+"-user"),this.userStorage&&await Le(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&Ze()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),Ir);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);const r=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);const r=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,r&&clearTimeout(r)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async dispose(){var t;this._removeVisibilityChangedCallback(),await this._stopAutoRefresh(),(t=this.broadcastChannel)===null||t===void 0||t.close(),this.broadcastChannel=null,this.stateChangeEmitters.clear()}async _autoRefreshTokenTick(){if(this._debug("#_autoRefreshTokenTick()","begin"),this.lock!=null){try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((n.expires_at*1e3-t)/Ir);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${Ir}ms, refresh threshold is ${Jo} ticks`),s<=Jo&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t instanceof _N)this._debug("auto refresh token tick lock not available");else throw t}return}if(this.refreshingDeferred!==null){this._debug("#_autoRefreshTokenTick()","refresh already in flight, skipping");return}try{const t=Date.now();try{await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((n.expires_at*1e3-t)/Ir);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${Ir}ms, refresh threshold is ${Jo} ticks`),s<=Jo&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Ze()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(t){this._debug("#visibilityChangedCallback","error",t)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const r=`#_onVisibilityChanged(${t})`;if(this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"){if(this.autoRefreshToken&&this._startAutoRefresh(),!t)if(await this.initializePromise,this.lock!=null)await this._acquireLock(this.lockAcquireTimeout,async()=>
201{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()});else{if(document.visibilityState!=="visible"){this._debug(r,"visibilityState is no longer visible, skipping recovery");return}await this._recoverAndRefresh()}}else document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,r,n){const s=[`provider=${encodeURIComponent(r)}`];if(n!=null&&n.redirectTo&&s.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&s.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[o,i]=await Gn(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(o)}`,code_challenge_method:`${encodeURIComponent(i)}`});s.push(a.toString())}if(n!=null&&n.queryParams){const o=new URLSearchParams(n.queryParams);s.push(o.toString())}return n!=null&&n.skipBrowserRedirect&&s.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${t}?${s.join("&")}`}async _unenroll(t){try{return await this._useSession(async r=>{var n;const{data:s,error:o}=r;return o?this._returnResult({data:null,error:o}):await V(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(D(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(t){try{return await this._useSession(async r=>{var n,s;const{data:o,error:i}=r;if(i)return this._returnResult({data:null,error:i});const a=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:l,error:c}=await V(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(n=o==null?void 0:o.session)===null||n===void 0?void 0:n.access_token});return c?this._returnResult({data:null,error:c}):(t.factorType==="totp"&&l.type==="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}`),this._returnResult({data:l,error:null}))})}catch(r){if(D(r))return this._returnResult({data:null,error:r});throw r}}async _verify(t){const r=async()=>{try{return await this._useSession(async n=>{var s;const{data:o,error:i}=n;if(i)return this._returnResult({data:null,error:i});const a=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?vg(t.webauthn.credential_response):yg(t.webauthn.credential_response)})}:{code:t.code}),{data:l,error:c}=await V(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:a,headers:this.headers,jwt:(s=o==null?void 0:o.session)===null||s===void 0?void 0:s.access_token});return c?this._returnResult({data:null,error:c}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+l.expires_in},l)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",l),this._returnResult({data:l,error:c}))})}catch(n){if(D(n))return this._returnResult({data:null,error:n});throw n}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,r):r()}async _challenge(t){const r=async()=>{try{return await this._useSession(async n=>{var s;const{data:o,error:i}=n;if(i)return this._returnResult({data:null,error:i});const a=await V(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(s=o==null?void 0:o.session)===null||s===void 0?void 0:s.access_token});if(a.error)return a;const{data:l}=a;if(l.type!=="webauthn")return{data:l,error:null};switch(l.webauthn.type){case"create":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:mg(l.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:gg(l.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(D(n))return this._returnResult({data:null,error:n});throw n}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,r):r()}async _challengeAndVerify(t){const{data:r,error:n}=await this._challenge({factorId:t.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:t.factorId,challengeId:r.id,code:t.code})}async _listFactors(){var t;const{data:{user:r},error:n}=await this.getUser();if(n)return{data:null,error:n};const s={all:[],phone:[],totp:[],webauthn:[]};for(const o of(t=r==null?void 0:r.factors)!==null&&t!==void 0?t:[])s.all.push(o),o.status==="verified"&&s[o.factor_type].push(o);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(t){var r,n,s,o;if(t)try{const{payload:f}=Ha(t);let x=null;f.aal&&(x=f.aal);let g=x;const{data:{user:b},error:v}=await this.getUser(t);if(v)return this._returnResult({data:null,error:v});((n=(r=b==null?void 0:b.factors)===null||r===void 0?void 0:r.filter(S=>S.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(g="aal2");const y=f.amr||[];return{data:{currentLevel:x,nextLevel:g,currentAuthenticationMethods:y},error:null}}catch(f){if(D(f))return this._returnResult({data:null,error:f});throw f}const{data:{session:i},error:a}
201=await this.getSession();if(a)return this._returnResult({data:null,error:a});if(!i)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:l}=Ha(i.access_token);let c=null;l.aal&&(c=l.aal);let u=c;((o=(s=i.user.factors)===null||s===void 0?void 0:s.filter(f=>f.status==="verified"))!==null&&o!==void 0?o:[]).length>0&&(u="aal2");const h=l.amr||[];return{data:{currentLevel:c,nextLevel:u,currentAuthenticationMethods:h},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?await V(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:n.access_token,xform:o=>({data:o,error:null})}):this._returnResult({data:null,error:new Be})})}catch(r){if(D(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(t,r){try{return await this._useSession(async n=>{const{data:{session:s},error:o}=n;if(o)return this._returnResult({data:null,error:o});if(!s)return this._returnResult({data:null,error:new Be});const i=await V(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"approve"},xform:a=>({data:a,error:null})});return i.data&&i.data.redirect_url&&Ze()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(i.data.redirect_url),i})}catch(n){if(D(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(t,r){try{return await this._useSession(async n=>{const{data:{session:s},error:o}=n;if(o)return this._returnResult({data:null,error:o});if(!s)return this._returnResult({data:null,error:new Be});const i=await V(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"deny"},xform:a=>({data:a,error:null})});return i.data&&i.data.redirect_url&&Ze()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(i.data.redirect_url),i})}catch(n){if(D(n))return this._returnResult({data:null,error:n});throw n}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;return n?this._returnResult({data:null,error:n}):r?await V(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new Be})})}catch(t){if(D(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?(await V(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new Be})})}catch(r){if(D(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(t,r={keys:[]}){let n=r.keys.find(a=>a.kid===t);if(n)return n;const s=Date.now();if(n=this.jwks.keys.find(a=>a.kid===t),n&&this.jwks_cached_at+HA>s)return n;const{data:o,error:i}=await V(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,n=o.keys.find(a=>a.kid===t),!n)?null:n}async getClaims(t,r={}){try{let n=t;if(!n){const{data:f,error:x}
201=await this.getSession();if(x||!f.session)return this._returnResult({data:null,error:x});n=f.session.access_token}const{header:s,payload:o,signature:i,raw:{header:a,payload:l}}=Ha(n);if(!(r!=null&&r.allowExpired))try{hN(o.exp)}catch(f){throw new Gl(f instanceof Error?f.message:"JWT validation failed")}const c=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!c){const{error:f}=await this.getUser(n);if(f)throw f;return{data:{claims:o,header:s,signature:i},error:null}}const u=fN(s.alg),d=await crypto.subtle.importKey("jwk",c,u,!0,["verify"]);if(!await crypto.subtle.verify(u,d,i,ZA(`${a}.${l}`)))throw new Gl("Invalid JWT signature");return{data:{claims:o,header:s,signature:i},error:null}}catch(n){if(D(n))return this._returnResult({data:null,error:n});throw n}}async signInWithPasskey(t){var r,n,s;Wt(this.experimental);try{if(!Yl())return this._returnResult({data:null,error:new er("Browser does not support WebAuthn",null)});const{data:o,error:i}=await this._startPasskeyAuthentication({options:{captchaToken:(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.captchaToken}});if(i||!o)return this._returnResult({data:null,error:i});const a=gg(o.options),l=(s=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.signal)!==null&&s!==void 0?s:nh.createNewAbortSignal(),{data:c,error:u}=await vb({publicKey:a,signal:l});if(u||!c)return this._returnResult({data:null,error:u??new er("WebAuthn ceremony failed",null)});const d=yg(c);return this._verifyPasskeyAuthentication({challengeId:o.challenge_id,credential:d})}catch(o){if(D(o))return this._returnResult({data:null,error:o});throw o}}async registerPasskey(t){var r,n;Wt(this.experimental);try{if(!Yl())return this._returnResult({data:null,error:new er("Browser does not support WebAuthn",null)});const{data:s,error:o}=await this._startPasskeyRegistration();if(o||!s)return this._returnResult({data:null,error:o});const i=mg(s.options),a=(n=(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.signal)!==null&&n!==void 0?n:nh.createNewAbortSignal(),{data:l,error:c}=await gb({publicKey:i,signal:a});if(c||!l)return this._returnResult({data:null,error:c??new er("WebAuthn ceremony failed",null)});const u=vg(l);return this._verifyPasskeyRegistration({challengeId:s.challenge_id,credential:u})}catch(s){if(D(s))return this._returnResult({data:null,error:s});throw s}}async _startPasskeyRegistration(){Wt(this.experimental);try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new Be});const{data:s,error:o}=await V(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:r.access_token,body:{}});return o?this._returnResult({data:null,error:o}):this._returnResult({data:s,error:null})})}catch(t){if(D(t))return this._returnResult({data:null,error:t});throw t}}async _verifyPasskeyRegistration(t){Wt(this.experimental);try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new Be});const{data:o,error:i}=await V(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:n.access_token,body:{challenge_id:t.challengeId,credential:t.credential}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:o,error:null})})}catch(r){if(D(r))return this._returnResult({data:null,error:r});throw r}}async _startPasskeyAuthentication(t){var r;Wt(this.experimental);try{const{data:n,error:s}=await V(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.captchaToken}}});return s?this._returnResult({data:null,error:s}):this._returnResult({data:n,error:null})}catch(n){if(D(n))return this._returnResult({data:null,error:n});throw n}}async _verifyPasskeyAuthentication(t){Wt(this.experimental);try{const{data:r,error:n}=await V(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:t.challengeId,credential:t.credential},xform:At});return n?this._returnResult({data:null,error:n}):(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:r,error:null}))}catch(r){if(D(r))return this._returnResult({data:null,error:r});throw r}}async _listPasskeys(){Wt(this.experimental);try{return await this._useSession(async t=>{const{data:{session:r},error:n}=t;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new Be});const{data:s,error:o}=await V(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:r.access_token,xform:i=>({data:i,error:null})});return o?this._returnResult({data:null,error:o}):this._returnResult({data:s,error:null})})}catch(t){if(D(t))return this._returnResult({data:null,error:t});throw t}}async _updatePasskey(t){Wt(this.experimental);try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new Be});const{data:o,error:i}=await V(this.fetch,"PATCH",`${this.url}/passkeys/${t.passkeyId}`,{headers:this.headers,jwt:n.access_token,body:{friendly_name:t.friendlyName}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:o,error:null})})}catch(r){if(D(r))return this._returnResult({data:null,error:r});throw r}}async _deletePasskey(t){Wt(this.experimental);try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new Be});const{error:o}
201=await V(this.fetch,"DELETE",`${this.url}/passkeys/${t.passkeyId}`,{headers:this.headers,jwt:n.access_token,noResolveJson:!0});return o?this._returnResult({data:null,error:o}):this._returnResult({data:null,error:null})})}catch(r){if(D(r))return this._returnResult({data:null,error:r});throw r}}}Ki.nextInstanceID={};const MN=Ki,DN="2.110.6";let Qo="",Zl;if(typeof Deno<"u"){var Ru;Qo="deno",Zl=(Ru=Deno.version)===null||Ru===void 0?void 0:Ru.deno}else if(typeof document<"u")Qo="web";else if(typeof navigator<"u"&&navigator.product==="ReactNative")Qo="react-native";else{var Pu;Qo="node";const e=globalThis.process;Zl=e==null||(Pu=e.version)===null||Pu===void 0?void 0:Pu.replace(/^v/,"")}const yb=[`runtime=${Qo}`];Zl&&yb.push(`runtime-version=${Zl}`);const UN={"X-Client-Info":`supabase-js/${DN}; ${yb.join("; ")}`},FN={headers:UN},BN={schema:"public"},zN={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},HN={},VN={enabled:!1,respectSamplingDecision:!0};function WN(e,t,r,n){function s(o){return o instanceof r?o:new r(function(i){i(o)})}return new(r||(r=Promise))(function(o,i){function a(u){try{c(n.next(u))}catch(d){i(d)}}function l(u){try{c(n.throw(u))}catch(d){i(d)}}function c(u){u.done?o(u.value):s(u.value).then(a,l)}c((n=n.apply(e,[])).next())})}let Au=null;const KN="@opentelemetry/api";function qN(){return Au===null&&(Au=import(KN).catch(()=>null)),Au}function GN(){return WN(this,void 0,void 0,function*(){try{const e=yield qN();if(!e||!e.propagation||!e.context)return null;const t={};e.propagation.inject(e.context.active(),t);const r=t.traceparent;return r?{traceparent:r,tracestate:t.tracestate,baggage:t.baggage}:null}catch{return null}})}function JN(e){if(!e||typeof e!="string")return null;const t=e.split("-");if(t.length!==4)return null;const[r,n,s,o]=t;if(r.length!==2||n.length!==32||s.length!==16||o.length!==2)return null;const i=/^[0-9a-f]+$/i;return!i.test(r)||!i.test(n)||!i.test(s)||!i.test(o)||n==="00000000000000000000000000000000"||s==="0000000000000000"?null:{version:r,traceId:n,parentId:s,traceFlags:o,isSampled:(parseInt(o,16)&1)===1}}function QN(e,t){if(!e||!t||t.length===0)return!1;let r;if(e instanceof URL)r=e;else try{r=new URL(e)}catch{return!1}for(const n of t)try{if(typeof n=="string"){if(YN(r.hostname,n))return!0}else if(n instanceof RegExp){if(n.test(r.hostname))return!0}else if(typeof n=="function"&&n(r))return!0}catch{continue}return!1}function YN(e,t){if(t===e)return!0;if(t.startsWith("*.")){const r=t.slice(2);if(e.endsWith(r)&&(e===r||e.endsWith("."+r)))return!0}return!1}function XN(e){const t=[];try{const r=new URL(e);t.push(r.hostname)}catch{}return t.push("*.supabase.co","*.supabase.in"),t.push("localhost","127.0.0.1","[::1]"),t}function qi(e){"@babel/helpers - typeof";return qi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qi(e)}function ZN(e,t){if(qi(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(qi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ej(e){var t=ZN(e,"string");return qi(t)=="symbol"?t:t+""}function tj(e,t,r){return(t=ej(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wg(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function Ae(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?wg(Object(r),!0).forEach(function(n){tj(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):wg(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}const rj=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),nj=()=>Headers,wb=e=>e.startsWith("sb_publishable_")||e.startsWith("sb_secret_"),sj="sb_temp_",bg=new Set,oj=e=>{var t,r;if(!e.startsWith("sb_")||wb(e)||e.startsWith(sj))return;const n=(t=(r=e.match(/^sb_[a-zA-Z0-9]+_/))===null||r===void 0?void 0:r[0])!==null&&t!==void 0?t:"unknown";bg.has(n)||(bg.add(n),console.warn("@supabase/supabase-js: Unrecognized Supabase API key format. The client will proceed and send this key as-is;
201 if you see authentication errors you may need to upgrade @supabase/supabase-js to a version that recognizes this key type."))},xg=(e,t,r,n,s,o)=>{const i=rj(n),a=nj(),l=(s==null?void 0:s.enabled)===!0,c=(s==null?void 0:s.respectSamplingDecision)!==!1,u=l?XN(t):null,d=!(o!=null&&o.omitApiKeyAsBearer&&wb(e));return async(h,f)=>{const x=await r();let g=new a(f==null?void 0:f.headers);if(g.has("apikey")||g.set("apikey",e),!g.has("Authorization")){const b=x??(d?e:null);b&&g.set("Authorization",`Bearer ${b}`)}if(u){const b=await ij(h,u,c);b&&(b.traceparent&&!g.has("traceparent")&&g.set("traceparent",b.traceparent),b.tracestate&&!g.has("tracestate")&&g.set("tracestate",b.tracestate),b.baggage&&!g.has("baggage")&&g.set("baggage",b.baggage))}return i(h,Ae(Ae({},f),{},{headers:g}))}};async function ij(e,t,r){if(!QN(typeof e=="string"||e instanceof URL?e:e.url,t))return null;const n=await GN();if(!n||!n.traceparent)return null;if(r){const s=JN(n.traceparent);if(s&&!s.isSampled)return null}return n}function Sg(e){return typeof e=="boolean"?{enabled:e}:e}function aj(e){return e.endsWith("/")?e:e+"/"}function lj(e,t){var r,n,s,o,i,a;const{db:l,auth:c,realtime:u,global:d}=e,{db:h,auth:f,realtime:x,global:g}=t,b=Sg(e.tracePropagation),v=Sg(t.tracePropagation),m={db:Ae(Ae({},h),l),auth:Ae(Ae({},f),c),realtime:Ae(Ae({},x),u),storage:{},global:Ae(Ae(Ae({},g),d),{},{headers:Ae(Ae({},(r=g==null?void 0:g.headers)!==null&&r!==void 0?r:{}),(n=d==null?void 0:d.headers)!==null&&n!==void 0?n:{})}),tracePropagation:{enabled:(s=(o=b==null?void 0:b.enabled)!==null&&o!==void 0?o:v==null?void 0:v.enabled)!==null&&s!==void 0?s:!1,respectSamplingDecision:(i=(a=b==null?void 0:b.respectSamplingDecision)!==null&&a!==void 0?a:v==null?void 0:v.respectSamplingDecision)!==null&&i!==void 0?i:!0},accessToken:async()=>""};return e.accessToken?m.accessToken=e.accessToken:delete m.accessToken,m}function cj(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(aj(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var uj=class extends MN{constructor(e){super(e)}},dj=class{constructor(e,t,r){var n,s;this.supabaseUrl=e,this.supabaseKey=t;const o=cj(e);if(!t)throw new Error("supabaseKey is required.");oj(t),this.realtimeUrl=new URL("realtime/v1",o),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",o),this.storageUrl=new URL("storage/v1",o),this.functionsUrl=new URL("functions/v1",o);const i=`sb-${o.hostname.split(".")[0]}-auth-token`,a={db:BN,realtime:HN,auth:Ae(Ae({},zN),{},{storageKey:i}),global:FN,tracePropagation:VN},l=lj(r??{},a);if(this.settings=l,this.storageKey=(n=l.auth.storageKey)!==null&&n!==void 0?n:"",this.headers=(s=l.global.headers)!==null&&s!==void 0?s:{},l.accessToken)this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(u,d)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(d)} is not possible`)}});else{var c;this.auth=this._initSupabaseAuthClient((c=l.auth)!==null&&c!==void 0?c:{},this.headers,l.global.fetch)}this.fetch=xg(t,e,this._getSessionToken.bind(this),l.global.fetch,l.tracePropagation),this.functionsFetch=xg(t,e,this._getSessionToken.bind(this),l.global.fetch,l.tracePropagation,{omitApiKeyAsBearer:!0}),this.realtime=this._initRealtimeClient(Ae({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},l.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(u=>this.realtime.setAuth(u)).catch(u=>console.warn("Failed to set initial Realtime auth token:",u)),this.rest=new wP(new URL("rest/v1",o).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch,timeout:l.db.timeout,urlLengthLimit:l.db.urlLengthLimit}),this.storage=new MA(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new uP(this.functionsUrl.href,{headers:this.headers,customFetch:this.functionsFetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,r)}
201channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getSessionToken(){var e=this,t,r;if(e.accessToken)return await e.accessToken();const{data:n}=await e.auth.getSession();return(t=(r=n.session)===null||r===void 0?void 0:r.access_token)!==null&&t!==void 0?t:null}async _getAccessToken(){var e=this,t;return(t=await e._getSessionToken())!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:s,storageKey:o,flowType:i,lock:a,debug:l,throwOnError:c,experimental:u,lockAcquireTimeout:d,skipAutoInitialize:h},f,x){const g={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new uj({url:this.authUrl.href,headers:Ae(Ae({},g),f),storageKey:o,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:s,flowType:i,lock:a,debug:l,throwOnError:c,experimental:u,fetch:x,lockAcquireTimeout:d,skipAutoInitialize:h,hasCustomAuthorizationHeader:Object.keys(this.headers).some(b=>b.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new aA(this.realtimeUrl.href,Ae(Ae({},e),{},{params:Ae(Ae({},{apikey:this.supabaseKey}),e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t==null?void 0:t.access_token)})}_handleTokenChanged(e,t,r){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const hj=(e,t,r)=>new dj(e,t,r);function fj(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const r=t.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=20:!1}fj()&&console.warn("⚠️  Node.js 20 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 22 or later. For more information, visit: https://github.com/orgs/supabase/discussions/45715");function pj(){var b,v;if(typeof window>"u")return;const e=location.hostname,r=["lovableproject.com","lovableproject-dev.com","lovable.app","gpt-eng.com","gptengineer.run"].some(m=>e===m||e.endsWith("."+m)),n="[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",s=r?((b=e.match(new RegExp("^(?:id-preview(?:-[a-z0-9]+)?|project)--("+n+")(?:-dev)?(?=\\.|$)","i")))==null?void 0:b[1])??((v=e.match(new RegExp("^("+n+")(?=[.-])","i")))==null?void 0:v[1]):void 0,o=window.parent&&window.parent!==window;if(!s||!o)return localStorage;const i=e.endsWith(".lovableproject-dev.com")||e.endsWith(".gpt-eng.com"),a=i?/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$|^http:\/\/localhost:3000$/:/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$/,l=location.ancestorOrigins&&location.ancestorOrigins[0]||(document.referrer?new URL(document.referrer).origin:""),c=l&&a.test(l)?[l]:i?["https://lovable.dev","http://localhost:3000"]:["https://lovable.dev"],u="lovable-preview-auth:result",d=2e3,h=()=>Math.random().toString(36).slice(2)+Date.now().toString(36),f=(m,y,S)=>new Promise(E=>{const _=h();let T=!1,R;const P=I=>{T||(T=!0,clearTimeout(R),window.removeEventListener("message",j),E(I))},j=I=>{if(c.indexOf(I.origin)<0)return;const W=I.data;W&&W.type===u&&W.requestId===_&&P(W)};window.addEventListener("message",j);const B={type:m,requestId:_,projectId:s,key:y};S!==void 0&&(B.value=S);for(const I of c)window.parent.postMessage(B,I);R=setTimeout(()=>P(null),d)});let x=!0;const g=250;return{getItem:async m=>{let y=await f("lovable-preview-auth:get",m);return!y&&x&&(await new Promise(S=>setTimeout(S,g)),y=await f("lovable-preview-auth:get",m)),x=!1,y&&y.ok&&typeof y.value=="string"?y.value===""?(localStorage.removeItem(m),null):y.value:localStorage.getItem(m)},setItem:(m,y)=>(localStorage.setItem(m,y),f("lovable-preview-auth:set",m,y).then(S=>{S&&S.ok&&typeof S.value=="string"&&localStorage.getItem(m)===y&&(S.value===""?localStorage.removeItem(m):localStorage.setItem(m,S.value))})),removeItem:m=>(localStorage.removeItem(m),f("lovable-preview-auth:remove",m).then(()=>{}))}}const mj="https://nluzwqqazbpfsgoermhl.supabase.co",_g="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im5sdXp3cXFhemJwZnNnb2VybWhsIiwicm9sZSI6ImFub24iLCJpYXQiOjE3ODQxNjk5ODgsImV4cCI6MjA5OTc0NTk4OH0.wOEpX6CpmU3rCdZoxxYMBPqT1dJbYsbFvD2e2wtqdLc";function gj(e){return e.startsWith("sb_publishable_")||e.startsWith("sb_secret_")}function vj(e){return(t,r)=>{const n=new Headers(typeof Request<"u"&&t instanceof Request?t.headers:void 0);
vendor: 7,201 bytes, line 201
201return r!=null&&r.headers&&new Headers(r.headers).forEach((s,o)=>n.set(o,s)),gj(e)&&n.get("Authorization")===`Bearer ${e}`&&n.delete("Authorization"),n.set("apikey",e),fetch(t,{...r,headers:n})}}const yj=hj(mj,_g,{global:{fetch:vj(_g)},auth:{storage:pj(),persistSession:!0,autoRefreshToken:!0}}),wj=()=>{const[e,t]=w.useState(Fm),[r,n]=w.useState(!0),[s,o]=w.useState("");w.useEffect(()=>{i()},[]);const i=async(a=!1)=>{n(!0),o("");try{const{data:l,error:c}=await yj.functions.invoke("jackrabbit-schedule",{body:a?{refresh:!0}:{}});if(c)throw new Error(c.message||"Failed to load schedule");if(!(l!=null&&l.success)||!l.days)throw new Error("Invalid schedule response from server");t(l.days)}catch(l){console.error("Schedule load error:",l),o(l instanceof Error?l.message:"Failed to load live schedule"),t(Fm)}finally{n(!1)}};return r?p.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:p.jsxs("div",{className:"text-center",children:[p.jsx(mk,{className:"w-8 h-8 animate-spin mx-auto mb-4"}),p.jsx("p",{children:"Loading schedule data..."})]})}):p.jsxs("div",{className:"min-h-screen bg-background",children:[s&&p.jsx(jf,{className:"mx-4 mt-4",variant:"destructive",children:p.jsxs(Of,{children:[s," - Showing sample data instead."]})}),p.jsx(Q0,{scheduleData:e})]})},Yo=w.forwardRef(({className:e,...t},r)=>p.jsx("div",{ref:r,className:le("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));Yo.displayName="Card";const Xo=w.forwardRef(({className:e,...t},r)=>p.jsx("div",{ref:r,className:le("flex flex-col space-y-1.5 p-6",e),...t}));Xo.displayName="CardHeader";const Zo=w.forwardRef(({className:e,...t},r)=>p.jsx("h3",{ref:r,className:le("text-2xl font-semibold leading-none tracking-tight",e),...t}));Zo.displayName="CardTitle";const hl=w.forwardRef(({className:e,...t},r)=>p.jsx("p",{ref:r,className:le("text-sm text-muted-foreground",e),...t}));hl.displayName="CardDescription";const ei=w.forwardRef(({className:e,...t},r)=>p.jsx("div",{ref:r,className:le("p-6 pt-0",e),...t}));ei.displayName="CardContent";const bj=w.forwardRef(({className:e,...t},r)=>p.jsx("div",{ref:r,className:le("flex items-center p-6 pt-0",e),...t}));bj.displayName="CardFooter";var xj="Label",bb=w.forwardRef((e,t)=>p.jsx(re.label,{...e,ref:t,onMouseDown:r=>{var s;r.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));bb.displayName=xj;var xb=bb;const Sj=na("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),wt=w.forwardRef(({className:e,...t},r)=>p.jsx(xb,{ref:r,className:le(Sj(),e),...t}));wt.displayName=xb.displayName;function Eg(e,[t,r]){return Math.min(r,Math.max(t,e))}var _j=w.createContext(void 0);function Lf(e){const t=w.useContext(_j);return e||t||"ltr"}var Nu=0;function Ej(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??kg()),document.body.insertAdjacentElement("beforeend",e[1]??kg()),Nu++,()=>{Nu===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Nu--}},[])}function kg(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ju="focusScope.autoFocusOnMount",Ou="focusScope.autoFocusOnUnmount",Cg={bubbles:!1,cancelable:!0},kj="FocusScope",Sb=w.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[a,l]=w.useState(null),c=Dt(s),u=Dt(o),d=w.useRef(null),h=Se(t,g=>l(g)),f=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(n){let g=function(y){if(f.paused||!a)return;const S=y.target;a.contains(S)?d.current=S:tn(d.current,{select:!0})},b=function(y){if(f.paused||!a)return;const S=y.relatedTarget;S!==null&&(a.contains(S)||tn(d.current,{select:!0}))},v=function(y){if(document.activeElement===document.body)for(const E of y)E.removedNodes.length>0&&tn(a)};document.addEventListener("focusin",g),document.addEventListener("focusout",b);const m=new MutationObserver(v);return a&&m.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",b),m.disconnect()}}},[n,a,f.paused]),w.useEffect(()=>{if(a){Rg.add(f);const g=document.activeElement;if(!a.contains(g)){const v=new CustomEvent(ju,Cg);a.addEventListener(ju,c),a.dispatchEvent(v),v.defaultPrevented||(Cj(Nj(_b(a)),{select:!0}),document.activeElement===g&&tn(a))}return()=>{a.removeEventListener(ju,c),setTimeout(()=>{const v=new CustomEvent(Ou,Cg);a.addEventListener(Ou,u),a.dispatchEvent(v),v.defaultPrevented||tn(g??document.body,{select:!0}),a.removeEventListener(Ou,u),Rg.remove(f)},0)}}},[a,c,u,f]);const x=w.useCallback(g=>{if(!r&&!n||f.paused)return;const b=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(b&&v){const m=g.currentTarget,[y,S]=Tj(m);y&&S?!g.shiftKey&&v===S?(g.preventDefault(),r&&tn(y,{select:!0})):g.shiftKey&&v===y&&(g.preventDefault(),r&&tn(S,{select:!0})):v===m&&g.preventDefault()}},[r,n,f.paused]);return p.jsx(re.div,{tabIndex:-1,...i,ref:h,onKeyDown:x})});Sb.displayName=kj;function Cj(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(tn(n,{select:t}),document.activeElement!==r)return}function Tj(e){const t=_b(e),r=Tg(t,e),n=Tg(t.reverse(),e);return[r,n]}function _b(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const s=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||s?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Tg(e,t){for(const r of e)if(!Rj(r,{upTo:t}))return r}function Rj(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Pj(e){return e instanceof HTMLInputElement&&"select"in e}function tn(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Pj(e)&&t&&e.select()}}var Rg=Aj();function Aj(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Pg(e,t),e.unshift(t)},remove(t){var r;e=Pg(e,t),(r=e[0])==null||r.resume()}}}function Pg(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function Nj(e){return e.filter(t=>t.tagName!=="A")}var jj=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Rs=new WeakMap,Va=new WeakMap,Wa={},Iu=0,Eb=function(e){return e&&(e.host||Eb(e.parentNode))},Oj=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=Eb(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},Ij=function(e,t,r,n){var s=Oj(t,Array.isArray(e)?e:[e]);Wa[r]||(Wa[r]=new WeakMap);var o=Wa[r],i=[],a=new Set,l=new Set(s),c=function(d){!d||a.has(d)||(a.add(d),c(d.parentNode))};
vendor: 6,462 bytes, lines 201-216
201s.forEach(c);var u=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(h){if(a.has(h))u(h);else try{var f=h.getAttribute(n),x=f!==null&&f!=="false",g=(Rs.get(h)||0)+1,b=(o.get(h)||0)+1;Rs.set(h,g),o.set(h,b),i.push(h),g===1&&x&&Va.set(h,!0),b===1&&h.setAttribute(r,"true"),x||h.setAttribute(n,"true")}catch(v){console.error("aria-hidden: cannot operate on ",h,v)}})};return u(t),a.clear(),Iu++,function(){i.forEach(function(d){var h=Rs.get(d)-1,f=o.get(d)-1;Rs.set(d,h),o.set(d,f),h||(Va.has(d)||d.removeAttribute(n),Va.delete(d)),f||d.removeAttribute(r)}),Iu--,Iu||(Rs=new WeakMap,Rs=new WeakMap,Va=new WeakMap,Wa={})}},Lj=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=jj(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live]"))),Ij(n,s,r,"aria-hidden")):function(){return null}},wr=function(){return wr=Object.assign||function(t){for(var r,n=1,s=arguments.length;n<s;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},wr.apply(this,arguments)};function kb(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(e);s<n.length;s++)t.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(e,n[s])&&(r[n[s]]=e[n[s]]);return r}function $j(e,t,r){if(r||arguments.length===2)for(var n=0,s=t.length,o;n<s;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}var fl="right-scroll-bar-position",pl="width-before-scroll-bar",Mj="with-scroll-bars-hidden",Dj="--removed-body-scroll-bar-size";function Lu(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Uj(e,t){var r=w.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var s=r.value;s!==n&&(r.value=n,r.callback(n,s))}}}})[0];return r.callback=t,r.facade}var Fj=typeof window<"u"?w.useLayoutEffect:w.useEffect,Ag=new WeakMap;function Bj(e,t){var r=Uj(null,function(n){return e.forEach(function(s){return Lu(s,n)})});return Fj(function(){var n=Ag.get(r);if(n){var s=new Set(n),o=new Set(e),i=r.current;s.forEach(function(a){o.has(a)||Lu(a,null)}),o.forEach(function(a){s.has(a)||Lu(a,i)})}Ag.set(r,e)},[e]),r}function zj(e){return e}function Hj(e,t){t===void 0&&(t=zj);var r=[],n=!1,s={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(o){var i=t(o,n);return r.push(i),function(){r=r.filter(function(a){return a!==i})}},assignSyncMedium:function(o){for(n=!0;r.length;){var i=r;r=[],i.forEach(o)}r={push:function(a){return o(a)},filter:function(){return r}}},assignMedium:function(o){n=!0;var i=[];if(r.length){var a=r;r=[],a.forEach(o),i=r}var l=function(){var u=i;i=[],u.forEach(o)},c=function(){return Promise.resolve().then(l)};c(),r={push:function(u){i.push(u),c()},filter:function(u){return i=i.filter(u),r}}}};return s}function Vj(e){e===void 0&&(e={});var t=Hj(null);return t.options=wr({async:!0,ssr:!1},e),t}var Cb=function(e){var t=e.sideCar,r=kb(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return w.createElement(n,wr({},r))};Cb.isSideCarExport=!0;function Wj(e,t){return e.useMedium(t),Cb}var Tb=Vj(),$u=function(){},Ic=w.forwardRef(function(e,t){var r=w.useRef(null),n=w.useState({onScrollCapture:$u,onWheelCapture:$u,onTouchMoveCapture:$u}),s=n[0],o=n[1],i=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,u=e.enabled,d=e.shards,h=e.sideCar,f=e.noRelative,x=e.noIsolation,g=e.inert,b=e.allowPinchZoom,v=e.as,m=v===void 0?"div":v,y=e.gapMode,S=kb(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=h,_=Bj([r,t]),T=wr(wr({},S),s);return w.createElement(w.Fragment,null,u&&w.createElement(E,{sideCar:Tb,removeScrollBar:c,shards:d,noRelative:f,noIsolation:x,inert:g,setCallbacks:o,allowPinchZoom:!!b,lockRef:r,gapMode:y}),i?w.cloneElement(w.Children.only(a),wr(wr({},T),{ref:_})):w.createElement(m,wr({},T,{className:l,ref:_}),a))});Ic.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ic.classNames={fullWidth:pl,zeroRight:fl};var Kj=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function qj(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Kj();return t&&e.setAttribute("nonce",t),e}function Gj(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Jj(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Qj=function(){var e=0,t=null;return{add:function(r){e==0&&(t=qj())&&(Gj(t,r),Jj(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Yj=function(){var e=Qj();return function(t,r){w.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Rb=function(){var e=Yj(),t=function(r){var n=r.styles,s=r.dynamic;return e(n,s),null};return t},Xj={left:0,top:0,right:0,gap:0},Mu=function(e){return parseInt(e||"",10)||0},Zj=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Mu(r),Mu(n),Mu(s)]},eO=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Xj;var t=Zj(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},tO=Rb(),ro="data-scroll-locked",rO=function(e,t,r,n){var s=e.left,o=e.top,i=e.right,a=e.gap;return r===void 0&&(r="margin"),`
202  .`.concat(Mj,` {
203   overflow: hidden `).concat(n,`;
204   padding-right: `).concat(a,"px ").concat(n,`;
205  }
206  body[`).concat(ro,`] {
207    overflow: hidden `).concat(n,`;
208    overscroll-behavior: contain;
209    `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
210    padding-left: `.concat(s,`px;
211    padding-top: `).concat(o,`px;
212    padding-right: `).concat(i,`px;
213    margin-left:0;
214    margin-top:0;
215    margin-right: `).concat(a,"px ").concat(n,`;
216    `),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";
216")].filter(Boolean).join(""),`
217  }
218  
219  .`).concat(fl,` {
220    right: `).concat(a,"px ").concat(n,`;
221  }
222  
223  .`).concat(pl,` {
224    margin-right: `).concat(a,"px ").concat(n,`;
225  }
226  
227  .`).concat(fl," .").concat(fl,` {
228    right: 0 `).concat(n,`;
229  }
230  
231  .`).concat(pl," .").concat(pl,` {
232    margin-right: 0 `).concat(n,`;
233  }
234  
235  body[`).concat(ro,`] {
236    `).concat(Dj,": ").concat(a,`px;
237  }
238`)},Ng=function(){var e=parseInt(document.body.getAttribute(ro)||"0",10);return isFinite(e)?e:0},nO=function(){w.useEffect(function(){return document.body.setAttribute(ro,(Ng()+1).toString()),function(){var e=Ng()-1;e<=0?document.body.removeAttribute(ro):document.body.setAttribute(ro,e.toString())}},[])},sO=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;nO();var o=w.useMemo(function(){return eO(s)},[s]);return w.createElement(tO,{styles:rO(o,!t,s,r?"":"!important")})},sh=!1;if(typeof window<"u")try{var Ka=Object.defineProperty({},"passive",{get:function(){return sh=!0,!0}});window.addEventListener("test",Ka,Ka),window.removeEventListener("test",Ka,Ka)}catch{sh=!1}var Ps=sh?{passive:!1}:!1,oO=function(e){return e.tagName==="TEXTAREA"},Pb=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!oO(e)&&r[t]==="visible")},iO=function(e){return Pb(e,"overflowY")},aO=function(e){return Pb(e,"overflowX")},jg=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=Ab(e,n);if(s){var o=Nb(e,n),i=o[1],a=o[2];if(i>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},lO=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},cO=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},Ab=function(e,t){return e==="v"?iO(t):aO(t)},Nb=function(e,t){return e==="v"?lO(t):cO(t)},uO=function(e,t){return e==="h"&&t==="rtl"?-1:1},dO=function(e,t,r,n,s){var o=uO(e,window.getComputedStyle(t).direction),i=o*n,a=r.target,l=t.contains(a),c=!1,u=i>0,d=0,h=0;do{if(!a)break;var f=Nb(e,a),x=f[0],g=f[1],b=f[2],v=g-b-o*x;(x||v)&&Ab(e,a)&&(d+=v,h+=x);var m=a.parentNode;a=m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE?m.host:m}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(u&&(Math.abs(d)<1||!s)||!u&&(Math.abs(h)<1||!s))&&(c=!0),c},qa=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Og=function(e){return[e.deltaX,e.deltaY]},Ig=function(e){return e&&"current"in e?e.current:e},hO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},fO=function(e){return`
239  .block-interactivity-`.concat(e,` {pointer-events: none;}
240  .allow-interactivity-`).concat(e,` {pointer-events: all;}
241`)},pO=0,As=[];function mO(e){var t=w.useRef([]),r=w.useRef([0,0]),n=w.useRef(),s=w.useState(pO++)[0],o=w.useState(Rb)[0],i=w.useRef(e);w.useEffect(function(){i.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var g=$j([e.lockRef.current],(e.shards||[]).map(Ig),!0).filter(Boolean);return g.forEach(function(b){return b.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),g.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=w.useCallback(function(g,b){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!i.current.allowPinchZoom;var v=qa(g),m=r.current,y="deltaX"in g?g.deltaX:m[0]-v[0],S="deltaY"in g?g.deltaY:m[1]-v[1],E,_=g.target,T=Math.abs(y)>Math.abs(S)?"h":"v";if("touches"in g&&T==="h"&&_.type==="range")return!1;var R=jg(T,_);if(!R)return!0;if(R?E=T:(E=T==="v"?"h":"v",R=jg(T,_)),!R)return!1;if(!n.current&&"changedTouches"in g&&(y||S)&&(n.current=E),!E)return!0;var P=n.current||E;return dO(P,b,g,P==="h"?y:S,!0)},[]),l=w.useCallback(function(g){var b=g;if(!(!As.length||As[As.length-1]!==o)){var v="deltaY"in b?Og(b):qa(b),m=t.current.filter(function(E){return E.name===b.type&&(E.target===b.target||b.target===E.shadowParent)&&hO(E.delta,v)}
vendor: 3,048 bytes, line 241
241)[0];if(m&&m.should){b.cancelable&&b.preventDefault();return}if(!m){var y=(i.current.shards||[]).map(Ig).filter(Boolean).filter(function(E){return E.contains(b.target)}),S=y.length>0?a(b,y[0]):!i.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),c=w.useCallback(function(g,b,v,m){var y={name:g,delta:b,target:v,should:m,shadowParent:gO(v)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(S){return S!==y})},1)},[]),u=w.useCallback(function(g){r.current=qa(g),n.current=void 0},[]),d=w.useCallback(function(g){c(g.type,Og(g),g.target,a(g,e.lockRef.current))},[]),h=w.useCallback(function(g){c(g.type,qa(g),g.target,a(g,e.lockRef.current))},[]);w.useEffect(function(){return As.push(o),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,Ps),document.addEventListener("touchmove",l,Ps),document.addEventListener("touchstart",u,Ps),function(){As=As.filter(function(g){return g!==o}),document.removeEventListener("wheel",l,Ps),document.removeEventListener("touchmove",l,Ps),document.removeEventListener("touchstart",u,Ps)}},[]);var f=e.removeScrollBar,x=e.inert;return w.createElement(w.Fragment,null,x?w.createElement(o,{styles:fO(s)}):null,f?w.createElement(sO,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function gO(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const vO=Wj(Tb,mO);var jb=w.forwardRef(function(e,t){return w.createElement(Ic,wr({},e,{ref:t,sideCar:vO}))});jb.classNames=Ic.classNames;var yO=[" ","Enter","ArrowUp","ArrowDown"],wO=[" ","Enter"],vs="Select",[Lc,$c,bO]=cf(vs),[Ao,EI]=Mn(vs,[bO,_c]),Mc=_c(),[xO,Dn]=Ao(vs),[SO,_O]=Ao(vs),Ob=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:s,onOpenChange:o,value:i,defaultValue:a,onValueChange:l,dir:c,name:u,autoComplete:d,disabled:h,required:f,form:x}=e,g=Mc(t),[b,v]=w.useState(null),[m,y]=w.useState(null),[S,E]=w.useState(!1),_=Lf(c),[T,R]=wo({prop:n,defaultProp:s??!1,onChange:o,caller:vs}),[P,j]=wo({prop:i,defaultProp:a,onChange:l,caller:vs}),B=w.useRef(null),I=b?x||!!b.closest("form"):!0,[W,$]=w.useState(new Set),Q=Array.from(W).map(z=>z.props.value).join(";");return p.jsx(UC,{...g,children:p.jsxs(xO,{required:f,scope:t,trigger:b,onTriggerChange:v,valueNode:m,onValueNodeChange:y,valueNodeHasChildren:S,onValueNodeHasChildrenChange:E,contentId:sa(),value:P,onValueChange:j,open:T,onOpenChange:R,dir:_,triggerPointerDownPosRef:B,disabled:h,children:[p.jsx(Lc.Provider,{scope:t,children:p.jsx(SO,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(z=>{$(q=>new Set(q).add(z))},[]),onNativeOptionRemove:w.useCallback(z=>{$(q=>{const C=new Set(q);return C.delete(z),C})},[]),children:r})}),I?p.jsxs(nx,{"aria-hidden":!0,required:f,tabIndex:-1,name:u,autoComplete:d,value:P,onChange:z=>j(z.target.value),disabled:h,form:x,children:[P===void 0?p.jsx("option",{value:""}):null,Array.from(W)]},Q):null]})})};Ob.displayName=vs;var Ib="SelectTrigger",Lb=w.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}
vendor: 16,730 bytes, line 241
241=e,o=Mc(r),i=Dn(Ib,r),a=i.disabled||n,l=Se(t,i.onTriggerChange),c=$c(r),u=w.useRef("touch"),[d,h,f]=ox(g=>{const b=c().filter(y=>!y.disabled),v=b.find(y=>y.value===i.value),m=ix(b,g,v);m!==void 0&&i.onValueChange(m.value)}),x=g=>{a||(i.onOpenChange(!0),f()),g&&(i.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return p.jsx(d0,{asChild:!0,...o,children:p.jsx(re.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":sx(i.value)?"":void 0,...s,ref:l,onClick:X(s.onClick,g=>{g.currentTarget.focus(),u.current!=="mouse"&&x(g)}),onPointerDown:X(s.onPointerDown,g=>{u.current=g.pointerType;const b=g.target;b.hasPointerCapture(g.pointerId)&&b.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(x(g),g.preventDefault())}),onKeyDown:X(s.onKeyDown,g=>{const b=d.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&h(g.key),!(b&&g.key===" ")&&yO.includes(g.key)&&(x(),g.preventDefault())})})})});Lb.displayName=Ib;var $b="SelectValue",Mb=w.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,children:o,placeholder:i="",...a}=e,l=Dn($b,r),{onValueNodeHasChildrenChange:c}=l,u=o!==void 0,d=Se(t,l.onValueNodeChange);return Ge(()=>{c(u)},[c,u]),p.jsx(re.span,{...a,ref:d,style:{pointerEvents:"none"},children:sx(l.value)?p.jsx(p.Fragment,{children:i}):o})});Mb.displayName=$b;var EO="SelectIcon",Db=w.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return p.jsx(re.span,{"aria-hidden":!0,...s,ref:t,children:n||"▼"})});Db.displayName=EO;var kO="SelectPortal",Ub=e=>p.jsx(uf,{asChild:!0,...e});Ub.displayName=kO;var ys="SelectContent",Fb=w.forwardRef((e,t)=>{const r=Dn(ys,e.__scopeSelect),[n,s]=w.useState();if(Ge(()=>{s(new DocumentFragment)},[]),!r.open){const o=n;return o?$n.createPortal(p.jsx(Bb,{scope:e.__scopeSelect,children:p.jsx(Lc.Slot,{scope:e.__scopeSelect,children:p.jsx("div",{children:e.children})})}),o):null}return p.jsx(zb,{...e,ref:t})});Fb.displayName=ys;var Kt=10,[Bb,Un]=Ao(ys),CO="SelectContentImpl",TO=ji("SelectContent.RemoveScroll"),zb=w.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:i,side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:h,collisionPadding:f,sticky:x,hideWhenDetached:g,avoidCollisions:b,...v}=e,m=Dn(ys,r),[y,S]=w.useState(null),[E,_]=w.useState(null),T=Se(t,F=>S(F)),[R,P]=w.useState(null),[j,B]=w.useState(null),I=$c(r),[W,$]=w.useState(!1),Q=w.useRef(!1);w.useEffect(()=>{if(y)return Lj(y)},[y]),Ej();const z=w.useCallback(F=>{const[de,...ge]=I().map(G=>G.ref.current),[ie]=ge.slice(-1),ne=document.activeElement;for(const G of F)if(G===ne||(G==null||G.scrollIntoView({block:"nearest"}),G===de&&E&&(E.scrollTop=0),G===ie&&E&&(E.scrollTop=E.scrollHeight),G==null||G.focus(),document.activeElement!==ne))return},[I,E]),q=w.useCallback(()=>z([R,y]),[z,R,y]);w.useEffect(()=>{W&&q()},[W,q]);const{onOpenChange:C,triggerPointerDownPosRef:k}=m;w.useEffect(()=>{if(y){let F={x:0,y:0};const de=ie=>{var ne,G;F={x:Math.abs(Math.round(ie.pageX)-(((ne=k.current)==null?void 0:ne.x)??0)),y:Math.abs(Math.round(ie.pageY)-(((G=k.current)==null?void 0:G.y)??0))}},ge=ie=>{F.x<=10&&F.y<=10?ie.preventDefault():y.contains(ie.target)||C(!1),document.removeEventListener("pointermove",de),k.current=null};return k.current!==null&&(document.addEventListener("pointermove",de),document.addEventListener("pointerup",ge,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",de),document.removeEventListener("pointerup",ge,{capture:!0})}}},[y,C,k]),w.useEffect(()=>{const F=()=>C(!1);return window.addEventListener("blur",F),window.addEventListener("resize",F),()=>{window.removeEventListener("blur",F),window.removeEventListener("resize",F)}},[C]);const[N,U]=ox(F=>{const de=I().filter(ne=>!ne.disabled),ge=de.find(ne=>ne.ref.current===document.activeElement),ie=ix(de,F,ge);ie&&setTimeout(()=>ie.ref.current.focus())}),L=w.useCallback((F,de,ge)=>{const ie=!Q.current&&!ge;(m.value!==void 0&&m.value===de||ie)&&(P(F),ie&&(Q.current=!0))},[m.value]),K=w.useCallback(()=>y==null?void 0:y.focus(),[y]),Y=w.useCallback((F,de,ge)=>{const ie=!Q.current&&!ge;(m.value!==void 0&&m.value===de||ie)&&B(F)},[m.value]),he=n==="popper"?oh:Hb,me=he===oh?{side:a,sideOffset:l,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:h,collisionPadding:f,sticky:x,hideWhenDetached:g,avoidCollisions:b}:{};return p.jsx(Bb,{scope:r,content:y,viewport:E,onViewportChange:_,itemRefCallback:L,selectedItem:R,onItemLeave:K,itemTextRefCallback:Y,focusSelectedItem:q,selectedItemText:j,position:n,isPositioned:W,searchRef:N,children:p.jsx(jb,{as:TO,allowPinchZoom:!0,children:p.jsx(Sb,{asChild:!0,trapped:m.open,onMountAutoFocus:F=>{F.preventDefault()},onUnmountAutoFocus:X(s,F=>{var de;(de=m.trigger)==null||de.focus({preventScroll:!0}),F.preventDefault()}),children:p.jsx(vc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:F=>F.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:p.jsx(he,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:F=>F.preventDefault(),...v,...me,onPlaced:()=>$(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:X(v.onKeyDown,F=>{const de=F.ctrlKey||F.altKey||F.metaKey;if(F.key==="Tab"&&F.preventDefault(),!de&&F.key.length===1&&U(F.key),["ArrowUp","ArrowDown","Home","End"].includes(F.key)){let ie=I().filter(ne=>!ne.disabled).map(ne=>ne.ref.current);if(["ArrowUp","End"].includes(F.key)&&(ie=ie.slice().reverse()),["ArrowUp","ArrowDown"].includes(F.key)){const ne=F.target,G=ie.indexOf(ne);ie=ie.slice(G+1)}setTimeout(()=>z(ie)),F.preventDefault()}})})})})})})});zb.displayName=CO;var RO="SelectItemAlignedPosition",Hb=w.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,o=Dn(ys,r),i=Un(ys,r),[a,l]=w.useState(null),[c,u]=w.useState(null),d=Se(t,T=>u(T)),h=$c(r),f=w.useRef(!1),x=w.useRef(!0),{viewport:g,selectedItem:b,selectedItemText:v,focusSelectedItem:m}=i,y=w.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&c&&g&&b&&v){const T=o.trigger.getBoundingClientRect(),R=c.getBoundingClientRect(),P=o.valueNode.getBoundingClientRect(),j=v.getBoundingClientRect();if(o.dir!=="rtl"){const ne=j.left-R.left,G=P.left-ne,ae=T.left-G,oe=T.width+ae,Oe=Math.max(oe,R.width),Re=window.innerWidth-Kt,ut=Eg(G,[Kt,Math.max(Kt,Re-Oe)]);a.style.minWidth=oe+"px",a.style.left=ut+"px"}else{const ne=R.right-j.right,G=window.innerWidth-P.right-ne,ae=window.innerWidth-T.right-G,oe=T.width+ae,Oe=Math.max(oe,R.width),Re=window.innerWidth-Kt,ut=Eg(G,[Kt,Math.max(Kt,Re-Oe)]);a.style.minWidth=oe+"px",a.style.right=ut+"px"}const B=h(),I=window.innerHeight-Kt*2,W=g.scrollHeight,$=window.getComputedStyle(c),Q=parseInt($.borderTopWidth,10),z=parseInt($.paddingTop,10),q=parseInt($.borderBottomWidth,10),C=parseInt($.paddingBottom,10),k=Q+z+W+C+q,N=Math.min(b.offsetHeight*5,k),U=window.getComputedStyle(g),L=parseInt(U.paddingTop,10),K=parseInt(U.paddingBottom,10),Y=T.top+T.height/2-Kt,he=I-Y,me=b.offsetHeight/2,F=b.offsetTop+me,de=Q+z+F,ge=k-de;if(de<=Y){const ne=B.length>0&&b===B[B.length-1].ref.current;a.style.bottom="0px";const G=c.clientHeight-g.offsetTop-g.offsetHeight,ae=Math.max(he,me+(ne?K:0)+G+q),oe=de+ae;a.style.height=oe+"px"}else{const ne=B.length>0&&b===B[0].ref.current;a.style.top="0px";const ae=Math.max(Y,Q+g.offsetTop+(ne?L:0)+me)+ge;a.style.height=ae+"px",g.scrollTop=de-Y+g.offsetTop}a.style.margin=`${Kt}px 0`,a.style.minHeight=N+"px",a.style.maxHeight=I+"px",n==null||n(),requestAnimationFrame(()=>f.current=!0)}},[h,o.trigger,o.valueNode,a,c,g,b,v,o.dir,n]);Ge(()=>y(),[y]);const[S,E]=w.useState();Ge(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const _=w.useCallback(T=>{T&&x.current===!0&&(y(),m==null||m(),x.current=!1)},[y,m]);return p.jsx(AO,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:f,onScrollButtonChange:_,children:p.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:p.jsx(re.div,{...s,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Hb.displayName=RO;var PO="SelectPopperPosition",oh=w.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:s=Kt,...o}=e,i=Mc(r);return p.jsx(h0,{...i,...o,ref:t,align:n,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});oh.displayName=PO;var[AO,$f]=Ao(ys,{}),ih="SelectViewport",Vb=w.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,o=Un(ih,r),i=$f(ih,r),a=Se(t,o.onViewportChange),l=w.useRef(0);return p.jsxs(p.Fragment,{children:[p.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),p.jsx(Lc.Slot,{scope:r,children:p.jsx(re.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:X(s.onScroll,c=>{const u=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:h}=i;if(h!=null&&h.current&&d){const f=Math.abs(l.current-u.scrollTop);if(f>0){const x=window.innerHeight-Kt*2,g=parseFloat(d.style.minHeight),b=parseFloat(d.style.height),v=Math.max(g,b);if(v<x){const m=v+f,y=Math.min(x,m),S=m-y;d.style.height=y+"px",d.style.bottom==="0px"&&(u.scrollTop=S>0?S:0,d.style.justifyContent="flex-end")}}}l.current=u.scrollTop})})})]})});Vb.displayName=ih;var Wb="SelectGroup",[NO,jO]=Ao(Wb),OO=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=sa();return p.jsx(NO,{scope:r,id:s,children:p.jsx(re.div,{role:"group","aria-labelledby":s,...n,ref:t})})});OO.displayName=Wb;var Kb="SelectLabel",qb=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=jO(Kb,r);return p.jsx(re.div,{id:s.id,...n,ref:t})});qb.displayName=Kb;var ec="SelectItem",[IO,Gb]=Ao(ec),Jb=w.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:o,...i}=e,a=Dn(ec,r),l=Un(ec,r),c=a.value===n,[u,d]=w.useState(o??""),[h,f]=w.useState(!1),x=Se(t,m=>{var y;return(y=l.itemRefCallback)==null?void 0:y.call(l,m,n,s)}),g=sa(),b=w.useRef("touch"),v=()=>{s||(a.onValueChange(n),a.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return p.jsx(IO,{scope:r,value:n,disabled:s,textId:g,isSelected:c,onItemTextChange:w.useCallback(m=>{d(y=>y||((m==null?void 0:m.textContent)??"").trim())},[]),children:p.jsx(Lc.ItemSlot,{scope:r,value:n,disabled:s,textValue:u,children:p.jsx(re.div,{role:"option","aria-labelledby":g,"data-highlighted":h?"":void 0,"aria-selected":c&&h,"data-state":c?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...i,ref:x,onFocus:X(i.onFocus,()=>f(!0)),onBlur:X(i.onBlur,()=>f(!1)),onClick:X(i.onClick,()=>{b.current!=="mouse"&&v()}),onPointerUp:X(i.onPointerUp,()=>{b.current==="mouse"&&v()}),onPointerDown:X(i.onPointerDown,m=>{b.current=m.pointerType}),onPointerMove:X(i.onPointerMove,m=>{var y;b.current=m.pointerType,s?(y=l.onItemLeave)==null||y.call(l):b.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:X(i.onPointerLeave,m=>{var y;m.currentTarget===document.activeElement&&((y=l.onItemLeave)==null||y.call(l))}),onKeyDown:X(i.onKeyDown,m=>{var S;((S=l.searchRef)==null?void 0:S.current)!==""&&m.key===" "||(wO.includes(m.key)&&v(),m.key===" "&&m.preventDefault())})})})})});Jb.displayName=ec;var ti="SelectItemText",Qb=w.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,...o}=e,i=Dn(ti,r),a=Un(ti,r),l=Gb(ti,r),c=_O(ti,r),[u,d]=w.useState(null),h=Se(t,v=>d(v),l.onItemTextChange,v=>{var m;return(m=a.itemTextRefCallback)==null?void 0:m.call(a,v,l.value,l.disabled)}),f=u==null?void 0:u.textContent,x=w.useMemo(()=>p.jsx("option",{value:l.value,disabled:l.disabled,children:f},l.value),[l.disabled,l.value,f]),{onNativeOptionAdd:g,onNativeOptionRemove:b}=c;return Ge(()=>(g(x),()=>b(x)),[g,b,x]),p.jsxs(p.Fragment,{children:[p.jsx(re.span,{id:l.textId,...o,ref:h}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?$n.createPortal(o.children,i.valueNode):null]})});Qb.displayName=ti;var Yb="SelectItemIndicator",Xb=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return Gb(Yb,r).isSelected?p.jsx(re.span,{"aria-hidden":!0,...n,ref:t}):null});Xb.displayName=Yb;var ah="SelectScrollUpButton",Zb=w.forwardRef((e,t)=>{const r=Un(ah,e.__scopeSelect),n=$f(ah,e.__scopeSelect),[s,o]=w.useState(!1),i=Se(t,n.onScrollButtonChange);return Ge(()=>{if(r.viewport&&r.isPositioned){let a=function(){const c=l.scrollTop>0;o(c)};const l=r.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),s?p.jsx(tx,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});Zb.displayName=ah;var lh="SelectScrollDownButton",ex=w.forwardRef((e,t)=>{const r=Un(lh,e.__scopeSelect),n=$f(lh,e.__scopeSelect),[s,o]=w.useState(!1),i=Se(t,n.onScrollButtonChange);return Ge(()=>{if(r.viewport&&r.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,u=Math.ceil(l.scrollTop)<c;o(u)};const l=r.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),s?p.jsx(tx,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});ex.displayName=lh;var tx=w.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...s}=e,o=Un("SelectScrollButton",r),i=w.useRef(null),a=$c(r),l=w.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return w.useEffect(()=>()=>l(),[l]),Ge(()=>{var u;const c=a().find(d=>d.ref.current===document.activeElement);(u=c==null?void 0:c.ref.current)==null||u.scrollIntoView({block:"nearest"})},[a]),p.jsx(re.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:X(s.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(n,50))}),onPointerMove:X(s.onPointerMove,()=>{var c;(c=o.onItemLeave)==null||c.call(o),i.current===null&&(i.current=window.setInterval(n,50))}),onPointerLeave:X(s.onPointerLeave,()=>{l()})})}),LO="SelectSeparator",rx=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return p.jsx(re.div,{"aria-hidden":!0,...n,ref:t})});rx.displayName=LO;var ch="SelectArrow",$O=w.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=Mc(r),o=Dn(ch,r),i=Un(ch,r);return o.open&&i.position==="popper"?p.jsx(f0,{...s,...n,ref:t}):null});$O.displayName=ch;var MO="SelectBubbleInput",nx=w.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const s=w.useRef(null),o=Se(n,s),i=B0(t);return w.useEffect(()=>{const a=s.current;if(!a)return;const l=window.HTMLSelectElement.prototype,u=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==t&&u){const d=new Event("change",{bubbles:!0});u.call(a,t),a.dispatchEvent(d)}},[i,t]),p.jsx(re.select,{...r,style:{...hw,...r.style},ref:o,defaultValue:t})});nx.displayName=MO;function sx(e){return e===""||e===void 0}function ox(e){const t=Dt(e),r=w.useRef(""),n=w.useRef(0),s=w.useCallback(i=>{const a=r.current+i;t(a),function l(c){r.current=c,window.clearTimeout(n.current),c!==""&&(n.current=window.setTimeout(()=>l(""),1e3))}(a)},[t]),o=w.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,o]}function ix(e,t,r){const s=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let i=DO(e,Math.max(o,0));s.length===1&&(i=i.filter(c=>c!==r));const l=i.find(c=>c.textValue.toLowerCase().startsWith(s.toLowerCase()));return l!==r?l:void 0}function DO(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var UO=Ob,ax=Lb,FO=Mb,BO=Db,zO=Ub,lx=Fb,HO=Vb,cx=qb,ux=Jb,VO=Qb,WO=Xb,dx=Zb,hx=ex,fx=rx;const Rr=UO,Pr=FO,ur=w.forwardRef(({className:e,children:t,...r},n)=>p.jsxs(ax,{ref:n,className:le("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
241ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[t,p.jsx(BO,{asChild:!0,children:p.jsx(pf,{className:"h-4 w-4 opacity-50"})})]}));ur.displayName=ax.displayName;const px=w.forwardRef(({className:e,...t},r)=>p.jsx(dx,{ref:r,className:le("flex cursor-default items-center justify-center py-1",e),...t,children:p.jsx(dk,{className:"h-4 w-4"})}));px.displayName=dx.displayName;const mx=w.forwardRef(({className:e,...t},r)=>p.jsx(hx,{ref:r,className:le("flex cursor-default items-center justify-center py-1",e),...t,children:p.jsx(pf,{className:"h-4 w-4"})}));mx.displayName=hx.displayName;const dr=w.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>p.jsx(zO,{children:p.jsxs(lx,{ref:s,className:le("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[p.jsx(px,{}),p.jsx(HO,{className:le("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),p.jsx(mx,{})]})}));dr.displayName=lx.displayName;const KO=w.forwardRef(({className:e,...t},r)=>p.jsx(cx,{ref:r,className:le("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));KO.displayName=cx.displayName;const bt=w.forwardRef(({className:e,children:t,...r},n)=>p.jsxs(ux,{ref:n,className:le("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...r,children:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(WO,{children:p.jsx(Lw,{className:"h-4 w-4"})})}),p.jsx(VO,{children:t})]}));bt.displayName=ux.displayName;const qO=w.forwardRef(({className:e,...t},r)=>p.jsx(fx,{ref:r,className:le("-mx-1 my-1 h-px bg-muted",e),...t}));qO.displayName=fx.displayName;const gx=w.forwardRef(({className:e,...t},r)=>p.jsx("textarea",{className:le("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
241ing-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:r,...t}));gx.displayName="Textarea";var Du="rovingFocusGroup.onEntryFocus",GO={bubbles:!1,cancelable:!0},ca="RovingFocusGroup",[uh,vx,JO]=cf(ca),[QO,yx]=Mn(ca,[JO]),[YO,XO]=QO(ca),wx=w.forwardRef((e,t)=>p.jsx(uh.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsx(uh.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsx(ZO,{...e,ref:t})})}));wx.displayName=ca;var ZO=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:s=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:u=!1,...d}=e,h=w.useRef(null),f=Se(t,h),x=Lf(o),[g,b]=wo({prop:i,defaultProp:a??null,onChange:l,caller:ca}),[v,m]=w.useState(!1),y=Dt(c),S=vx(r),E=w.useRef(!1),[_,T]=w.useState(0);return w.useEffect(()=>{const R=h.current;if(R)return R.addEventListener(Du,y),()=>R.removeEventListener(Du,y)},[y]),p.jsx(YO,{scope:r,orientation:n,dir:x,loop:s,currentTabStopId:g,onItemFocus:w.useCallback(R=>b(R),[b]),onItemShiftTab:w.useCallback(()=>m(!0),[]),onFocusableItemAdd:w.useCallback(()=>T(R=>R+1),[]),onFocusableItemRemove:w.useCallback(()=>T(R=>R-1),[]),children:p.jsx(re.div,{tabIndex:v||_===0?-1:0,"data-orientation":n,...d,ref:f,style:{outline:"none",...e.style},onMouseDown:X(e.onMouseDown,()=>{E.current=!0}),onFocus:X(e.onFocus,R=>{const P=!E.current;if(R.target===R.currentTarget&&P&&!v){const j=new CustomEvent(Du,GO);if(R.currentTarget.dispatchEvent(j),!j.defaultPrevented){const B=S().filter(z=>z.focusable),I=B.find(z=>z.active),W=B.find(z=>z.id===g),Q=[I,W,...B].filter(Boolean).map(z=>z.ref.current);Sx(Q,u)}}E.current=!1}),onBlur:X(e.onBlur,()=>m(!1))})})}),bx="RovingFocusGroupItem",xx=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:s=!1,tabStopId:o,children:i,...a}=e,l=sa(),c=o||l,u=XO(bx,r),d=u.currentTabStopId===c,h=vx(r),{onFocusableItemAdd:f,onFocusableItemRemove:x,currentTabStopId:g}=u;return w.useEffect(()=>{if(n)return f(),()=>x()},[n,f,x]),p.jsx(uh.ItemSlot,{scope:r,id:c,focusable:n,active:s,children:p.jsx(re.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...a,ref:t,onMouseDown:X(e.onMouseDown,b=>{n?u.onItemFocus(c):b.preventDefault()}),onFocus:X(e.onFocus,()=>u.onItemFocus(c)),onKeyDown:X(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){u.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const v=rI(b,u.orientation,u.dir);if(v!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let y=h().filter(S=>S.focusable).map(S=>S.ref.current);if(v==="last")y.reverse();else if(v==="prev"||v==="next"){v==="prev"&&y.reverse();const S=y.indexOf(b.currentTarget);y=u.loop?nI(y,S+1):y.slice(S+1)}setTimeout(()=>Sx(y))}}),children:typeof i=="function"?i({isCurrentTabStop:d,hasTabStop:g!=null}):i})})});xx.displayName=bx;var eI={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function tI(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function rI(e,t,r){const n=tI(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return eI[n]}function Sx(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function nI(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var sI=wx,oI=xx,Dc="Tabs",[iI,kI]=Mn(Dc,[yx]),_x=yx(),[aI,Mf]=iI(Dc),Ex=w.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:s,defaultValue:o,orientation:i="horizontal",dir:a,activationMode:l="automatic",...c}=e,u=Lf(a),[d,h]=wo({prop:n,onChange:s,defaultProp:o??"",caller:Dc});return p.jsx(aI,{scope:r,baseId:sa(),value:d,onValueChange:h,orientation:i,dir:u,activationMode:l,children:p.jsx(re.div,{dir:u,"data-orientation":i,...c,ref:t})})});Ex.displayName=Dc;var kx="TabsList",Cx=w.forwardRef((e,t)=>
vendor: 2,359 bytes, line 241
241{const{__scopeTabs:r,loop:n=!0,...s}=e,o=Mf(kx,r),i=_x(r);return p.jsx(sI,{asChild:!0,...i,orientation:o.orientation,dir:o.dir,loop:n,children:p.jsx(re.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});Cx.displayName=kx;var Tx="TabsTrigger",Rx=w.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:s=!1,...o}=e,i=Mf(Tx,r),a=_x(r),l=Nx(i.baseId,n),c=jx(i.baseId,n),u=n===i.value;return p.jsx(oI,{asChild:!0,...a,focusable:!s,active:u,children:p.jsx(re.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:l,...o,ref:t,onMouseDown:X(e.onMouseDown,d=>{!s&&d.button===0&&d.ctrlKey===!1?i.onValueChange(n):d.preventDefault()}),onKeyDown:X(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&i.onValueChange(n)}),onFocus:X(e.onFocus,()=>{const d=i.activationMode!=="manual";!u&&!s&&d&&i.onValueChange(n)})})})});Rx.displayName=Tx;var Px="TabsContent",Ax=w.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:s,children:o,...i}=e,a=Mf(Px,r),l=Nx(a.baseId,n),c=jx(a.baseId,n),u=n===a.value,d=w.useRef(u);return w.useEffect(()=>{const h=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(h)},[]),p.jsx(ta,{present:s||u,children:({present:h})=>p.jsx(re.div,{"data-state":u?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:c,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:h&&o})})});Ax.displayName=Px;function Nx(e,t){return`${e}-trigger-${t}`}function jx(e,t){return`${e}-content-${t}`}var lI=Ex,Ox=Cx,Ix=Rx,Lx=Ax;const cI=lI,$x=w.forwardRef(({className:e,...t},r)=>p.jsx(Ox,{ref:r,className:le("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));$x.displayName=Ox.displayName;const dh=w.forwardRef(({className:e,...t},r)=>p.jsx(Ix,{ref:r,className:le("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e),...t}));dh.displayName=Ix.displayName;
241const hh=w.forwardRef(({className:e,...t},r)=>p.jsx(Lx,{ref:r,className:le("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));hh.displayName=Lx.displayName;function uI(e){const t=e.trim().split(`
242`);if(t.length<2)return[];const r=t[0].split(",").map(s=>s.trim().replace(/"/g,"")),n=[];for(let s=1;s<t.length;s++){const o=dI(t[s]);if(o.length===r.length){const i={};r.forEach((a,l)=>{i[a]=o[l].trim()}),n.push(i)}}return n}function dI(e){const t=[];let r="",n=!1;for(let s=0;s<e.length;s++){const o=e[s];o==='"'?n=!n:o===","&&!n?(t.push(r),r=""):r+=o}return t.push(r),t}function hI(e,t){const r=new Map;e.forEach(o=>{var m;const i=o[t.day],a=t.date?o[t.date]:"",l=o[t.startTime],c=t.endTime?o[t.endTime]:"";if(!i||!l)return;const u=c?`${l} - ${c}`:l,d=a?`${i}|${a}`:i;let h,f="";if(t.link){const y=(m=o[t.link])==null?void 0:m.trim();y&&(h=y.startsWith("http")?y:`https://${y}`,f=h)}const x=o.Openings||o.openings||"",g=parseInt(x,10)||0,b=o.Description||o.description||o.Notes||o.notes||"",v={time:u,startTime:l,endTime:c,name:o[t.name]||"",age:o[t.age]||"",type:o[t.type]||"",instructor:o[t.instructor]||"",openings:g,notes:b,registerUrl:f,link:h};r.has(d)||r.set(d,[]),r.get(d).push(v)});const n=[];r.forEach((o,i)=>{if(i.includes("|")){const[a,l]=i.split("|");n.push({day:a,date:l,items:o})}else n.push({day:i,items:o})});const s=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"];return n.sort((o,i)=>{const a=s.indexOf(o.day),l=s.indexOf(i.day);return a-l}),n}function Lg(e){return e.length===0?[]:Object.keys(e[0])}async function fI(e){try{const t=await fetch(e);if(!t.ok)throw new Error(`Failed to fetch CSV: ${t.statusText}`);return await t.text()}catch(t){throw new Error(`Error fetching CSV: ${t instanceof Error?t.message:"Unknown error"}`)}}const pI=()=>{const[e,t]=w.useState([]),[r,n]=w.useState([]),[s,o]=w.useState({day:"",date:"",startTime:"",endTime:"",name:"",age:"",type:"",instructor:"",link:""}),[i,a]=w.useState([]),[l,c]=w.useState(""),[u,d]=w.useState(""),[h,f]=w.useState(!1),[x,g]=w.useState(""),{toast:b}=ow(),v=_=>{try{const T=uI(_);if(T.length===0)throw new Error("No data found in CSV");t(T),n(Lg(T)),g(""),b({title:"CSV loaded successfully",description:`Found ${T.length} rows with ${Lg(T).length} columns`})}catch(T){g(T instanceof Error?T.message:"Failed to parse CSV")}},m=async()=>{if(l){f(!0);try{const _=await fI(l);d(_),v(_)}catch(_){g(_ instanceof Error?_.message:"Failed to fetch CSV")}finally{f(!1)}}},y=()=>{u&&v(u)},S=()=>{if(e.length===0){g("Please upload CSV data first");return}const T=["day","startTime","name","age","type","instructor"].filter(R=>!s[R]);if(T.length>0){g(`Please map required fields: ${T.join(", ")}`);return}try{const R=hI(e,s);if(a(R),g(""),l){const P=new URLSearchParams;Object.entries(s).forEach(([B,I])=>{I&&P.set(B,I)});const j=`/?csv=${encodeURIComponent(l)}&${P.toString()}`;window.location.href=j;return}b({title:"Schedule generated successfully",description:`Created schedule with ${R.length} days and ${R.reduce((P,j)=>P+j.items.length,0)} classes`})}catch(R){g(R instanceof Error?R.message:"Failed to generate schedule")}},E=()=>{if(!l){b({title:"URL required",description:"Please enter a CSV URL to generate embed code",variant:"destructive"});return}const T=`<iframe src="${`${window.location.origin}/?csv=${encodeURIComponent(l)}`}" width="100%" height="600" frameborder="0"></iframe>`;navigator.clipboard.writeText(T),b({title:"Embed code copied!",description:"Paste this iframe code into your website"})};return p.jsx("div",{className:"min-h-screen bg-background",children:p.jsxs("div",{className:"container max-w-6xl mx-auto py-8 px-4",children:[p.jsxs("div",{className:"mb-6 flex items-center gap-4",children:[p.jsx(PR,{to:"/",children:p.jsxs(We,{variant:"outline",size:"sm",children:[p.jsx(ck,{className:"w-4 h-4 mr-2"}),"Back to Schedule"]})}),p.jsxs("div",{children:[p.jsx("h1",{className:"text-3xl font-bold",children:"Import Schedule"}),p.jsx("p",{className:"text-muted-foreground",children:"Import your schedule from a CSV file or spreadsheet"})]})]}),x&&p.jsx(jf,{className:"mb-6",variant:"destructive",children:p.jsx(Of,{children:x})}),p.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[p.jsxs("div",{className:"space-y-6",children:[p.jsxs(Yo,{children:[p.jsxs(Xo,{children:[p.jsxs(Zo,{className:"flex items-center gap-2",children:[p.jsx(pk,{className:"w-5 h-5"}),"Import CSV Data"]}),p.jsx(hl,{children:"Upload your schedule data from a CSV file or Google Sheets"})]}),p.jsx(ei,{children:p.jsxs(cI,{defaultValue:"url",className:"w-full",children:[p.jsxs($x,{className:"grid w-full grid-cols-2",children:[p.jsx(dh,{value:"url",children:"From URL"}),p.jsx(dh,{value:"text",children:"Paste Text"})]}),p.jsxs(hh,{value:"url",className:"space-y-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(wt,{htmlFor:"csv-url",children:"CSV URL (Google Sheets CSV link)"}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(ts,{id:"csv-url",placeholder:"https://docs.google.com/spreadsheets/d/.../export?format=csv",value:l,onCh
242ange:_=>c(_.target.value)}),p.jsx(We,{onClick:m,disabled:h,children:h?"Loading...":"Fetch"})]})]}),p.jsxs("div",{className:"p-4 bg-muted rounded-lg",children:[p.jsx("h4",{className:"font-medium mb-2",children:"How to get Google Sheets CSV URL:"}),p.jsxs("ol",{className:"text-sm text-muted-foreground space-y-1 list-decimal list-inside",children:[p.jsx("li",{children:"Open your Google Sheet"}),p.jsx("li",{children:"Click File → Share → Publish to web"}),p.jsx("li",{children:'Choose "Comma-separated values (.csv)"'}),p.jsx("li",{children:'Click "Publish" and copy the link'})]})]})]}),p.jsxs(hh,{value:"text",className:"space-y-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(wt,{htmlFor:"csv-text",children:"CSV Text"}),p.jsx(gx,{id:"csv-text",placeholder:"Paste your CSV data here...",value:u,onChange:_=>d(_.target.value),rows:8})]}),p.jsx(We,{onClick:y,children:"Parse CSV"})]})]})})]}),r.length>0&&p.jsxs(Yo,{children:[p.jsxs(Xo,{children:[p.jsx(Zo,{children:"Map Columns"}),p.jsx(hl,{children:"Map your CSV columns to schedule fields"})]}),p.jsxs(ei,{className:"space-y-4",children:[p.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[p.jsxs("div",{className:"space-y-2",children:[p.jsx(wt,{children:"Day *"}),p.jsxs(Rr,{value:s.day,onValueChange:_=>o({...s,day:_}),children:[p.jsx(ur,{children:p.jsx(Pr,{placeholder:"Select column"})}),p.jsx(dr,{children:r.map(_=>p.jsx(bt,{value:_,children:_},_))})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(wt,{children:"Date"}),p.jsxs(Rr,{value:s.date||"__none__",onValueChange:_=>o({...s,date:_==="__none__"?"":_}),children:[p.jsx(ur,{children:p.jsx(Pr,{placeholder:"Select column (optional)"})}),p.jsxs(dr,{children:[p.jsx(bt,{value:"__none__",children:"None (weekly schedule)"}),r.map(_=>p.jsx(bt,{value:_,children:_},_))]})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(wt,{children:"Start Time *"}),p.jsxs(Rr,{value:s.startTime,onValueChange:_=>o({...s,startTime:_}),children:[p.jsx(ur,{children:p.jsx(Pr,{placeholder:"Select column"})}),p.jsx(dr,{children:r.map(_=>p.jsx(bt,{value:_,children:_},_))})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(wt,{children:"End Time"}),p.jsxs(Rr,{value:s.endTime||"__none__",onValueChange:_=>o({...s,endTime:_==="__none__"?"":_}),children:[p.jsx(ur,{children:p.jsx(Pr,{placeholder:"Select column (optional)"})}),p.jsxs(dr,{children:[p.jsx(bt,{value:"__none__",children:"None"}),r.map(_=>p.jsx(bt,{value:_,children:_},_))]})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(wt,{children:"Class Name *"}),p.jsxs(Rr,{value:s.name,onValueChange:_=>o({...s,name:_}),children:[p.jsx(ur,{children:p.jsx(Pr,{placeholder:"Select column"})}),p.jsx(dr,{children:r.map(_=>p.jsx(bt,{value:_,children:_},_))})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(wt,{children:"Age Group *"}),p.jsxs(Rr,{value:s.age,onValueChange:_=>o({...s,age:_}),children:[p.jsx(ur,{children:p.jsx(Pr,{placeholder:"Select column"})}),p.jsx(dr,{children:r.map(_=>p.jsx(bt,{value:_,children:_},_))})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(wt,{children:"Class Type *"}),p.jsxs(Rr,{value:s.type,onValueChange:_=>o({...s,type:_}),children:[p.jsx(ur,{children:p.jsx(Pr,{placeholder:"Select column"})}),p.jsx(dr,{children:r.map(_=>p.jsx(bt,{value:_,children:_},_))})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(wt,{children:"Instructor *"}),p.jsxs(Rr,{value:s.instructor,onValueChange:_=>o({...s,instructor:_}),children:[p.jsx(ur,{children:p.jsx(Pr,{placeholder:"Select column"})}),p.jsx(dr,{children:r.map(_=>p.jsx(bt,{value:_,children:_},_))})]})]}),p.jsxs("div",{className:"space-y-2",children:[p.jsx(wt,{children:"Link"}),p.jsxs(Rr,{value:s.link||"__none__",onValueChange:_=>o({...s,link:_==="__none__"?"":_}),children:[p.jsx(ur,{children:p.jsx(Pr,{placeholder:"Select column (optional)"})}),p.jsxs(dr,{children:[p.jsx(bt,{value:"__none__",children:"None"}),r.map(_=>p.jsx(bt,{value:_,children:_},_))]})]}),p.jsx("p",{className:"text-xs text-muted-foreground",children:"If set, the entire class row becomes clickable and opens in a new tab. Leave as 'None' for no links."})]})]}),p.jsxs("div",{className:"flex gap-2 pt-4",children:[p.jsx(We,{onClick:S,className:"flex-1",children:"Generate Schedule"}),l&&p.jsxs(We,{onClick:E,variant:"outline",children:[p.jsx(fk,{className:"w-4 h-4 mr-2"}),"Get Embed Code"]})]})]})]}),i.length>0&&l&&p.jsxs(Yo,{children:[p.jsx(Xo,{children:p.jsx(Zo,{children:"Integration Options"})}),p.jsx(ei,{className:"space-y-4",children:p.jsxs("div",{className:"space-y-2",children:[p.jsx(wt,{children:"Direct URL"}),p.jsxs("div",{className:"flex gap-2",children:[p.jsx(ts,{value:`${window.location.origin}/?csv=${encodeURIComponent(l)}`,readOnly:!0}),p.jsx(We,{variant:"outline",onClick:()=>window.open(`${window.location.origin}/?csv=${encodeURIComponent(l)}`,"_blank"),children:p.jsx(mf,{className:"w-4 h-4"})})]})]})})]})]}),p.jsx("div",{children:i.length>0&&p.jsxs(Yo,{children:[p.jsxs(Xo,{children:[p.jsx(Zo,{children:"Preview"}),p.jsx(hl,{children:"Preview of your imported schedule"})]}),p.jsx(ei,{className:"p-0",children:p.jsx("div",{className:"max-h-[600px] overflow-auto",children:p.jsx(Q0,{scheduleData:i})})})]})})]})]})})},mI=()=>
242{const e=aa();return w.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),p.jsx("div",{className:"flex min-h-screen items-center justify-center bg-gray-100",children:p.jsxs("div",{className:"text-center",children:[p.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),p.jsx("p",{className:"mb-4 text-xl text-gray-600",children:"Oops! Page not found"}),p.jsx("a",{href:"/",className:"text-blue-500 underline hover:text-blue-700",children:"Return to Home"})]})})},gI=new TT,vI=()=>p.jsx(PT,{client:gI,children:p.jsxs(nT,{children:[p.jsx(Zk,{}),p.jsx(N1,{}),p.jsx(CR,{children:p.jsxs(wR,{children:[p.jsx(cl,{path:"/",element:p.jsx(wj,{})}),p.jsx(cl,{path:"/import",element:p.jsx(pI,{})}),p.jsx(cl,{path:"*",element:p.jsx(mI,{})})]})})]})});sw(document.getElementById("root")).render(p.jsx(vI,{}));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.