vendor: 6,287 bytes, lines 1-9
1var E_=Object.defineProperty;var vm=e=>{throw TypeError(e)};var __=(e,t,r)=>t in e?E_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Xn=(e,t,r)=>__(e,typeof t!="symbol"?t+"":t,r),Uu=(e,t,r)=>t.has(e)||vm("Cannot "+r);var D=(e,t,r)=>(Uu(e,t,"read from private field"),r?r.call(e):t.get(e)),we=(e,t,r)=>t.has(e)?vm("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),fe=(e,t,r,n)=>(Uu(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),ut=(e,t,r)=>(Uu(e,t,"access private method"),r);var Va=(e,t,r,n)=>({set _(s){fe(e,t,s,r)},get _(){return D(e,t,n)}});function C_(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 Ny(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Py={exports:{}},Mc={},Ry={exports:{}},pe={};/** 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 _a=Symbol.for("react.element"),k_=Symbol.for("react.portal"),T_=Symbol.for("react.fragment"),N_=Symbol.for("react.strict_mode"),P_=Symbol.for("react.profiler"),R_=Symbol.for("react.provider"),j_=Symbol.for("react.context"),A_=Symbol.for("react.forward_ref"),O_=Symbol.for("react.suspense"),I_=Symbol.for("react.memo"),D_=Symbol.for("react.lazy"),ym=Symbol.iterator;function L_(e){return e===null||typeof e!="object"?null:(e=ym&&e[ym]||e["@@iterator"],typeof e=="function"?e:null)}var jy={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ay=Object.assign,Oy={};function qo(e,t,r){this.props=e,this.context=t,this.refs=Oy,this.updater=r||jy}qo.prototype.isReactComponent={};qo.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")};qo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Iy(){}Iy.prototype=qo.prototype;function _h(e,t,r){this.props=e,this.context=t,this.refs=Oy,this.updater=r||jy}var Ch=_h.prototype=new Iy;Ch.constructor=_h;Ay(Ch,qo.prototype);Ch.isPureReactComponent=!0;var wm=Array.isArray,Dy=Object.prototype.hasOwnProperty,kh={current:null},Ly={key:!0,ref:!0,__self:!0,__source:!0};function $y(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)Dy.call(t,n)&&!Ly.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:_a,type:e,key:o,ref:i,props:s,_owner:kh.current}}function $_(e,t){return{$$typeof:_a,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Th(e){return typeof e=="object"&&e!==null&&e.$$typeof===_a}function M_(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var xm=/\/+/g;function Bu(e,t){return typeof e=="object"&&e!==null&&e.key!=null?M_(""+e.key):t.toString(36)}function Al(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 _a:case k_:i=!0}}if(i)return i=e,s=s(i),e=n===""?"."+Bu(i,0):n,wm(s)?(r="",e!=null&&(r=e.replace(xm,"$&/")+"/"),Al(s,t,r,"",function(c){return c})):s!=null&&(Th(s)&&(s=$_(s,r+(!s.key||i&&i.key===s.key?"":(""+s.key).replace(xm,"$&/")+"/")+e)),t.push(s)),1;if(i=0,n=n===""?".":n+":",wm(e))for(var a=0;a<e.length;a++){o=e[a];var l=n+Bu(o,a);i+=Al(o,t,r,l,s)}else if(l=L_(e),typeof l=="function")for(e=l.call(e),a=0;!(o=e.next()).done;)o=o.value,l=n+Bu(o,a++),i+=Al(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 qa(e,t,r){if(e==null)return e;var n=[],s=0;return Al(e,n,"","",function(o){return t.call(r,o,s++)}),n}function F_(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 xt={current:null},Ol={transition:null},U_={ReactCurrentDispatcher:xt,ReactCurrentBatchConfig:Ol,ReactCurrentOwner:kh};function My(){throw Error("act(...) is not supported in production builds of React.")}pe.Children={map:qa,forEach:function(e,t,r){qa(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return qa(e,function(){t++}),t},toArray:function(e){return qa(e,function(t){return t})||[]},only:function(e){if(!Th(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};pe.Component=qo;pe.Fragment=T_;pe.Profiler=P_;pe.PureComponent=_h;pe.StrictMode=N_;pe.Suspense=O_;
vendor: 7,019 bytes, lines 9-25
9pe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=U_;pe.act=My;pe.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=Ay({},e.props),s=e.key,o=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(o=t.ref,i=kh.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)Dy.call(t,l)&&!Ly.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:_a,type:e.type,key:s,ref:o,props:n,_owner:i}};pe.createContext=function(e){return e={$$typeof:j_,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:R_,_context:e},e.Consumer=e};pe.createElement=$y;pe.createFactory=function(e){var t=$y.bind(null,e);return t.type=e,t};pe.createRef=function(){return{current:null}};pe.forwardRef=function(e){return{$$typeof:A_,render:e}};pe.isValidElement=Th;pe.lazy=function(e){return{$$typeof:D_,_payload:{_status:-1,_result:e},_init:F_}};pe.memo=function(e,t){return{$$typeof:I_,type:e,compare:t===void 0?null:t}};pe.startTransition=function(e){var t=Ol.transition;Ol.transition={};try{e()}finally{Ol.transition=t}};pe.unstable_act=My;pe.useCallback=function(e,t){return xt.current.useCallback(e,t)};pe.useContext=function(e){return xt.current.useContext(e)};pe.useDebugValue=function(){};pe.useDeferredValue=function(e){return xt.current.useDeferredValue(e)};pe.useEffect=function(e,t){return xt.current.useEffect(e,t)};pe.useId=function(){return xt.current.useId()};pe.useImperativeHandle=function(e,t,r){return xt.current.useImperativeHandle(e,t,r)};pe.useInsertionEffect=function(e,t){return xt.current.useInsertionEffect(e,t)};pe.useLayoutEffect=function(e,t){return xt.current.useLayoutEffect(e,t)};pe.useMemo=function(e,t){return xt.current.useMemo(e,t)};pe.useReducer=function(e,t,r){return xt.current.useReducer(e,t,r)};pe.useRef=function(e){return xt.current.useRef(e)};pe.useState=function(e){return xt.current.useState(e)};pe.useSyncExternalStore=function(e,t,r){return xt.current.useSyncExternalStore(e,t,r)};pe.useTransition=function(){return xt.current.useTransition()};pe.version="18.3.1";Ry.exports=pe;var p=Ry.exports;const z=Ny(p),Fy=C_({__proto__:null,default:z},[p]);/** 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 B_=p,z_=Symbol.for("react.element"),W_=Symbol.for("react.fragment"),H_=Object.prototype.hasOwnProperty,V_=B_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,q_={key:!0,ref:!0,__self:!0,__source:!0};function Uy(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)H_.call(t,n)&&!q_.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:z_,type:e,key:o,ref:i,props:s,_owner:V_.current}}Mc.Fragment=W_;Mc.jsx=Uy;Mc.jsxs=Uy;Py.exports=Mc;var u=Py.exports,By={exports:{}},zt={},zy={exports:{}},Wy={};/** 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(P,$){var K=P.length;P.push($);e:for(;0<K;){var B=K-1>>>1,Y=P[B];if(0<s(Y,$))P[B]=$,P[K]=Y,K=B;else break e}}function r(P){return P.length===0?null:P[0]}function n(P){if(P.length===0)return null;var $=P[0],K=P.pop();if(K!==$){P[0]=K;e:for(var B=0,Y=P.length,ae=Y>>>1;B<ae;){var ue=2*(B+1)-1,_e=P[ue],O=ue+1,I=P[O];if(0>s(_e,K))O<Y&&0>s(I,_e)?(P[B]=I,P[O]=K,B=O):(P[B]=_e,P[ue]=K,B=ue);else if(O<Y&&0>s(I,K))P[B]=I,P[O]=K,B=O;else break e}}return $}function s(P,$){var K=P.sortIndex-$.sortIndex;return K!==0?K:P.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var i=Date,a=i.now();e.unstable_now=function(){return i.now()-a}}var l=[],c=[],d=1,f=null,h=3,v=!1,w=!1,m=!1,b=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(P){for(var $=r(c);$!==null;){if($.callback===null)n(c);else if($.startTime<=P)n(c),$.sortIndex=$.expirationTime,t(l,$);else break;$=r(c)}}function S(P){if(m=!1,x(P),!w)if(r(l)!==null)w=!0,H(E);else{var $=r(c);$!==null&&ee(S,$.startTime-P)}}function E(P,$){w=!1,m&&(m=!1,g(k),k=-1),v=!0;var K=h;try{for(x($),f=r(l);f!==null&&(!(f.expirationTime>$)||P&&!R());){var B=f.callback;if(typeof B=="function"){f.callback=null,h=f.priorityLevel;var Y=B(f.expirationTime<=$);$=e.unstable_now(),typeof Y=="function"?f.callback=Y:f===r(l)&&n(l),x($)}else n(l);f=r(l)}if(f!==null)var ae=!0;else{var ue=r(c);ue!==null&&ee(S,ue.startTime-$),ae=!1}return ae}finally{f=null,h=K,v=!1}}var C=!1,_=null,k=-1,N=5,j=-1;function R(){return!(e.unstable_now()-j<N)}function T(){if(_!==null){var P=e.unstable_now();j=P;var $=!0;try{$=_(!0,P)}finally{$?A():(C=!1,_=null)}}else C=!1}var A;if(typeof y=="function")A=function(){y(T)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,W=L.port2;L.port1.onmessage=T,A=function(){W.postMessage(null)}}else A=function(){b(T,0)};function H(P){_=P,C||(C=!0,A())}function ee(P,$){k=b(function(){P(e.unstable_now())},$)}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(P){P.callback=null},e.unstable_continueExecution=function(){w||v||(w=!0,H(E))},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return r(l)},e.unstable_next=function(P){switch(h){case 1:case 2:case 3:var $=3;break;default:$=h}var K=h;h=$;try{return P()}finally{h=K}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(P,$){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var K=h;h=P;try{return $()}finally{h=K}},e.unstable_scheduleCallback=function(P,$,K){var B=e.unstable_now();switch(typeof K=="object"&&K!==null?(K=K.delay,K=typeof K=="number"&&0<K?B+K:B):K=B,P){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}
vendor: 4,615 bytes, lines 25-33
25return Y=K+Y,P={id:d++,callback:$,priorityLevel:P,startTime:K,expirationTime:Y,sortIndex:-1},K>B?(P.sortIndex=K,t(c,P),r(l)===null&&P===r(c)&&(m?(g(k),k=-1):m=!0,ee(S,K-B))):(P.sortIndex=Y,t(l,P),w||v||(w=!0,H(E))),P},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(P){var $=h;return function(){var K=h;h=$;try{return P.apply(this,arguments)}finally{h=K}}}})(Wy);zy.exports=Wy;var K_=zy.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 G_=p,Bt=K_;function F(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 Hy=new Set,zi={};function Ps(e,t){Oo(e,t),Oo(e+"Capture",t)}function Oo(e,t){for(zi[e]=t,e=0;e<t.length;e++)Hy.add(t[e])}var Jr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$d=Object.prototype.hasOwnProperty,Y_=/^[: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]*$/,bm={},Sm={};function J_(e){return $d.call(Sm,e)?!0:$d.call(bm,e)?!1:Y_.test(e)?Sm[e]=!0:(bm[e]=!0,!1)}function Q_(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 X_(e,t,r,n){if(t===null||typeof t>"u"||Q_(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 bt(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 at={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){at[e]=new bt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];at[t]=new bt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){at[e]=new bt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){at[e]=new bt(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){at[e]=new bt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){at[e]=new bt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){at[e]=new bt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){at[e]=new bt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){at[e]=new bt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Nh=/[\-:]([a-z])/g;function Ph(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
33-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(Nh,Ph);at[t]=new bt(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(Nh,Ph);at[t]=new bt(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(Nh,Ph);at[t]=new bt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){at[e]=new bt(e,1,!1,e.toLowerCase(),null,!1,!1)});at.xlinkHref=new bt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){at[e]=new bt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Rh(e,t,r,n){var s=at.hasOwnProperty(t)?at[t]:null;(s!==null?s.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(X_(t,r,s,n)&&(r=null),n||s===null?J_(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 rn=G_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ka=Symbol.for("react.element"),Qs=Symbol.for("react.portal"),Xs=Symbol.for("react.fragment"),jh=Symbol.for("react.strict_mode"),Md=Symbol.for("react.profiler"),Vy=Symbol.for("react.provider"),qy=Symbol.for("react.context"),Ah=Symbol.for("react.forward_ref"),Fd=Symbol.for("react.suspense"),Ud=Symbol.for("react.suspense_list"),Oh=Symbol.for("react.memo"),fn=Symbol.for("react.lazy"),Ky=Symbol.for("react.offscreen"),Em=Symbol.iterator;function li(e){return e===null||typeof e!="object"?null:(e=Em&&e[Em]||e["@@iterator"],typeof e=="function"?e:null)}var Be=Object.assign,zu;function wi(e){if(zu===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);zu=t&&t[1]||""}return` 34`+zu+e}var Wu=!1;function Hu(e,t){if(!e||Wu)return"";Wu=!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()}}catch(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{Wu=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?wi(e):""}function Z_(e){switch(e.tag){case 5:return wi(e.type);case 16:return wi("Lazy");case 13:return wi("Suspense");case 19:return wi("SuspenseList");case 0:case 2:case 15:return e=Hu(e.type,!1),e;case 11:return e=Hu(e.type.render,!1),e;case 1:return e=Hu(e.type,!0),e;default:return""}}function Bd(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 Xs:return"Fragment";case Qs:return"Portal";case Md:return"Profiler";case jh:return"StrictMode";case Fd:return"Suspense";case Ud:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case qy:return(e.displayName||"Context")+".Consumer";case Vy:return(e._context.displayName||"Context")+".Provider";case Ah:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Oh:return t=e.displayName||null,t!==null?t:Bd(e.type)||"Memo";case fn:t=e._payload,e=e._init;try{return Bd(e(t))}catch{}}return null}function eC(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 Bd(t);case 8:return t===jh?"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 Ln(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Gy(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function tC(e){var t=Gy(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 Ga(e){e._valueTracker||(e._valueTracker=tC(e))}function Yy(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=Gy(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Gl(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 zd(e,t){var r=t.checked;return Be({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function _m(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Ln(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}}
vendor: 4,651 bytes, line 37
37function Jy(e,t){t=t.checked,t!=null&&Rh(e,"checked",t,!1)}function Wd(e,t){Jy(e,t);var r=Ln(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")?Hd(e,t.type,r):t.hasOwnProperty("defaultValue")&&Hd(e,t.type,Ln(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Cm(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 Hd(e,t,r){(t!=="number"||Gl(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var xi=Array.isArray;function uo(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=""+Ln(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 Vd(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(F(91));return Be({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function km(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(F(92));if(xi(r)){if(1<r.length)throw Error(F(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:Ln(r)}}function Qy(e,t){var r=Ln(t.value),n=Ln(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 Tm(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Xy(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 qd(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Xy(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ya,Zy=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(Ya=Ya||document.createElement("div"),Ya.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ya.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Wi(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Ti={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},rC=["Webkit","ms","Moz","O"];Object.keys(Ti).forEach(function(e){rC.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ti[t]=Ti[e]})});function ew(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Ti.hasOwnProperty(e)&&Ti[e]?(""+t).trim():t+"px"}function tw(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=ew(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var nC=Be({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 Kd(e,t){if(t){if(nC[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(F(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(F(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(F(61))}if(t.style!=null&&typeof t.style!="object")throw Error(F(62))}}function Gd(e,t){if(e.indexOf("-")===-1)return typeof t.is=="str
37ing";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 Yd=null;function Ih(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Jd=null,fo=null,ho=null;function Nm(e){if(e=Ta(e)){if(typeof Jd!="function")throw Error(F(280));var t=e.stateNode;t&&(t=Wc(t),Jd(e.stateNode,e.type,t))}}function rw(e){fo?ho?ho.push(e):ho=[e]:fo=e}function nw(){if(fo){var e=fo,t=ho;if(ho=fo=null,Nm(e),t)for(e=0;e<t.length;e++)Nm(t[e])}}function sw(e,t){return e(t)}function ow(){}var Vu=!1;function iw(e,t,r){if(Vu)return e(t,r);Vu=!0;try{return sw(e,t,r)}finally{Vu=!1,(fo!==null||ho!==null)&&(ow(),nw())}}function Hi(e,t){var r=e.stateNode;if(r===null)return null;var n=Wc(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(F(231,t,typeof r));return r}var Qd=!1;if(Jr)try{var ci={};Object.defineProperty(ci,"passive",{get:function(){Qd=!0}}),window.addEventListener("test",ci,ci),window.removeEventListener("test",ci,ci)}catch{Qd=!1}function sC(e,t,r,n,s,o,i,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(r,c)}catch(d){this.onError(d)}}var Ni=!1,Yl=null,Jl=!1,Xd=null,oC={onError:function(e){Ni=!0,Yl=e}};function iC(e,t,r,n,s,o,i,a,l){Ni=!1,Yl=null,sC.apply(oC,arguments)}function aC(e,t,r,n,s,o,i,a,l){if(iC.apply(this,arguments),Ni){if(Ni){var c=Yl;Ni=!1,Yl=null}else throw Error(F(198));Jl||(Jl=!0,Xd=c)}}function Rs(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 aw(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 Pm(e){if(Rs(e)!==e)throw Error(F(188))}function lC(e){var t=e.alternate;if(!t){if(t=Rs(e),t===null)throw Error(F(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 Pm(s),e;if(o===n)return Pm(s),t;o=o.sibling}throw Error(F(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(F(189))}}if(r.alternate!==n)throw Error(F(190))}if(r.tag!==3)throw Error(F(188));return r.stateNode.current===r?e:t}function lw(e){return e=lC(e),e!==null?cw(e):null}function cw(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=cw(e);if(t!==null)return t;e=e.sibling}return null}var uw=Bt.unstable_scheduleCallback,Rm=Bt.unstable_cancelCallback,cC=Bt.unstable_shouldYield,uC=Bt.unstable_requestPaint,qe=Bt.unstable_now,dC=Bt.unstable_getCurrentPriorityLevel,Dh=Bt.unstable_ImmediatePriority,dw=Bt.unstable_UserBlockingPriority,Ql=Bt.unstable_NormalPriority,fC=Bt.unstable_LowPriority,fw=Bt.unstable_IdlePriority,Fc=null,Ar=null;function hC(e){if(Ar&&typeof Ar.onCommitFiberRoot=="function")try{Ar.onCommitFiberRoot(Fc,e,void 0,(e.current.flags&128)===128)}catch{}}var ur=Math.clz32?Math.clz32:gC,pC=Math.log,mC=Math.LN2;function gC(e){return e>>>=0,e===0?32:31-(pC(e)/mC|0)|0}var Ja=64,Qa=4194304;function bi(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 Xl(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=bi(a):(o&=i,o!==0&&(n=bi(o)))}else i=r&~s,i!==0?n=bi(i):o!==0&&(n=bi(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-ur(t),s=1<<r,n|=e[r],t&=~s;return n}function vC(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 yC(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,o=e.pendingLanes;0<o;){var i=31-ur(o),a=1<<i,l=s[i];l===-1?(!(a&r)||a&n)&&(s[i]=vC(a,t)):l<=t&&(e.expiredLanes|=a),o&=~a}}function Zd(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function hw(){var e=Ja;return Ja<<=1,!(Ja&4194240)&&(Ja=64),e}function qu(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}
vendor: 4,087 bytes, line 37
37function Ca(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ur(t),e[t]=r}function wC(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-ur(r),o=1<<s;t[s]=0,n[s]=-1,e[s]=-1,r&=~o}}function Lh(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-ur(r),s=1<<n;s&t|e[n]&t&&(e[n]|=t),r&=~s}}var Ee=0;function pw(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var mw,$h,gw,vw,yw,ef=!1,Xa=[],kn=null,Tn=null,Nn=null,Vi=new Map,qi=new Map,pn=[],xC="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 jm(e,t){switch(e){case"focusin":case"focusout":kn=null;break;case"dragenter":case"dragleave":Tn=null;break;case"mouseover":case"mouseout":Nn=null;break;case"pointerover":case"pointerout":Vi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":qi.delete(t.pointerId)}}function ui(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=Ta(t),t!==null&&$h(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function bC(e,t,r,n,s){switch(t){case"focusin":return kn=ui(kn,e,t,r,n,s),!0;case"dragenter":return Tn=ui(Tn,e,t,r,n,s),!0;case"mouseover":return Nn=ui(Nn,e,t,r,n,s),!0;case"pointerover":var o=s.pointerId;return Vi.set(o,ui(Vi.get(o)||null,e,t,r,n,s)),!0;case"gotpointercapture":return o=s.pointerId,qi.set(o,ui(qi.get(o)||null,e,t,r,n,s)),!0}return!1}function ww(e){var t=os(e.target);if(t!==null){var r=Rs(t);if(r!==null){if(t=r.tag,t===13){if(t=aw(r),t!==null){e.blockedOn=t,yw(e.priority,function(){gw(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 Il(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=tf(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);Yd=n,r.target.dispatchEvent(n),Yd=null}else return t=Ta(r),t!==null&&$h(t),e.blockedOn=r,!1;t.shift()}return!0}function Am(e,t,r){Il(e)&&r.delete(t)}function SC(){ef=!1,kn!==null&&Il(kn)&&(kn=null),Tn!==null&&Il(Tn)&&(Tn=null),Nn!==null&&Il(Nn)&&(Nn=null),Vi.forEach(Am),qi.forEach(Am)}function di(e,t){e.blockedOn===t&&(e.blockedOn=null,ef||(ef=!0,Bt.unstable_scheduleCallback(Bt.unstable_NormalPriority,SC)))}function Ki(e){function t(s){return di(s,e)}if(0<Xa.length){di(Xa[0],e);for(var r=1;r<Xa.length;r++){var n=Xa[r];n.blockedOn===e&&(n.blockedOn=null)}}for(kn!==null&&di(kn,e),Tn!==null&&di(Tn,e),Nn!==null&&di(Nn,e),Vi.forEach(t),qi.forEach(t),r=0;r<pn.length;r++)n=pn[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<pn.length&&(r=pn[0],r.blockedOn===null);)ww(r),r.blockedOn===null&&pn.shift()}var po=rn.ReactCurrentBatchConfig,Zl=!0;function EC(e,t,r,n){var s=Ee,o=po.transition;po.transition=null;try{Ee=1,Mh(e,t,r,n)}finally{Ee=s,po.transition=o}}function _C(e,t,r,n){var s=Ee,o=po.transition;po.transition=null;try{Ee=4,Mh(e,t,r,n)}finally{Ee=s,po.transition=o}}function Mh(e,t,r,n){if(Zl){var s=tf(e,t,r,n);if(s===null)rd(e,t,n,ec,r),jm(e,n);else if(bC(s,e,t,r,n))n.stopPropagation();else if(jm(e,n),t&4&&-1<xC.indexOf(e)){for(;s!==null;){var o=Ta(s);if(o!==null&&mw(o),o=tf(e,t,r,n),o===null&&rd(e,t,n,ec,r),o===s)break;s=o}s!==null&&n.stopPropagation()}else rd(e,t,n,null,r)}}var ec=null;function tf(e,t,r,n){if(ec=null,e=Ih(n),e=os(e),e!==null)if(t=Rs(e),t===null)e=null;else if(r=t.tag,r===13){if(e=aw(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 ec=e,null}
vendor: 10,401 bytes, line 37
37function xw(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(dC()){case Dh:return 1;case dw:return 4;case Ql:case fC:return 16;case fw:return 536870912;default:return 16}default:return 16}}var En=null,Fh=null,Dl=null;function bw(){if(Dl)return Dl;var e,t=Fh,r=t.length,n,s="value"in En?En.value:En.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 Dl=s.slice(e,1<n?1-n:void 0)}function Ll(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 Za(){return!0}function Om(){return!1}function Wt(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)?Za:Om,this.isPropagationStopped=Om,this}return Be(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=Za)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Za)},persist:function(){},isPersistent:Za}),t}var Ko={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Uh=Wt(Ko),ka=Be({},Ko,{view:0,detail:0}),CC=Wt(ka),Ku,Gu,fi,Uc=Be({},ka,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bh,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!==fi&&(fi&&e.type==="mousemove"?(Ku=e.screenX-fi.screenX,Gu=e.screenY-fi.screenY):Gu=Ku=0,fi=e),Ku)},movementY:function(e){return"movementY"in e?e.movementY:Gu}}),Im=Wt(Uc),kC=Be({},Uc,{dataTransfer:0}),TC=Wt(kC),NC=Be({},ka,{relatedTarget:0}),Yu=Wt(NC),PC=Be({},Ko,{animationName:0,elapsedTime:0,pseudoElement:0}),RC=Wt(PC),jC=Be({},Ko,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),AC=Wt(jC),OC=Be({},Ko,{data:0}),Dm=Wt(OC),IC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},DC={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"},LC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $C(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=LC[e])?!!t[e]:!1}function Bh(){return $C}var MC=Be({},ka,{key:function(e){if(e.key){var t=IC[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ll(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?DC[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bh,charCode:function(e){return e.type==="keypress"?Ll(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ll(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),FC=Wt(MC),UC=Be({},Uc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Lm=Wt(UC),BC=Be({},ka,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bh}),zC=Wt(BC),WC=Be({},Ko,{propertyName:0,elapsedTime:0,pseudoElement:0}),HC=Wt(WC),VC=Be({},Uc,{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}),qC=Wt(VC),KC=[9,13,27,32],zh=Jr&&"CompositionEvent"in window,Pi=null;Jr&&"documentMode"in document&&(Pi=document.documentMode);var GC=Jr&&"TextEvent"in window&&!Pi,Sw=Jr&&(!zh||Pi&&8<Pi&&11>=Pi),$m=" ",Mm=!1;function Ew(e,t){switch(e){case"keyup":return KC.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _w(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Zs=!1;function YC(e,t){switch(e){case"compositionend":return _w(t);case"keypress":return t.which!==32?null:(Mm=!0,$m);case"textInput":return e=t.data,e===$m&&Mm?null:e;default:return null}}function JC(e,t){if(Zs)return e==="compositionend"||!zh&&Ew(e,t)?(e=bw(),Dl=Fh=En=null,Zs=!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 Sw&&t.locale!=="ko"?null:t.data;default:return null}}var QC={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 Fm(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!QC[e.type]:t==="textarea"}function Cw(e,t,r,n){rw(n),t=tc(t,"onChange"),0<t.length&&(r=new Uh("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Ri=null,Gi=null;function XC(e){Lw(e,0)}function Bc(e){var t=ro(e);if(Yy(t))return e}function ZC(e,t){if(e==="change")return t}var kw=!1;if(Jr){var Ju;if(Jr){var Qu="oninput"in document;if(!Qu){var Um=document.createElement("div");Um.setAttribute("oninput","return;"),Qu=typeof Um.oninput=="function"}Ju=Qu}else Ju=!1;kw=Ju&&(!document.documentMode||9<document.documentMode)}function Bm(){Ri&&(Ri.detachEvent("onpropertychange",Tw),Gi=Ri=null)}function Tw(e){if(e.propertyName==="value"&&Bc(Gi)){var t=[];Cw(t,Gi,e,Ih(e)),iw(XC,t)}}function ek(e,t,r){e==="focusin"?(Bm(),Ri=t,Gi=r,Ri.attachEvent("onpropertychange",Tw)):e==="focusout"&&Bm()}function tk(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Bc(Gi)}function rk(e,t){if(e==="click")return Bc(t)}function nk(e,t){if(e==="input"||e==="change")return Bc(t)}function sk(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var pr=typeof Object.is=="function"?Object.is:sk;function Yi(e,t){if(pr(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(!$d.call(t,s)||!pr(e[s],t[s]))return!1}return!0}function zm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Wm(e,t){var r=zm(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=zm(r)}}function Nw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Nw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Pw(){for(var e=window,t=Gl();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Gl(e.document)}return t}function Wh(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 ok(e){var t=Pw(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Nw(r.ownerDocument.documentElement,r)){if(n!==null&&Wh(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=Wm(r,o);var i=Wm(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 ik=Jr&&"documentMode"in document&&11>=document.documentMode,eo=null,rf=null,ji=null,nf=!1;function Hm(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;nf||eo==null||eo!==Gl(n)||(n=eo,"selectionStart"in n&&Wh(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}),ji&&Yi(ji,n)||(ji=n,n=tc(rf,"onSelect"),0<n.length&&(t=new Uh("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=eo)))}function el(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var to={animationend:el("Animation","AnimationEnd"),animationiteration:el("Animation","AnimationIteration"),animationstart:el("Animation","AnimationStart"),transitionend:el("Transition","TransitionEnd")},Xu={},Rw={};Jr&&(Rw=document.createElement("div").style,"AnimationEvent"in window||(delete to.animationend.animation,delete to.animationiteration.animation,delete to.animationstart.animation),"TransitionEvent"in window||delete to.transitionend.transition);function zc(e){if(Xu[e])return Xu[e];if(!to[e])return e;var t=to[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Rw)return Xu[e]=t[r];return e}var jw=zc("animationend"),Aw=zc("animationiteration"),Ow=zc("animationstart"),Iw=zc("transitionend"),Dw=new Map,Vm="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 Hn(e,t){Dw.set(e,t),Ps(t,[e])}for(var Zu=0;Zu<Vm.length;Zu++){var ed=Vm[Zu],ak=ed.toLowerCase(),lk=ed[0].toUpperCase()+ed.slice(1);Hn(ak,"on"+lk)}Hn(jw,"onAnimationEnd");Hn(Aw,"onAnimationIteration");Hn(Ow,"onAnimationStart");Hn("dblclick","onDoubleClick");Hn("focusin","onFocus");Hn("focusout","onBlur");Hn(Iw,"onTransitionEnd");Oo("onMouseEnter",["mouseout","mouseover"]);Oo("onMouseLeave",["mouseout","mouseover"]);Oo("onPointerEnter",["pointerout","pointerover"]);Oo("onPointerLeave",["pointerout","pointerover"]);Ps("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ps("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ps("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ps("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ps("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ps("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Si="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(" "),ck=new Set("cancel close invalid load scroll toggle".split(" ").concat(Si));function qm(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,aC(n,t,void 0,e),e.currentTarget=null}function Lw(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;qm(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;qm(s,a,c),o=l}}}if(Jl)throw e=Xd,Jl=!1,Xd=null,e}function Ae(e,t){var r=t[cf];r===void 0&&(r=t[cf]=new Set);var n=e+"__bubble";r.has(n)||($w(t,e,2,!1),r.add(n))}function td(e,t,r){var n=0;t&&(n|=4),$w(r,e,n,t)}var tl="_reactListening"+Math.random().toString(36).slice(2);function Ji(e){if(!e[tl]){e[tl]=!0,Hy.forEach(function(r){r!=="selectionchange"&&(ck.has(r)||td(r,!1,e),td(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[tl]||(t[tl]=!0,td("selectionchange",!1,t))}}function $w(e,t,r,n){switch(xw(t)){case 1:var s=EC;break;case 4:s=_C;break;default:s=Mh}r=s.bind(null,t,r,e),s=void 0,!Qd||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 rd(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: 5,374 bytes, lines 37-38
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=os(a),i===null)return;if(l=i.tag,l===5||l===6){n=o=i;continue e}a=a.parentNode}}n=n.return}iw(function(){var c=o,d=Ih(r),f=[];e:{var h=Dw.get(e);if(h!==void 0){var v=Uh,w=e;switch(e){case"keypress":if(Ll(r)===0)break e;case"keydown":case"keyup":v=FC;break;case"focusin":w="focus",v=Yu;break;case"focusout":w="blur",v=Yu;break;case"beforeblur":case"afterblur":v=Yu;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":v=Im;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":v=TC;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":v=zC;break;case jw:case Aw:case Ow:v=RC;break;case Iw:v=HC;break;case"scroll":v=CC;break;case"wheel":v=qC;break;case"copy":case"cut":case"paste":v=AC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":v=Lm}var m=(t&4)!==0,b=!m&&e==="scroll",g=m?h!==null?h+"Capture":null:h;m=[];for(var y=c,x;y!==null;){x=y;var S=x.stateNode;if(x.tag===5&&S!==null&&(x=S,g!==null&&(S=Hi(y,g),S!=null&&m.push(Qi(y,S,x)))),b)break;y=y.return}0<m.length&&(h=new v(h,w,null,r,d),f.push({event:h,listeners:m}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",v=e==="mouseout"||e==="pointerout",h&&r!==Yd&&(w=r.relatedTarget||r.fromElement)&&(os(w)||w[Qr]))break e;if((v||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,v?(w=r.relatedTarget||r.toElement,v=c,w=w?os(w):null,w!==null&&(b=Rs(w),w!==b||w.tag!==5&&w.tag!==6)&&(w=null)):(v=null,w=c),v!==w)){if(m=Im,S="onMouseLeave",g="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(m=Lm,S="onPointerLeave",g="onPointerEnter",y="pointer"),b=v==null?h:ro(v),x=w==null?h:ro(w),h=new m(S,y+"leave",v,r,d),h.target=b,h.relatedTarget=x,S=null,os(d)===c&&(m=new m(g,y+"enter",w,r,d),m.target=x,m.relatedTarget=b,S=m),b=S,v&&w)t:{for(m=v,g=w,y=0,x=m;x;x=Is(x))y++;for(x=0,S=g;S;S=Is(S))x++;for(;0<y-x;)m=Is(m),y--;for(;0<x-y;)g=Is(g),x--;for(;y--;){if(m===g||g!==null&&m===g.alternate)break t;m=Is(m),g=Is(g)}m=null}else m=null;v!==null&&Km(f,h,v,m,!1),w!==null&&b!==null&&Km(f,b,w,m,!0)}}e:{if(h=c?ro(c):window,v=h.nodeName&&h.nodeName.toLowerCase(),v==="select"||v==="input"&&h.type==="file")var E=ZC;else if(Fm(h))if(kw)E=nk;else{E=tk;var C=ek}else(v=h.nodeName)&&v.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(E=rk);if(E&&(E=E(e,c))){Cw(f,E,r,d);break e}C&&C(e,h,c),e==="focusout"&&(C=h._wrapperState)&&C.controlled&&h.type==="number"&&Hd(h,"number",h.value)}switch(C=c?ro(c):window,e){case"focusin":(Fm(C)||C.contentEditable==="true")&&(eo=C,rf=c,ji=null);break;case"focusout":ji=rf=eo=null;break;case"mousedown":nf=!0;break;case"contextmenu":case"mouseup":case"dragend":nf=!1,Hm(f,r,d);break;case"selectionchange":if(ik)break;case"keydown":case"keyup":Hm(f,r,d)}var _;if(zh)e:{switch(e){case"compositionstart":var k="onCompositionStart";break e;case"compositionend":k="onCompositionEnd";break e;case"compositionupdate":k="onCompositionUpdate";break e}k=void 0}else Zs?Ew(e,r)&&(k="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(k="onCompositionStart");k&&(Sw&&r.locale!=="ko"&&(Zs||k!=="onCompositionStart"?k==="onCompositionEnd"&&Zs&&(_=bw()):(En=d,Fh="value"in En?En.value:En.textContent,Zs=!0)),C=tc(c,k),0<C.length&&(k=new Dm(k,e,null,r,d),f.push({event:k,listeners:C}),_?k.data=_:(_=_w(r),_!==null&&(k.data=_)))),(_=GC?YC(e,r):JC(e,r))&&(c=tc(c,"onBeforeInput"),0<c.length&&(d=new Dm("onBeforeInput","beforeinput",null,r,d),f.push({event:d,listeners:c}),d.data=_))}Lw(f,t)})}function Qi(e,t,r){return{instance:e,listener:t,currentTarget:r}}function tc(e,t){for(var r=t+"Capture",n=[];e!==null;){var s=e,o=s.stateNode;s.tag===5&&o!==null&&(s=o,o=Hi(e,r),o!=null&&n.unshift(Qi(e,o,s)),o=Hi(e,t),o!=null&&n.push(Qi(e,o,s))),e=e.return}return n}function Is(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Km(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=Hi(r,o),l!=null&&i.unshift(Qi(r,l,a))):s||(l=Hi(r,o),l!=null&&i.push(Qi(r,l,a)))),r=r.return}i.length!==0&&e.push({event:t,listeners:i})}var uk=/\r\n?/g,dk=/\u0000|\uFFFD/g;function Gm(e){return(typeof e=="string"?e:""+e).replace(uk,` 38`).replace(dk,"")}function rl(e,t,r){if(t=Gm(t),Gm(e)!==t&&r)throw Error(F(425))}function rc(){}var sf=null,of=null;function af(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 lf=typeof setTimeout=="function"?setTimeout:void 0,fk=typeof clearTimeout=="function"?clearTimeout:void 0,Ym=typeof Promise=="function"?Promise:void 0,hk=typeof queueMicrotask=="function"?queueMicrotask:typeof Ym<"u"?function(e){return Ym.resolve(null).then(e).catch(pk)}:lf;function pk(e){setTimeout(function(){throw e})}
vendor: 2,834 bytes, line 38
38function nd(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),Ki(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=s}while(r);Ki(t)}function Pn(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 Jm(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 Go=Math.random().toString(36).slice(2),jr="__reactFiber$"+Go,Xi="__reactProps$"+Go,Qr="__reactContainer$"+Go,cf="__reactEvents$"+Go,mk="__reactListeners$"+Go,gk="__reactHandles$"+Go;function os(e){var t=e[jr];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Qr]||r[jr]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Jm(e);e!==null;){if(r=e[jr])return r;e=Jm(e)}return t}e=r,r=e.parentNode}return null}function Ta(e){return e=e[jr]||e[Qr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ro(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(F(33))}function Wc(e){return e[Xi]||null}var uf=[],no=-1;function Vn(e){return{current:e}}function Ie(e){0>no||(e.current=uf[no],uf[no]=null,no--)}function Re(e,t){no++,uf[no]=e.current,e.current=t}var $n={},mt=Vn($n),kt=Vn(!1),vs=$n;function Io(e,t){var r=e.type.contextTypes;if(!r)return $n;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},o;for(o in r)s[o]=t[o];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Tt(e){return e=e.childContextTypes,e!=null}function nc(){Ie(kt),Ie(mt)}function Qm(e,t,r){if(mt.current!==$n)throw Error(F(168));Re(mt,t),Re(kt,r)}function Mw(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(F(108,eC(e)||"Unknown",s));return Be({},r,n)}function sc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||$n,vs=mt.current,Re(mt,e),Re(kt,kt.current),!0}function Xm(e,t,r){var n=e.stateNode;if(!n)throw Error(F(169));r?(e=Mw(e,t,vs),n.__reactInternalMemoizedMergedChildContext=e,Ie(kt),Ie(mt),Re(mt,e)):Ie(kt),Re(kt,r)}var Vr=null,Hc=!1,sd=!1;function Fw(e){Vr===null?Vr=[e]:Vr.push(e)}function vk(e){Hc=!0,Fw(e)}function qn(){if(!sd&&Vr!==null){sd=!0;var e=0,t=Ee;try{var r=Vr;for(Ee=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}Vr=null,Hc=!1}catch(s){throw Vr!==null&&(Vr=Vr.slice(e+1)),uw(Dh,qn),s}finally{Ee=t,sd=!1}}return null}var so=[],oo=0,oc=null,ic=0,qt=[],Kt=0,ys=null,qr=1,Kr="";function ts(e,t){so[oo++]=ic,so[oo++]=oc,oc=e,ic=t}
vendor: 13,505 bytes, line 38
38function Uw(e,t,r){qt[Kt++]=qr,qt[Kt++]=Kr,qt[Kt++]=ys,ys=e;var n=qr;e=Kr;var s=32-ur(n)-1;n&=~(1<<s),r+=1;var o=32-ur(t)+s;if(30<o){var i=s-s%5;o=(n&(1<<i)-1).toString(32),n>>=i,s-=i,qr=1<<32-ur(t)+s|r<<s|n,Kr=o+e}else qr=1<<o|r<<s|n,Kr=e}function Hh(e){e.return!==null&&(ts(e,1),Uw(e,1,0))}function Vh(e){for(;e===oc;)oc=so[--oo],so[oo]=null,ic=so[--oo],so[oo]=null;for(;e===ys;)ys=qt[--Kt],qt[Kt]=null,Kr=qt[--Kt],qt[Kt]=null,qr=qt[--Kt],qt[Kt]=null}var Ft=null,Mt=null,Le=!1,ar=null;function Bw(e,t){var r=Gt(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 Zm(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,Ft=e,Mt=Pn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ft=e,Mt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=ys!==null?{id:qr,overflow:Kr}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=Gt(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Ft=e,Mt=null,!0):!1;default:return!1}}function df(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ff(e){if(Le){var t=Mt;if(t){var r=t;if(!Zm(e,t)){if(df(e))throw Error(F(418));t=Pn(r.nextSibling);var n=Ft;t&&Zm(e,t)?Bw(n,r):(e.flags=e.flags&-4097|2,Le=!1,Ft=e)}}else{if(df(e))throw Error(F(418));e.flags=e.flags&-4097|2,Le=!1,Ft=e}}}function eg(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ft=e}function nl(e){if(e!==Ft)return!1;if(!Le)return eg(e),Le=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!af(e.type,e.memoizedProps)),t&&(t=Mt)){if(df(e))throw zw(),Error(F(418));for(;t;)Bw(e,t),t=Pn(t.nextSibling)}if(eg(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(F(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Mt=Pn(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Mt=null}}else Mt=Ft?Pn(e.stateNode.nextSibling):null;return!0}function zw(){for(var e=Mt;e;)e=Pn(e.nextSibling)}function Do(){Mt=Ft=null,Le=!1}function qh(e){ar===null?ar=[e]:ar.push(e)}var yk=rn.ReactCurrentBatchConfig;function hi(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(F(309));var n=r.stateNode}if(!n)throw Error(F(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(F(284));if(!r._owner)throw Error(F(290,e))}return e}function sl(e,t){throw e=Object.prototype.toString.call(t),Error(F(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function tg(e){var t=e._init;return t(e._payload)}function Ww(e){function t(g,y){if(e){var x=g.deletions;x===null?(g.deletions=[y],g.flags|=16):x.push(y)}}function r(g,y){if(!e)return null;for(;y!==null;)t(g,y),y=y.sibling;return null}function n(g,y){for(g=new Map;y!==null;)y.key!==null?g.set(y.key,y):g.set(y.index,y),y=y.sibling;return g}function s(g,y){return g=On(g,y),g.index=0,g.sibling=null,g}function o(g,y,x){return g.index=x,e?(x=g.alternate,x!==null?(x=x.index,x<y?(g.flags|=2,y):x):(g.flags|=2,y)):(g.flags|=1048576,y)}function i(g){return e&&g.alternate===null&&(g.flags|=2),g}function a(g,y,x,S){return y===null||y.tag!==6?(y=dd(x,g.mode,S),y.return=g,y):(y=s(y,x),y.return=g,y)}function l(g,y,x,S){var E=x.type;return E===Xs?d(g,y,x.props.children,S,x.key):y!==null&&(y.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===fn&&tg(E)===y.type)?(S=s(y,x.props),S.ref=hi(g,y,x),S.return=g,S):(S=Wl(x.type,x.key,x.props,null,g.mode,S),S.ref=hi(g,y,x),S.return=g,S)}function c(g,y,x,S){return y===null||y.tag!==4||y.stateNode.containerInfo!==x.containerInfo||y.stateNode.implementation!==x.implementation?(y=fd(x,g.mode,S),y.return=g,y):(y=s(y,x.children||[]),y.return=g,y)}function d(g,y,x,S,E){return y===null||y.tag!==7?(y=ps(x,g.mode,S,E),y.return=g,y):(y=s(y,x),y.return=g,y)}function f(g,y,x){if(typeof y=="string"&&y!==""||typeof y=="number")return y=dd(""+y,g.mode,x),y.return=g,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Ka:return x=Wl(y.type,y.key,y.props,null,g.mode,x),x.ref=hi(g,null,y),x.return=g,x;case Qs:return y=fd(y,g.mode,x),y.return=g,y;case fn:var S=y._init;return f(g,S(y._payload),x)}if(xi(y)||li(y))return y=ps(y,g.mode,x,null),y.return=g,y;sl(g,y)}return null}function h(g,y,x,S){var E=y!==null?y.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return E!==null?null:a(g,y,""+x,S);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Ka:return x.key===E?l(g,y,x,S):null;case Qs:return x.key===E?c(g,y,x,S):null;case fn:return E=x._init,h(g,y,E(x._payload),S)}if(xi(x)||li(x))return E!==null?null:d(g,y,x,S,null);sl(g,x)}return null}function v(g,y,x,S,E){if(typeof S=="string"&&S!==""||typeof S=="number")return g=g.get(x)||null,a(y,g,""+S,E);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Ka:return g=g.get(S.key===null?x:S.key)||null,l(y,g,S,E);case Qs:return g=g.get(S.key===null?x:S.key)||null,c(y,g,S,E);case fn:var C=S._init;return v(g,y,x,C(S._payload),E)}if(xi(S)||li(S))return g=g.get(x)||null,d(y,g,S,E,null);sl(y,S)}return null}function w(g,y,x,S){for(var E=null,C=null,_=y,k=y=0,N=null;_!==null&&k<x.length;k++){_.index>k?(N=_,_=null):N=_.sibling;var j=h(g,_,x[k],S);if(j===null){_===null&&(_=N);break}e&&_&&j.alternate===null&&t(g,_),y=o(j,y,k),C===null?E=j:C.sibling=j,C=j,_=N}if(k===x.length)return r(g,_),Le&&ts(g,k),E;if(_===null){for(;k<x.length;k++)_=f(g,x[k],S),_!==null&&(y=o(_,y,k),C===null?E=_:C.sibling=_,C=_);return Le&&ts(g,k),E}for(_=n(g,_);k<x.length;k++)N=v(_,g,k,x[k],S),N!==null&&(e&&N.alternate!==null&&_.delete(N.key===null?k:N.key),y=o(N,y,k),C===null?E=N:C.sibling=N,C=N);return e&&_.forEach(function(R){return t(g,R)}),Le&&ts(g,k),E}function m(g,y,x,S){var E=li(x);if(typeof E!="function")throw Error(F(150));if(x=E.call(x),x==null)throw Error(F(151));for(var C=E=null,_=y,k=y=0,N=null,j=x.next();_!==null&&!j.done;k++,j=x.next()){_.index>k?(N=_,_=null):N=_.sibling;var R=h(g,_,j.value,S);if(R===null){_===null&&(_=N);break}e&&_&&R.alternate===null&&t(g,_),y=o(R,y,k),C===null?E=R:C.sibling=R,C=R,_=N}if(j.done)return r(g,_),Le&&ts(g,k),E;if(_===null){for(;!j.done;k++,j=x.next())j=f(g,j.value,S),j!==null&&(y=o(j,y,k),C===null?E=j:C.sibling=j,C=j);return Le&&ts(g,k),E}for(_=n(g,_);!j.done;k++,j=x.next())j=v(_,g,k,j.value,S),j!==null&&(e&&j.alternate!==null&&_.delete(j.key===null?k:j.key),y=o(j,y,k),C===null?E=j:C.sibling=j,C=j);return e&&_.forEach(function(T){return t(g,T)}),Le&&ts(g,k),E}function b(g,y,x,S){if(typeof x=="object"&&x!==null&&x.type===Xs&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Ka:e:{for(var E=x.key,C=y;C!==null;){if(C.key===E){if(E=x.type,E===Xs){if(C.tag===7){r(g,C.sibling),y=s(C,x.props.children),y.return=g,g=y;break e}}else if(C.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===fn&&tg(E)===C.type){r(g,C.sibling),y=s(C,x.props),y.ref=hi(g,C,x),y.return=g,g=y;break e}r(g,C);break}else t(g,C);C=C.sibling}x.type===Xs?(y=ps(x.props.children,g.mode,S,x.key),y.return=g,g=y):(S=Wl(x.type,x.key,x.props,null,g.mode,S),S.ref=hi(g,y,x),S.return=g,g=S)}return i(g);case Qs:e:{for(C=x.key;y!==null;){if(y.key===C)if(y.tag===4&&y.stateNode.containerInfo===x.containerInfo&&y.stateNode.implementation===x.implementation){r(g,y.sibling),y=s(y,x.children||[]),y.return=g,g=y;break e}else{r(g,y);break}else t(g,y);y=y.sibling}y=fd(x,g.mode,S),y.return=g,g=y}return i(g);case fn:return C=x._init,b(g,y,C(x._payload),S)}if(xi(x))return w(g,y,x,S);if(li(x))return m(g,y,x,S);sl(g,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,y!==null&&y.tag===6?(r(g,y.sibling),y=s(y,x),y.return=g,g=y):(r(g,y),y=dd(x,g.mode,S),y.return=g,g=y),i(g)):r(g,y)}return b}var Lo=Ww(!0),Hw=Ww(!1),ac=Vn(null),lc=null,io=null,Kh=null;function Gh(){Kh=io=lc=null}function Yh(e){var t=ac.current;Ie(ac),e._currentValue=t}function hf(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 mo(e,t){lc=e,Kh=io=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ct=!0),e.firstContext=null)}function Jt(e){var t=e._currentValue;if(Kh!==e)if(e={context:e,memoizedValue:t,next:null},io===null){if(lc===null)throw Error(F(308));io=e,lc.dependencies={lanes:0,firstContext:e}}else io=io.next=e;return t}var is=null;function Jh(e){is===null?is=[e]:is.push(e)}function Vw(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,Jh(t)):(r.next=s.next,s.next=r),t.interleaved=r,Xr(e,n)}function Xr(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 hn=!1;function Qh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function qw(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 Gr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Rn(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,me&2){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,Xr(e,r)}return s=n.interleaved,s===null?(t.next=t,Jh(n)):(t.next=s.next,s.next=t),n.interleaved=t,Xr(e,r)}function $l(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,Lh(e,r)}}function rg(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 cc(e,t,r,n){var s=e.updateQueue;hn=!1;var o=s.firstBaseUpdate,i=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,c=l.next;l.next=null,i===null?o=c:i.next=c,i=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==i&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(o!==null){var f=s.baseState;i=0,d=c=l=null,a=o;do{var h=a.lane,v=a.eventTime;if((n&h)===h){d!==null&&(d=d.next={eventTime:v,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var w=e,m=a;switch(h=t,v=r,m.tag){case 1:if(w=m.payload,typeof w=="function"){f=w.call(v,f,h);break e}f=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=m.payload,h=typeof w=="function"?w.call(v,f,h):w,h==null)break e;f=Be({},f,h);break e;case 2:hn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[a]:h.push(a))}else v={eventTime:v,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=v,l=f):d=d.next=v,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(d===null&&(l=f),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do i|=s.lane,s=s.next;while(s!==t)}else o===null&&(s.shared.lanes=0);xs|=i,e.lanes=i,e.memoizedState=f}}function ng(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(F(191,s));s.call(n)}}}var Na={},Or=Vn(Na),Zi=Vn(Na),ea=Vn(Na);function as(e){if(e===Na)throw Error(F(174));return e}function Xh(e,t){switch(Re(ea,t),Re(Zi,e),Re(Or,Na),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:qd(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=qd(t,e)}Ie(Or),Re(Or,t)}function $o(){Ie(Or),Ie(Zi),Ie(ea)}function Kw(e){as(ea.current);var t=as(Or.current),r=qd(t,e.type);t!==r&&(Re(Zi,e),Re(Or,r))}function Zh(e){Zi.current===e&&(Ie(Or),Ie(Zi))}var Me=Vn(0);function uc(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 od=[];function ep(){for(var e=0;e<od.length;e++)od[e]._workInProgressVersionPrimary=null;od.length=0}var Ml=rn.ReactCurrentDispatcher,id=rn.ReactCurrentBatchConfig,ws=0,Ue=null,Qe=null,tt=null,dc=!1,Ai=!1,ta=0,wk=0;function dt(){throw Error(F(321))}function tp(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!pr(e[r],t[r]))return!1;return!0}function rp(e,t,r,n,s,o){if(ws=o,Ue=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ml.current=e===null||e.memoizedState===null?Ek:_k,e=r(n,s),Ai){o=0;
vendor: 6,592 bytes, line 38
38do{if(Ai=!1,ta=0,25<=o)throw Error(F(301));o+=1,tt=Qe=null,t.updateQueue=null,Ml.current=Ck,e=r(n,s)}while(Ai)}if(Ml.current=fc,t=Qe!==null&&Qe.next!==null,ws=0,tt=Qe=Ue=null,dc=!1,t)throw Error(F(300));return e}function np(){var e=ta!==0;return ta=0,e}function Cr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tt===null?Ue.memoizedState=tt=e:tt=tt.next=e,tt}function Qt(){if(Qe===null){var e=Ue.alternate;e=e!==null?e.memoizedState:null}else e=Qe.next;var t=tt===null?Ue.memoizedState:tt.next;if(t!==null)tt=t,Qe=e;else{if(e===null)throw Error(F(310));Qe=e,e={memoizedState:Qe.memoizedState,baseState:Qe.baseState,baseQueue:Qe.baseQueue,queue:Qe.queue,next:null},tt===null?Ue.memoizedState=tt=e:tt=tt.next=e}return tt}function ra(e,t){return typeof t=="function"?t(e):t}function ad(e){var t=Qt(),r=t.queue;if(r===null)throw Error(F(311));r.lastRenderedReducer=e;var n=Qe,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 d=c.lane;if((ws&d)===d)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 f={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=f,i=n):l=l.next=f,Ue.lanes|=d,xs|=d}c=c.next}while(c!==null&&c!==o);l===null?i=n:l.next=a,pr(n,t.memoizedState)||(Ct=!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,Ue.lanes|=o,xs|=o,s=s.next;while(s!==e)}else s===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function ld(e){var t=Qt(),r=t.queue;if(r===null)throw Error(F(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);pr(o,t.memoizedState)||(Ct=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),r.lastRenderedState=o}return[o,n]}function Gw(){}function Yw(e,t){var r=Ue,n=Qt(),s=t(),o=!pr(n.memoizedState,s);if(o&&(n.memoizedState=s,Ct=!0),n=n.queue,sp(Xw.bind(null,r,n,e),[e]),n.getSnapshot!==t||o||tt!==null&&tt.memoizedState.tag&1){if(r.flags|=2048,na(9,Qw.bind(null,r,n,s,t),void 0,null),rt===null)throw Error(F(349));ws&30||Jw(r,t,s)}return s}function Jw(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Ue.updateQueue,t===null?(t={lastEffect:null,stores:null},Ue.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Qw(e,t,r,n){t.value=r,t.getSnapshot=n,Zw(t)&&e0(e)}function Xw(e,t,r){return r(function(){Zw(t)&&e0(e)})}function Zw(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!pr(e,r)}catch{return!0}}function e0(e){var t=Xr(e,1);t!==null&&dr(t,e,1,-1)}function sg(e){var t=Cr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ra,lastRenderedState:e},t.queue=e,e=e.dispatch=Sk.bind(null,Ue,e),[t.memoizedState,e]}function na(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=Ue.updateQueue,t===null?(t={lastEffect:null,stores:null},Ue.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 t0(){return Qt().memoizedState}function Fl(e,t,r,n){var s=Cr();Ue.flags|=e,s.memoizedState=na(1|t,r,void 0,n===void 0?null:n)}function Vc(e,t,r,n){var s=Qt();n=n===void 0?null:n;var o=void 0;if(Qe!==null){var i=Qe.memoizedState;if(o=i.destroy,n!==null&&tp(n,i.deps)){s.memoizedState=na(t,r,o,n);return}}Ue.flags|=e,s.memoizedState=na(1|t,r,o,n)}function og(e,t){return Fl(8390656,8,e,t)}function sp(e,t){return Vc(2048,8,e,t)}function r0(e,t){return Vc(4,2,e,t)}function n0(e,t){return Vc(4,4,e,t)}function s0(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 o0(e,t,r){return r=r!=null?r.concat([e]):null,Vc(4,4,s0.bind(null,t,e),r)}function op(){}function i0(e,t){var r=Qt();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&tp(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function a0(e,t){var r=Qt();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&tp(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function l0(e,t,r){return ws&21?(pr(r,t)||(r=hw(),Ue.lanes|=r,xs|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ct=!0),e.memoizedState=r)}function xk(e,t){var r=Ee;Ee=r!==0&&4>r?r:4,e(!0);var n=id.transition;id.transition={};try{e(!1),t()}finally{Ee=r,id.transition=n}}function c0(){return Qt().memoizedState}function bk(e,t,r){var n=An(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},u0(e))d0(t,r);else if(r=Vw(e,t,r,n),r!==null){var s=wt();dr(r,e,n,s),f0(r,t,n)}}function Sk(e,t,r){var n=An(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(u0(e))d0(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,pr(a,i)){var l=t.interleaved;l===null?(s.next=s,Jh(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}r=Vw(e,t,s,n),r!==null&&(s=wt(),dr(r,e,n,s),f0(r,t,n))}}function u0(e){var t=e.alternate;return e===Ue||t!==null&&t===Ue}function d0(e,t){Ai=dc=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function f0(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Lh(e,r)}}var fc={readContext:Jt,useCallback:dt,useContext:dt,useEffect:dt,useImperativeHandle:dt,useInsertionEffect:dt,useLayoutEffect:dt,useMemo:dt,useReducer:dt,useRef:dt,useState:dt,useDebugValue:dt,useDeferredValue:dt,useTransition:dt,useMutableSource:dt,useSyncExternalStore:dt,useId:dt,unstable_isNewReconciler:!1},Ek={readContext:Jt,useCallback:function(e,t){return Cr().memoizedState=[e,t===void 0?null:t],e},useContext:Jt,useEffect:og,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Fl(4194308,4,s0.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Fl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Fl(4,2,e,t)},useMemo:function(e,t){var r=Cr();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Cr();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=bk.bind(null,Ue,e),[n.memoizedState,e]}
vendor: 5,922 bytes, lines 38-40
38,useRef:function(e){var t=Cr();return e={current:e},t.memoizedState=e},useState:sg,useDebugValue:op,useDeferredValue:function(e){return Cr().memoizedState=e},useTransition:function(){var e=sg(!1),t=e[0];return e=xk.bind(null,e[1]),Cr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Ue,s=Cr();if(Le){if(r===void 0)throw Error(F(407));r=r()}else{if(r=t(),rt===null)throw Error(F(349));ws&30||Jw(n,t,r)}s.memoizedState=r;var o={value:r,getSnapshot:t};return s.queue=o,og(Xw.bind(null,n,o,e),[e]),n.flags|=2048,na(9,Qw.bind(null,n,o,r,t),void 0,null),r},useId:function(){var e=Cr(),t=rt.identifierPrefix;if(Le){var r=Kr,n=qr;r=(n&~(1<<32-ur(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=ta++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=wk++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},_k={readContext:Jt,useCallback:i0,useContext:Jt,useEffect:sp,useImperativeHandle:o0,useInsertionEffect:r0,useLayoutEffect:n0,useMemo:a0,useReducer:ad,useRef:t0,useState:function(){return ad(ra)},useDebugValue:op,useDeferredValue:function(e){var t=Qt();return l0(t,Qe.memoizedState,e)},useTransition:function(){var e=ad(ra)[0],t=Qt().memoizedState;return[e,t]},useMutableSource:Gw,useSyncExternalStore:Yw,useId:c0,unstable_isNewReconciler:!1},Ck={readContext:Jt,useCallback:i0,useContext:Jt,useEffect:sp,useImperativeHandle:o0,useInsertionEffect:r0,useLayoutEffect:n0,useMemo:a0,useReducer:ld,useRef:t0,useState:function(){return ld(ra)},useDebugValue:op,useDeferredValue:function(e){var t=Qt();return Qe===null?t.memoizedState=e:l0(t,Qe.memoizedState,e)},useTransition:function(){var e=ld(ra)[0],t=Qt().memoizedState;return[e,t]},useMutableSource:Gw,useSyncExternalStore:Yw,useId:c0,unstable_isNewReconciler:!1};function rr(e,t){if(e&&e.defaultProps){t=Be({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function pf(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:Be({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var qc={isMounted:function(e){return(e=e._reactInternals)?Rs(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=wt(),s=An(e),o=Gr(n,s);o.payload=t,r!=null&&(o.callback=r),t=Rn(e,o,s),t!==null&&(dr(t,e,s,n),$l(t,e,s))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=wt(),s=An(e),o=Gr(n,s);o.tag=1,o.payload=t,r!=null&&(o.callback=r),t=Rn(e,o,s),t!==null&&(dr(t,e,s,n),$l(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=wt(),n=An(e),s=Gr(r,n);s.tag=2,t!=null&&(s.callback=t),t=Rn(e,s,n),t!==null&&(dr(t,e,n,r),$l(t,e,n))}};function ig(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?!Yi(r,n)||!Yi(s,o):!0}function h0(e,t,r){var n=!1,s=$n,o=t.contextType;return typeof o=="object"&&o!==null?o=Jt(o):(s=Tt(t)?vs:mt.current,n=t.contextTypes,o=(n=n!=null)?Io(e,s):$n),t=new t(r,o),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=qc,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=o),t}function ag(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&&qc.enqueueReplaceState(t,t.state,null)}function mf(e,t,r,n){var s=e.stateNode;s.props=r,s.state=e.memoizedState,s.refs={},Qh(e);var o=t.contextType;typeof o=="object"&&o!==null?s.context=Jt(o):(o=Tt(t)?vs:mt.current,s.context=Io(e,o)),s.state=e.memoizedState,o=t.getDerivedStateFromProps,typeof o=="function"&&(pf(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&&qc.enqueueReplaceState(s,s.state,null),cc(e,r,s,n),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Mo(e,t){try{var r="",n=t;do r+=Z_(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 cd(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function gf(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var kk=typeof WeakMap=="function"?WeakMap:Map;function p0(e,t,r){r=Gr(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){pc||(pc=!0,kf=n),gf(e,t)},r}function m0(e,t,r){r=Gr(-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(){gf(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(r.callback=function(){gf(e,t),typeof n!="function"&&(jn===null?jn=new Set([this]):jn.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),r}function lg(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new kk;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=Uk.bind(null,e,t,r),t.then(e,e))}function cg(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 ug(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=Gr(-1,1),t.tag=2,Rn(r,t,1))),r.lanes|=1),e)}var Tk=rn.ReactCurrentOwner,Ct=!1;function vt(e,t,r,n){t.child=e===null?Hw(t,null,r,n):Lo(t,e.child,r,n)}function dg(e,t,r,n,s){r=r.render;var o=t.ref;
vendor: 8,078 bytes, line 40
40return mo(t,s),n=rp(e,t,r,n,o,s),r=np(),e!==null&&!Ct?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Zr(e,t,s)):(Le&&r&&Hh(t),t.flags|=1,vt(e,t,n,s),t.child)}function fg(e,t,r,n,s){if(e===null){var o=r.type;return typeof o=="function"&&!hp(o)&&o.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=o,g0(e,t,o,n,s)):(e=Wl(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:Yi,r(i,n)&&e.ref===t.ref)return Zr(e,t,s)}return t.flags|=1,e=On(o,n),e.ref=t.ref,e.return=t,t.child=e}function g0(e,t,r,n,s){if(e!==null){var o=e.memoizedProps;if(Yi(o,n)&&e.ref===t.ref)if(Ct=!1,t.pendingProps=n=o,(e.lanes&s)!==0)e.flags&131072&&(Ct=!0);else return t.lanes=e.lanes,Zr(e,t,s)}return vf(e,t,r,n,s)}function v0(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},Re(lo,Ot),Ot|=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,Re(lo,Ot),Ot|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=o!==null?o.baseLanes:r,Re(lo,Ot),Ot|=n}else o!==null?(n=o.baseLanes|r,t.memoizedState=null):n=r,Re(lo,Ot),Ot|=n;return vt(e,t,s,r),t.child}function y0(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function vf(e,t,r,n,s){var o=Tt(r)?vs:mt.current;return o=Io(t,o),mo(t,s),r=rp(e,t,r,n,o,s),n=np(),e!==null&&!Ct?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Zr(e,t,s)):(Le&&n&&Hh(t),t.flags|=1,vt(e,t,r,s),t.child)}function hg(e,t,r,n,s){if(Tt(r)){var o=!0;sc(t)}else o=!1;if(mo(t,s),t.stateNode===null)Ul(e,t),h0(t,r,n),mf(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=Jt(c):(c=Tt(r)?vs:mt.current,c=Io(t,c));var d=r.getDerivedStateFromProps,f=typeof d=="function"||typeof i.getSnapshotBeforeUpdate=="function";f||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==n||l!==c)&&ag(t,i,n,c),hn=!1;var h=t.memoizedState;i.state=h,cc(t,n,i,s),l=t.memoizedState,a!==n||h!==l||kt.current||hn?(typeof d=="function"&&(pf(t,r,d,n),l=t.memoizedState),(a=hn||ig(t,r,a,n,h,l,c))?(f||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,qw(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:rr(t.type,a),i.props=c,f=t.pendingProps,h=i.context,l=r.contextType,typeof l=="object"&&l!==null?l=Jt(l):(l=Tt(r)?vs:mt.current,l=Io(t,l));var v=r.getDerivedStateFromProps;(d=typeof v=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==f||h!==l)&&ag(t,i,n,l),hn=!1,h=t.memoizedState,i.state=h,cc(t,n,i,s);var w=t.memoizedState;a!==f||h!==w||kt.current||hn?(typeof v=="function"&&(pf(t,r,v,n),w=t.memoizedState),(c=hn||ig(t,r,c,n,h,w,l)||!1)?(d||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(n,w,l),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(n,w,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=w),i.props=n,i.state=w,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 yf(e,t,r,n,o,s)}function yf(e,t,r,n,s,o){y0(e,t);var i=(t.flags&128)!==0;if(!n&&!i)return s&&Xm(t,r,!1),Zr(e,t,o);n=t.stateNode,Tk.current=t;var a=i&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&i?(t.child=Lo(t,e.child,null,o),t.child=Lo(t,null,a,o)):vt(e,t,a,o),t.memoizedState=n.state,s&&Xm(t,r,!0),t.child}function w0(e){var t=e.stateNode;t.pendingContext?Qm(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Qm(e,t.context,!1),Xh(e,t.containerInfo)}function pg(e,t,r,n,s){return Do(),qh(s),t.flags|=256,vt(e,t,r,n),t.child}var wf={dehydrated:null,treeContext:null,retryLane:0};function xf(e){return{baseLanes:e,cachePool:null,transitions:null}}function x0(e,t,r){var n=t.pendingProps,s=Me.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),Re(Me,s&1),e===null)return ff(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=Yc(i,n,0,null),e=ps(e,n,r,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=xf(r),t.memoizedState=wf,e):ip(t,i));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return Nk(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=On(s,l),n.subtreeFlags=s.subtreeFlags&14680064),a!==null?o=On(a,o):(o=ps(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?xf(r):{baseLanes:i.baseLanes|r,cachePool:null,transitions:i.transitions},o.memoizedState=i,o.childLanes=e.childLanes&~r,t.memoizedState=wf,n}return o=e.child,e=o.sibling,n=On(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 ip(e,t){return t=Yc({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ol(e,t,r,n){return n!==null&&qh(n),Lo(t,e.child,null,r),e=ip(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Nk(e,t,r,n,s,o,i){if(r)return t.flags&256?(t.flags&=-257,n=cd(Error(F(422))),ol(e,t,i,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=n.fallback,s=t.mode,n=Yc({mode:"visible",children:n.children},s,0,null),o=ps(o,s,i,null),o.flags|=2,n.return=t,o.return=t,n.sibling=o,t.child=n,t.mode&1&&Lo(t,e.child,null,i),t.child.memoizedState=xf(i),t.memoizedState=wf,o);if(!(t.mode&1))return ol(e,t,i,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var a=n.dgst;return n=a,o=Error(F(419)),n=cd(o,n,void 0),ol(e,t,i,n)}if(a=(i&e.childLanes)!==0,Ct||a){if(n=rt,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,Xr(e,s),dr(n,e,s,-1))}return fp(),n=cd(Error(F(421))),ol(e,t,i,n)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=Bk.bind(null,e),s._reactRetry=t,null):(e=o.treeContext,Mt=Pn(s.nextSibling),Ft=t,Le=!0,ar=null,e!==null&&(qt[Kt++]=qr,qt[Kt++]=Kr,qt[Kt++
vendor: 5,504 bytes, line 40
40]=ys,qr=e.id,Kr=e.overflow,ys=t),t=ip(t,n.children),t.flags|=4096,t)}function mg(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),hf(e.return,t,r)}function ud(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 b0(e,t,r){var n=t.pendingProps,s=n.revealOrder,o=n.tail;if(vt(e,t,n.children,r),n=Me.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&&mg(e,r,t);else if(e.tag===19)mg(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(Re(Me,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&&uc(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),ud(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&&uc(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}ud(t,!0,r,null,o);break;case"together":ud(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ul(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Zr(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),xs|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(F(153));if(t.child!==null){for(e=t.child,r=On(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=On(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Pk(e,t,r){switch(t.tag){case 3:w0(t),Do();break;case 5:Kw(t);break;case 1:Tt(t.type)&&sc(t);break;case 4:Xh(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,s=t.memoizedProps.value;Re(ac,n._currentValue),n._currentValue=s;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Re(Me,Me.current&1),t.flags|=128,null):r&t.child.childLanes?x0(e,t,r):(Re(Me,Me.current&1),e=Zr(e,t,r),e!==null?e.sibling:null);Re(Me,Me.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return b0(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Re(Me,Me.current),n)break;return null;case 22:case 23:return t.lanes=0,v0(e,t,r)}return Zr(e,t,r)}var S0,bf,E0,_0;S0=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}};bf=function(){};E0=function(e,t,r,n){var s=e.memoizedProps;if(s!==n){e=t.stateNode,as(Or.current);var o=null;switch(r){case"input":s=zd(e,s),n=zd(e,n),o=[];break;case"select":s=Be({},s,{value:void 0}),n=Be({},n,{value:void 0}),o=[];break;case"textarea":s=Vd(e,s),n=Vd(e,n),o=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=rc)}Kd(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"&&(zi.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"&&(zi.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Ae("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)}};_0=function(e,t,r,n){r!==n&&(t.flags|=4)};function pi(e,t){if(!Le)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 ft(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 Rk(e,t,r){var n=t.pendingProps;switch(Vh(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ft(t),null;case 1:return Tt(t.type)&&nc(),ft(t),null;case 3:return n=t.stateNode,$o(),Ie(kt),Ie(mt),ep(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(nl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ar!==null&&(Pf(ar),ar=null))),bf(e,t),ft(t),null;
vendor: 33,481 bytes, line 40
40case 5:Zh(t);var s=as(ea.current);if(r=t.type,e!==null&&t.stateNode!=null)E0(e,t,r,n,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(F(166));return ft(t),null}if(e=as(Or.current),nl(t)){n=t.stateNode,r=t.type;var o=t.memoizedProps;switch(n[jr]=t,n[Xi]=o,e=(t.mode&1)!==0,r){case"dialog":Ae("cancel",n),Ae("close",n);break;case"iframe":case"object":case"embed":Ae("load",n);break;case"video":case"audio":for(s=0;s<Si.length;s++)Ae(Si[s],n);break;case"source":Ae("error",n);break;case"img":case"image":case"link":Ae("error",n),Ae("load",n);break;case"details":Ae("toggle",n);break;case"input":_m(n,o),Ae("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!o.multiple},Ae("invalid",n);break;case"textarea":km(n,o),Ae("invalid",n)}Kd(r,o),s=null;for(var i in o)if(o.hasOwnProperty(i)){var a=o[i];i==="children"?typeof a=="string"?n.textContent!==a&&(o.suppressHydrationWarning!==!0&&rl(n.textContent,a,e),s=["children",a]):typeof a=="number"&&n.textContent!==""+a&&(o.suppressHydrationWarning!==!0&&rl(n.textContent,a,e),s=["children",""+a]):zi.hasOwnProperty(i)&&a!=null&&i==="onScroll"&&Ae("scroll",n)}switch(r){case"input":Ga(n),Cm(n,o,!0);break;case"textarea":Ga(n),Tm(n);break;case"select":case"option":break;default:typeof o.onClick=="function"&&(n.onclick=rc)}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=Xy(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[jr]=t,e[Xi]=n,S0(e,t,!1,!1),t.stateNode=e;e:{switch(i=Gd(r,n),r){case"dialog":Ae("cancel",e),Ae("close",e),s=n;break;case"iframe":case"object":case"embed":Ae("load",e),s=n;break;case"video":case"audio":for(s=0;s<Si.length;s++)Ae(Si[s],e);s=n;break;case"source":Ae("error",e),s=n;break;case"img":case"image":case"link":Ae("error",e),Ae("load",e),s=n;break;case"details":Ae("toggle",e),s=n;break;case"input":_m(e,n),s=zd(e,n),Ae("invalid",e);break;case"option":s=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},s=Be({},n,{value:void 0}),Ae("invalid",e);break;case"textarea":km(e,n),s=Vd(e,n),Ae("invalid",e);break;default:s=n}Kd(r,s),a=s;for(o in a)if(a.hasOwnProperty(o)){var l=a[o];o==="style"?tw(e,l):o==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Zy(e,l)):o==="children"?typeof l=="string"?(r!=="textarea"||l!=="")&&Wi(e,l):typeof l=="number"&&Wi(e,""+l):o!=="suppressContentEditableWarning"&&o!=="suppressHydrationWarning"&&o!=="autoFocus"&&(zi.hasOwnProperty(o)?l!=null&&o==="onScroll"&&Ae("scroll",e):l!=null&&Rh(e,o,l,i))}switch(r){case"input":Ga(e),Cm(e,n,!1);break;case"textarea":Ga(e),Tm(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Ln(n.value));break;case"select":e.multiple=!!n.multiple,o=n.value,o!=null?uo(e,!!n.multiple,o,!1):n.defaultValue!=null&&uo(e,!!n.multiple,n.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=rc)}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 ft(t),null;case 6:if(e&&t.stateNode!=null)_0(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(F(166));if(r=as(ea.current),as(Or.current),nl(t)){if(n=t.stateNode,r=t.memoizedProps,n[jr]=t,(o=n.nodeValue!==r)&&(e=Ft,e!==null))switch(e.tag){case 3:rl(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&rl(n.nodeValue,r,(e.mode&1)!==0)}o&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[jr]=t,t.stateNode=n}return ft(t),null;case 13:if(Ie(Me),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Le&&Mt!==null&&t.mode&1&&!(t.flags&128))zw(),Do(),t.flags|=98560,o=!1;else if(o=nl(t),n!==null&&n.dehydrated!==null){if(e===null){if(!o)throw Error(F(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(F(317));o[jr]=t}else Do(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ft(t),o=!1}else ar!==null&&(Pf(ar),ar=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||Me.current&1?Ze===0&&(Ze=3):fp())),t.updateQueue!==null&&(t.flags|=4),ft(t),null);case 4:return $o(),bf(e,t),e===null&&Ji(t.stateNode.containerInfo),ft(t),null;case 10:return Yh(t.type._context),ft(t),null;case 17:return Tt(t.type)&&nc(),ft(t),null;case 19:if(Ie(Me),o=t.memoizedState,o===null)return ft(t),null;if(n=(t.flags&128)!==0,i=o.rendering,i===null)if(n)pi(o,!1);else{if(Ze!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=uc(e),i!==null){for(t.flags|=128,pi(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 Re(Me,Me.current&1|2),t.child}e=e.sibling}o.tail!==null&&qe()>Fo&&(t.flags|=128,n=!0,pi(o,!1),t.lanes=4194304)}else{if(!n)if(e=uc(i),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),pi(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!Le)return ft(t),null}else 2*qe()-o.renderingStartTime>Fo&&r!==1073741824&&(t.flags|=128,n=!0,pi(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=qe(),t.sibling=null,r=Me.current,Re(Me,n?r&1|2:r&1),t):(ft(t),null);case 22:case 23:return dp(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Ot&1073741824&&(ft(t),t.subtreeFlags&6&&(t.flags|=8192)):ft(t),null;case 24:return null;case 25:return null}throw Error(F(156,t.tag))}function jk(e,t){switch(Vh(t),t.tag){case 1:return Tt(t.type)&&nc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return $o(),Ie(kt),Ie(mt),ep(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Zh(t),null;case 13:if(Ie(Me),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(F(340));Do()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ie(Me),null;case 4:return $o(),null;case 10:return Yh(t.type._context),null;case 22:case 23:return dp(),null;case 24:return null;default:return null}}var il=!1,pt=!1,Ak=typeof WeakSet=="function"?WeakSet:Set,G=null;function ao(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){He(e,t,n)}else r.current=null}function Sf(e,t,r){try{r()}catch(n){He(e,t,n)}}var gg=!1;function Ok(e,t){if(sf=Zl,e=Pw(),Wh(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,d=0,f=e,h=null;t:for(;;){for(var v;f!==r||s!==0&&f.nodeType!==3||(a=i+s),f!==o||n!==0&&f.nodeType!==3||(l=i+n),f.nodeType===3&&(i+=f.nodeValue.length),(v=f.firstChild)!==null;)h=f,f=v;for(;;){if(f===e)break t;if(h===r&&++c===s&&(a=i),h===o&&++d===n&&(l=i),(v=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=v}r=a===-1||l===-1?null:{start:a,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(of={focusedElem:e,selectionRange:r},Zl=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var m=w.memoizedProps,b=w.memoizedState,g=t.stateNode,y=g.getSnapshotBeforeUpdate(t.elementType===t.type?m:rr(t.type,m),b);g.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(F(163))}}catch(S){He(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return w=gg,gg=!1,w}function Oi(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&&Sf(t,r,o)}s=s.next}while(s!==n)}}function Kc(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 Ef(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 C0(e){var t=e.alternate;t!==null&&(e.alternate=null,C0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[jr],delete t[Xi],delete t[cf],delete t[mk],delete t[gk])),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 k0(e){return e.tag===5||e.tag===3||e.tag===4}function vg(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||k0(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 _f(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=rc));else if(n!==4&&(e=e.child,e!==null))for(_f(e,t,r),e=e.sibling;e!==null;)_f(e,t,r),e=e.sibling}function Cf(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(Cf(e,t,r),e=e.sibling;e!==null;)Cf(e,t,r),e=e.sibling}var ot=null,ir=!1;function an(e,t,r){for(r=r.child;r!==null;)T0(e,t,r),r=r.sibling}function T0(e,t,r){if(Ar&&typeof Ar.onCommitFiberUnmount=="function")try{Ar.onCommitFiberUnmount(Fc,r)}catch{}switch(r.tag){case 5:pt||ao(r,t);case 6:var n=ot,s=ir;ot=null,an(e,t,r),ot=n,ir=s,ot!==null&&(ir?(e=ot,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):ot.removeChild(r.stateNode));break;case 18:ot!==null&&(ir?(e=ot,r=r.stateNode,e.nodeType===8?nd(e.parentNode,r):e.nodeType===1&&nd(e,r),Ki(e)):nd(ot,r.stateNode));break;case 4:n=ot,s=ir,ot=r.stateNode.containerInfo,ir=!0,an(e,t,r),ot=n,ir=s;break;case 0:case 11:case 14:case 15:if(!pt&&(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)&&Sf(r,t,i),s=s.next}while(s!==n)}an(e,t,r);break;case 1:if(!pt&&(ao(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(a){He(r,t,a)}an(e,t,r);break;case 21:an(e,t,r);break;case 22:r.mode&1?(pt=(n=pt)||r.memoizedState!==null,an(e,t,r),pt=n):an(e,t,r);break;default:an(e,t,r)}}function yg(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Ak),t.forEach(function(n){var s=zk.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function er(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:ot=a.stateNode,ir=!1;break e;case 3:ot=a.stateNode.containerInfo,ir=!0;break e;case 4:ot=a.stateNode.containerInfo,ir=!0;break e}a=a.return}if(ot===null)throw Error(F(160));T0(o,i,s),ot=null,ir=!1;var l=s.alternate;l!==null&&(l.return=null),s.return=null}catch(c){He(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)N0(t,e),t=t.sibling}function N0(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(er(t,e),Er(e),n&4){try{Oi(3,e,e.return),Kc(3,e)}catch(m){He(e,e.return,m)}try{Oi(5,e,e.return)}catch(m){He(e,e.return,m)}}break;case 1:er(t,e),Er(e),n&512&&r!==null&&ao(r,r.return);break;case 5:if(er(t,e),Er(e),n&512&&r!==null&&ao(r,r.return),e.flags&32){var s=e.stateNode;try{Wi(s,"")}catch(m){He(e,e.return,m)}}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&&Jy(s,o),Gd(a,i);var c=Gd(a,o);for(i=0;i<l.length;i+=2){var d=l[i],f=l[i+1];d==="style"?tw(s,f):d==="dangerouslySetInnerHTML"?Zy(s,f):d==="children"?Wi(s,f):Rh(s,d,f,c)}switch(a){case"input":Wd(s,o);break;case"textarea":Qy(s,o);break;case"select":var h=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!o.multiple;var v=o.value;v!=null?uo(s,!!o.multiple,v,!1):h!==!!o.multiple&&(o.defaultValue!=null?uo(s,!!o.multiple,o.defaultValue,!0):uo(s,!!o.multiple,o.multiple?[]:"",!1))}s[Xi]=o}catch(m){He(e,e.return,m)}}break;case 6:if(er(t,e),Er(e),n&4){if(e.stateNode===null)throw Error(F(162));s=e.stateNode,o=e.memoizedProps;try{s.nodeValue=o}catch(m){He(e,e.return,m)}}break;case 3:if(er(t,e),Er(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Ki(t.containerInfo)}catch(m){He(e,e.return,m)}break;case 4:er(t,e),Er(e);break;case 13:er(t,e),Er(e),s=e.child,s.flags&8192&&(o=s.memoizedState!==null,s.stateNode.isHidden=o,!o||s.alternate!==null&&s.alternate.memoizedState!==null||(cp=qe())),n&4&&yg(e);break;case 22:if(d=r!==null&&r.memoizedState!==null,e.mode&1?(pt=(c=pt)||d,er(t,e),pt=c):er(t,e),Er(e),n&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(G=e,d=e.child;d!==null;){for(f=G=d;G!==null;){switch(h=G,v=h.child,h.tag){case 0:case 11:case 14:case 15:Oi(4,h,h.return);break;case 1:ao(h,h.return);var w=h.stateNode;if(typeof w.componentWillUnmount=="function"){n=h,r=h.return;try{t=n,w.props=t.memoizedProps,w.state=t.memoizedState,w.componentWillUnmount()}catch(m){He(n,r,m)}}break;case 5:ao(h,h.return);break;case 22:if(h.memoizedState!==null){xg(f);continue}}v!==null?(v.return=h,G=v):xg(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{s=f.stateNode,c?(o=s.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none"):(a=f.stateNode,l=f.memoizedProps.style,i=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=ew("display",i))}catch(m){He(e,e.return,m)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(m){He(e,e.return,m)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:er(t,e),Er(e),n&4&&yg(e);break;case 21:break;default:er(t,e),Er(e)}}function Er(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(k0(r)){var n=r;break e}r=r.return}throw Error(F(160))}switch(n.tag){case 5:var s=n.stateNode;n.flags&32&&(Wi(s,""),n.flags&=-33);var o=vg(e);Cf(e,o,s);break;case 3:case 4:var i=n.stateNode.containerInfo,a=vg(e);_f(e,a,i);break;default:throw Error(F(161))}}catch(l){He(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ik(e,t,r){G=e,P0(e)}function P0(e,t,r){for(var n=(e.mode&1)!==0;G!==null;){var s=G,o=s.child;if(s.tag===22&&n){var i=s.memoizedState!==null||il;if(!i){var a=s.alternate,l=a!==null&&a.memoizedState!==null||pt;a=il;var c=pt;if(il=i,(pt=l)&&!c)for(G=s;G!==null;)i=G,l=i.child,i.tag===22&&i.memoizedState!==null?bg(s):l!==null?(l.return=i,G=l):bg(s);for(;o!==null;)G=o,P0(o),o=o.sibling;G=s,il=a,pt=c}wg(e)}else s.subtreeFlags&8772&&o!==null?(o.return=s,G=o):wg(e)}}function wg(e){for(;G!==null;){var t=G;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:pt||Kc(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!pt)if(r===null)n.componentDidMount();else{var s=t.elementType===t.type?r.memoizedProps:rr(t.type,r.memoizedProps);n.componentDidUpdate(s,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&ng(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}ng(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 d=c.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&Ki(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(F(163))}pt||t.flags&512&&Ef(t)}catch(h){He(t,t.return,h)}}if(t===e){G=null;break}if(r=t.sibling,r!==null){r.return=t.return,G=r;break}G=t.return}}function xg(e){for(;G!==null;){var t=G;if(t===e){G=null;break}var r=t.sibling;if(r!==null){r.return=t.return,G=r;break}G=t.return}}function bg(e){for(;G!==null;){var t=G;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Kc(4,t)}catch(l){He(t,r,l)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var s=t.return;try{n.componentDidMount()}catch(l){He(t,s,l)}}var o=t.return;try{Ef(t)}catch(l){He(t,o,l)}break;case 5:var i=t.return;try{Ef(t)}catch(l){He(t,i,l)}}}catch(l){He(t,t.return,l)}if(t===e){G=null;break}var a=t.sibling;if(a!==null){a.return=t.return,G=a;break}G=t.return}}var Dk=Math.ceil,hc=rn.ReactCurrentDispatcher,ap=rn.ReactCurrentOwner,Yt=rn.ReactCurrentBatchConfig,me=0,rt=null,Ye=null,it=0,Ot=0,lo=Vn(0),Ze=0,sa=null,xs=0,Gc=0,lp=0,Ii=null,_t=null,cp=0,Fo=1/0,Br=null,pc=!1,kf=null,jn=null,al=!1,_n=null,mc=0,Di=0,Tf=null,Bl=-1,zl=0;function wt(){return me&6?qe():Bl!==-1?Bl:Bl=qe()}function An(e){return e.mode&1?me&2&&it!==0?it&-it:yk.transition!==null?(zl===0&&(zl=hw()),zl):(e=Ee,e!==0||(e=window.event,e=e===void 0?16:xw(e.type)),e):1}function dr(e,t,r,n){if(50<Di)throw Di=0,Tf=null,Error(F(185));Ca(e,r,n),(!(me&2)||e!==rt)&&(e===rt&&(!(me&2)&&(Gc|=r),Ze===4&&mn(e,it)),Nt(e,n),r===1&&me===0&&!(t.mode&1)&&(Fo=qe()+500,Hc&&qn()))}function Nt(e,t){var r=e.callbackNode;yC(e,t);var n=Xl(e,e===rt?it:0);if(n===0)r!==null&&Rm(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&Rm(r),t===1)e.tag===0?vk(Sg.bind(null,e)):Fw(Sg.bind(null,e)),hk(function(){!(me&6)&&qn()}),r=null;else{switch(pw(n)){case 1:r=Dh;break;case 4:r=dw;break;case 16:r=Ql;break;case 536870912:r=fw;break;default:r=Ql}r=$0(r,R0.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function R0(e,t){if(Bl=-1,zl=0,me&6)throw Error(F(327));var r=e.callbackNode;if(go()&&e.callbackNode!==r)return null;var n=Xl(e,e===rt?it:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=gc(e,n);else{t=n;var s=me;me|=2;var o=A0();(rt!==e||it!==t)&&(Br=null,Fo=qe()+500,hs(e,t));do try{Mk();break}catch(a){j0(e,a)}while(!0);Gh(),hc.current=o,me=s,Ye!==null?t=0:(rt=null,it=0,t=Ze)}if(t!==0){if(t===2&&(s=Zd(e),s!==0&&(n=s,t=Nf(e,s))),t===1)throw r=sa,hs(e,0),mn(e,n),Nt(e,qe()),r;if(t===6)mn(e,n);else{if(s=e.current.alternate,!(n&30)&&!Lk(s)&&(t=gc(e,n),t===2&&(o=Zd(e),o!==0&&(n=o,t=Nf(e,o))),t===1))throw r=sa,hs(e,0),mn(e,n),Nt(e,qe()),r;switch(e.finishedWork=s,e.finishedLanes=n,t){case 0:case 1:throw Error(F(345));case 2:rs(e,_t,Br);break;case 3:if(mn(e,n),(n&130023424)===n&&(t=cp+500-qe(),10<t)){if(Xl(e,0)!==0)break;if(s=e.suspendedLanes,(s&n)!==n){wt(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=lf(rs.bind(null,e,_t,Br),t);break}rs(e,_t,Br);break;case 4:if(mn(e,n),(n&4194240)===n)break;for(t=e.eventTimes,s=-1;0<n;){var i=31-ur(n);o=1<<i,i=t[i],i>s&&(s=i),n&=~o}if(n=s,n=qe()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Dk(n/1960))-n,10<n){e.timeoutHandle=lf(rs.bind(null,e,_t,Br),n);break}rs(e,_t,Br);break;case 5:rs(e,_t,Br);break;default:throw Error(F(329))}}}return Nt(e,qe()),e.callbackNode===r?R0.bind(null,e):null}function Nf(e,t){var r=Ii;return e.current.memoizedState.isDehydrated&&(hs(e,t).flags|=256),e=gc(e,t),e!==2&&(t=_t,_t=r,t!==null&&Pf(t)),e}function Pf(e){_t===null?_t=e:_t.push.apply(_t,e)}function Lk(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(!pr(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 mn(e,t){for(t&=~lp,t&=~Gc,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-ur(t),n=1<<r;e[r]=-1,t&=~n}}function Sg(e){if(me&6)throw Error(F(327));go();var t=Xl(e,0);if(!(t&1))return Nt(e,qe()),null;var r=gc(e,t);if(e.tag!==0&&r===2){var n=Zd(e);n!==0&&(t=n,r=Nf(e,n))}if(r===1)throw r=sa,hs(e,0),mn(e,t),Nt(e,qe()),r;if(r===6)throw Error(F(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,rs(e,_t,Br),Nt(e,qe()),null}function up(e,t){var r=me;me|=1;try{return e(t)}finally{me=r,me===0&&(Fo=qe()+500,Hc&&qn())}}function bs(e){_n!==null&&_n.tag===0&&!(me&6)&&go();var t=me;me|=1;var r=Yt.transition,n=Ee;try{if(Yt.transition=null,Ee=1,e)return e()}finally{Ee=n,Yt.transition=r,me=t,!(me&6)&&qn()}}function dp(){Ot=lo.current,Ie(lo)}function hs(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,fk(r)),Ye!==null)for(r=Ye.return;r!==null;){var n=r;switch(Vh(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&nc();break;case 3:$o(),Ie(kt),Ie(mt),ep();break;case 5:Zh(n);break;case 4:$o();break;case 13:Ie(Me);break;case 19:Ie(Me);break;case 10:Yh(n.type._context);break;case 22:case 23:dp()}r=r.return}if(rt=e,Ye=e=On(e.current,null),it=Ot=t,Ze=0,sa=null,lp=Gc=xs=0,_t=Ii=null,is!==null){for(t=0;t<is.length;t++)if(r=is[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}is=null}return e}function j0(e,t){do{var r=Ye;try{if(Gh(),Ml.current=fc,dc){for(var n=Ue.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}dc=!1}if(ws=0,tt=Qe=Ue=null,Ai=!1,ta=0,ap.current=null,r===null||r.return===null){Ze=1,sa=t,Ye=null;break}e:{var o=e,i=r.return,a=r,l=t;if(t=it,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,d=a,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var v=cg(i);if(v!==null){v.flags&=-257,ug(v,i,a,o,t),v.mode&1&&lg(o,c,t),t=v,l=c;var w=t.updateQueue;if(w===null){var m=new Set;m.add(l),t.updateQueue=m}else w.add(l);break e}else{if(!(t&1)){lg(o,c,t),fp();break e}l=Error(F(426))}}else if(Le&&a.mode&1){var b=cg(i);if(b!==null){!(b.flags&65536)&&(b.flags|=256),ug(b,i,a,o,t),qh(Mo(l,a));break e}}o=l=Mo(l,a),Ze!==4&&(Ze=2),Ii===null?Ii=[o]:Ii.push(o),o=i;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var g=p0(o,l,t);rg(o,g);break e;case 1:a=l;var y=o.type,x=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(jn===null||!jn.has(x)))){o.flags|=65536,t&=-t,o.lanes|=t;var S=m0(o,a,t);rg(o,S);break e}}o=o.return}while(o!==null)}I0(r)}catch(E){t=E,Ye===r&&r!==null&&(Ye=r=r.return);continue}break}while(!0)}function A0(){var e=hc.current;return hc.current=fc,e===null?fc:e}function fp(){(Ze===0||Ze===3||Ze===2)&&(Ze=4),rt===null||!(xs&268435455)&&!(Gc&268435455)||mn(rt,it)}function gc(e,t){var r=me;me|=2;var n=A0();(rt!==e||it!==t)&&(Br=null,hs(e,t));do try{$k();break}catch(s){j0(e,s)}while(!0);if(Gh(),me=r,hc.current=n,Ye!==null)throw Error(F(261));return rt=null,it=0,Ze}function $k(){for(;Ye!==null;)O0(Ye)}function Mk(){for(;Ye!==null&&!cC();)O0(Ye)}function O0(e){var t=L0(e.alternate,e,Ot);e.memoizedProps=e.pendingProps,t===null?I0(e):Ye=t,ap.current=null}function I0(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=jk(r,t),r!==null){r.flags&=32767,Ye=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ze=6,Ye=null;return}}else if(r=Rk(r,t,Ot),r!==null){Ye=r;return}if(t=t.sibling,t!==null){Ye=t;return}Ye=t=e}while(t!==null);Ze===0&&(Ze=5)}function rs(e,t,r){var n=Ee,s=Yt.transition;try{Yt.transition=null,Ee=1,Fk(e,t,r,n)}finally{Yt.transition=s,Ee=n}return null}function Fk(e,t,r,n){do go();while(_n!==null);if(me&6)throw Error(F(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(F(177));e.callbackNode=null,e.callbackPriority=0;var o=r.lanes|r.childLanes;if(wC(e,o),e===rt&&(Ye=rt=null,it=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||al||(al=!0,$0(Ql,function(){return go(),null})),o=(r.flags&15990)!==0,r.subtreeFlags&15990||o){o=Yt.transition,Yt.transition=null;var i=Ee;Ee=1;var a=me;me|=4,ap.current=null,Ok(e,r),N0(r,e),ok(of),Zl=!!sf,of=sf=null,e.current=r,Ik(r),uC(),me=a,Ee=i,Yt.transition=o}else e.current=r;if(al&&(al=!1,_n=e,mc=s),o=e.pendingLanes,o===0&&(jn=null),hC(r.stateNode),Nt(e,qe()),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(pc)throw pc=!1,e=kf,kf=null,e;return mc&1&&e.tag!==0&&go(),o=e.pendingLanes,o&1?e===Tf?Di++:(Di=0,Tf=e):Di=0,qn(),null}function go(){if(_n!==null){var e=pw(mc),t=Yt.transition,r=Ee;try{if(Yt.transition=null,Ee=16>e?16:e,_n===null)var n=!1;else{if(e=_n,_n=null,mc=0,me&6)throw Error(F(331));var s=me;for(me|=4,G=e.current;G!==null;){var o=G,i=o.child;if(G.flags&16){var a=o.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(G=c;G!==null;){var d=G;switch(d.tag){case 0:case 11:case 15:Oi(8,d,o)}var f=d.child;if(f!==null)f.return=d,G=f;else for(;G!==null;){d=G;var h=d.sibling,v=d.return;if(C0(d),d===c){G=null;break}if(h!==null){h.return=v,G=h;break}G=v}}}var w=o.alternate;if(w!==null){var m=w.child;if(m!==null){w.child=null;do{var b=m.sibling;m.sibling=null,m=b}while(m!==null)}}G=o}}if(o.subtreeFlags&2064&&i!==null)i.return=o,G=i;else e:for(;G!==null;){if(o=G,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Oi(9,o,o.return)}var g=o.sibling;if(g!==null){g.return=o.return,G=g;break e}G=o.return}}var y=e.current;for(G=y;G!==null;){i=G;var x=i.child;if(i.subtreeFlags&2064&&x!==null)x.return=i,G=x;else e:for(i=y;G!==null;){if(a=G,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Kc(9,a)}}catch(E){He(a,a.return,E)}if(a===i){G=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,G=S;break e}G=a.return}}if(me=s,qn(),Ar&&typeof Ar.onPostCommitFiberRoot=="function")try{Ar.onPostCommitFiberRoot(Fc,e)}catch{}n=!0}return n}finally{Ee=r,Yt.transition=t}}return!1}function Eg(e,t,r){t=Mo(r,t),t=p0(e,t,1),e=Rn(e,t,1),t=wt(),e!==null&&(Ca(e,1,t),Nt(e,t))}function He(e,t,r){if(e.tag===3)Eg(e,e,r);else for(;t!==null;){if(t.tag===3){Eg(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(jn===null||!jn.has(n))){e=Mo(r,e),e=m0(t,e,1),t=Rn(t,e,1),e=wt(),t!==null&&(Ca(t,1,e),Nt(t,e));break}}t=t.return}}function Uk(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=wt(),e.pingedLanes|=e.suspendedLanes&r,rt===e&&(it&r)===r&&(Ze===4||Ze===3&&(it&130023424)===it&&500>qe()-cp?hs(e,0):lp|=r),Nt(e,t)}function D0(e,t){t===0&&(e.mode&1?(t=Qa,Qa<<=1,!(Qa&130023424)&&(Qa=4194304)):t=1);var r=wt();e=Xr(e,t),e!==null&&(Ca(e,t,r),Nt(e,r))}function Bk(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),D0(e,r)}function zk(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(F(314))}n!==null&&n.delete(t),D0(e,r)}var L0;L0=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||kt.current)Ct=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Ct=!1,Pk(e,t,r);Ct=!!(e.flags&131072)}else Ct=!1,Le&&t.flags&1048576&&Uw(t,ic,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Ul(e,t),e=t.pendingProps;var s=Io(t,mt.current);mo(t,r),s=rp(null,t,n,e,s,r);var o=np();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,Tt(n)?(o=!0,sc(t)):o=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Qh(t),s.updater=qc,t.stateNode=s,s._reactInternals=t,mf(t,n,e,r),t=yf(null,t,n,!0,o,r)):(t.tag=0,Le&&o&&Hh(t),vt(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Ul(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=Hk(n),e=rr(n,e),s){case 0:t=vf(null,t,n,e,r);break e;case 1:t=hg(null,t,n,e,r);break e;case 11:t=dg(null,t,n,e,r);break e;case 14:t=fg(null,t,n,rr(n.type,e),r);break e}throw Error(F(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:rr(n,s),vf(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:rr(n,s),hg(e,t,n,s,r);case 3:e:{if(w0(t),e===null)throw Error(F(387));n=t.pendingProps,o=t.memoizedState,s=o.element,qw(e,t),cc(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=Mo(Error(F(423)),t),t=pg(e,t,n,r,s);break e}else if(n!==s){s=Mo(Error(F(424)),t),t=pg(e,t,n,r,s);break e}else for(Mt=Pn(t.stateNode.containerInfo.firstChild),Ft=t,Le=!0,ar=null,r=Hw(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Do(),n===s){t=Zr(e,t,r);break e}vt(e,t,n,r)}t=t.child}return t;case 5:return Kw(t),e===null&&ff(t),n=t.type,s=t.pendingProps,o=e!==null?e.memoizedProps:null,i=s.children,af(n,s)?i=null:o!==null&&af(n,o)&&(t.flags|=32),y0(e,t),vt(e,t,i,r),t.child;case 6:return e===null&&ff(t),null;case 13:return x0(e,t,r);case 4:return Xh(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Lo(t,null,n,r):vt(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:rr(n,s),dg(e,t,n,s,r);case 7:return vt(e,t,t.pendingProps,r),t.child;case 8:return vt(e,t,t.pendingProps.children,r),t.child;case 12:return vt(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,Re(ac,n._currentValue),n._currentValue=i,o!==null)if(pr(o.value,i)){if(o.children===s.children&&!kt.current){t=Zr(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=Gr(-1,r&-r),l.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),hf(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(F(341));i.lanes|=r,a=i.alternate,a!==null&&(a.lanes|=r),hf(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}vt(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,mo(t,r),s=Jt(s),n=n(s),t.flags|=1,vt(e,t,n,r),t.child;case 14:return n=t.type,s=rr(n,t.pendingProps),s=rr(n.type,s),fg(e,t,n,s,r);case 15:return g0(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:rr(n,s),Ul(e,t),t.tag=1,Tt(n)?(e=!0,sc(t)):e=!1,mo(t,r),h0(t,n,s),mf(t,n,s,r),yf(null,t,n,!0,e,r);case 19:return b0(e,t,r);case 22:return v0(e,t,r)}throw Error(F(156,t.tag))};function $0(e,t){return uw(e,t)}function Wk(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gt(e,t,r,n){return new Wk(e,t,r,n)}function hp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Hk(e){if(typeof e=="function")return hp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ah)return 11;if(e===Oh)return 14}return 2}function On(e,t){var r=e.alternate;return r===null?(r=Gt(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.depen
vendor: 4,590 bytes, line 40
40dencies,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 Wl(e,t,r,n,s,o){var i=2;if(n=e,typeof e=="function")hp(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Xs:return ps(r.children,s,o,t);case jh:i=8,s|=8;break;case Md:return e=Gt(12,r,t,s|2),e.elementType=Md,e.lanes=o,e;case Fd:return e=Gt(13,r,t,s),e.elementType=Fd,e.lanes=o,e;case Ud:return e=Gt(19,r,t,s),e.elementType=Ud,e.lanes=o,e;case Ky:return Yc(r,s,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Vy:i=10;break e;case qy:i=9;break e;case Ah:i=11;break e;case Oh:i=14;break e;case fn:i=16,n=null;break e}throw Error(F(130,e==null?e:typeof e,""))}return t=Gt(i,r,t,s),t.elementType=e,t.type=n,t.lanes=o,t}function ps(e,t,r,n){return e=Gt(7,e,n,t),e.lanes=r,e}function Yc(e,t,r,n){return e=Gt(22,e,n,t),e.elementType=Ky,e.lanes=r,e.stateNode={isHidden:!1},e}function dd(e,t,r){return e=Gt(6,e,null,t),e.lanes=r,e}function fd(e,t,r){return t=Gt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Vk(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=qu(0),this.expirationTimes=qu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qu(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function pp(e,t,r,n,s,o,i,a,l){return e=new Vk(e,t,r,a,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Gt(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Qh(o),e}function qk(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Qs,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function M0(e){if(!e)return $n;e=e._reactInternals;e:{if(Rs(e)!==e||e.tag!==1)throw Error(F(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Tt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(F(171))}if(e.tag===1){var r=e.type;if(Tt(r))return Mw(e,r,t)}return t}function F0(e,t,r,n,s,o,i,a,l){return e=pp(r,n,!0,e,s,o,i,a,l),e.context=M0(null),r=e.current,n=wt(),s=An(r),o=Gr(n,s),o.callback=t??null,Rn(r,o,s),e.current.lanes=s,Ca(e,s,n),Nt(e,n),e}function Jc(e,t,r,n){var s=t.current,o=wt(),i=An(s);return r=M0(r),t.context===null?t.context=r:t.pendingContext=r,t=Gr(o,i),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=Rn(s,t,i),e!==null&&(dr(e,s,i,o),$l(e,s,i)),i}function vc(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 _g(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function mp(e,t){_g(e,t),(e=e.alternate)&&_g(e,t)}function Kk(){return null}var U0=typeof reportError=="function"?reportError:function(e){console.error(e)};function gp(e){this._internalRoot=e}Qc.prototype.render=gp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(F(409));Jc(e,t,null,null)};Qc.prototype.unmount=gp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;bs(function(){Jc(null,e,null,null)}),t[Qr]=null}};function Qc(e){this._internalRoot=e}Qc.prototype.unstable_scheduleHydration=function(e){if(e){var t=vw();e={blockedOn:null,target:e,priority:t};for(var r=0;r<pn.length&&t!==0&&t<pn[r].priority;r++);pn.splice(r,0,e),r===0&&ww(e)}};function vp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Xc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Cg(){}function Gk(e,t,r,n,s){if(s){if(typeof n=="function"){var o=n;n=function(){var c=vc(i);o.call(c)}}var i=F0(t,n,e,0,null,!1,!1,"",Cg);return e._reactRootContainer=i,e[Qr]=i.current,Ji(e.nodeType===8?e.parentNode:e),bs(),i}for(;s=e.lastChild;)e.removeChild(s);if(typeof n=="function"){var a=n;n=function(){var c=vc(l);a.call(c)}}var l=pp(e,0,!1,null,null,!1,!1,"",Cg);return e._reactRootContainer=l,e[Qr]=l.current,Ji(e.nodeType===8?e.parentNode:e),bs(function(){J
vendor: 4,693 bytes, line 40
40c(t,l,r,n)}),l}function Zc(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=vc(i);a.call(l)}}Jc(t,i,e,s)}else i=Gk(r,t,e,s,n);return vc(i)}mw=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=bi(t.pendingLanes);r!==0&&(Lh(t,r|1),Nt(t,qe()),!(me&6)&&(Fo=qe()+500,qn()))}break;case 13:bs(function(){var n=Xr(e,1);if(n!==null){var s=wt();dr(n,e,1,s)}}),mp(e,1)}};$h=function(e){if(e.tag===13){var t=Xr(e,134217728);if(t!==null){var r=wt();dr(t,e,134217728,r)}mp(e,134217728)}};gw=function(e){if(e.tag===13){var t=An(e),r=Xr(e,t);if(r!==null){var n=wt();dr(r,e,t,n)}mp(e,t)}};vw=function(){return Ee};yw=function(e,t){var r=Ee;try{return Ee=e,t()}finally{Ee=r}};Jd=function(e,t,r){switch(t){case"input":if(Wd(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=Wc(n);if(!s)throw Error(F(90));Yy(n),Wd(n,s)}}}break;case"textarea":Qy(e,r);break;case"select":t=r.value,t!=null&&uo(e,!!r.multiple,t,!1)}};sw=up;ow=bs;var Yk={usingClientEntryPoint:!1,Events:[Ta,ro,Wc,rw,nw,up]},mi={findFiberByHostInstance:os,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Jk={bundleType:mi.bundleType,version:mi.version,rendererPackageName:mi.rendererPackageName,rendererConfig:mi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:rn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=lw(e),e===null?null:e.stateNode},findFiberByHostInstance:mi.findFiberByHostInstance||Kk,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ll=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ll.isDisabled&&ll.supportsFiber)try{Fc=ll.inject(Jk),Ar=ll}catch{}}zt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Yk;zt.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!vp(t))throw Error(F(200));return qk(e,t,null,r)};zt.createRoot=function(e,t){if(!vp(e))throw Error(F(299));var r=!1,n="",s=U0;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=pp(e,1,!1,null,null,r,!1,n,s),e[Qr]=t.current,Ji(e.nodeType===8?e.parentNode:e),new gp(t)};zt.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(F(188)):(e=Object.keys(e).join(","),Error(F(268,e)));return e=lw(t),e=e===null?null:e.stateNode,e};zt.flushSync=function(e){return bs(e)};zt.hydrate=function(e,t,r){if(!Xc(t))throw Error(F(200));return Zc(null,e,t,!0,r)};zt.hydrateRoot=function(e,t,r){if(!vp(e))throw Error(F(405));var n=r!=null&&r.hydratedSources||null,s=!1,o="",i=U0;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(o=r.identifierPrefix),r.onRecoverableError!==void 0&&(i=r.onRecoverableError)),t=F0(t,null,e,1,r??null,s,!1,o,i),e[Qr]=t.current,Ji(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 Qc(t)};zt.render=function(e,t,r){if(!Xc(t))throw Error(F(200));return Zc(null,e,t,!1,r)};zt.unmountComponentAtNode=function(e){if(!Xc(e))throw Error(F(40));return e._reactRootContainer?(bs(function(){Zc(null,null,e,!1,function(){e._reactRootContainer=null,e[Qr]=null})}),!0):!1};zt.unstable_batchedUpdates=up;zt.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Xc(r))throw Error(F(200));if(e==null||e._reactInternals===void 0)throw Error(F(38));return Zc(e,t,r,!1,n)};zt.version="18.3.1-next-f1338f8080-20240426";function B0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(B0)}catch(e){console.error(e)}}B0(),By.exports=zt;var Kn=By.exports;const Pa=Ny(Kn);var z0,kg=Kn;z0=kg.createRoot,kg.hydrateRoot;const Qk=1,Xk=1e6;let hd=0;function Zk(){return hd=(hd+1)%Number.MAX_SAFE_INTEGER,hd.toString()}const pd=new Map,Tg=e=>{if(pd.has(e))return;const t=setTimeout(()=>{pd.delete(e),Li({type:"REMOVE_TOAST",toastId:e})},Xk);pd.set(e,t)},eT=(e,t)=>
40{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Qk)};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?Tg(r):e.toasts.forEach(n=>{Tg(n.id)}),{...e,toasts:e.toasts.map(n=>n.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)}}},Hl=[];let Vl={toasts:[]};function Li(e){Vl=eT(Vl,e),Hl.forEach(t=>{t(Vl)})}function tT({...e}){const t=Zk(),r=s=>Li({type:"UPDATE_TOAST",toast:{...s,id:t}}),n=()=>Li({type:"DISMISS_TOAST",toastId:t});return Li({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||n()}}}),{id:t,dismiss:n,update:r}}function W0(){const[e,t]=p.useState(Vl);return p.useEffect(()=>(Hl.push(t),()=>{const r=Hl.indexOf(t);r>-1&&Hl.splice(r,1)}),[e]),{...e,toast:tT,dismiss:r=>Li({type:"DISMISS_TOAST",toastId:r})}}function q(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 rT(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function H0(...e){return t=>e.forEach(r=>rT(r,t))}function le(...e){return p.useCallback(H0(...e),e)}function nT(e,t){const r=p.createContext(t);function n(o){const{children:i,...a}=o,l=p.useMemo(()=>a,Object.values(a));return u.jsx(r.Provider,{value:l,children:i})}function s(o){const i=p.useContext(r);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return n.displayName=e+"Provider",[n,s]}function vr(e,t=[]){let r=[];function n(o,i){const a=p.createContext(i),l=r.length;r=[...r,i];function c(f){const{scope:h,children:v,...w}=f,m=(h==null?void 0:h[e][l])||a,b=p.useMemo(()=>w,Object.values(w));return u.jsx(m.Provider,{value:b,children:v})}function d(f,h){const v=(h==null?void 0:h[e][l])||a,w=p.useContext(v);if(w)return w;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${o}\``)}return c.displayName=o+"Provider",[c,d]}const s=()=>{const o=r.map(i=>p.createContext(i));return function(a){const l=(a==null?void 0:a[e])||o;return p.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return s.scopeName=e,[n,sT(s,...t)]}function sT(...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 f=l(o)[`__scope${c}`];return{...a,...f}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}var Mn=p.forwardRef((e,t)=>{const{children:r,...n}=e,s=p.Children.toArray(r),o=s.find(oT);if(o){const i=o.props.children,a=s.map(l=>l===o?p.Children.count(i)>1?p.Children.only(null):p.isValidElement(i)?i.props.children:null:l);return u.jsx(Rf,{...n,ref:t,children:p.isValidElement(i)?p.cloneElement(i,void 0,a):null})}return u.jsx(Rf,{...n,ref:t,children:r})});Mn.displayName="Slot";var Rf=p.forwardRef((e,t)=>{const{children:r,...n}=e;if(p.isValidElement(r)){const s=aT(r);return p.cloneElement(r,{...iT(n,r.props),ref:t?H0(t,s):s})}return p.Children.count(r)>1?p.Children.only(null):null});Rf.displayName="SlotClone";var yp=({children:e})=>u.jsx(u.Fragment,{children:e});function oT(e){return p.isValidElement(e)&&e.type===yp}function iT(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)=>{o(...a),s(...a)}:s&&(r[n]=s):n==="style"?r[n]={...s,...o}:n==="className"&&(r[n]=[s,o].filter(Boolean).join(" "))}return{...e,...r}}function aT(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 wp(e){const t=e+"CollectionProvider",[r,n]=vr(t),[s,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=v=>{const{scope:w,children:m}=v,b=z.useRef(null),g=z.useRef(new Map).current;return u.jsx(s,{scope:w,itemMap:g,collectionRef:b,children:m})};i.displayName=t;const a=e+"CollectionSlot",l=z.forwardRef((v,w)=>{const{scope:m,children:b}=v,g=o(a,m),y=le(w,g.collectionRef);
vendor: 4,275 bytes, line 40
40return u.jsx(Mn,{ref:y,children:b})});l.displayName=a;const c=e+"CollectionItemSlot",d="data-radix-collection-item",f=z.forwardRef((v,w)=>{const{scope:m,children:b,...g}=v,y=z.useRef(null),x=le(w,y),S=o(c,m);return z.useEffect(()=>(S.itemMap.set(y,{ref:y,...g}),()=>void S.itemMap.delete(y))),u.jsx(Mn,{[d]:"",ref:x,children:b})});f.displayName=c;function h(v){const w=o(e+"CollectionConsumer",v);return z.useCallback(()=>{const b=w.collectionRef.current;if(!b)return[];const g=Array.from(b.querySelectorAll(`[${d}]`));return Array.from(w.itemMap.values()).sort((S,E)=>g.indexOf(S.ref.current)-g.indexOf(E.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:i,Slot:l,ItemSlot:f},h,n]}var lT=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],X=lT.reduce((e,t)=>{const r=p.forwardRef((n,s)=>{const{asChild:o,...i}=n,a=o?Mn:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(a,{...i,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Ra(e,t){e&&Kn.flushSync(()=>e.dispatchEvent(t))}function ke(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function eu(e,t=globalThis==null?void 0:globalThis.document){const r=ke(e);p.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 cT="DismissableLayer",jf="dismissableLayer.update",uT="dismissableLayer.pointerDownOutside",dT="dismissableLayer.focusOutside",Ng,V0=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),q0=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:a,...l}=e,c=p.useContext(V0),[d,f]=p.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=p.useState({}),w=le(t,_=>f(_)),m=Array.from(c.layers),[b]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=m.indexOf(b),y=d?m.indexOf(d):-1,x=c.layersWithOutsidePointerEventsDisabled.size>0,S=y>=g,E=hT(_=>{const k=_.target,N=[...c.branches].some(j=>j.contains(k));!S||N||(s==null||s(_),i==null||i(_),_.defaultPrevented||a==null||a())},h),C=pT(_=>{const k=_.target;[...c.branches].some(j=>j.contains(k))||(o==null||o(_),i==null||i(_),_.defaultPrevented||a==null||a())},h);return eu(_=>{y===c.layers.size-1&&(n==null||n(_),!_.defaultPrevented&&a&&(_.preventDefault(),a()))},h),p.useEffect(()=>{if(d)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Ng=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),Pg(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Ng)}},[d,h,r,c]),p.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),Pg())},[d,c]),p.useEffect(()=>{const _=()=>v({});return document.addEventListener(jf,_),()=>document.removeEventListener(jf,_)},[]),u.jsx(X.div,{...l,ref:w,style:{pointerEvents:x?S?"auto":"none":void 0,...e.style},onFocusCapture:q(e.onFocusCapture,C.onFocusCapture),onBlurCapture:q(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:q(e.onPointerDownCapture,E.onPointerDownCapture)})});q0.displayName=cT;var fT="DismissableLayerBranch",K0=p.forwardRef((e,t)=>{const r=p.useContext(V0),n=p.useRef(null),s=le(t,n);return p.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),u.jsx(X.div,{...e,ref:s})});K0.displayName=fT;function hT(e,t=globalThis==null?void 0:globalThis.document){const r=ke(e),n=p.useRef(!1),s=p.useRef(()=>{});return p.useEffect(()=>{const o=a=>{if(a.target&&!n.current){let l=function(){G0(uT,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",
40s.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function pT(e,t=globalThis==null?void 0:globalThis.document){const r=ke(e),n=p.useRef(!1);return p.useEffect(()=>{const s=o=>{o.target&&!n.current&&G0(dT,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 Pg(){const e=new CustomEvent(jf);document.dispatchEvent(e)}function G0(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?Ra(s,o):s.dispatchEvent(o)}var mT=q0,gT=K0,$e=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},vT="Portal",Y0=p.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[s,o]=p.useState(!1);$e(()=>o(!0),[]);const i=r||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Pa.createPortal(u.jsx(X.div,{...n,ref:t}),i):null});Y0.displayName=vT;function yT(e,t){return p.useReducer((r,n)=>t[r][n]??r,e)}var yr=e=>{const{present:t,children:r}=e,n=wT(t),s=typeof r=="function"?r({present:n.isPresent}):p.Children.only(r),o=le(n.ref,xT(s));return typeof r=="function"||n.isPresent?p.cloneElement(s,{ref:o}):null};yr.displayName="Presence";function wT(e){const[t,r]=p.useState(),n=p.useRef({}),s=p.useRef(e),o=p.useRef("none"),i=e?"mounted":"unmounted",[a,l]=yT(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const c=cl(n.current);o.current=a==="mounted"?c:"none"},[a]),$e(()=>{const c=n.current,d=s.current;if(d!==e){const h=o.current,v=cl(c);e?l("MOUNT"):v==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&h!==v?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,l]),$e(()=>{if(t){const c=f=>{const v=cl(n.current).includes(f.animationName);f.target===t&&v&&Kn.flushSync(()=>l("ANIMATION_END"))},d=f=>{f.target===t&&(o.current=cl(n.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:p.useCallback(c=>{c&&(n.current=getComputedStyle(c)),r(c)},[])}}function cl(e){return(e==null?void 0:e.animationName)||"none"}function xT(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 Fn({prop:e,defaultProp:t,onChange:r=()=>{}}){const[n,s]=bT({defaultProp:t,onChange:r}),o=e!==void 0,i=o?e:n,a=ke(r),l=p.useCallback(c=>{if(o){const f=typeof c=="function"?c(e):c;f!==e&&a(f)}else s(c)},[o,e,s,a]);return[i,l]}function bT({defaultProp:e,onChange:t}){const r=p.useState(e),[n]=r,s=p.useRef(n),o=ke(t);return p.useEffect(()=>{s.current!==n&&(o(n),s.current=n)},[n,s,o]),r}var ST="VisuallyHidden",ja=p.forwardRef((e,t)=>u.jsx(X.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));ja.displayName=ST;var ET=ja,xp="ToastProvider",[bp,_T,CT]=wp("Toast"),[J0,XM]=vr("Toast",[CT]),[kT,tu]=J0(xp),Q0=e=>{const{__scopeToast:t,label:r="Notification",duration:n=5e3,swipeDirection:s="right",swipeThreshold:o=50,children:i}=e,[a,l]=p.useState(null),[c,d]=p.useState(0),f=p.useRef(!1),h=p.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${xp}\`. Expected non-empty \`string\`.`),u.jsx(bp.Provider,{scope:t,children:u.jsx(kT,{scope:t,label:r,duration:n,swipeDirection:s,swipeThreshold:o,toastCount:c,viewport:a,onViewportChange:l,onToastAdd:p.useCallback(()=>d(v=>v+1),[]),onToastRemove:p.useCallback(()=>d(v=>v-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:h,children:i})})};Q0.displayName=xp;var X0="ToastViewport",TT=["F8"],Af="toast.viewportPause",Of="toast.viewportResume",Z0=p.forwardRef((e,t)=>
40{const{__scopeToast:r,hotkey:n=TT,label:s="Notifications ({hotkey})",...o}=e,i=tu(X0,r),a=_T(r),l=p.useRef(null),c=p.useRef(null),d=p.useRef(null),f=p.useRef(null),h=le(t,f,i.onViewportChange),v=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),w=i.toastCount>0;p.useEffect(()=>{const b=g=>{var x;n.every(S=>g[S]||g.code===S)&&((x=f.current)==null||x.focus())};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[n]),p.useEffect(()=>{const b=l.current,g=f.current;if(w&&b&&g){const y=()=>{if(!i.isClosePausedRef.current){const C=new CustomEvent(Af);g.dispatchEvent(C),i.isClosePausedRef.current=!0}},x=()=>{if(i.isClosePausedRef.current){const C=new CustomEvent(Of);g.dispatchEvent(C),i.isClosePausedRef.current=!1}},S=C=>{!b.contains(C.relatedTarget)&&x()},E=()=>{b.contains(document.activeElement)||x()};return b.addEventListener("focusin",y),b.addEventListener("focusout",S),b.addEventListener("pointermove",y),b.addEventListener("pointerleave",E),window.addEventListener("blur",y),window.addEventListener("focus",x),()=>{b.removeEventListener("focusin",y),b.removeEventListener("focusout",S),b.removeEventListener("pointermove",y),b.removeEventListener("pointerleave",E),window.removeEventListener("blur",y),window.removeEventListener("focus",x)}}},[w,i.isClosePausedRef]);const m=p.useCallback(({tabbingDirection:b})=>{const y=a().map(x=>{const S=x.ref.current,E=[S,...UT(S)];return b==="forwards"?E:E.reverse()});return(b==="forwards"?y.reverse():y).flat()},[a]);return p.useEffect(()=>{const b=f.current;if(b){const g=y=>{var E,C,_;const x=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!x){const k=document.activeElement,N=y.shiftKey;if(y.target===b&&N){(E=c.current)==null||E.focus();return}const T=m({tabbingDirection:N?"backwards":"forwards"}),A=T.findIndex(L=>L===k);md(T.slice(A+1))?y.preventDefault():N?(C=c.current)==null||C.focus():(_=d.current)==null||_.focus()}};return b.addEventListener("keydown",g),()=>b.removeEventListener("keydown",g)}},[a,m]),u.jsxs(gT,{ref:l,role:"region","aria-label":s.replace("{hotkey}",v),tabIndex:-1,style:{pointerEvents:w?void 0:"none"},children:[w&&u.jsx(If,{ref:c,onFocusFromOutsideViewport:()=>{const b=m({tabbingDirection:"forwards"});md(b)}}),u.jsx(bp.Slot,{scope:r,children:u.jsx(X.ol,{tabIndex:-1,...o,ref:h})}),w&&u.jsx(If,{ref:d,onFocusFromOutsideViewport:()=>{const b=m({tabbingDirection:"backwards"});md(b)}})]})});Z0.displayName=X0;var ex="ToastFocusProxy",If=p.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...s}=e,o=tu(ex,r);return u.jsx(ja,{"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()}})});If.displayName=ex;var ru="Toast",NT="toast.swipeStart",PT="toast.swipeMove",RT="toast.swipeCancel",jT="toast.swipeEnd",tx=p.forwardRef((e,t)=>{const{forceMount:r,open:n,defaultOpen:s,onOpenChange:o,...i}=e,[a=!0,l]=Fn({prop:n,defaultProp:s,onChange:o});return u.jsx(yr,{present:r||a,children:u.jsx(IT,{open:a,...i,ref:t,onClose:()=>l(!1),onPause:ke(e.onPause),onResume:ke(e.onResume),onSwipeStart:q(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:q(e.onSwipeMove,c=>{const{x:d,y:f}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","move"),c.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:q(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:q(e.onSwipeEnd,c=>{const{x:d,y:f}=c.detail.delta;c.currentTarget.setAttribute("data-swipe","end"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),c.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),c.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),c.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),l(!1)})})})});tx.displayName=ru;var[AT,OT]=J0(ru,{onClose(){}}),IT=p.forwardRef((e,t)=>
40{const{__scopeToast:r,type:n="foreground",duration:s,open:o,onClose:i,onEscapeKeyDown:a,onPause:l,onResume:c,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:h,onSwipeEnd:v,...w}=e,m=tu(ru,r),[b,g]=p.useState(null),y=le(t,L=>g(L)),x=p.useRef(null),S=p.useRef(null),E=s||m.duration,C=p.useRef(0),_=p.useRef(E),k=p.useRef(0),{onToastAdd:N,onToastRemove:j}=m,R=ke(()=>{var W;(b==null?void 0:b.contains(document.activeElement))&&((W=m.viewport)==null||W.focus()),i()}),T=p.useCallback(L=>{!L||L===1/0||(window.clearTimeout(k.current),C.current=new Date().getTime(),k.current=window.setTimeout(R,L))},[R]);p.useEffect(()=>{const L=m.viewport;if(L){const W=()=>{T(_.current),c==null||c()},H=()=>{const ee=new Date().getTime()-C.current;_.current=_.current-ee,window.clearTimeout(k.current),l==null||l()};return L.addEventListener(Af,H),L.addEventListener(Of,W),()=>{L.removeEventListener(Af,H),L.removeEventListener(Of,W)}}},[m.viewport,E,l,c,T]),p.useEffect(()=>{o&&!m.isClosePausedRef.current&&T(E)},[o,E,m.isClosePausedRef,T]),p.useEffect(()=>(N(),()=>j()),[N,j]);const A=p.useMemo(()=>b?lx(b):null,[b]);return m.viewport?u.jsxs(u.Fragment,{children:[A&&u.jsx(DT,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite","aria-atomic":!0,children:A}),u.jsx(AT,{scope:r,onClose:R,children:Kn.createPortal(u.jsx(bp.ItemSlot,{scope:r,children:u.jsx(mT,{asChild:!0,onEscapeKeyDown:q(a,()=>{m.isFocusedToastEscapeKeyDownRef.current||R(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:u.jsx(X.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":m.swipeDirection,...w,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:q(e.onKeyDown,L=>{L.key==="Escape"&&(a==null||a(L.nativeEvent),L.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,R()))}),onPointerDown:q(e.onPointerDown,L=>{L.button===0&&(x.current={x:L.clientX,y:L.clientY})}),onPointerMove:q(e.onPointerMove,L=>{if(!x.current)return;const W=L.clientX-x.current.x,H=L.clientY-x.current.y,ee=!!S.current,P=["left","right"].includes(m.swipeDirection),$=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,K=P?$(0,W):0,B=P?0:$(0,H),Y=L.pointerType==="touch"?10:2,ae={x:K,y:B},ue={originalEvent:L,delta:ae};ee?(S.current=ae,ul(PT,f,ue,{discrete:!1})):Rg(ae,m.swipeDirection,Y)?(S.current=ae,ul(NT,d,ue,{discrete:!1}),L.target.setPointerCapture(L.pointerId)):(Math.abs(W)>Y||Math.abs(H)>Y)&&(x.current=null)}),onPointerUp:q(e.onPointerUp,L=>{const W=S.current,H=L.target;if(H.hasPointerCapture(L.pointerId)&&H.releasePointerCapture(L.pointerId),S.current=null,x.current=null,W){const ee=L.currentTarget,P={originalEvent:L,delta:W};Rg(W,m.swipeDirection,m.swipeThreshold)?ul(jT,v,P,{discrete:!0}):ul(RT,h,P,{discrete:!0}),ee.addEventListener("click",$=>$.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),DT=e=>{const{__scopeToast:t,children:r,...n}=e,s=tu(ru,t),[o,i]=p.useState(!1),[a,l]=p.useState(!1);return MT(()=>i(!0)),p.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:u.jsx(Y0,{asChild:!0,children:u.jsx(ja,{...n,children:o&&u.jsxs(u.Fragment,{children:[s.label," ",r]})})})},LT="ToastTitle",rx=p.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return u.jsx(X.div,{...n,ref:t})});rx.displayName=LT;var $T="ToastDescription",nx=p.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e;return u.jsx(X.div,{...n,ref:t})});nx.displayName=$T;var sx="ToastAction",ox=p.forwardRef((e,t)=>{const{altText:r,...n}=e;return r.trim()?u.jsx(ax,{altText:r,asChild:!0,children:u.jsx(Sp,{...n,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${sx}\`. Expected non-empty \`string\`.`),null)});ox.displayName=sx;var ix="ToastClose",Sp=p.forwardRef((e,t)=>{const{__scopeToast:r,...n}=e,s=OT(ix,r);return u.jsx(ax,{asChild:!0,children:u.jsx(X.button,{type:"button",...n,ref:t,onClick:q(e.onClick,s.onClose)})})});Sp.displayName=ix;var ax=p.forwardRef((e,t)=>{const{__scopeToast:r,altText:n,...s}=e;return u.jsx(X.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...s,ref:t})});function lx(e){const t=[];
vendor: 12,080 bytes, lines 40-179
40return Array.from(e.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&t.push(n.textContent),FT(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(...lx(n))}}),t}function ul(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?Ra(s,o):s.dispatchEvent(o)}var Rg=(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 MT(e=()=>{}){const t=ke(e);$e(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[t])}function FT(e){return e.nodeType===e.ELEMENT_NODE}function UT(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 md(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var BT=Q0,cx=Z0,ux=tx,dx=rx,fx=nx,hx=ox,px=Sp;function mx(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=mx(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function gx(){for(var e,t,r=0,n="",s=arguments.length;r<s;r++)(e=arguments[r])&&(t=mx(e))&&(n&&(n+=" "),n+=t);return n}const jg=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ag=gx,nu=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return Ag(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 d=r==null?void 0:r[c],f=o==null?void 0:o[c];if(d===null)return null;const h=jg(d)||jg(f);return s[c][h]}),a=r&&Object.entries(r).reduce((c,d)=>{let[f,h]=d;return h===void 0||(c[f]=h),c},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((c,d)=>{let{class:f,className:h,...v}=d;return Object.entries(v).every(w=>{let[m,b]=w;return Array.isArray(b)?b.includes({...o,...a}[m]):{...o,...a}[m]===b})?[...c,f,h]:c},[]);return Ag(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 zT=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),vx=(...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 WT={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 HT=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:o,iconNode:i,...a},l)=>p.createElement("svg",{ref:l,...WT,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:vx("lucide",s),...a},[...i.map(([c,d])=>p.createElement(c,d)),...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 ve=(e,t)=>{const r=p.forwardRef(({className:n,...s},o)=>p.createElement(HT,{ref:o,iconNode:t,className:vx(`lucide-${zT(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 yx=ve("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 Df=ve("Calendar",[["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"}]]);/** 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 Ep=ve("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 wx=ve("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 Lf=ve("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** 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 $f=ve("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** 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 VT=ve("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** 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 qT=ve("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 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 cr=ve("Dumbbell",[["path",{d:"M14.4 14.4 9.6 9.6",key:"ic80wn"}],["path",{d:"M18.657 21.485a2 2 0 1 1-2.829-2.828l-1.767 1.768a2 2 0 1 1-2.829-2.829l6.364-6.364a2 2 0 1 1 2.829 2.829l-1.768 1.767a2 2 0 1 1 2.828 2.829z",key:"nnl7wr"}],["path",{d:"m21.5 21.5-1.4-1.4",key:"1f1ice"}],["path",{d:"M3.9 3.9 2.5 2.5",key:"1evmna"}],["path",{d:"M6.404 12.768a2 2 0 1 1-2.829-2.829l1.768-1.767a2 2 0 1 1-2.828-2.829l2.828-2.828a2 2 0 1 1 2.829 2.828l1.767-1.768a2 2 0 1 1 2.829 2.829z",key:"yhosts"}]]);/** 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 KT=ve("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/** 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 GT=ve("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 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 YT=ve("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/** 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 JT=ve("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/** 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 QT=ve("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/** 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 XT=ve("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/** 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 oa=ve("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** 141 * @license lucide-react v0.462.0 - ISC 142 * 143 * This source code is licensed under the ISC license. 144 * See the LICENSE file in the root directory of this source tree. 145 */const Uo=ve("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** 146 * @license lucide-react v0.462.0 - ISC 147 * 148 * This source code is licensed under the ISC license. 149 * See the LICENSE file in the root directory of this source tree. 150 */const ZT=ve("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** 151 * @license lucide-react v0.462.0 - ISC 152 * 153 * This source code is licensed under the ISC license. 154 * See the LICENSE file in the root directory of this source tree. 155 */const xx=ve("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** 156 * @license lucide-react v0.462.0 - ISC 157 * 158 * This source code is licensed under the ISC license. 159 * See the LICENSE file in the root directory of this source tree. 160 */const eN=ve("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** 161 * @license lucide-react v0.462.0 - ISC 162 * 163 * This source code is licensed under the ISC license. 164 * See the LICENSE file in the root directory of this source tree. 165 */const tN=ve("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/** 166 * @license lucide-react v0.462.0 - ISC 167 * 168 * This source code is licensed under the ISC license. 169 * See the LICENSE file in the root directory of this source tree. 170 */const rN=ve("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** 171 * @license lucide-react v0.462.0 - ISC 172 * 173 * This source code is licensed under the ISC license. 174 * See the LICENSE file in the root directory of this source tree. 175 */const Og=ve("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/** 176 * @license lucide-react v0.462.0 - ISC 177 * 178 * This source code is licensed under the ISC license. 179 * See the LICENSE file in the root directory of this source tree.
vendor: 8,760 bytes, lines 180-215
180 */const _p=ve("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/** 181 * @license lucide-react v0.462.0 - ISC 182 * 183 * This source code is licensed under the ISC license. 184 * See the LICENSE file in the root directory of this source tree. 185 */const nN=ve("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** 186 * @license lucide-react v0.462.0 - ISC 187 * 188 * This source code is licensed under the ISC license. 189 * See the LICENSE file in the root directory of this source tree. 190 */const Ig=ve("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** 191 * @license lucide-react v0.462.0 - ISC 192 * 193 * This source code is licensed under the ISC license. 194 * See the LICENSE file in the root directory of this source tree. 195 */const Dg=ve("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/** 196 * @license lucide-react v0.462.0 - ISC 197 * 198 * This source code is licensed under the ISC license. 199 * See the LICENSE file in the root directory of this source tree. 200 */const su=ve("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** 201 * @license lucide-react v0.462.0 - ISC 202 * 203 * This source code is licensed under the ISC license. 204 * See the LICENSE file in the root directory of this source tree. 205 */const sN=ve("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** 206 * @license lucide-react v0.462.0 - ISC 207 * 208 * This source code is licensed under the ISC license. 209 * See the LICENSE file in the root directory of this source tree. 210 */const ou=ve("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** 211 * @license lucide-react v0.462.0 - ISC 212 * 213 * This source code is licensed under the ISC license. 214 * See the LICENSE file in the root directory of this source tree. 215 */const Lg=ve("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Cp="-",oN=e=>{const t=aN(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{const a=i.split(Cp);return a[0]===""&&a.length!==1&&a.shift(),bx(a,t)||iN(i)},getConflictingClassGroupIds:(i,a)=>{const l=r[i]||[];return a&&n[i]?[...l,...n[i]]:l}}},bx=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),s=n?bx(e.slice(1),n):void 0;if(s)return s;if(t.validators.length===0)return;const o=e.join(Cp);return(i=t.validators.find(({validator:a})=>a(o)))==null?void 0:i.classGroupId},$g=/^\[(.+)\]$/,iN=e=>{if($g.test(e)){const t=$g.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},aN=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return cN(Object.entries(e.classGroups),r).forEach(([o,i])=>{Mf(i,n,o,t)}),n},Mf=(e,t,r,n)=>{e.forEach(s=>{if(typeof s=="string"){const o=s===""?t:Mg(t,s);o.classGroupId=r;return}if(typeof s=="function"){if(lN(s)){Mf(s(n),t,r,n);return}t.validators.push({validator:s,classGroupId:r});return}Object.entries(s).forEach(([o,i])=>{Mf(i,Mg(t,o),r,n)})})},Mg=(e,t)=>{let r=e;return t.split(Cp).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},lN=e=>e.isThemeGetter,cN=(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,uN=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)}}},Sx="!",dN=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,s=t[0],o=t.length,i=a=>{const l=[];let c=0,d=0,f;for(let b=0;b<a.length;b++){let g=a[b];if(c===0){if(g===s&&(n||a.slice(b,b+o)===t)){l.push(a.slice(d,b)),d=b+o;continue}if(g==="/"){f=b;continue}}g==="["?c++:g==="]"&&c--}const h=l.length===0?a:a.substring(d),v=h.startsWith(Sx),w=v?h.substring(1):h,m=f&&f>d?f-d:void 0;return{modifiers:l,hasImportantModifier:v,baseClassName:w,maybePostfixModifierPosition:m}};return r?a=>r({className:a,parseClassName:i}):i},fN=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},hN=e=>({cache:uN(e.cacheSize),parseClassName:dN(e),...oN(e)}),pN=/\s+/,mN=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:s}=t,o=[],i=e.trim().split(pN);let a="";for(let l=i.length-1;l>=0;l-=1){const c=i[l],{modifiers:d,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:v}=r(c);let w=!!v,m=n(w?h.substring(0,v):h);if(!m){if(!w){a=c+(a.length>0?" "+a:a);continue}if(m=n(h),!m){a=c+(a.length>0?" "+a:a);continue}w=!1}const b=fN(d).join(":"),g=f?b+Sx:b,y=g+m;if(o.includes(y))continue;o.push(y);const x=s(m,w);for(let S=0;S<x.length;++S){const E=x[S];o.push(g+E)}a=c+(a.length>0?" "+a:a)}return a};function gN(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Ex(t))&&(n&&(n+=" "),n+=r);return n}const Ex=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Ex(e[n]))&&(r&&(r+=" "),r+=t);return r};function vN(e,...t){let r,n,s,o=i;function i(l){const c=t.reduce((d,f)=>f(d),e());return r=hN(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 d=mN(l,r);return s(l,d),d}return function(){return o(gN.apply(null,arguments))}}const je=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},_x=/^\[(?:([a-z-]+):)?(.+)\]$/i,yN=/^\d+\/\d+$/,wN=new Set(["px","full","screen"]),xN=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,bN=/\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$/,SN=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,EN=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_N=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Mr=e=>vo(e)||wN.has(e)||yN.test(e),ln=e=>Yo(e,"length",AN),vo=e=>!!e&&!Number.isNaN(Number(e)),gd=e=>Yo(e,"number",vo),gi=e=>!!e&&Number.isInteger(Number(e)),CN=e=>e.endsWith("%")&&vo(e.slice(0,-1)),de=e=>_x.test(e),cn=e=>xN.test(e),kN=new Set(["length","size","percentage"]),TN=e=>Yo(e,kN,Cx),NN=e=>Yo(e,"position",Cx),PN=new Set(["image","url"]),RN=e=>Yo(e,PN,IN),jN=e=>Yo(e,"",ON),vi=()=>!0,Yo=(e,t,r)=>{const n=_x.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},AN=e=>bN.test(e)&&!SN.test(e),Cx=()=>!1,ON=e=>EN.test(e),IN=e=>_N.test(e),DN=()=>{const e=je("colors"),t=je("spacing"),r=je("blur"),n=je("brightness"),s=je("borderColor"),o=je("borderRadius"),i=je("borderSpacing"),a=je("borderWidth"),l=je("contrast"),c=je("grayscale"),d=je("hueRotate"),f=je("invert"),h=je("gap"),v=je("gradientColorStops"),w=je("gradientColorStopPositions"),m=je("inset"),b=je("margin"),g=je("opacity"),y=je("padding"),x=je("saturate"),S=je("scale"),E=je("sepia"),C=je("skew"),_=je("space"),k=je("translate"),N=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto",de,t],T=()=>[de,t],A=()=>["",Mr,ln],L=()=>["auto",vo,de],W=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],H=()=>["solid","dashed","dotted","double","none"],ee=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],P=()=>["start","end","center","between","around","evenly","stretch"],$=()=>["","0",de],K=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>[vo,de];return{cacheSize:500,separator:":",theme:{colors:[vi],spacing:[Mr,ln],blur:["none","",cn,de],brightness:B(),borderColor:[e],borderRadius:["n
215one","","full",cn,de],borderSpacing:T(),borderWidth:A(),contrast:B(),grayscale:$(),hueRotate:B(),invert:$(),gap:T(),gradientColorStops:[e],gradientColorStopPositions:[CN,ln],inset:R(),margin:R(),opacity:B(),padding:T(),saturate:B(),scale:B(),sepia:$(),skew:B(),space:T(),translate:T()},classGroups:{aspect:[{aspect:["auto","square","video",de]}],container:["container"],columns:[{columns:[cn]}],"break-after":[{"break-after":K()}],"break-before":[{"break-before":K()}],"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:[...W(),de]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",gi,de]}],basis:[{basis:R()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",de]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",gi,de]}],"grid-cols":[{"grid-cols":[vi]}],"col-start-end":[{col:["auto",{span:["full",gi,de]},de]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[vi]}],"row-start-end":[{row:["auto",{span:[gi,de]},de]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",de]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",de]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...P()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...P(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...P(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],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":[_]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[_]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",de,t]}],"min-w":[{"min-w":[de,t,"min","max","fit"]}],"max-w":[{"max-w":[de,t,"none","full","min","max","fit","prose",{screen:[cn]},cn]}],h:[{h:[de,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[de,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[de,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[de,t,"auto","min","max","fit"]}],"font-size":[{text:["base",cn,ln]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",gd]}],"font-family":[{font:[vi]}],"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-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",de]}],"line-clamp":[{"line-clamp":["none",vo,gd]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Mr,de]}],"list-image":[{"list-image":["none",de]}],"list-style-type":[{list:["none","disc","decimal",de]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...H(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Mr,ln]}],"underline-offset":[{"underline-offset":["auto",Mr,de]}],"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:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",de]}],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",de]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...W(),NN]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",TN]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},RN]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[w]}
vendor: 5,110 bytes, line 215
215],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],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":[g]}],"border-style":[{border:[...H(),"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":[g]}],"divide-style":[{divide:H()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[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:["",...H()]}],"outline-offset":[{"outline-offset":[Mr,de]}],"outline-w":[{outline:[Mr,ln]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:A()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[Mr,ln]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",cn,jN]}],"shadow-color":[{shadow:[vi]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...ee(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ee()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",cn,de]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[x]}],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":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"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",de]}],duration:[{duration:B()}],ease:[{ease:["linear","in","out","in-out",de]}],delay:[{delay:B()}],animate:[{animate:["none","spin","ping","pulse","bounce",de]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[gi,de]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",de]}],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",de]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"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,613 bytes, line 215
215],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",de]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Mr,ln,gd]}],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-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"]}}},LN=vN(DN);function ie(...e){return LN(gx(e))}const $N=BT,kx=p.forwardRef(({className:e,...t},r)=>u.jsx(cx,{ref:r,className:ie("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}));kx.displayName=cx.displayName;const MN=nu("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"}}),Tx=p.forwardRef(({className:e,variant:t,...r},n)=>u.jsx(ux,{ref:n,className:ie(MN({variant:t}),e),...r}));Tx.displayName=ux.displayName;const FN=p.forwardRef(({className:e,...t},r)=>u.jsx(hx,{ref:r,className:ie("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 hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));FN.displayName=hx.displayName;const Nx=p.forwardRef(({className:e,...t},r)=>u.jsx(px,{ref:r,className:ie("absolute right-2 top-2 rounded-md p-1 text-foreground
215/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:u.jsx(ou,{className:"h-4 w-4"})}));Nx.displayName=px.displayName;const Px=p.forwardRef(({className:e,...t},r)=>u.jsx(dx,{ref:r,className:ie("text-sm font-semibold",e),...t}));Px.displayName=dx.displayName;const Rx=p.forwardRef(({className:e,...t},r)=>u.jsx(fx,{ref:r,className:ie("text-sm opacity-90",e),...t}));Rx.displayName=fx.displayName;function UN(){const{toasts:e}=W0();return u.jsxs($N,{children:[e.map(function({id:t,title:r,description:n,action:s,...o}){return u.jsxs(Tx,{...o,children:[u.jsxs("div",{className:"grid gap-1",children:[r&&u.jsx(Px,{children:r}),n&&u.jsx(Rx,{children:n})]}),s,u.jsx(Nx,{})]},t)}),u.jsx(kx,{})]})}var Fg=["light","dark"],BN="(prefers-color-scheme: dark)",zN=p.createContext(void 0),WN={setTheme:e=>{},themes:[]},HN=()=>{var e;return(e=p.useContext(zN))!=null?e:WN};p.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:n,enableColorScheme:s,defaultTheme:o,value:i,attrs:a,nonce:l})=>{let c=o==="system",d=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(w=>`'${w}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,f=s?Fg.includes(o)&&o?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${o}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",h=(w,m=!1,b=!0)=>{let g=i?i[w]:w,y=m?w+"|| ''":`'${g}'`,x="";return s&&b&&!m&&Fg.includes(w)&&(x+=`d.style.colorScheme = '${w}';`),r==="class"?m||g?x+=`c.add(${y})`:x+="null":g&&(x+=`d[s](n,${y})`),x},v=e?`!function(){${d}${h(e)}}()`:n?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${c})){var t='${BN}',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)+"}"}${f}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${i?`var x=${JSON.stringify(i)};`:""}${h(i?"x[e]":"e",!0)}}else{${h(o,!1,!1)};}${f}}catch(t){}}();`;return p.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:v}})});var VN=e=>{switch(e){case"success":return GN;case"info":return JN;case"warning":return YN;case"error":return QN;default:return null}},qN=Array(12).fill(0),KN=({visible:e})=>z.createElement("div",{className:"sonner-loading-wrapper","data-visible":e},z.createElement("div",{className:"sonner-spinner"},qN.map((t,r)=>z.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),GN=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},z.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"})),YN=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},z.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"})),JN=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},z.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"})),QN=z.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},z.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"})),XN=()=>{let[e,t]=z.useState(document.hidden);return z.useEffect(()=>{let r=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),e},Ff=1,ZN=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>
215{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:Ff++,o=this.toasts.find(a=>a.id===s),i=e.dismissible===void 0?!0:e.dismissible;return 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=>(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)=>this.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;return n.then(async o=>{if(tP(o)&&!o.ok){s=!1;let i=typeof t.error=="function"?await t.error(`HTTP error! status: ${o.status}`):t.error,a=typeof t.description=="function"?await t.description(`HTTP error! status: ${o.status}`):t.description;this.create({id:r,type:"error",message:i,description:a})}else if(t.success!==void 0){s=!1;let i=typeof t.success=="function"?await t.success(o):t.success,a=typeof t.description=="function"?await t.description(o):t.description;this.create({id:r,type:"success",message:i,description:a})}}).catch(async o=>{if(t.error!==void 0){s=!1;let i=typeof t.error=="function"?await t.error(o):t.error,a=typeof t.description=="function"?await t.description(o):t.description;this.create({id:r,type:"error",message:i,description:a})}}).finally(()=>{var o;s&&(this.dismiss(r),r=void 0),(o=t.finally)==null||o.call(t)}),r},this.custom=(e,t)=>{let r=(t==null?void 0:t.id)||Ff++;return this.create({jsx:e(r),id:r,...t}),r},this.subscribers=[],this.toasts=[]}},At=new ZN,eP=(e,t)=>{let r=(t==null?void 0:t.id)||Ff++;return At.addToast({title:e,...t,id:r}),r},tP=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",rP=eP,nP=()=>At.toasts,xe=Object.assign(rP,{success:At.success,info:At.info,warning:At.warning,error:At.error,custom:At.custom,message:At.message,promise:At.promise,dismiss:At.dismiss,loading:At.loading},{getHistory:nP});function sP(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))}sP(`: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}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-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;
215left: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;background:var(--gray1);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}: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:0;right:0;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}
215: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, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);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-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-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%)} 216`);function dl(e){return e.label!==void 0}var oP=3,iP="32px",aP=4e3,lP=356,cP=14,uP=20,dP=200;function fP(...e){return e.filter(Boolean).join(" ")}var hP=e=>{var t,r,n,s,o,i,a,l,c,d;let{invert:f,toast:h,unstyled:v,interacting:w,setHeights:m,visibleToasts:b,heights:g,index:y,toasts:x,expanded:S,removeToast:E,defaultRichColors:C,closeButton:_,style:k,cancelButtonStyle:N,actionButtonStyle:j,className:R="",descriptionClassName:T="",duration:A,position:L,gap:W,loadingIcon:H,expandByDefault:ee,classNames:P,icons:$,closeButtonAriaLabel:K="Close toast",pauseWhenPageIsHidden:B,cn:Y}=e,[ae,ue]=z.useState(!1),[_e,O]=z.useState(!1),[I,U]=z.useState(!1),[Z,ne]=z.useState(!1),[Q,M]=z.useState(0),[te,se]=z.useState(0),he=z.useRef(null),ye=z.useRef(null),Ke=y===0,lt=y+1<=b,ge=h.type,ct=h.dismissible!==!1,Jn=h.className||"",ri=h.descriptionClassName||"",on=z.useMemo(()=>g.findIndex(ce=>ce.toastId===h.id)||0,[g,h.id]),za=z.useMemo(()=>{var ce;return(ce=h.closeButton)!=null?ce:_},[h.closeButton,_]),ni=z.useMemo(()=>h.duration||A||aP,[h.duration,A]),si=z.useRef(0),$r=z.useRef(0),Wa=z.useRef(0),br=z.useRef(null),[Zt,oi]=L.split("-"),As=z.useMemo(()=>g.reduce((ce,Ce,be)=>be>=on?ce:ce+Ce.height,0),[g,on]),Qn=XN(),ii=h.invert||f,ai=ge==="loading";$r.current=z.useMemo(()=>on*W+As,[on,As]),z.useEffect(()=>{ue(!0)},[]),z.useLayoutEffect(()=>{if(!ae)return;let ce=ye.current,Ce=ce.style.height;ce.style.height="auto";let be=ce.getBoundingClientRect().height;ce.style.height=Ce,se(be),m(Pt=>Pt.find(Rt=>Rt.toastId===h.id)?Pt.map(Rt=>Rt.toastId===h.id?{...Rt,height:be}:Rt):[{toastId:h.id,height:be,position:h.position},...Pt])},[ae,h.title,h.description,m,h.id]);let Sr=z.useCallback(()=>{O(!0),M($r.current),m(ce=>ce.filter(Ce=>Ce.toastId!==h.id)),setTimeout(()=>{E(h)},dP)},[h,E,m,$r]);z.useEffect(()=>{if(h.promise&&ge==="loading"||h.duration===1/0||h.type==="loading")return;let ce,Ce=ni;return S||w||B&&Qn?(()=>{if(Wa.current<si.current){let be=new Date().getTime()-si.current;Ce=Ce-be}
216Wa.current=new Date().getTime()})():Ce!==1/0&&(si.current=new Date().getTime(),ce=setTimeout(()=>{var be;(be=h.onAutoClose)==null||be.call(h,h),Sr()},Ce)),()=>clearTimeout(ce)},[S,w,ee,h,ni,Sr,h.promise,ge,B,Qn]),z.useEffect(()=>{let ce=ye.current;if(ce){let Ce=ce.getBoundingClientRect().height;return se(Ce),m(be=>[{toastId:h.id,height:Ce,position:h.position},...be]),()=>m(be=>be.filter(Pt=>Pt.toastId!==h.id))}},[m,h.id]),z.useEffect(()=>{h.delete&&Sr()},[Sr,h.delete]);function Fu(){return $!=null&&$.loading?z.createElement("div",{className:"sonner-loader","data-visible":ge==="loading"},$.loading):H?z.createElement("div",{className:"sonner-loader","data-visible":ge==="loading"},H):z.createElement(KN,{visible:ge==="loading"})}return z.createElement("li",{"aria-live":h.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:ye,className:Y(R,Jn,P==null?void 0:P.toast,(t=h==null?void 0:h.classNames)==null?void 0:t.toast,P==null?void 0:P.default,P==null?void 0:P[ge],(r=h==null?void 0:h.classNames)==null?void 0:r[ge]),"data-sonner-toast":"","data-rich-colors":(n=h.richColors)!=null?n:C,"data-styled":!(h.jsx||h.unstyled||v),"data-mounted":ae,"data-promise":!!h.promise,"data-removed":_e,"data-visible":lt,"data-y-position":Zt,"data-x-position":oi,"data-index":y,"data-front":Ke,"data-swiping":I,"data-dismissible":ct,"data-type":ge,"data-invert":ii,"data-swipe-out":Z,"data-expanded":!!(S||ee&&ae),style:{"--index":y,"--toasts-before":y,"--z-index":x.length-y,"--offset":`${_e?Q:$r.current}px`,"--initial-height":ee?"auto":`${te}px`,...k,...h.style},onPointerDown:ce=>{ai||!ct||(he.current=new Date,M($r.current),ce.target.setPointerCapture(ce.pointerId),ce.target.tagName!=="BUTTON"&&(U(!0),br.current={x:ce.clientX,y:ce.clientY}))},onPointerUp:()=>{var ce,Ce,be,Pt;if(Z||!ct)return;br.current=null;let Rt=Number(((ce=ye.current)==null?void 0:ce.style.getPropertyValue("--swipe-amount").replace("px",""))||0),Os=new Date().getTime()-((Ce=he.current)==null?void 0:Ce.getTime()),Ha=Math.abs(Rt)/Os;if(Math.abs(Rt)>=uP||Ha>.11){M($r.current),(be=h.onDismiss)==null||be.call(h,h),Sr(),ne(!0);return}(Pt=ye.current)==null||Pt.style.setProperty("--swipe-amount","0px"),U(!1)},onPointerMove:ce=>{var Ce;if(!br.current||!ct)return;let be=ce.clientY-br.current.y,Pt=ce.clientX-br.current.x,Rt=(Zt==="top"?Math.min:Math.max)(0,be),Os=ce.pointerType==="touch"?10:2;Math.abs(Rt)>Os?(Ce=ye.current)==null||Ce.style.setProperty("--swipe-amount",`${be}px`):Math.abs(Pt)>Os&&(br.current=null)}},za&&!h.jsx?z.createElement("button",{"aria-label":K,"data-disabled":ai,"data-close-button":!0,onClick:ai||!ct?()=>{}:()=>{var ce;Sr(),(ce=h.onDismiss)==null||ce.call(h,h)},className:Y(P==null?void 0:P.closeButton,(s=h==null?void 0:h.classNames)==null?void 0:s.closeButton)},z.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"},z.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),z.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,h.jsx||z.isValidElement(h.title)?h.jsx||h.title:z.createElement(z.Fragment,null,ge||h.icon||h.promise?z.createElement("div",{"data-icon":"",className:Y(P==null?void 0:P.icon,(o=h==null?void 0:h.classNames)==null?void 0:o.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||Fu():null,h.type!=="loading"?h.icon||($==null?void 0:$[ge])||VN(ge):null):null,z.createElement("div",{"data-content":"",className:Y(P==null?void 0:P.content,(i=h==null?void 0:h.classNames)==null?void 0:i.content)},z.createElement("div",{"data-title":"",className:Y(P==null?void 0:P.title,(a=h==null?void 0:h.classNames)==null?void 0:a.title)},h.title),h.description?z.createElement("div",{"data-description":"",className:Y(T,ri,P==null?void 0:P.description,(l=h==null?void 0:h.classNames)==null?void 0:l.description)},h.description):null),z.isValidElement(h.cancel)?h.cancel:h.cancel&&dl(h.cancel)?z.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||N,onClick:ce=>{var Ce,be;dl(h.cancel)&&ct&&((be=(Ce=h.cancel).onClick)==null||be.call(Ce,ce),Sr())},className:Y(P==null?void 0:P.cancelButton,(c=h==null?void 0:h.classNames)==null?void 0:c.cancelButton)},h.cancel.label):null,z.isValidElement(h.action)?h.action:h.action&&dl(h.action)?z.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||j,onClick:ce=>{var Ce,be;dl(h.action)&&(ce.defaultPrevented||((be=(Ce=h.action).onClick)==null||be.call(Ce,ce),Sr()))},className:Y(P==null?void 0:P.actionButton,(d=h==null?void 0:h.classNames)==null?void 0:d.actionButton)},h.action.label):null))};function Ug(){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}var pP=e=>{let{invert:t,position:r="bottom-right",hotkey:n=["altKey","KeyT"],expand:s,closeButton:o,className:i,offset:a,theme:l="light",richColors:c,duration:d,style:f,visibleToasts:h=oP,toastOptions:v,dir:w=Ug(),gap:m=cP,loadingIcon:b,icons:g,containerAriaLabel:y="Notifications",pauseWhenPageIsHidden:x,cn:S=fP}=e,[E,C]=z.useState([]),_=z.useMemo(()=>
216Array.from(new Set([r].concat(E.filter(B=>B.position).map(B=>B.position)))),[E,r]),[k,N]=z.useState([]),[j,R]=z.useState(!1),[T,A]=z.useState(!1),[L,W]=z.useState(l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=z.useRef(null),ee=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=z.useRef(null),$=z.useRef(!1),K=z.useCallback(B=>{var Y;(Y=E.find(ae=>ae.id===B.id))!=null&&Y.delete||At.dismiss(B.id),C(ae=>ae.filter(({id:ue})=>ue!==B.id))},[E]);return z.useEffect(()=>At.subscribe(B=>{if(B.dismiss){C(Y=>Y.map(ae=>ae.id===B.id?{...ae,delete:!0}:ae));return}setTimeout(()=>{Pa.flushSync(()=>{C(Y=>{let ae=Y.findIndex(ue=>ue.id===B.id);return ae!==-1?[...Y.slice(0,ae),{...Y[ae],...B},...Y.slice(ae+1)]:[B,...Y]})})})}),[]),z.useEffect(()=>{if(l!=="system"){W(l);return}l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?W("dark"):W("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:B})=>{W(B?"dark":"light")})},[l]),z.useEffect(()=>{E.length<=1&&R(!1)},[E]),z.useEffect(()=>{let B=Y=>{var ae,ue;n.every(_e=>Y[_e]||Y.code===_e)&&(R(!0),(ae=H.current)==null||ae.focus()),Y.code==="Escape"&&(document.activeElement===H.current||(ue=H.current)!=null&&ue.contains(document.activeElement))&&R(!1)};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[n]),z.useEffect(()=>{if(H.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,$.current=!1)}},[H.current]),E.length?z.createElement("section",{"aria-label":`${y} ${ee}`,tabIndex:-1},_.map((B,Y)=>{var ae;let[ue,_e]=B.split("-");return z.createElement("ol",{key:B,dir:w==="auto"?Ug():w,tabIndex:-1,ref:H,className:i,"data-sonner-toaster":!0,"data-theme":L,"data-y-position":ue,"data-x-position":_e,style:{"--front-toast-height":`${((ae=k[0])==null?void 0:ae.height)||0}px`,"--offset":typeof a=="number"?`${a}px`:a||iP,"--width":`${lP}px`,"--gap":`${m}px`,...f},onBlur:O=>{$.current&&!O.currentTarget.contains(O.relatedTarget)&&($.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:O=>{O.target instanceof HTMLElement&&O.target.dataset.dismissible==="false"||$.current||($.current=!0,P.current=O.relatedTarget)},onMouseEnter:()=>R(!0),onMouseMove:()=>R(!0),onMouseLeave:()=>{T||R(!1)},onPointerDown:O=>{O.target instanceof HTMLElement&&O.target.dataset.dismissible==="false"||A(!0)},onPointerUp:()=>A(!1)},E.filter(O=>!O.position&&Y===0||O.position===B).map((O,I)=>{var U,Z;return z.createElement(hP,{key:O.id,icons:g,index:I,toast:O,defaultRichColors:c,duration:(U=v==null?void 0:v.duration)!=null?U:d,className:v==null?void 0:v.className,descriptionClassName:v==null?void 0:v.descriptionClassName,invert:t,visibleToasts:h,closeButton:(Z=v==null?void 0:v.closeButton)!=null?Z:o,interacting:T,position:B,style:v==null?void 0:v.style,unstyled:v==null?void 0:v.unstyled,classNames:v==null?void 0:v.classNames,cancelButtonStyle:v==null?void 0:v.cancelButtonStyle,actionButtonStyle:v==null?void 0:v.actionButtonStyle,removeToast:K,toasts:E.filter(ne=>ne.position==O.position),heights:k.filter(ne=>ne.position==O.position),setHeights:N,expandByDefault:s,gap:m,loadingIcon:b,expanded:j,pauseWhenPageIsHidden:x,cn:S})}))})):null};const mP=({...e})=>{const{theme:t="system"}=HN();return u.jsx(pP,{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})};function gP(e,t=[]){let r=[];function n(o,i){const a=p.createContext(i),l=r.length;r=[...r,i];const c=f=>{var g;const{scope:h,children:v,...w}=f,m=((g=h==null?void 0:h[e])==null?void 0:g[l])||a,b=p.useMemo(()=>w,Object.values(w));return u.jsx(m.Provider,{value:b,children:v})};c.displayName=o+"Provider";function d(f,h){var m;const v=((m=h==null?void 0:h[e])==null?void 0:m[l])||a,w=p.useContext(v);if(w)return w;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${o}\``)}return[c,d]}const s=()=>{const o=r.map(i=>p.createContext(i));return function(a){const l=(a==null?void 0:a[e])||o;return p.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return s.scopeName=e,[n,vP(s,...t)]}function vP(...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}
vendor: 15,519 bytes, line 216
216)=>{const f=l(o)[`__scope${c}`];return{...a,...f}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}var yP="DismissableLayer",Uf="dismissableLayer.update",wP="dismissableLayer.pointerDownOutside",xP="dismissableLayer.focusOutside",Bg,jx=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),kp=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:a,...l}=e,c=p.useContext(jx),[d,f]=p.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=p.useState({}),w=le(t,_=>f(_)),m=Array.from(c.layers),[b]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=m.indexOf(b),y=d?m.indexOf(d):-1,x=c.layersWithOutsidePointerEventsDisabled.size>0,S=y>=g,E=EP(_=>{const k=_.target,N=[...c.branches].some(j=>j.contains(k));!S||N||(s==null||s(_),i==null||i(_),_.defaultPrevented||a==null||a())},h),C=_P(_=>{const k=_.target;[...c.branches].some(j=>j.contains(k))||(o==null||o(_),i==null||i(_),_.defaultPrevented||a==null||a())},h);return eu(_=>{y===c.layers.size-1&&(n==null||n(_),!_.defaultPrevented&&a&&(_.preventDefault(),a()))},h),p.useEffect(()=>{if(d)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Bg=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),zg(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Bg)}},[d,h,r,c]),p.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),zg())},[d,c]),p.useEffect(()=>{const _=()=>v({});return document.addEventListener(Uf,_),()=>document.removeEventListener(Uf,_)},[]),u.jsx(X.div,{...l,ref:w,style:{pointerEvents:x?S?"auto":"none":void 0,...e.style},onFocusCapture:q(e.onFocusCapture,C.onFocusCapture),onBlurCapture:q(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:q(e.onPointerDownCapture,E.onPointerDownCapture)})});kp.displayName=yP;var bP="DismissableLayerBranch",SP=p.forwardRef((e,t)=>{const r=p.useContext(jx),n=p.useRef(null),s=le(t,n);return p.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),u.jsx(X.div,{...e,ref:s})});SP.displayName=bP;function EP(e,t=globalThis==null?void 0:globalThis.document){const r=ke(e),n=p.useRef(!1),s=p.useRef(()=>{});return p.useEffect(()=>{const o=a=>{if(a.target&&!n.current){let l=function(){Ax(wP,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 _P(e,t=globalThis==null?void 0:globalThis.document){const r=ke(e),n=p.useRef(!1);return p.useEffect(()=>{const s=o=>{o.target&&!n.current&&Ax(xP,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 zg(){const e=new CustomEvent(Uf);document.dispatchEvent(e)}function Ax(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?Ra(s,o):s.dispatchEvent(o)}var CP=Fy.useId||(()=>{}),kP=0;function fr(e){const[t,r]=p.useState(CP());return $e(()=>{e||r(n=>n??String(kP++))},[e]),e||(t?`radix-${t}`:"")}const TP=["top","right","bottom","left"],Un=Math.min,It=Math.max,yc=Math.round,fl=Math.floor,Bn=e=>({x:e,y:e}),NP={left:"right",right:"left",bottom:"top",top:"bottom"},PP={start:"end",end:"start"};function Bf(e,t,r){return It(e,Un(t,r))}function en(e,t){return typeof e=="function"?e(t):e}function tn(e){return e.split("-")[0]}function Jo(e){return e.split("-")[1]}function Tp(e){return e==="x"?"y":"x"}function Np(e){return e==="y"?"height":"width"}function zn(e){return["top","bottom"].includes(tn(e))?"y":"x"}function Pp(e){return Tp(zn(e))}function RP(e,t,r){r===void 0&&(r=!1);const n=Jo(e),s=Pp(e),o=Np(s);let i=s==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=wc(i)),[i,wc(i)]}function jP(e){const t=wc(e);return[zf(e),t,zf(t)]}function zf(e){return e.replace(/start|end/g,t=>PP[t])}function AP(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 OP(e,t,r,n){const s=Jo(e);let o=AP(tn(e),r==="start",n);return s&&(o=o.map(i=>i+"-"+s),t&&(o=o.concat(o.map(zf)))),o}function wc(e){return e.replace(/left|right|bottom|top/g,t=>NP[t])}function IP(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ox(e){return typeof e!="number"?IP(e):{top:e,right:e,bottom:e,left:e}}function xc(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 Wg(e,t,r){let{reference:n,floating:s}=e;const o=zn(t),i=Pp(t),a=Np(i),l=tn(t),c=o==="y",d=n.x+n.width/2-s.width/2,f=n.y+n.height/2-s.height/2,h=n[a]/2-s[a]/2;let v;switch(l){case"top":v={x:d,y:n.y-s.height};break;case"bottom":v={x:d,y:n.y+n.height};break;case"right":v={x:n.x+n.width,y:f};break;case"left":v={x:n.x-s.width,y:f};break;default:v={x:n.x,y:n.y}}switch(Jo(t)){case"start":v[i]-=h*(r&&c?-1:1);break;case"end":v[i]+=h*(r&&c?-1:1);break}return v}const DP=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:d,y:f}=Wg(c,n,l),h=n,v={},w=0;for(let m=0;m<a.length;m++){const{name:b,fn:g}=a[m],{x:y,y:x,data:S,reset:E}=await g({x:d,y:f,initialPlacement:n,placement:h,strategy:s,middlewareData:v,rects:c,platform:i,elements:{reference:e,floating:t}});d=y??d,f=x??f,v={...v,[b]:{...v[b],...S}},E&&w<=50&&(w++,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:d,y:f}=Wg(c,h,l)),m=-1)}return{x:d,y:f,placement:h,strategy:s,middlewareData:v}};async function ia(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:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:v=0}=en(t,e),w=Ox(v),b=a[h?f==="floating"?"reference":"floating":f],g=xc(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:d,strategy:l})),y=f==="floating"?{x:n,y:s,width:i.floating.width,height:i.floating.height}:i.reference,x=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),S=await(o.isElement==null?void 0:o.isElement(x))?await(o.getScale==null?void 0:o.getScale(x))||{x:1,y:1}:{x:1,y:1},E=xc(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:x,strategy:l}):y);return{top:(g.top-E.top+w.top)/S.y,bottom:(E.bottom-g.bottom+w.bottom)/S.y,left:(g.left-E.left+w.left)/S.x,right:(E.right-g.right+w.right)/S.x}}const LP=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:d=0}=en(e,t)||{};if(c==null)return{};const f=Ox(d),h={x:r,y:n},v=Pp(s),w=Np(v),m=await i.getDimensions(c),b=v==="y",g=b?"top":"left",y=b?"bottom":"right",x=b?"clientHeight":"clientWidth",S=o.reference[w]+o.reference[v]-h[v]-o.floating[w],E=h[v]-o.reference[v],C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let _=C?C[x]:0;(!_||!await(i.isElement==null?void 0:i.isElement(C)))&&(_=a.floating[x]||o.floating[w]);const k=S/2-E/2,N=_/2-m[w]/2-1,j=Un(f[g],N),R=Un(f[y],N),T=j,A=_-m[w]-R,L=_/2-m[w]/2+k,W=Bf(T,L,A),H=!l.arrow&&Jo(s)!=null&&L!==W&&o.reference[w]/2-(L<T?j:R)-m[w]/2<0,ee=H?L<T?L-T:L-A:0;return{[v]:h[v]+ee,data:{[v]:W,centerOffset:L-W-ee,...H&&{alignmentOffset:ee}},reset:H}}}),$P=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:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:m=!0,...b}=en(e,t);if((r=o.arrow)!=null&&r.alignmentOffset)return{};const g=tn(s),y=zn(a),x=tn(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),E=h||(x||!m?[wc(a)]:jP(a)),C=w!=="none";!h&&C&&E.push(...OP(a,m,w,S));const _=[a,...E],k=await ia(t,b),N=[];let j=((n=o.flip)==null?void 0:n.overflows)||[];if(d&&N.push(k[g]),f){const L=RP(s,i,S);N.push(k[L[0]],k[L[1]])}if(j=[...j,{placement:s,overflows:N}],!N.every(L=>L<=0)){var R,T;const L=(((R=o.flip)==null?void 0:R.index)||0)+1,W=_[L];if(W)return{data:{index:L,overflows:j},reset:{placement:W}};let H=(T=j.filter(ee=>ee.overflows[0]<=0).sort((ee,P)=>ee.overflows[1]-P.overflows[1])[0])==null?void 0:T.placement;if(!H)switch(v){case"bestFit":{var A;const ee=(A=j.filter(P=>{if(C){const $=zn(P.placement);return $===y||$==="y"}return!0}).map(P=>[P.placement,P.overflows.filter($=>$>0).reduce(($,K)=>$+K,0)]).sort((P,$)=>P[1]-$[1])[0])==null?void 0:A[0];ee&&(H=ee);break}case"initialPlacement":H=a;break}if(s!==H)return{reset:{placement:H}}}return{}}}};function Hg(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Vg(e){return TP.some(t=>e[t]>=0)}const MP=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...s}=en(e,t);switch(n){case"referenceHidden":{const o=await ia(t,{...s,elementContext:"reference"}),i=Hg(o,r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Vg(i)}}}case"escaped":{const o=await ia(t,{...s,altBoundary:!0}),i=Hg(o,r.floating);return{data:{escapedOffsets:i,escaped:Vg(i)}}}default:return{}}}}};async function FP(e,t){const{placement:r,platform:n,elements:s}=e,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),i=tn(r),a=Jo(r),l=zn(r)==="y",c=["left","top"].includes(i)?-1:1,d=o&&l?-1:1,f=en(t,e);let{mainAxis:h,crossAxis:v,alignmentAxis:w}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof w=="number"&&(v=a==="end"?w*-1:w),l?{x:v*d,y:h*c}:{x:h*c,y:v*d}}const UP=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 FP(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}}}}},BP=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:g,y}=b;return{x:g,y}}},...l}=en(e,t),c={x:r,y:n},d=await ia(t,l),f=zn(tn(s)),h=Tp(f);let v=c[h],w=c[f];if(o){const b=h==="y"?"top":"left",g=h==="y"?"bottom":"right",y=v+d[b],x=v-d[g];v=Bf(y,v,x)}if(i){const b=f==="y"?"top":"left",g=f==="y"?"bottom":"right",y=w+d[b],x=w-d[g];w=Bf(y,w,x)}const m=a.fn({...t,[h]:v,[f]:w});return{...m,data:{x:m.x-r,y:m.y-n,enabled:{[h]:o,[f]:i}}}}}},zP=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}=en(e,t),d={x:r,y:n},f=zn(s),h=Tp(f);let v=d[h],w=d[f];const m=en(a,t),b=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const x=h==="y"?"height":"width",S=o.reference[h]-o.floating[x]+b.mainAxis,E=o.reference[h]+o.reference[x]-b.mainAxis;v<S?v=S:v>E&&(v=E)}if(c){var g,y;const x=h==="y"?"width":"height",S=["top","left"].includes(tn(s)),E=o.reference[f]-o.floating[x]+(S&&((g=i.offset)==null?void 0:g[f])||0)+(S?0:b.crossAxis),C=o.reference[f]+o.reference[x]+(S?0:((y=i.offset)==null?void 0:y[f])||0)-(S?b.crossAxis:0);w<E?w=E:w>C&&(w=C)}return{[h]:v,[f]:w}}}},WP=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}=en(e,t),d=await ia(t,c),f=tn(s),h=Jo(s),v=zn(s)==="y",{width:w,height:m}=o.floating;let b,g;f==="top"||f==="bottom"?(b=f,g=h===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(g=f,b=h==="end"?"top":"bottom");const y=m-d.top-d.bottom,x=w-d.left-d.right,S=Un(m-d[b],y),E=Un(w-d[g],x),C=!t.middlewareData.shift;let _=S,k=E;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(k=x),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(_=y),C&&!h){const j=It(d.left,0),R=It(d.right,0),T=It(d.top,0),A=It(d.bottom,0);v?k=w-2*(j!==0||R!==0?j+R:It(d.left,d.right)):_=m-2*(T!==0||A!==0?T+A:It(d.top,d.bottom))}await l({...t,availableWidth:k,availableHeight:_});const N=await i.getDimensions(a.floating);return w!==N.width||m!==N.height?{reset:{rects:!0}}:{}}}};function iu(){return typeof window<"u"}function Qo(e){return Ix(e)?(e.nodeName||"").toLowerCase():"#document"}function Ut(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Dr(e){var t;return(t=(Ix(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ix(e){return iu()?e instanceof Node||e instanceof Ut(e).Node:!1}function mr(e){return iu()?e instanceof Element||e instanceof Ut(e).Element:!1}function Ir(e){return iu()?e instanceof HTMLElement||e instanceof Ut(e).HTMLElement:!1}function qg(e){return!iu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ut(e).ShadowRoot}function Aa(e){const{overflow:t,overflowX:r,overflowY:n,display:s}=gr(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(s)}function HP(e){return["table","td","th"].includes(Qo(e))}function au(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Rp(e){const t=jp(),r=mr(e)?gr(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 VP(e){let t=Wn(e);for(;Ir(t)&&!Bo(t);){if(Rp(t))return t;if(au(t))return null;t=Wn(t)}return null}function jp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Bo(e){return["html","body","#document"].includes(Qo(e))}function gr(e){return Ut(e).getComputedStyle(e)}function lu(e){return mr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Wn(e){if(Qo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||qg(e)&&e.host||Dr(e);return qg(t)?t.host:t}function Dx(e){const t=Wn(e);return Bo(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ir(t)&&Aa(t)?t:Dx(t)}function aa(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const s=Dx(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),i=Ut(s);if(o){const a=Wf(i);
vendor: 7,125 bytes, line 216
216return t.concat(i,i.visualViewport||[],Aa(s)?s:[],a&&r?aa(a):[])}return t.concat(s,aa(s,[],r))}function Wf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Lx(e){const t=gr(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=Ir(e),o=s?e.offsetWidth:r,i=s?e.offsetHeight:n,a=yc(r)!==o||yc(n)!==i;return a&&(r=o,n=i),{width:r,height:n,$:a}}function Ap(e){return mr(e)?e:e.contextElement}function yo(e){const t=Ap(e);if(!Ir(t))return Bn(1);const r=t.getBoundingClientRect(),{width:n,height:s,$:o}=Lx(t);let i=(o?yc(r.width):r.width)/n,a=(o?yc(r.height):r.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const qP=Bn(0);function $x(e){const t=Ut(e);return!jp()||!t.visualViewport?qP:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function KP(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Ut(e)?!1:t}function Ss(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const s=e.getBoundingClientRect(),o=Ap(e);let i=Bn(1);t&&(n?mr(n)&&(i=yo(n)):i=yo(e));const a=KP(o,r,n)?$x(o):Bn(0);let l=(s.left+a.x)/i.x,c=(s.top+a.y)/i.y,d=s.width/i.x,f=s.height/i.y;if(o){const h=Ut(o),v=n&&mr(n)?Ut(n):n;let w=h,m=Wf(w);for(;m&&n&&v!==w;){const b=yo(m),g=m.getBoundingClientRect(),y=gr(m),x=g.left+(m.clientLeft+parseFloat(y.paddingLeft))*b.x,S=g.top+(m.clientTop+parseFloat(y.paddingTop))*b.y;l*=b.x,c*=b.y,d*=b.x,f*=b.y,l+=x,c+=S,w=Ut(m),m=Wf(w)}}return xc({width:d,height:f,x:l,y:c})}function GP(e){let{elements:t,rect:r,offsetParent:n,strategy:s}=e;const o=s==="fixed",i=Dr(n),a=t?au(t.floating):!1;if(n===i||a&&o)return r;let l={scrollLeft:0,scrollTop:0},c=Bn(1);const d=Bn(0),f=Ir(n);if((f||!f&&!o)&&((Qo(n)!=="body"||Aa(i))&&(l=lu(n)),Ir(n))){const h=Ss(n);c=yo(n),d.x=h.x+n.clientLeft,d.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+d.x,y:r.y*c.y-l.scrollTop*c.y+d.y}}function YP(e){return Array.from(e.getClientRects())}function Hf(e,t){const r=lu(e).scrollLeft;return t?t.left+r:Ss(Dr(e)).left+r}function JP(e){const t=Dr(e),r=lu(e),n=e.ownerDocument.body,s=It(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=It(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Hf(e);const a=-r.scrollTop;return gr(n).direction==="rtl"&&(i+=It(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:i,y:a}}function QP(e,t){const r=Ut(e),n=Dr(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=jp();(!c||c&&t==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:i,x:a,y:l}}function XP(e,t){const r=Ss(e,!0,t==="fixed"),n=r.top+e.clientTop,s=r.left+e.clientLeft,o=Ir(e)?yo(e):Bn(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 Kg(e,t,r){let n;if(t==="viewport")n=QP(e,r);else if(t==="document")n=JP(Dr(e));else if(mr(t))n=XP(t,r);else{const s=$x(e);n={...t,x:t.x-s.x,y:t.y-s.y}}return xc(n)}function Mx(e,t){const r=Wn(e);return r===t||!mr(r)||Bo(r)?!1:gr(r).position==="fixed"||Mx(r,t)}function ZP(e,t){const r=t.get(e);if(r)return r;let n=aa(e,[],!1).filter(a=>mr(a)&&Qo(a)!=="body"),s=null;const o=gr(e).position==="fixed";let i=o?Wn(e):e;for(;mr(i)&&!Bo(i);){const a=gr(i),l=Rp(i);!l&&a.position==="fixed"&&(s=null),(o?!l&&!s:!l&&a.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||Aa(i)&&!l&&Mx(e,i))?n=n.filter(d=>d!==i):s=a,i=Wn(i)}return t.set(e,n),n}function eR(e){let{element:t,boundary:r,rootBoundary:n,strategy:s}=e;const i=[...r==="clippingAncestors"?au(t)?[]:ZP(t,this._c):[].concat(r),n],a=i[0],l=i.reduce((c,d)=>{const f=Kg(t,d,s);return c.top=It(f.top,c.top),c.right=Un(f.right,c.right),c.bottom=Un(f.bottom,c.bottom),c.left=It(f.left,c.left),c},Kg(t,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function tR(e){const{width:t,height:r}=Lx(e);return{width:t,height:r}}function rR(e,t,r){const n=Ir(t),s=Dr(t),o=r==="fixed",i=Ss(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=Bn(0);if(n||!n&&!o)if((Qo(t)!=="body"||Aa(s))&&(a=lu(t)),n){const v=Ss(t,!0,o,t);l.x=v.x+t.clientLeft,l.y=v.y+t.clientTop}else s&&(l.x=Hf(s));let c=0,d=0;if(s&&!n&&!o){const v=s.getBoundingClientRect();d=v.top+a.scrollTop,c=v.left+a.scrollLeft-Hf(s,v)}const f=i.left+a.scrollLeft-l.x-c,h=i.top+a.scrollTop-l.y-d;return{x:f,y:h,width:i.width,height:i.height}}function vd(e){return gr(e).position==="static"}function Gg(e,t){if(!Ir(e)||gr(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Dr(e)===r&&(r=r.ownerDocument.body),r}function Fx(e,t){const r=Ut(e);if(au(e))return r;if(!Ir(e)){let s=Wn(e);for(;s&&!Bo(s);){if(mr(s)&&!vd(s))return s;s=Wn(s)}return r}let n=Gg(e,t);for(;n&&HP(n)&&vd(n);)n=Gg(n,t);return n&&Bo(n)&&vd(n)&&!Rp(n)?r:n||VP(e)||r}const nR=async function(e){const t=this.getOffsetParent||Fx,r=this.getDimensions,n=await r(e.floating);return{reference:rR(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function sR(e){return gr(e).direction==="rtl"}const oR={convertOffsetParentRelativeRectToViewportRelativeRect:GP,getDocumentElement:Dr,getClippingRect:eR,getOffsetParent:Fx,getElementRects:nR,getClientRects:YP,getDimensions:tR,getScale:yo,isElement:mr,isRTL:sR};function iR(e,t){let r=null,n;const s=Dr(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:d,width:f,height:h}=e.getBoundingClientRect();if(a||t(),!f||!h)return;const v=fl(d),w=fl(s.clientWidth-(c+f)),m=fl(s.clientHeight-(d+h)),b=fl(c),y={rootMargin:-v+"px "+-w+"px "+-m+"px "+-b+"px",threshold:It(0,Un(1,l))||1};let x=!0;function S(E){const C=E[0].intersectionRatio;if(C!==l){if(!x)return i();C?i(!1,C):n=setTimeout(()=>{i(!1,1e-7)},1e3)}x=!1}try{r=new IntersectionObserver(S,{...y,root:s.ownerDocument})}catch{r=new IntersectionObserver(S,y)}r.observe(e)}return i(!0),o}function aR(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=Ap(e),d=s||o?[...c?aa(c):[],...aa(t)]:[];d.forEach(g=>{s&&g.addEventListener("scroll",r,{passive:!0}),o&&g.addEventListener("resize",r)});const f=c&&a?iR(c,r):null;let h=-1,v=null;i&&(v=new ResizeObserver(g=>{let[y]=g;y&&y.target===c&&v&&(v.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=v)==null||x.observe(t)})),r()}),c&&!l&&v.observe(c),v.observe(t));let w,m=l?Ss(e):null;l&&b();function b(){const g=Ss(e);m&&(g.x!==m.x||g.y!==m.y||g.width!==m.width||g.height!==m.height)&&r(),m=g,w=requestAnimationFrame(b)}return r(),()=>{var g;d.forEach(y=>{s&&y.removeEventListener("scroll",r),o&&y.removeEventListener("resize",r)}),f==null||f(),(g=v)==null||g.disconnect(),v=null,l&&cancelAnimationFrame(w)}}const lR=UP,cR=BP,uR=$P,dR=WP,fR=MP,Yg=LP,hR=zP,pR=(e,t,r)=>{const n=new Map,s={platform:oR,...r},o={...s.platform,_c:n};return DP(e,t,{...s,platform:o})};var ql=typeof document<"u"?p.useLayoutEffect:p.useEffect;function bc(e,t){if(e===t)return!0;
vendor: 4,144 bytes, line 216
216if(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(!bc(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)&&!bc(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function Ux(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Jg(e,t){const r=Ux(e);return Math.round(t*r)/r}function yd(e){const t=p.useRef(e);return ql(()=>{t.current=e}),t}function mR(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,[d,f]=p.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,v]=p.useState(n);bc(h,n)||v(n);const[w,m]=p.useState(null),[b,g]=p.useState(null),y=p.useCallback(P=>{P!==C.current&&(C.current=P,m(P))},[]),x=p.useCallback(P=>{P!==_.current&&(_.current=P,g(P))},[]),S=o||w,E=i||b,C=p.useRef(null),_=p.useRef(null),k=p.useRef(d),N=l!=null,j=yd(l),R=yd(s),T=yd(c),A=p.useCallback(()=>{if(!C.current||!_.current)return;const P={placement:t,strategy:r,middleware:h};R.current&&(P.platform=R.current),pR(C.current,_.current,P).then($=>{const K={...$,isPositioned:T.current!==!1};L.current&&!bc(k.current,K)&&(k.current=K,Kn.flushSync(()=>{f(K)}))})},[h,t,r,R,T]);ql(()=>{c===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,f(P=>({...P,isPositioned:!1})))},[c]);const L=p.useRef(!1);ql(()=>(L.current=!0,()=>{L.current=!1}),[]),ql(()=>{if(S&&(C.current=S),E&&(_.current=E),S&&E){if(j.current)return j.current(S,E,A);A()}},[S,E,A,j,N]);const W=p.useMemo(()=>({reference:C,floating:_,setReference:y,setFloating:x}),[y,x]),H=p.useMemo(()=>({reference:S,floating:E}),[S,E]),ee=p.useMemo(()=>{const P={position:r,left:0,top:0};if(!H.floating)return P;const $=Jg(H.floating,d.x),K=Jg(H.floating,d.y);return a?{...P,transform:"translate("+$+"px, "+K+"px)",...Ux(H.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:$,top:K}},[r,a,H.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:A,refs:W,elements:H,floatingStyles:ee}),[d,A,W,H,ee])}const gR=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?Yg({element:n.current,padding:s}).fn(r):{}:n?Yg({element:n,padding:s}).fn(r):{}}}},vR=(e,t)=>({...lR(e),options:[e,t]}),yR=(e,t)=>({...cR(e),options:[e,t]}),wR=(e,t)=>({...hR(e),options:[e,t]}),xR=(e,t)=>({...uR(e),options:[e,t]}),bR=(e,t)=>({...dR(e),options:[e,t]}),SR=(e,t)=>({...fR(e),options:[e,t]}),ER=(e,t)=>({...gR(e),options:[e,t]});var _R="Arrow",Bx=p.forwardRef((e,t)=>{const{children:r,width:n=10,height:s=5,...o}=e;return u.jsx(X.svg,{...o,ref:t,width:n,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});Bx.displayName=_R;var CR=Bx;function zx(e){const[t,r]=p.useState(void 0);return $e(()=>{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 Op="Popper",[Wx,cu]=vr(Op),[kR,Hx]=Wx(Op),Vx=e=>{const{__scopePopper:t,children:r}=e,[n,s]=p.useState(null);return u.jsx(kR,{scope:t,anchor:n,onAnchorChange:s,children:r})};Vx.displayName=Op;var qx="PopperAnchor",Kx=p.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...s}=e,o=Hx(qx,r),i=p.useRef(null),a=le(t,i);return p.useEffect(()=>{o.onAnchorChange((n==null?void 0:n.current)||i.current)}),n?null:u.jsx(X.div,{...s,ref:a})});Kx.displayName=qx;var Ip="PopperContent",[TR,NR]=Wx(Ip),Gx=p.forwardRef((e,t)=>
vendor: 6,741 bytes, line 216
216{var I,U,Z,ne,Q,M;const{__scopePopper:r,side:n="bottom",sideOffset:s=0,align:o="center",alignOffset:i=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:v="optimized",onPlaced:w,...m}=e,b=Hx(Ip,r),[g,y]=p.useState(null),x=le(t,te=>y(te)),[S,E]=p.useState(null),C=zx(S),_=(C==null?void 0:C.width)??0,k=(C==null?void 0:C.height)??0,N=n+(o!=="center"?"-"+o:""),j=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},R=Array.isArray(c)?c:[c],T=R.length>0,A={padding:j,boundary:R.filter(RR),altBoundary:T},{refs:L,floatingStyles:W,placement:H,isPositioned:ee,middlewareData:P}=mR({strategy:"fixed",placement:N,whileElementsMounted:(...te)=>aR(...te,{animationFrame:v==="always"}),elements:{reference:b.anchor},middleware:[vR({mainAxis:s+k,alignmentAxis:i}),l&&yR({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?wR():void 0,...A}),l&&xR({...A}),bR({...A,apply:({elements:te,rects:se,availableWidth:he,availableHeight:ye})=>{const{width:Ke,height:lt}=se.reference,ge=te.floating.style;ge.setProperty("--radix-popper-available-width",`${he}px`),ge.setProperty("--radix-popper-available-height",`${ye}px`),ge.setProperty("--radix-popper-anchor-width",`${Ke}px`),ge.setProperty("--radix-popper-anchor-height",`${lt}px`)}}),S&&ER({element:S,padding:a}),jR({arrowWidth:_,arrowHeight:k}),h&&SR({strategy:"referenceHidden",...A})]}),[$,K]=Qx(H),B=ke(w);$e(()=>{ee&&(B==null||B())},[ee,B]);const Y=(I=P.arrow)==null?void 0:I.x,ae=(U=P.arrow)==null?void 0:U.y,ue=((Z=P.arrow)==null?void 0:Z.centerOffset)!==0,[_e,O]=p.useState();return $e(()=>{g&&O(window.getComputedStyle(g).zIndex)},[g]),u.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...W,transform:ee?W.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:_e,"--radix-popper-transform-origin":[(ne=P.transformOrigin)==null?void 0:ne.x,(Q=P.transformOrigin)==null?void 0:Q.y].join(" "),...((M=P.hide)==null?void 0:M.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(TR,{scope:r,placedSide:$,onArrowChange:E,arrowX:Y,arrowY:ae,shouldHideArrow:ue,children:u.jsx(X.div,{"data-side":$,"data-align":K,...m,ref:x,style:{...m.style,animation:ee?void 0:"none"}})})})});Gx.displayName=Ip;var Yx="PopperArrow",PR={top:"bottom",right:"left",bottom:"top",left:"right"},Jx=p.forwardRef(function(t,r){const{__scopePopper:n,...s}=t,o=NR(Yx,n),i=PR[o.placedSide];return u.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:u.jsx(CR,{...s,ref:r,style:{...s.style,display:"block"}})})});Jx.displayName=Yx;function RR(e){return e!==null}var jR=e=>({name:"transformOrigin",options:e,fn(t){var b,g,y;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,d]=Qx(r),f={start:"0%",center:"50%",end:"100%"}[d],h=(((g=s.arrow)==null?void 0:g.x)??0)+a/2,v=(((y=s.arrow)==null?void 0:y.y)??0)+l/2;let w="",m="";return c==="bottom"?(w=i?f:`${h}px`,m=`${-l}px`):c==="top"?(w=i?f:`${h}px`,m=`${n.floating.height+l}px`):c==="right"?(w=`${-l}px`,m=i?f:`${v}px`):c==="left"&&(w=`${n.floating.width+l}px`,m=i?f:`${v}px`),{data:{x:w,y:m}}}});function Qx(e){const[t,r="center"]=e.split("-");return[t,r]}var AR=Vx,Xx=Kx,Zx=Gx,eb=Jx,OR="Portal",tb=p.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[s,o]=p.useState(!1);$e(()=>o(!0),[]);const i=r||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Pa.createPortal(u.jsx(X.div,{...n,ref:t}),i):null});tb.displayName=OR;function IR(e,t){return p.useReducer((r,n)=>t[r][n]??r,e)}var rb=e=>{const{present:t,children:r}=e,n=DR(t),s=typeof r=="function"?r({present:n.isPresent}):p.Children.only(r),o=le(n.ref,LR(s));return typeof r=="function"||n.isPresent?p.cloneElement(s,{ref:o}):null};rb.displayName="Presence";function DR(e){const[t,r]=p.useState(),n=p.useRef({}),s=p.useRef(e),o=p.useRef("none"),i=e?"mounted":"unmounted",[a,l]=IR(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const c=hl(n.current);o.current=a==="mounted"?c:"none"},[a]),$e(()=>{const c=n.current,d=s.current;if(d!==e){const h=o.current,v=hl(c);e?l("MOUNT"):v==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&h!==v?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,l]),$e(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,f=v=>{const m=hl(n.current).includes(v.animationName);if(v.target===t&&m&&(l("ANIMATION_END"),!s.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=v=>{v.target===t&&(o.current=hl(n.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:p.useCallback(c=>{c&&(n.current=getComputedStyle(c)),r(c)},[])}}function hl(e){return(e==null?void 0:e.animationName)||"none"}function LR(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[uu,ZM]=gP("Tooltip",[cu]),Dp=cu(),nb="TooltipProvider",$R=700,Qg="tooltip.open",[MR,sb]=uu(nb),ob=e=>{const{__scopeTooltip:t,delayDuration:r=$R,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:o}=e,[i,a]=p.useState(!0),l=p.useRef(!1),c=p.useRef(0);return p.useEffect(()=>{const d=c.current;return()=>window.clearTimeout(d)},[]),u.jsx(MR,{scope:t,isOpenDelayed:i,delayDuration:r,onOpen:p.useCallback(()=>{window.clearTimeout(c.current),a(!1)},[]),onClose:p.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a(!0),n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:p.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:o})};ob.displayName=nb;var ib="Tooltip",[e4,du]=uu(ib),Vf="TooltipTrigger",FR=p.forwardRef((e,t)=>
vendor: 5,546 bytes, line 216
216{const{__scopeTooltip:r,...n}=e,s=du(Vf,r),o=sb(Vf,r),i=Dp(r),a=p.useRef(null),l=le(t,a,s.onTriggerChange),c=p.useRef(!1),d=p.useRef(!1),f=p.useCallback(()=>c.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),u.jsx(Xx,{asChild:!0,...i,children:u.jsx(X.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...n,ref:l,onPointerMove:q(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),d.current=!0)}),onPointerLeave:q(e.onPointerLeave,()=>{s.onTriggerLeave(),d.current=!1}),onPointerDown:q(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:q(e.onFocus,()=>{c.current||s.onOpen()}),onBlur:q(e.onBlur,s.onClose),onClick:q(e.onClick,s.onClose)})})});FR.displayName=Vf;var UR="TooltipPortal",[t4,BR]=uu(UR,{forceMount:void 0}),zo="TooltipContent",ab=p.forwardRef((e,t)=>{const r=BR(zo,e.__scopeTooltip),{forceMount:n=r.forceMount,side:s="top",...o}=e,i=du(zo,e.__scopeTooltip);return u.jsx(rb,{present:n||i.open,children:i.disableHoverableContent?u.jsx(lb,{side:s,...o,ref:t}):u.jsx(zR,{side:s,...o,ref:t})})}),zR=p.forwardRef((e,t)=>{const r=du(zo,e.__scopeTooltip),n=sb(zo,e.__scopeTooltip),s=p.useRef(null),o=le(t,s),[i,a]=p.useState(null),{trigger:l,onClose:c}=r,d=s.current,{onPointerInTransitChange:f}=n,h=p.useCallback(()=>{a(null),f(!1)},[f]),v=p.useCallback((w,m)=>{const b=w.currentTarget,g={x:w.clientX,y:w.clientY},y=qR(g,b.getBoundingClientRect()),x=KR(g,y),S=GR(m.getBoundingClientRect()),E=JR([...x,...S]);a(E),f(!0)},[f]);return p.useEffect(()=>()=>h(),[h]),p.useEffect(()=>{if(l&&d){const w=b=>v(b,d),m=b=>v(b,l);return l.addEventListener("pointerleave",w),d.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",w),d.removeEventListener("pointerleave",m)}}},[l,d,v,h]),p.useEffect(()=>{if(i){const w=m=>{const b=m.target,g={x:m.clientX,y:m.clientY},y=(l==null?void 0:l.contains(b))||(d==null?void 0:d.contains(b)),x=!YR(g,i);y?h():x&&(h(),c())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[l,d,i,c,h]),u.jsx(lb,{...e,ref:o})}),[WR,HR]=uu(ib,{isInside:!1}),lb=p.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":s,onEscapeKeyDown:o,onPointerDownOutside:i,...a}=e,l=du(zo,r),c=Dp(r),{onClose:d}=l;return p.useEffect(()=>(document.addEventListener(Qg,d),()=>document.removeEventListener(Qg,d)),[d]),p.useEffect(()=>{if(l.trigger){const f=h=>{const v=h.target;v!=null&&v.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),u.jsx(kp,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:u.jsxs(Zx,{"data-state":l.stateAttribute,...c,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[u.jsx(yp,{children:n}),u.jsx(WR,{scope:r,isInside:!0,children:u.jsx(ET,{id:l.contentId,role:"tooltip",children:s||n})})]})})});ab.displayName=zo;var cb="TooltipArrow",VR=p.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,s=Dp(r);return HR(cb,r).isInside?null:u.jsx(eb,{...s,...n,ref:t})});VR.displayName=cb;function qR(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 KR(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 GR(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 YR(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].x,l=t[o].y,c=t[i].x,d=t[i].y;l>n!=d>n&&r<(c-a)*(n-l)/(d-l)+a&&(s=!s)}return s}function JR(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),QR(t)}function QR(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 XR=ob,ub=ab;const ZR=XR,ej=p.forwardRef(({className:e,sideOffset:t=4,...r},n)=>u.jsx(ub,{ref:n,sideOffset:t,className:ie("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]:sli
216de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));ej.displayName=ub.displayName;var fu=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(){}},hu=typeof window>"u"||"Deno"in globalThis;function nr(){}function tj(e,t){return typeof e=="function"?e(t):e}function rj(e){return typeof e=="number"&&e>=0&&e!==1/0}function nj(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Xg(e,t){return typeof e=="function"?e(t):e}function sj(e,t){return typeof e=="function"?e(t):e}function Zg(e,t){const{type:r="all",exact:n,fetchStatus:s,predicate:o,queryKey:i,stale:a}=e;if(i){if(n){if(t.queryHash!==Lp(i,t.options))return!1}else if(!ca(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 ev(e,t){const{exact:r,status:n,predicate:s,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(la(t.options.mutationKey)!==la(o))return!1}else if(!ca(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||s&&!s(t))}function Lp(e,t){return((t==null?void 0:t.queryKeyHashFn)||la)(e)}function la(e){return JSON.stringify(e,(t,r)=>qf(r)?Object.keys(r).sort().reduce((n,s)=>(n[s]=r[s],n),{}):r)}function ca(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(r=>!ca(e[r],t[r])):!1}function db(e,t){if(e===t)return e;const r=tv(e)&&tv(t);if(r||qf(e)&&qf(t)){const n=r?e:Object.keys(e),s=n.length,o=r?t:Object.keys(t),i=o.length,a=r?[]:{};let l=0;for(let c=0;c<i;c++){const d=r?c:o[c];(!r&&n.includes(d)||r)&&e[d]===void 0&&t[d]===void 0?(a[d]=void 0,l++):(a[d]=db(e[d],t[d]),a[d]===e[d]&&e[d]!==void 0&&l++)}return s===i&&l===s?e:a}return t}function tv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function qf(e){if(!rv(e))return!1;const t=e.constructor;if(t===void 0)return!0;const r=t.prototype;return!(!rv(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function rv(e){return Object.prototype.toString.call(e)==="[object Object]"}function oj(e){return new Promise(t=>{setTimeout(t,e)})}function ij(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?db(e,t):t}function aj(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function lj(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var fb=Symbol();function hb(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===fb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var cs,yn,_o,xy,cj=(xy=class extends fu{constructor(){super();we(this,cs);we(this,yn);we(this,_o);fe(this,_o,t=>{if(!hu&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){D(this,yn)||this.setEventListener(D(this,_o))}onUnsubscribe(){var t;this.hasListeners()||((t=D(this,yn))==null||t.call(this),fe(this,yn,void 0))}setEventListener(t){var r;fe(this,_o,t),(r=D(this,yn))==null||r.call(this),fe(this,yn,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){D(this,cs)!==t&&(fe(this,cs,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof D(this,cs)=="boolean"?D(this,cs):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},cs=new WeakMap,yn=new WeakMap,_o=new WeakMap,xy),pb=new cj,Co,wn,ko,by,uj=(by=class extends fu{constructor(){super();we(this,Co,!0);we(this,wn);we(this,ko);fe(this,ko,t=>{if(!hu&&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
vendor: 18,532 bytes, line 216
216)}}})}onSubscribe(){D(this,wn)||this.setEventListener(D(this,ko))}onUnsubscribe(){var t;this.hasListeners()||((t=D(this,wn))==null||t.call(this),fe(this,wn,void 0))}setEventListener(t){var r;fe(this,ko,t),(r=D(this,wn))==null||r.call(this),fe(this,wn,t(this.setOnline.bind(this)))}setOnline(t){D(this,Co)!==t&&(fe(this,Co,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return D(this,Co)}},Co=new WeakMap,wn=new WeakMap,ko=new WeakMap,by),Sc=new uj;function dj(e){return Math.min(1e3*2**e,3e4)}function mb(e){return(e??"online")==="online"?Sc.isOnline():!0}var gb=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function wd(e){return e instanceof gb}function vb(e){let t=!1,r=0,n=!1,s,o,i;const a=new Promise((g,y)=>{o=g,i=y}),l=g=>{var y;n||(w(new gb(g)),(y=e.abort)==null||y.call(e))},c=()=>{t=!0},d=()=>{t=!1},f=()=>pb.isFocused()&&(e.networkMode==="always"||Sc.isOnline())&&e.canRun(),h=()=>mb(e.networkMode)&&e.canRun(),v=g=>{var y;n||(n=!0,(y=e.onSuccess)==null||y.call(e,g),s==null||s(),o(g))},w=g=>{var y;n||(n=!0,(y=e.onError)==null||y.call(e,g),s==null||s(),i(g))},m=()=>new Promise(g=>{var y;s=x=>{(n||f())&&g(x)},(y=e.onPause)==null||y.call(e)}).then(()=>{var g;s=void 0,n||(g=e.onContinue)==null||g.call(e)}),b=()=>{if(n)return;let g;const y=r===0?e.initialPromise:void 0;try{g=y??e.fn()}catch(x){g=Promise.reject(x)}Promise.resolve(g).then(v).catch(x=>{var k;if(n)return;const S=e.retry??(hu?0:3),E=e.retryDelay??dj,C=typeof E=="function"?E(r,x):E,_=S===!0||typeof S=="number"&&r<S||typeof S=="function"&&S(r,x);if(t||!_){w(x);return}r++,(k=e.onFail)==null||k.call(e,r,x),oj(C).then(()=>f()?void 0:m()).then(()=>{t?w(x):b()})})};return{promise:a,cancel:l,continue:()=>(s==null||s(),a),cancelRetry:c,continueRetry:d,canStart:h,start:()=>(h()?b():m().then(b),a)}}function fj(){let e=[],t=0,r=a=>{a()},n=a=>{a()},s=a=>setTimeout(a,0);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 yt=fj(),us,Sy,yb=(Sy=class{constructor(){we(this,us)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),rj(this.gcTime)&&fe(this,us,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(hu?1/0:5*60*1e3))}clearGcTimeout(){D(this,us)&&(clearTimeout(D(this,us)),fe(this,us,void 0))}},us=new WeakMap,Sy),To,No,Vt,ht,Sa,ds,or,Ur,Ey,hj=(Ey=class extends yb{constructor(t){super();we(this,or);we(this,To);we(this,No);we(this,Vt);we(this,ht);we(this,Sa);we(this,ds);fe(this,ds,!1),fe(this,Sa,t.defaultOptions),this.setOptions(t.options),this.observers=[],fe(this,Vt,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,fe(this,To,mj(this.options)),this.state=t.state??D(this,To),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=D(this,ht))==null?void 0:t.promise}setOptions(t){this.options={...D(this,Sa),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&D(this,Vt).remove(this)}setData(t,r){const n=ij(this.state.data,t,this.options);return ut(this,or,Ur).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){ut(this,or,Ur).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,s;const r=(n=D(this,ht))==null?void 0:n.promise;return(s=D(this,ht))==null||s.cancel(t),r?r.then(nr).catch(nr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(D(this,To))}isActive(){return this.observers.some(t=>sj(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!nj(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=D(this,ht))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=D(this,ht))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),D(this,Vt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(D(this,ht)&&(D(this,ds)?D(this,ht).cancel({revert:!0}):D(this,ht).cancelRetry()),this.scheduleGc()),D(this,Vt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ut(this,or,Ur).call(this,{type:"invalidate"})}fetch(t,r){var l,c,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(D(this,ht))return D(this,ht).continueRetry(),D(this,ht).promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(h=>h.options.queryFn);f&&this.setOptions(f.options)}const n=new AbortController,s=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(fe(this,ds,!0),n.signal)})},o=()=>{const f=hb(this.options,r),h={queryKey:this.queryKey,meta:this.meta};return s(h),fe(this,ds,!1),this.options.persister?this.options.persister(f,h,this):f(h)},i={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};s(i),(l=this.options.behavior)==null||l.onFetch(i,this),fe(this,No,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=i.fetchOptions)==null?void 0:c.meta))&&ut(this,or,Ur).call(this,{type:"fetch",meta:(d=i.fetchOptions)==null?void 0:d.meta});const a=f=>{var h,v,w,m;wd(f)&&f.silent||ut(this,or,Ur).call(this,{type:"error",error:f}),wd(f)||((v=(h=D(this,Vt).config).onError)==null||v.call(h,f,this),(m=(w=D(this,Vt).config).onSettled)==null||m.call(w,this.state.data,f,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return fe(this,ht,vb({initialPromise:r==null?void 0:r.initialPromise,fn:i.fetchFn,abort:n.abort.bind(n),onSuccess:f=>{var h,v,w,m;if(f===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(b){a(b);return}(v=(h=D(this,Vt).config).onSuccess)==null||v.call(h,f,this),(m=(w=D(this,Vt).config).onSettled)==null||m.call(w,f,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:a,onFail:(f,h)=>{ut(this,or,Ur).call(this,{type:"failed",failureCount:f,error:h})},onPause:()=>{ut(this,or,Ur).call(this,{type:"pause"})},onContinue:()=>{ut(this,or,Ur).call(this,{type:"continue"})},retry:i.options.retry,retryDelay:i.options.retryDelay,networkMode:i.options.networkMode,canRun:()=>!0})),D(this,ht).start()}},To=new WeakMap,No=new WeakMap,Vt=new WeakMap,ht=new WeakMap,Sa=new WeakMap,ds=new WeakMap,or=new WeakSet,Ur=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,...pj(n.data,this.options),fetchMeta:t.meta??null};case"success":return{...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 wd(s)&&s.revert&&D(this,No)?{...D(this,No),fetchStatus:"idle"}:{...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),yt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),D(this,Vt).notify({query:this,type:"updated",action:t})})},Ey);function pj(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:mb(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function mj(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 Tr,_y,gj=(_y=class extends fu{constructor(t={}){super();we(this,Tr);this.config=t,fe(this,Tr,new Map)}build(t,r,n){const s=r.queryKey,o=r.queryHash??Lp(s,r);let i=this.get(o);return i||(i=new hj({cache:this,queryKey:s,queryHash:o,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(s)}),this.add(i)),i}add(t){D(this,Tr).has(t.queryHash)||(D(this,Tr).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=D(this,Tr).get(t.queryHash);r&&(t.destroy(),r===t&&D(this,Tr).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){yt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return D(this,Tr).get(t)}getAll(){return[...D(this,Tr).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Zg(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Zg(t,n)):r}notify(t){yt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){yt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){yt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Tr=new WeakMap,_y),Nr,gt,fs,Pr,un,Cy,vj=(Cy=class extends yb{constructor(t){super();we(this,Pr);we(this,Nr);we(this,gt);we(this,fs);this.mutationId=t.mutationId,fe(this,gt,t.mutationCache),fe(this,Nr,[]),this.state=t.state||yj(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){D(this,Nr).includes(t)||(D(this,Nr).push(t),this.clearGcTimeout(),D(this,gt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){fe(this,Nr,D(this,Nr).filter(r=>r!==t)),this.scheduleGc(),D(this,gt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){D(this,Nr).length||(this.state.status==="pending"?this.scheduleGc():D(this,gt).remove(this))}continue(){var t;return((t=D(this,fs))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var s,o,i,a,l,c,d,f,h,v,w,m,b,g,y,x,S,E,C,_;fe(this,fs,vb({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(k,N)=>{ut(this,Pr,un).call(this,{type:"failed",failureCount:k,error:N})},onPause:()=>{ut(this,Pr,un).call(this,{type:"pause"})},onContinue:()=>{ut(this,Pr,un).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>D(this,gt).canRun(this)}));const r=this.state.status==="pending",n=!D(this,fs).canStart();try{if(!r){ut(this,Pr,un).call(this,{type:"pending",variables:t,isPaused:n}),await((o=(s=D(this,gt).config).onMutate)==null?void 0:o.call(s,t,this));const N=await((a=(i=this.options).onMutate)==null?void 0:a.call(i,t));N!==this.state.context&&ut(this,Pr,un).call(this,{type:"pending",context:N,variables:t,isPaused:n})}const k=await D(this,fs).start();return await((c=(l=D(this,gt).config).onSuccess)==null?void 0:c.call(l,k,t,this.state.context,this)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,k,t,this.state.context)),await((v=(h=D(this,gt).config).onSettled)==null?void 0:v.call(h,k,null,this.state.variables,this.state.context,this)),await((m=(w=this.options).onSettled)==null?void 0:m.call(w,k,null,t,this.state.context)),ut(this,Pr,un).call(this,{type:"success",data:k}),k}catch(k){try{throw await((g=(b=D(this,gt).config).onError)==null?void 0:g.call(b,k,t,this.state.context,this)),await((x=(y=this.options).onError)==null?void 0:x.call(y,k,t,this.state.context)),await((E=(S=D(this,gt).config).onSettled)==null?void 0:E.call(S,void 0,k,this.state.variables,this.state.context,this)),await((_=(C=this.options).onSettled)==null?void 0:_.call(C,void 0,k,t,this.state.context)),k}finally{ut(this,Pr,un).call(this,{type:"error",error:k})}}finally{D(this,gt).runNext(this)}}},Nr=new WeakMap,gt=new WeakMap,fs=new WeakMap,Pr=new WeakSet,un=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};case"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),yt.batch(()=>{D(this,Nr).forEach(n=>{n.onMutationUpdate(t)}),D(this,gt).notify({mutation:this,type:"updated",action:t})})},Cy);function yj(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var jt,Ea,ky,wj=(ky=class extends fu{constructor(t={}){super();we(this,jt);we(this,Ea);this.config=t,fe(this,jt,new Map),fe(this,Ea,Date.now())}build(t,r,n){const s=new vj({mutationCache:this,mutationId:++Va(this,Ea)._,options:t.defaultMutationOptions(r),state:n});return this.add(s),s}add(t){const r=pl(t),n=D(this,jt).get(r)??[];n.push(t),D(this,jt).set(r,n),this.notify({type:"added",mutation:t})}remove(t){var n;const r=pl(t);if(D(this,jt).has(r)){const s=(n=D(this,jt).get(r))==null?void 0:n.filter(o=>o!==t);s&&(s.length===0?D(this,jt).delete(r):D(this,jt).set(r,s))}this.notify({type:"removed",mutation:t})}canRun(t){var n;const r=(n=D(this,jt).get(pl(t)))==null?void 0:n.find(s=>s.state.status==="pending");return!r||r===t}runNext(t){var n;const r=(n=D(this,jt).get(pl(t)))==null?void 0:n.find(s=>s!==t&&s.state.isPaused);return(r==null?void 0:r.continue())??Promise.resolve()}clear(){yt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...D(this,jt).values()].flat()}find(t){const r={exact:!0,...t};return this.getAll().find(n=>ev(r,n))}findAll(t={}){return this.getAll().filter(r=>ev(t,r))}notify(t){yt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return yt.batch(()=>Promise.all(t.map(r=>r.continue().catch(nr))))}},jt=new WeakMap,Ea=new WeakMap,ky);function pl(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function nv(e){return{onFetch:(t,r)=>{var d,f,h,v,w;const n=t.options,s=(h=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:h.direction,o=((v=t.state.data)==null?void 0:v.pages)||[],i=((w=t.state.data)==null?void 0:w.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let m=!1;const b=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(t.signal.aborted?m=!0:t.signal.addEventListener("abort",()=>{m=!0}),t.signal)})},g=hb(t.options,t.fetchOptions),y=async(x,S,E)=>{if(m)return Promise.reject();if(S==null&&x.pages.length)return Promise.resolve(x);const C={queryKey:t.queryKey,pageParam:S,direction:E?"backward":"forward",meta:t.options.meta};b(C);const _=await g(C),{maxPages:k}=t.options,N=E?lj:aj;return{pages:N(x.pages,_,k),pageParams:N(x.pageParams,S,k)}};if(s&&o.length){const x=s==="backward",S=x?xj:sv,E={pages:o,pageParams:i},C=S(n,E);a=await y(E,C,x)}else{const x=e??o.length;do{const S=l===0?i[0]??n.initialPageParam:sv(n,a);if(l>0&&S==null)break;a=await y(a,S),l++}while(l<x)}return a};t.options.persister?t.fetchFn=()=>{var m,b;return(b=(m=t.options).persister)==null?void 0:b.call(m,c,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=c}}}function sv(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 xj(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 ze,xn,bn,Po,Ro,Sn,jo,Ao,Ty,bj=(Ty=class{constructor(e={}){we(this,ze);we(this,xn);we(this,bn);we(this,Po);we(this,Ro);we(this,Sn);we(this,jo);we(this,Ao);fe(this,ze,e.queryCache||new gj),fe(this,xn,e.mutationCache||new wj),fe(this,bn,e.defaultOptions||{}),fe(this,Po,new Map),fe(this,Ro,new Map),fe(this,Sn,0)}mount(){Va(this,Sn)._++,D(this,Sn)===1&&(fe(this,jo,pb.subscribe(async e=>{e&&(await this.resumePausedMutations(),D(this,ze).onFocus())})),fe(this,Ao,Sc.subscribe(async e=>{e&&(await this.resumePausedMutations(),D(this,ze).onOnline())})))}unmount(){var e,t;Va(this,Sn)._--,D(this,Sn)===0&&((e=D(this,jo))==null||e.call(this),fe(this,jo,void 0),(t=D(this,Ao))==null||t.call(this),fe(this,Ao,void 0))}isFetching(e){return D(this,ze).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return D(this,xn).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=D(this,ze).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const r=this.defaultQueryOptions(e),n=D(this,ze).build(this,r);return e.revalidateIfStale&&n.isStaleByTime(Xg(r.staleTime,n))&&this.prefetchQuery(r),Promise.resolve(t)}}getQueriesData(e){return D(this,ze).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=D(this,ze).get(n.queryHash),o=s==null?void 0:s.state.data,i=tj(t,o);if(i!==void 0)return D(this,ze).build(this,n).setData(i,{...r,manual:!0})}setQueriesData(e,t,r){return yt.batch(()=>D(this,ze).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=D(this,ze).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=D(this,ze);yt.batch(()=>
216{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=D(this,ze),n={type:"active",...e};return yt.batch(()=>(r.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries(n,t)))}cancelQueries(e={},t={}){const r={revert:!0,...t},n=yt.batch(()=>D(this,ze).findAll(e).map(s=>s.cancel(r)));return Promise.all(n).then(nr).catch(nr)}invalidateQueries(e={},t={}){return yt.batch(()=>{if(D(this,ze).findAll(e).forEach(n=>{n.invalidate()}),e.refetchType==="none")return Promise.resolve();const r={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(r,t)})}refetchQueries(e={},t){const r={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},n=yt.batch(()=>D(this,ze).findAll(e).filter(s=>!s.isDisabled()).map(s=>{let o=s.fetch(void 0,r);return r.throwOnError||(o=o.catch(nr)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(nr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=D(this,ze).build(this,t);return r.isStaleByTime(Xg(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(nr).catch(nr)}fetchInfiniteQuery(e){return e.behavior=nv(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(nr).catch(nr)}ensureInfiniteQueryData(e){return e.behavior=nv(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Sc.isOnline()?D(this,xn).resumePausedMutations():Promise.resolve()}getQueryCache(){return D(this,ze)}getMutationCache(){return D(this,xn)}getDefaultOptions(){return D(this,bn)}setDefaultOptions(e){fe(this,bn,e)}setQueryDefaults(e,t){D(this,Po).set(la(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...D(this,Po).values()];let r={};return t.forEach(n=>{ca(e,n.queryKey)&&(r={...r,...n.defaultOptions})}),r}setMutationDefaults(e,t){D(this,Ro).set(la(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...D(this,Ro).values()];let r={};return t.forEach(n=>{ca(e,n.mutationKey)&&(r={...r,...n.defaultOptions})}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...D(this,bn).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Lp(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.enabled!==!0&&t.queryFn===fb&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...D(this,bn).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){D(this,ze).clear(),D(this,xn).clear()}},ze=new WeakMap,xn=new WeakMap,bn=new WeakMap,Po=new WeakMap,Ro=new WeakMap,Sn=new WeakMap,jo=new WeakMap,Ao=new WeakMap,Ty),Sj=p.createContext(void 0),Ej=({client:e,children:t})=>(p.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(Sj.Provider,{value:e,children:t}));/** 217 * @remix-run/router v1.19.2 218 * 219 * Copyright (c) Remix Software Inc. 220 * 221 * This source code is licensed under the MIT license found in the 222 * LICENSE.md file in the root directory of this source tree. 223 * 224 * @license MIT 225 */function ua(){return ua=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},ua.apply(this,arguments)}var Cn;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Cn||(Cn={}));const ov="popstate";function _j(e){e===void 0&&(e={});function t(n,s){let{pathname:o,search:i,hash:a}=n.location;return Kf("",{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:xb(s)}return kj(t,r,null,e)}function Je(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function wb(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Cj(){return Math.random().toString(36).substr(2,8)}function iv(e,t){return{usr:e.state,key:e.key,idx:t}}function Kf(e,t,r,n){return r===void 0&&(r=null),ua({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Xo(t):t,{state:r,key:t&&t.key||n||Cj()})}function xb(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 Xo(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 kj(e,t,r,n){n===void 0&&(n={});let{window:s=document.defaultView,v5Compat:o=!1}=n,i=s.history,a=Cn.Pop,l=null,c=d();c==null&&(c=0,i.replaceState(ua({},i.state,{idx:c}),""));function d(){return(i.state||{idx:null}).idx}function f(){a=Cn.Pop;let b=d(),g=b==null?null:b-c;c=b,l&&l({action:a,location:m.location,delta:g})}function h(b,g){a=Cn.Push;let y=Kf(m.location,b,g);c=d()+1;let x=iv(y,c),S=m.createHref(y);try{i.pushState(x,"",S)}
vendor: 3,324 bytes, line 225
225catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;s.location.assign(S)}o&&l&&l({action:a,location:m.location,delta:1})}function v(b,g){a=Cn.Replace;let y=Kf(m.location,b,g);c=d();let x=iv(y,c),S=m.createHref(y);i.replaceState(x,"",S),o&&l&&l({action:a,location:m.location,delta:0})}function w(b){let g=s.location.origin!=="null"?s.location.origin:s.location.href,y=typeof b=="string"?b:xb(b);return y=y.replace(/ $/,"%20"),Je(g,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,g)}let m={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(ov,f),l=b,()=>{s.removeEventListener(ov,f),l=null}},createHref(b){return t(s,b)},createURL:w,encodeLocation(b){let g=w(b);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:h,replace:v,go(b){return i.go(b)}};return m}var av;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(av||(av={}));function Tj(e,t,r){return r===void 0&&(r="/"),Nj(e,t,r,!1)}function Nj(e,t,r,n){let s=typeof t=="string"?Xo(t):t,o=Eb(s.pathname||"/",r);if(o==null)return null;let i=bb(e);Pj(i);let a=null;for(let l=0;a==null&&l<i.length;++l){let c=Uj(o);a=Mj(i[l],c,n)}return a}function bb(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("/")&&(Je(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. 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=ms([n,l.relativePath]),d=r.concat(l);o.children&&o.children.length>0&&(Je(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),bb(o.children,t,d,c)),!(o.path==null&&!o.index)&&t.push({path:c,score:Lj(c,o.index),routesMeta:d})};return e.forEach((o,i)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))s(o,i);else for(let l of Sb(o.path))s(o,i,l)}),t}function Sb(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=Sb(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 Pj(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:$j(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const Rj=/^:[\w-]+$/,jj=3,Aj=2,Oj=1,Ij=10,Dj=-2,lv=e=>e==="*";function Lj(e,t){let r=e.split("/"),n=r.length;return r.some(lv)&&(n+=Dj),t&&(n+=Aj),r.filter(s=>!lv(s)).reduce((s,o)=>s+(Rj.test(o)?jj:o===""?Oj:Ij),n)}function $j(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 Mj(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,d=o==="/"?t:t.slice(o.length)||"/",f=cv({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},d),h=l.route;if(!f&&c&&r&&!n[n.length-1].route.index&&(f=cv({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},d)),!f)return null;
vendor: 13,202 bytes, lines 225-243
225Object.assign(s,f.params),i.push({params:s,pathname:ms([o,f.pathname]),pathnameBase:Hj(ms([o,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(o=ms([o,f.pathnameBase]))}return i}function cv(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=Fj(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,d,f)=>{let{paramName:h,isOptional:v}=d;if(h==="*"){let m=a[f]||"";i=o.slice(0,o.length-m.length).replace(/(.)\/+$/,"$1")}const w=a[f];return v&&!w?c[h]=void 0:c[h]=(w||"").replace(/%2F/g,"/"),c},{}),pathname:o,pathnameBase:i,pattern:e}}function Fj(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),wb(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 Uj(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return wb(!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 Eb(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 Bj(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:s=""}=typeof e=="string"?Xo(e):e;return{pathname:r?r.startsWith("/")?r:zj(r,t):t,search:Vj(n),hash:qj(s)}}function zj(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 xd(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 Wj(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function _b(e,t){let r=Wj(e);return t?r.map((n,s)=>s===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Cb(e,t,r,n){n===void 0&&(n=!1);let s;typeof e=="string"?s=Xo(e):(s=ua({},e),Je(!s.pathname||!s.pathname.includes("?"),xd("?","pathname","search",s)),Je(!s.pathname||!s.pathname.includes("#"),xd("#","pathname","hash",s)),Je(!s.search||!s.search.includes("#"),xd("#","search","hash",s)));let o=e===""||s.pathname==="",i=o?"/":s.pathname,a;if(i==null)a=r;else{let f=t.length-1;if(!n&&i.startsWith("..")){let h=i.split("/");for(;h[0]==="..";)h.shift(),f-=1;s.pathname=h.join("/")}a=f>=0?t[f]:"/"}let l=Bj(s,a),c=i&&i!=="/"&&i.endsWith("/"),d=(o||i===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(c||d)&&(l.pathname+="/"),l}const ms=e=>e.join("/").replace(/\/\/+/g,"/"),Hj=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Vj=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,qj=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Kj(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const kb=["post","put","patch","delete"];new Set(kb);const Gj=["get",...kb];new Set(Gj);/** 226 * React Router v6.26.2 227 * 228 * Copyright (c) Remix Software Inc. 229 * 230 * This source code is licensed under the MIT license found in the 231 * LICENSE.md file in the root directory of this source tree. 232 * 233 * @license MIT 234 */function da(){return da=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},da.apply(this,arguments)}const $p=p.createContext(null),Yj=p.createContext(null),Oa=p.createContext(null),pu=p.createContext(null),js=p.createContext({outlet:null,matches:[],isDataRoute:!1}),Tb=p.createContext(null);function Ia(){return p.useContext(pu)!=null}function mu(){return Ia()||Je(!1),p.useContext(pu).location}function Nb(e){p.useContext(Oa).static||p.useLayoutEffect(e)}function gu(){let{isDataRoute:e}=p.useContext(js);return e?lA():Jj()}function Jj(){Ia()||Je(!1);let e=p.useContext($p),{basename:t,future:r,navigator:n}=p.useContext(Oa),{matches:s}=p.useContext(js),{pathname:o}=mu(),i=JSON.stringify(_b(s,r.v7_relativeSplatPath)),a=p.useRef(!1);return Nb(()=>{a.current=!0}),p.useCallback(function(c,d){if(d===void 0&&(d={}),!a.current)return;if(typeof c=="number"){n.go(c);return}let f=Cb(c,JSON.parse(i),o,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:ms([t,f.pathname])),(d.replace?n.replace:n.push)(f,d.state,d)},[t,n,i,o,e])}function Qj(e,t){return Xj(e,t)}function Xj(e,t,r,n){Ia()||Je(!1);let{navigator:s}=p.useContext(Oa),{matches:o}=p.useContext(js),i=o[o.length-1],a=i?i.params:{};i&&i.pathname;let l=i?i.pathnameBase:"/";i&&i.route;let c=mu(),d;if(t){var f;let b=typeof t=="string"?Xo(t):t;l==="/"||(f=b.pathname)!=null&&f.startsWith(l)||Je(!1),d=b}else d=c;let h=d.pathname||"/",v=h;if(l!=="/"){let b=l.replace(/^\//,"").split("/");v="/"+h.replace(/^\//,"").split("/").slice(b.length).join("/")}let w=Tj(e,{pathname:v}),m=nA(w&&w.map(b=>Object.assign({},b,{params:Object.assign({},a,b.params),pathname:ms([l,s.encodeLocation?s.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?l:ms([l,s.encodeLocation?s.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),o,r,n);return t&&m?p.createElement(pu.Provider,{value:{location:da({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Cn.Pop}},m):m}function Zj(){let e=aA(),t=Kj(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 p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),r?p.createElement("pre",{style:s},r):null,null)}const eA=p.createElement(Zj,null);class tA extends p.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?p.createElement(js.Provider,{value:this.props.routeContext},p.createElement(Tb.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function rA(e){let{routeContext:t,match:r,children:n}=e,s=p.useContext($p);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),p.createElement(js.Provider,{value:t},n)}function nA(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 d=i.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);d>=0||Je(!1),i=i.slice(0,Math.min(i.length,d+1))}let l=!1,c=-1;if(r&&n&&n.v7_partialHydration)for(let d=0;d<i.length;d++){let f=i[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(c=d),f.route.id){let{loaderData:h,errors:v}=r,w=f.route.loader&&h[f.route.id]===void 0&&(!v||v[f.route.id]===void 0);if(f.route.lazy||w){l=!0,c>=0?i=i.slice(0,c+1):i=[i[0]];break}}}return i.reduceRight((d,f,h)=>{let v,w=!1,m=null,b=null;r&&(v=a&&f.route.id?a[f.route.id]:void 0,m=f.route.errorElement||eA,l&&(c<0&&h===0?(w=!0,b=null):c===h&&(w=!0,b=f.route.hydrateFallbackElement||null)));let g=t.concat(i.slice(0,h+1)),y=()=>{let x;return v?x=m:w?x=b:f.route.Component?x=p.createElement(f.route.Component,null):f.route.element?x=f.route.element:x=d,p.createElement(rA,{match:f,routeContext:{outlet:d,matches:g,isDataRoute:r!=null},children:x})};return r&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?p.createElement(tA,{location:r.location,revalidation:r.revalidation,component:m,error:v,children:y(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):y()},null)}var Pb=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Pb||{}),Ec=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}(Ec||{});function sA(e){let t=p.useContext($p);return t||Je(!1),t}function oA(e){let t=p.useContext(Yj);return t||Je(!1),t}function iA(e){let t=p.useContext(js);return t||Je(!1),t}function Rb(e){let t=iA(),r=t.matches[t.matches.length-1];return r.route.id||Je(!1),r.route.id}function aA(){var e;let t=p.useContext(Tb),r=oA(Ec.UseRouteError),n=Rb(Ec.UseRouteError);return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function lA(){let{router:e}=sA(Pb.UseNavigateStable),t=Rb(Ec.UseNavigateStable),r=p.useRef(!1);return Nb(()=>{r.current=!0}),p.useCallback(function(s,o){o===void 0&&(o={}),r.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,da({fromRouteId:t},o)))},[e,t])}function vu(e){let{to:t,replace:r,state:n,relative:s}=e;Ia()||Je(!1);let{future:o,static:i}=p.useContext(Oa),{matches:a}=p.useContext(js),{pathname:l}=mu(),c=gu(),d=Cb(t,_b(a,o.v7_relativeSplatPath),l,s==="path"),f=JSON.stringify(d);return p.useEffect(()=>c(JSON.parse(f),{replace:r,state:n,relative:s}),[c,f,s,r,n]),null}function ns(e){Je(!1)}function cA(e){let{basename:t="/",children:r=null,location:n,navigationType:s=Cn.Pop,navigator:o,static:i=!1,future:a}=e;Ia()&&Je(!1);let l=t.replace(/^\/*/,"/"),c=p.useMemo(()=>({basename:l,navigator:o,static:i,future:da({v7_relativeSplatPath:!1},a)}),[l,a,o,i]);typeof n=="string"&&(n=Xo(n));let{pathname:d="/",search:f="",hash:h="",state:v=null,key:w="default"}=n,m=p.useMemo(()=>{let b=Eb(d,l);return b==null?null:{location:{pathname:b,search:f,hash:h,state:v,key:w},navigationType:s}},[l,d,f,h,v,w,s]);return m==null?null:p.createElement(Oa.Provider,{value:c},p.createElement(pu.Provider,{children:r,value:m}))}function uA(e){let{children:t,location:r}=e;return Qj(Gf(t),r)}new Promise(()=>{});function Gf(e,t){t===void 0&&(t=[]);let r=[];return p.Children.forEach(e,(n,s)=>{if(!p.isValidElement(n))return;let o=[...t,s];if(n.type===p.Fragment){r.push.apply(r,Gf(n.props.children,o));return}n.type!==ns&&Je(!1),!n.props.index||!n.props.children||Je(!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=Gf(n.props.children,o)),r.push(i)}),r}/** 235 * React Router DOM v6.26.2 236 * 237 * Copyright (c) Remix Software Inc. 238 * 239 * This source code is licensed under the MIT license found in the 240 * LICENSE.md file in the root directory of this source tree. 241 * 242 * @license MIT 243 */const dA="6";try{window.__reactRouterVersion=dA}catch{}const fA="startTransition",uv=Fy[fA];function hA(e){let{basename:t,children:r,future:n,window:s}=e,o=p.useRef();o.current==null&&(o.current=_j({window:s,v5Compat:!0}));let i=o.current,[a,l]=p.useState({action:i.action,location:i.location}),{v7_startTransition:c}=n||{},d=p.useCallback(f=>{c&&uv?uv(()=>l(f)):l(f)},[l,c]);return p.useLayoutEffect(()=>i.listen(d),[i,d]),p.createElement(cA,{basename:t,children:r,location:a.location,navigationType:a.action,navigator:i,future:n})}var dv;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(dv||(dv={}));var fv;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(fv||(fv={}));const Pe=p.forwardRef(({className:e,...t},r)=>u.jsx("div",{ref:r,className:ie("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));
243Pe.displayName="Card";const Dt=p.forwardRef(({className:e,...t},r)=>u.jsx("div",{ref:r,className:ie("flex flex-col space-y-1.5 p-6",e),...t}));Dt.displayName="CardHeader";const Lt=p.forwardRef(({className:e,...t},r)=>u.jsx("h3",{ref:r,className:ie("text-2xl font-semibold leading-none tracking-tight",e),...t}));Lt.displayName="CardTitle";const jb=p.forwardRef(({className:e,...t},r)=>u.jsx("p",{ref:r,className:ie("text-sm text-muted-foreground",e),...t}));jb.displayName="CardDescription";const Oe=p.forwardRef(({className:e,...t},r)=>u.jsx("div",{ref:r,className:ie("p-6 pt-0",e),...t}));Oe.displayName="CardContent";const pA=p.forwardRef(({className:e,...t},r)=>u.jsx("div",{ref:r,className:ie("flex items-center p-6 pt-0",e),...t}));pA.displayName="CardFooter";const Mp=nu("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"}}),re=p.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...s},o)=>{const i=n?Mn:"button";return u.jsx(i,{className:ie(Mp({variant:t,size:r,className:e})),ref:o,...s})});re.displayName="Button";function $i(e,t){const[r,n]=p.useState(()=>{try{const o=window.localStorage.getItem(e);return o?JSON.parse(o):t}catch(o){return console.error(`Error reading localStorage key "${e}":`,o),t}});return[r,o=>{try{const i=o instanceof Function?o(r):o;n(i),window.localStorage.setItem(e,JSON.stringify(i))}catch(i){console.error(`Error setting localStorage key "${e}":`,i)}}]}function mA(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(d){try{c(n.next(d))}catch(f){i(f)}}function l(d){try{c(n.throw(d))}catch(f){i(f)}}function c(d){d.done?o(d.value):s(d.value).then(a,l)}c((n=n.apply(e,t||[])).next())})}const gA=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class Fp 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 vA extends Fp{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class hv extends Fp{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class pv extends Fp{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var Yf;(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"})(Yf||(Yf={}));class yA{constructor(t,{headers:r={},customFetch:n,region:s=Yf.Any}={}){this.url=t,this.headers=r,this.region=s,this.fetch=gA(n)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return mA(this,arguments,void 0,function*(r,n={}){var s;let o,i;try{const{headers:a,method:l,body:c,signal:d,timeout:f}=n;let h={},{region:v}=n;v||(v=this.region);const w=new URL(`${this.url}/${r}`);v&&v!=="any"&&(h["x-region"]=v,w.searchParams.set("forceFunctionRegion",v));let m;c&&(a&&!Object.prototype.hasOwnProperty.call(a,"Content-Type")||!a)?typeof Blob<"u"&&c instanceof Blob||c instanceof ArrayBuffer?(h["Content-Type"]="application/octet-stream",m=c):typeof c=="string"?(h["Content-Type"]="text/plain",m=c):typeof FormData<"u"&&c instanceof FormData?m=c:(h["Content-Type"]="application/json",m=JSON.stringify(c)):c&&typeof c!="string"&&!(typeof Blob<"u"&&c instanceof Blob)&&!(c instanceof ArrayBuffer)&&!(typeof FormData<"u"&&c instanceof FormData)?m=JSON.stringify(c):m=c;let b=d;f&&(i=new AbortController,o=setTimeout(()=>i.abort(),f),d?(b=i.signal,d.addEventListener("abort",()=>i.abort())):b=i.signal);const g=yield this.fetch(w.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},h),this.headers),a),body:m,signal:b}).catch(E=>{throw new vA(E)}),y=g.headers.get("x-relay-error");
243if(y&&y==="true")throw new hv(g);if(!g.ok)throw new pv(g);let x=((s=g.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),S;return x==="application/json"?S=yield g.json():x==="application/octet-stream"||x==="application/pdf"?S=yield g.blob():x==="text/event-stream"?S=g:x==="multipart/form-data"?S=yield g.formData():S=yield g.text(),{data:S,error:null,response:g}}catch(a){return{data:null,error:a,response:a instanceof pv||a instanceof hv?a.context:void 0}}finally{o&&clearTimeout(o)}})}}const Ab=3,mv=e=>Math.min(1e3*2**e,3e4),wA=[520,503],Ob=["GET","HEAD","OPTIONS"];var xA=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 gv(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 bA(e,t,r,n){return!(!n||r>=Ab||!Ob.includes(e)||!wA.includes(t))}var SA=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=new Headers(r.headers);i>0&&c.set("X-Retry-Count",String(i));let d;try{d=await n(r.url.toString(),{method:r.method,headers:c,body:JSON.stringify(r.body,(f,h)=>typeof h=="bigint"?h.toString():h),signal:r.signal})}catch(f){if((f==null?void 0:f.name)==="AbortError"||(f==null?void 0:f.code)==="ABORT_ERR"||!Ob.includes(r.method))throw f;if(r.retryEnabled&&i<Ab){const h=mv(i);i++,await gv(h,r.signal);continue}throw f}if(bA(r.method,d.status,i,r.retryEnabled)){var a,l;const f=(a=(l=d.headers)===null||l===void 0?void 0:l.get("Retry-After"))!==null&&a!==void 0?a:null,h=f!==null?Math.max(0,parseInt(f,10)||0)*1e3:mv(i);await d.text(),i++,await gv(h,r.signal);continue}return await r.processResponse(d)}})();return this.shouldThrowOnError||(o=o.catch(i=>{var a;let l="",c="",d="";const f=i==null?void 0:i.cause;if(f){var h,v,w,m;const y=(h=f==null?void 0:f.message)!==null&&h!==void 0?h:"",x=(v=f==null?void 0:f.code)!==null&&v!==void 0?v:"";l=`${(w=i==null?void 0:i.name)!==null&&w!==void 0?w:"FetchError"}: ${i==null?void 0:i.message}`,l+=` 244 245Caused by: ${(m=f==null?void 0:f.name)!==null&&m!==void 0?m:"Error"}: ${y}`,x&&(l+=` (${x})`),f!=null&&f.stack&&(l+=` 246${f.stack}`)}else{var b;l=(b=i==null?void 0:i.stack)!==null&&b!==void 0?b:""}const g=this.url.toString().length;return(i==null?void 0:i.name)==="AbortError"||(i==null?void 0:i.code)==="ABORT_ERR"?(d="",c="Request was aborted (timeout or manual cancellation)",g>this.urlLengthLimit&&(c+=`. Note: Your request URL is ${g} 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.`)):((f==null?void 0:f.name)==="HeadersOverflowError"||(f==null?void 0:f.code)==="UND_ERR_HEADERS_OVERFLOW")&&(d="",c="HTTP headers exceeded server limits (typically 16KB)",g>this.urlLengthLimit&&(c+=`. Your request URL is ${g} 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:d},data:null,count:null,status:0,statusText:""}}
246)),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();h===""||(t.headers.get("Accept")==="text/csv"||t.headers.get("Accept")&&(!((c=t.headers.get("Accept"))===null||c===void 0)&&c.includes("application/vnd.pgrst.plan+text"))?n=h:n=JSON.parse(h))}const d=(a=t.headers.get("Prefer"))===null||a===void 0?void 0:a.match(/count=(exact|planned|estimated)/),f=(l=e.headers.get("content-range"))===null||l===void 0?void 0:l.split("/");d&&f&&f.length>1&&(s=parseInt(f[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 d=await e.text();try{r=JSON.parse(d),Array.isArray(r)&&e.status===404&&(n=[],r=null,o=200,i="OK")}catch{e.status===404&&d===""?(o=204,i="No Content"):r={message:d}}if(r&&t.shouldThrowOnError)throw new xA(r)}return{success:r===null,error:r,data:n,count:s,status:o,statusText:i}}returns(){return this}overrideTypes(){return this}},EA=class extends SA{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 vv=new RegExp("[,()]");var Ks=class extends EA{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"&&vv.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"&&vv.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])=>
246r!==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}},_A=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 Ks({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>
2460){const l=[...new Set(a)].map(c=>`"${c}"`);o.searchParams.set("columns",l.join(","))}}return new Ks({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((d,f)=>d.concat(Object.keys(f)),[]);if(c.length>0){const d=[...new Set(c)].map(f=>`"${f}"`);a.searchParams.set("columns",d.join(","))}}return new Ks({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 Ks({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 Ks({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 fa(e){"@babel/helpers - typeof";return fa=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},fa(e)}function CA(e,t){if(fa(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(fa(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kA(e){var t=CA(e,"string");return fa(t)=="symbol"?t:t+""}function TA(e,t,r){return(t=kA(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yv(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 ml(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?yv(Object(r),!0).forEach(function(n){TA(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):yv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var NA=class Ib{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,d)=>{const f=new AbortController,h=setTimeout(()=>f.abort(),o),v=d==null?void 0:d.signal;if(v){if(v.aborted)return clearTimeout(h),l(c,d);const w=()=>{clearTimeout(h),f.abort()};return v.addEventListener("abort",w,{once:!0}),l(c,ml(ml({},d),{},{signal:f.signal})).finally(()=>{clearTimeout(h),v.removeEventListener("abort",w)})}return l(c,ml(ml({},d),{},{signal:f.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 _A(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 Ib(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 d=v=>v!==null&&typeof v=="object"&&(!Array.isArray(v)||v.some(d)),f=n&&Object.values(r).some(d);f?(a="POST",c=r):n||s?(a=n?"HEAD":"GET",Object.entries(r).filter(([v,w])=>w!==void 0).map(([v,w])=>[v,Array.isArray(w)?`{${w.join(",")}}`:`${w}
246`]).forEach(([v,w])=>{l.searchParams.append(v,w)})):(a="POST",c=r);const h=new Headers(this.headers);return f?h.set("Prefer",o?`count=${o},return=minimal`:"return=minimal"):o&&h.set("Prefer",`count=${o}`),new Ks({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 PA{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const r=globalThis.process;if(r){const n=r.versions;if(n&&n.node){const s=n.node,o=parseInt(s.replace(/^v/,"").split(".")[0]);return o>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${o} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${o} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option: 247import ws from "ws" 248new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.constructor)return t.constructor;let r=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(r+=` 249 250Suggested solution: ${t.workaround}`),new Error(r)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const RA="2.105.1",jA=`realtime-js/${RA}`,AA="1.0.0",Db="2.0.0",OA=Db,IA=1e4,DA=100,gn={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Lb={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave",access_token:"access_token"},Jf={connecting:"connecting",open:"open",closing:"closing",closed:"closed"};class LA{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=t.topic,a=(s=t.ref)!==null&&s!==void 0?s:"",l=(o=t.join_ref)!==null&&o!==void 0?o:"",c=t.payload.event,d=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},f=Object.keys(d).length===0?"":JSON.stringify(d);if(l.length>255)throw new Error(`joinRef length ${l.length} exceeds maximum of 255`);if(a.length>255)throw new Error(`ref length ${a.length} exceeds maximum of 255`);if(i.length>255)throw new Error(`topic length ${i.length} exceeds maximum of 255`);if(c.length>255)throw new Error(`userEvent length ${c.length} exceeds maximum of 255`);if(f.length>255)throw new Error(`metadata length ${f.length} exceeds maximum of 255`);const h=this.USER_BROADCAST_PUSH_META_LENGTH+l.length+a.length+i.length+c.length+f.length,v=new ArrayBuffer(this.HEADER_LENGTH+h);let w=new DataView(v),m=0;w.setUint8(m++,this.KINDS.userBroadcastPush),w.setUint8(m++,l.length),w.setUint8(m++,a.length),w.setUint8(m++,i.length),w.setUint8(m++,c.length),w.setUint8(m++,f.length),w.setUint8(m++,r),Array.from(l,g=>w.setUint8(m++,g.charCodeAt(0))),Array.from(a,g=>w.setUint8(m++,g.charCodeAt(0))),Array.from(i,g=>w.setUint8(m++,g.charCodeAt(0))),Array.from(c,g=>w.setUint8(m++,g.charCodeAt(0))),Array.from(f,g=>w.setUint8(m++,g.charCodeAt(0)));var b=new Uint8Array(v.byteLength+n.byteLength);return b.set(new Uint8Array(v),0),b.set(new Uint8Array(n),v.byteLength),b.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;
250const d=n.decode(t.slice(l,l+o));l=l+o;const f=n.decode(t.slice(l,l+i));l=l+i;const h=t.slice(l,t.byteLength),v=a===this.JSON_ENCODING?JSON.parse(n.decode(h)):h,w={type:this.BROADCAST_EVENT,event:d,payload:v};return i>0&&(w.meta=JSON.parse(f)),{join_ref:null,ref:null,topic:c,event:this.BROADCAST_EVENT,payload:w}}_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 Ne;(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"})(Ne||(Ne={}));const wv=(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]=$A(i,e,t,s),o),{}):{}},$A=(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)?$b(o,i):Qf(i)},$b=(e,t)=>{if(e.charAt(0)==="_"){const r=e.slice(1,e.length);return BA(t,r)}switch(e){case Ne.bool:return MA(t);case Ne.float4:case Ne.float8:case Ne.int2:case Ne.int4:case Ne.int8:case Ne.numeric:case Ne.oid:return FA(t);case Ne.json:case Ne.jsonb:return UA(t);case Ne.timestamp:return zA(t);case Ne.abstime:case Ne.date:case Ne.daterange:case Ne.int4range:case Ne.int8range:case Ne.money:case Ne.reltime:case Ne.text:case Ne.time:case Ne.timestamptz:case Ne.timetz:case Ne.tsrange:case Ne.tstzrange:return Qf(t);default:return Qf(t)}},Qf=e=>e,MA=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},FA=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},UA=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},BA=(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=>$b(t,a))}return e},zA=e=>typeof e=="string"?e.replace(" ","T"):e,Mb=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 Mi=e=>typeof e=="function"?e:function(){return e},WA=typeof self<"u"?self:null,Gs=typeof window<"u"?window:null,kr=WA||Gs||globalThis,HA="2.0.0",VA=1e4,qA=1e3,Rr={connecting:0,open:1,closing:2,closed:3},St={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},zr={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},Xf={longpoll:"longpoll",websocket:"websocket"},KA={complete:4},Zf="base64url.bearer.phx.",gl=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})}},Fb=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))}},GA=class{constructor(e,t,r){this.state=St.closed,this.topic=e,this.params=Mi(t||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new gl(this,zr.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new Fb(()=>{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=St.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(n=>n.send()),this.pushBuffer=[]}),this.joinPush.receive("error",n=>{this.state=St.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=St.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=St.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 gl(this,zr.leave,Mi({}),this.timeout).send(),this.state=St.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(zr.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 250
250teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=St.closed,this.bindings=[]}onClose(e){this.on(zr.close,e)}onError(e){return this.on(zr.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 gl(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=St.leaving;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(zr.close,"leave")},r=new gl(this,zr.leave,Mi({}),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=St.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===St.closed}isErrored(){return this.state===St.errored}isJoined(){return this.state===St.joined}isJoining(){return this.state===St.joining}isLeaving(){return this.state===St.leaving}},_c=class{static request(e,t,r,n,s,o,i){if(kr.XDomainRequest){let a=new kr.XDomainRequest;return this.xdomainRequest(a,e,t,n,s,o,i)}else if(kr.XMLHttpRequest){let a=new kr.XMLHttpRequest;return this.xhrRequest(a,e,t,r,n,s,o,i)}else{if(kr.fetch&&kr.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),kr.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===KA.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)}`}},YA=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)},Ds=class{constructor(e,t){t&&t.length===2&&t[1].startsWith(Zf)&&(this.authToken=atob(t[1].slice(Zf.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=Rr.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+Xf.websocket),"$1/"+Xf.longpoll)}endpointURL(){return _c.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,r){this.close(e,t,r),this.readyState=Rr.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===Rr.open||this.readyState===Rr.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=Rr.open,this.onopen({}),this.poll();break;
250case 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=YA(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(` 251`),()=>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=Rr.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=_c.request(e,this.endpointURL(),t,r,this.timeout,i,a=>{this.reqs.delete(o),this.isActive()&&s(a)}),this.reqs.add(o)}},JA=class Ei{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=Ei.syncState(this.state,s,o,i),this.pendingDiffs.forEach(l=>{this.state=Ei.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=Ei.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 Ei.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 d=o[l];if(d){let f=c.metas.map(m=>m.phx_ref),h=d.metas.map(m=>m.phx_ref),v=c.metas.filter(m=>h.indexOf(m.phx_ref)<0),w=d.metas.filter(m=>f.indexOf(m.phx_ref)<0);v.length>0&&(i[l]=c,i[l].metas=v),w.length>0&&(a[l]=this.clone(d),a[l].metas=w)}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 d=t[a].metas.map(h=>h.phx_ref),f=c.metas.filter(h=>d.indexOf(h.phx_ref)<0);t[a].metas.unshift(...f)}n(a,c,l)}),this.map(i,(a,l)=>{let c=t[a];if(!c)return;let d=l.metas.map(f=>f.phx_ref);c.metas=c.metas.filter(f=>d.indexOf(f.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))}},vl={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,f=>l.setUint8(c++,f.charCodeAt(0))),Array.from(r,f=>l.setUint8(c++,f.charCodeAt(0))),Array.from(s,f=>l.setUint8(c++,f.charCodeAt(0))),Array.from(n,f=>l.setUint8(c++,f.charCodeAt(0)));var d=new Uint8Array(a.byteLength+o.byteLength);return d.set(new Uint8Array(a),0),d.set(new Uint8Array(o),a.byteLength),d.buffer},binaryDecode(e){let t=new DataView(e),r=t.getUint8(0),n=new TextDecoder;
vendor: 8,635 bytes, line 251
251switch(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 d=e.slice(i,e.byteLength);return{join_ref:a,ref:null,topic:l,event:c,payload:d}},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 d=r.decode(e.slice(a,a+o));a=a+o;let f=r.decode(e.slice(a,a+i));a=a+i;let h=e.slice(a,e.byteLength),v={status:f,response:h};return{join_ref:l,ref:c,topic:d,event:zr.reply,payload:v}},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}}},QA=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=t.timeout||VA,this.transport=t.transport||kr.WebSocket||Ds,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=t.sessionStorage||kr&&kr.sessionStorage,this.establishedConnections=0,this.defaultEncoder=vl.encode.bind(vl),this.defaultDecoder=vl.decode.bind(vl),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!==Ds?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let r=null;Gs&&Gs.addEventListener&&(Gs.addEventListener("pagehide",n=>{this.conn&&(this.disconnect(),r=this.connectClock)}),Gs.addEventListener("pageshow",n=>{r===this.connectClock&&(r=null,this.connect())}),Gs.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=n=>t.rejoinAfterMs?t.rejoinAfterMs(n):[1e3,2e3,5e3][n-1]||1e4,this.reconnectAfterMs=n=>t.reconnectAfterMs?t.reconnectAfterMs(n):[10,50,100,150,200,250,500,1e3,2e3][n-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(n,s,o)=>{console.log(`${n}: ${s}`,o)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=Mi(t.params||{}),this.endPoint=`${e}/${Xf.websocket}`,this.vsn=t.vsn||HA,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new Fb(()=>{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 Ds}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=_c.appendParams(_c.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=Mi(e)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Ds?this.connectWithFallback(Ds,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 Ds:return"LongPoll";default:return e.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let e;this.authToken&&(e=["phoenix",`${Zf}${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(),qA,"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===Rr.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 251
251triggerChanError(e){this.channels.forEach(t=>{t.isErrored()||t.isLeaving()||t.isClosed()||t.trigger(zr.error,e)})}connectionState(){switch(this.conn&&this.conn.readyState){case Rr.connecting:return"connecting";case Rr.open:return"open";case Rr.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 GA(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=ZA(r);this.presence=new JA(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=XA(t),Object.getOwnPropertyNames(t).reduce((r,n)=>{const s=t[n];return r[n]=Kl(s),r},{})}static onJoinPayload(t,r,n){const s=xv(r),o=Kl(n);return{event:"join",key:t,currentPresences:s,newPresences:o}}static onLeavePayload(t,r,n){const s=xv(r),o=Kl(n);return{event:"leave",key:t,currentPresences:s,leftPresences:o}}}function Kl(e){return e.metas.map(t=>(t.presence_ref=t.phx_ref,delete t.phx_ref,delete t.phx_ref_prev,t))}function XA(e){return JSON.parse(JSON.stringify(e))}function ZA(e){return(e==null?void 0:e.events)&&{events:e.events}}function xv(e){return e!=null&&e.metas?Kl(e):[]}var bv;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(bv||(bv={}));class e2{get state(){return this.presenceAdapter.state}constructor(t,r){this.channel=t,this.presenceAdapter=new Fi(this.channel.channelAdapter,r)}}function t2(e){if(e instanceof Error)return e;if(typeof e=="string")return new Error(e);
251if(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 r2{constructor(t,r,n){const s=n2(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>DA){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===gn.joined}isJoined(){return this.state===gn.joined}isJoining(){return this.state===gn.joining}isClosed(){return this.state===gn.closed}isLeaving(){return this.state===gn.leaving}updateFilterBindings(t){this.channel.filterBindings=t}updatePayloadTransform(t){this.channel.onMessage=t}getChannel(){return this.channel}}function n2(e){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},e.config)}}var Sv;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(Sv||(Sv={}));var co;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(co||(co={}));var Wr;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(Wr||(Wr={}));class Ui{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 r2(this.socket.socketAdapter,t,this.params),this.presence=new e2(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=Mb(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(v=>v.filter))!==null&&s!==void 0?s:[],d=!!this.bindings[co.PRESENCE]&&this.bindings[co.PRESENCE].length>0||((o=this.params.config.presence)===null||o===void 0?void 0:o.enabled)===!0,f={},h={broadcast:i,presence:Object.assign(Object.assign({},a),{enabled:d}),postgres_changes:c,private:l};this.socket.accessTokenValue&&(f.access_token=this.socket.accessTokenValue),this._onError(v=>{t==null||t(Wr.CHANNEL_ERROR,t2(v))}),this._onClose(()=>t==null?void 0:t(Wr.CLOSED)),this.updateJoinPayload(Object.assign({config:h},f)),this._updateFilterMessage(),this.channelAdapter.subscribe(r).receive("ok",async({postgres_changes:v})=>
251{if(this.socket._isManualToken()||this.socket.setAuth(),v===void 0){t==null||t(Wr.SUBSCRIBED);return}this._updatePostgresBindings(v,t)}).receive("error",v=>{this.state=gn.errored;const w=Object.values(v).join(", ")||"error";t==null||t(Wr.CHANNEL_ERROR,new Error(w,{cause:v}))}).receive("timeout",()=>{t==null||t(Wr.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:d,table:f,filter:h}}=l,v=t&&t[a];if(v&&v.event===c&&Ui.isFilterValueEqual(v.schema,d)&&Ui.isFilterValueEqual(v.table,f)&&Ui.isFilterValueEqual(v.filter,h))i.push(Object.assign(Object.assign({},l),{id:v.id}));else{this.unsubscribe(),this.state=gn.errored,r==null||r(Wr.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=i,this.state!=gn.errored&&r&&r(Wr.SUBSCRIBED)}presenceState(){return this.presence.state}async track(t,r={}){return await this.send({type:"presence",event:"track",payload:t},r.timeout||this.timeout)}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===co.PRESENCE||t===co.POSTGRES_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={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(o.Authorization=`Bearer ${this.socket.accessTokenValue}`);const i={method:"POST",headers:o,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:r,private:this.private}]})},a=await this._fetchWithTimeout(this.broadcastEndpointURL,i,(s=n.timeout)!==null&&s!==void 0?s:this.timeout);if(a.status===202)return{success:!0};let l=a.statusText;try{const c=await a.json();l=c.error||c.message||l}catch{}return Promise.reject(new Error(l))}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
251in 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.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=this.channelAdapter.on(t,n),i={type:s,filter:r,callback:n,ref:o};return this.bindings[s]?this.bindings[s].push(i):this.bindings[s]=[i],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,d;const f=t.event.toLocaleLowerCase();if(this._notThisChannelEvent(f,n))return!1;const h=(s=this.bindings[f])===null||s===void 0?void 0:s.find(v=>v.ref===t.ref);if(!h)return!0;if(["broadcast","presence","postgres_changes"].includes(f))if("id"in h){const v=h.id,w=(o=h.filter)===null||o===void 0?void 0:o.event;return v&&((i=r.ids)===null||i===void 0?void 0:i.includes(v))&&(w==="*"||(w==null?void 0:w.toLocaleLowerCase())===((a=r.data)===null||a===void 0?void 0:a.type.toLocaleLowerCase()))}else{const v=(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 v==="*"||v===((d=r==null?void 0:r.event)===null||d===void 0?void 0:d.toLocaleLowerCase())}else return h.type.toLocaleLowerCase()===f})}_notThisChannelEvent(t,r){const{close:n,error:s,leave:o,join:i}=Lb;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=wv(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(r.old=wv(t.columns,t.old_record)),r}}class s2{constructor(t,r){this.socket=new QA(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(()=>
251o("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()==Jf.connecting}isDisconnecting(){return this.socket.connectionState()==Jf.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const Ev={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},o2=[1e3,2e3,5e3,1e4],i2=1e4,a2=` 252 addEventListener("message", (e) => { 253 if (e.data.event === "start") { 254 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 255 } 256 });`;class l2{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 LA,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 s2(t,s),this.httpEndpoint=Mb(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 r.includes("Node.js")?new Error(`${r} 257 258To use Realtime in Node.js, you need to provide a WebSocket implementation: 259 260Option 1: Use Node.js 22+ which has native WebSocket support 261Option 2: Install and provide the "ws" package: 262 263 npm install ws 264 265 import ws from "ws" 266 const client = new RealtimeClient(url, { 267 ...options, 268 transport: ws 269 })`):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()||Jf.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 Ui(`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}
269this._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:jA};r&&s.updateJoinPayload(o),s.joinedOnce&&s.channelAdapter.isJoined()&&s.channelAdapter.push(Lb.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=="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([a2],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_initializeOptions(t){var r,n,s,o,i,a,l,c,d,f,h;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 v={};v.timeout=(s=t==null?void 0:t.timeout)!==null&&s!==void 0?s:IA,v.heartbeatIntervalMs=(o=t==null?void 0:t.heartbeatIntervalMs)!==null&&o!==void 0?o:Ev.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:Ev.HEARTBEAT_INTERVAL),v.transport=(l=t==null?void 0:t.transport)!==null&&l!==void 0?l:PA.getWebSocketConstructor(),v.params=t==null?void 0:t.params,v.logger=t==null?void 0:t.logger,v.heartbeatCallback=this._wrapHeartbeatCallback(t==null?void 0:t.heartbeatCallback),v.reconnectAfterMs=(c=t==null?void 0:t.reconnectAfterMs)!==null&&c!==void 0?c:g=>o2[g-1]||i2;let w,m;const b=(d=t==null?void 0:t.vsn)!==null&&d!==void 0?d:OA;switch(b){case AA:w=(g,y)=>y(JSON.stringify(g)),m=(g,y)=>y(JSON.parse(g));break;case Db:w=this.serializer.encode.bind(this.serializer),m=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${v.vsn}`)}if(v.vsn=b,v.encode=(f=t==null?void 0:t.encode)!==null&&f!==void 0?f:w,v.decode=(h=t==null?void 0:t.decode)!==null&&h!==void 0?h:m,v.beforeReconnect=this._reconnectAuth.bind(this),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,v.params=Object.assign(Object.assign({},v.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,v.autoSendHeartbeat=!this.worker}return v}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}
269var ha=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 c2(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 u2(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 d2(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:s,body:o,headers:i}){const a=c2(e.baseUrl,n,s),l=await u2(e.auth),c=await t(a,{method:r,headers:{...o?{"Content-Type":"application/json"}:{},...l,...i},body:o?JSON.stringify(o):void 0}),d=await c.text(),f=(c.headers.get("content-type")||"").includes("application/json"),h=f&&d?JSON.parse(d):d;if(!c.ok){const v=f?h:void 0,w=v==null?void 0:v.error;throw new ha((w==null?void 0:w.message)??`Request failed with status ${c.status}`,{status:c.status,icebergType:w==null?void 0:w.type,icebergCode:w==null?void 0:w.code,details:v})}return{status:c.status,headers:c.headers,data:h}}}}function yl(e){return e.join("�")}var f2=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:yl(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/${yl(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${yl(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${yl(e.namespace)}`}),!0}catch(t){if(t instanceof ha&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(r){if(r instanceof ha&&r.status===409)return;throw r}}};function Ls(e){return e.join("�")}var h2=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/${Ls(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/${Ls(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/${Ls(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/${Ls(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/${Ls(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/${Ls(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(r){if(r instanceof ha&&r.status===404)return!1;throw r}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(r){if(r instanceof ha&&r.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw r}}},p2=class{constructor(e){var n;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const r=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=d2({baseUrl:r,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(n=e.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new f2(this.client,t),this.tableOps=new h2(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)}
269async 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 pa(e){"@babel/helpers - typeof";return pa=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},pa(e)}function m2(e,t){if(pa(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(pa(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function g2(e){var t=m2(e,"string");return pa(t)=="symbol"?t:t+""}function v2(e,t,r){return(t=g2(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _v(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 oe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_v(Object(r),!0).forEach(function(n){v2(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_v(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var yu=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 wu(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var eh=class extends yu{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 oe({},super.toJSON())}},Ub=class extends yu{constructor(e,t,r="storage"){super(e,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};function Cc(e,t,r){const n=oe({},e),s=t.toLowerCase();for(const o of Object.keys(n))o.toLowerCase()===s&&delete n[o];return n[s]=r,n}function y2(e){const t={};for(const[r,n]of Object.entries(e))t[r.toLowerCase()]=n;return t}const w2=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),x2=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)},th=e=>{if(Array.isArray(e))return e.map(r=>th(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]=th(n)}),t},b2=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e),Cv=e=>{var t;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(t=e.error)===null||t===void 0?void 0:t.message)||JSON.stringify(e)},S2=async(e,t,r,n)=>{if(e!==null&&typeof e=="object"&&typeof e.json=="function"){const s=e;let o=parseInt(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 eh(Cv(i),o,a,n))}).catch(()=>{const i=o+"";t(new eh(s.statusText||`HTTP ${o} error`,o,i,n))})}else t(new Ub(Cv(e),e,n))},E2=(e,t,r,n)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};if(e==="GET"||e==="HEAD"||!n)return oe(oe({},s),r);if(x2(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=Cc(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),oe(oe({},s),r)};async function yi(e,t,r,n,s,o,i){return new Promise((a,l)=>{e(r,E2(t,n,s,o)).then(c=>{if(!c.ok)throw c;if(n!=null&&n.noResolveJson)return c;if(i==="vectors"){const d=c.headers.get("content-type");if(c.headers.get("content-length")==="0"||c.status===204)return{};if(!d||!d.includes("application/json"))return{}}return c.json()}).then(c=>a(c)).catch(c=>S2(c,l,n,i))})}function Bb(e="storage"){return{get:async(t,r,n,s)=>yi(t,"GET",r,n,s,void 0,e),post:async(t,r,n,s,o)=>yi(t,"POST",r,s,o,n,e),put:async(t,r,n,s,o)=>yi(t,"PUT",r,s,o,n,e),head:async(t,r,n,s)=>yi(t,"HEAD",r,oe(oe({},n),{},{noResolveJson:!0}),s,void 0,e),remove:async(t,r,n,s,o)=>yi(t,"DELETE",r,s,o,n,e)}}const _2=Bb("storage"),{get:ma,post:sr,put:rh,head:C2,remove:Up}=_2,$t=Bb("vectors");var Zo=class{constructor(e,t={},r,n="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=y2(t),this.fetch=w2(r),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=Cc(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(wu(r))return{data:null,error:r};throw r}}},k2=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t}then(e,t){return this.execute().then(e,t)}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(wu(t))return{data:null,error:t};throw t}}};let zb;zb=Symbol.toStringTag;var T2=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[zb]="BlobDownloadBuilder",this.promise=null}asStream(){return new k2(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(wu(t))return{data:null,error:t};throw t}}};const N2={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},kv={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var P2=class extends Zo{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=oe(oe({},kv),n);let a=oe(oe({},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,v]of Object.entries(n.headers))a=Cc(a,h,v);const c=s._removeEmptyFolders(t),d=s._getFinalPath(c),f=await(e=="PUT"?rh:sr)(s.fetch,`${s.url}/object/${d}`,o,oe({headers:a},i!=null&&i.duplex?{duplex:i.duplex}:{}));return{path:c,id:f.Id,fullPath:f.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=oe(oe({},kv),n);let d=oe(oe({},s.headers),{"x-upsert":String(c.upsert)});const f=c.metadata;if(typeof Blob<"u"&&r instanceof Blob?(l=new FormData,l.append("cacheControl",c.cacheControl),f&&l.append("metadata",s.encodeMetadata(f)),l.append("",r)):typeof FormData<"u"&&r instanceof FormData?(l=r,l.has("cacheControl")||l.append("cacheControl",c.cacheControl),f&&!l.has("metadata")&&l.a
269ppend("metadata",s.encodeMetadata(f))):(l=r,d["cache-control"]=`max-age=${c.cacheControl}`,d["content-type"]=c.contentType,f&&(d["x-metadata"]=s.toBase64(s.encodeMetadata(f))),(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,v]of Object.entries(n.headers))d=Cc(d,h,v);return{path:o,fullPath:(await rh(s.fetch,a.toString(),l,oe({headers:d},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=oe({},r.headers);t!=null&&t.upsert&&(s["x-upsert"]="true");const o=await sr(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 yu("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 sr(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:e,destinationKey:t,de
269stinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers}))}async copy(e,t,r){var n=this;return n.handleOperation(async()=>({path:(await sr(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 sr(n.fetch,`${n.url}/object/sign/${s}`,oe({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 sr(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=>oe(oe({},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=()=>ma(this.fetch,`${this.url}/${n}/${i}${o?`?${o}`:""}`,{headers:this.headers,noResolveJson:!0},r);return new T2(a,this.shouldThrowOnError)}async info(e){var t=this;const r=t._getFinalPath(e);return t.handleOperation(async()=>th(await ma(t.fetch,`${t.url}/object/info/${r}`,{headers:t.headers})))}async exists(e){var t=this;const r=t._getFinalPath(e);try{return await C2(t.fetch,`${t.url}/object/${r}`,{headers:t.headers}),{data:!0,error:null}}catch(s){if(t.shouldThrowOnError)throw s;if(wu(s)){var n;const o=s instanceof eh?s.status:s instanceof Ub?(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 Up(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,r){var n=this;return n.handleOperation(async()=>{const s=oe(oe(oe({},N2),t),{},{prefix:e||""});return await sr(n.fetch,`${n.url}/object/list/${n.bucketId}`,s,{headers:n.headers},r)})}async listV2(e,t){var r=this;return r.handleOperation(async()=>{const n=oe({},e);return await sr(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("quality",t.quality.toString()),e}};const R2="2.105.1",Da={"X-Client-Info":`storage-js/${R2}`};var j2=class extends Zo{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=oe(oe({},Da),t);super(o,i,r,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const r=t.listBucketOptionsToQueryString(e);return await ma(t.fetch,`${t.url}/bucket${r}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await ma(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var r=this;return r.handleOperation(async()=>await sr(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 rh(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 sr(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Up(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}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():""}},A2=class extends Zo{constructor(e,t={},r){const n=e.replace(/\/$/,""),s=oe(oe({},Da),t);super(n,s,r,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await sr(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>
269{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 ma(t.fetch,s,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Up(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!b2(e))throw new yu("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 p2({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}}}}})}},O2=class extends Zo{constructor(e,t={},r){const n=e.replace(/\/$/,""),s=oe(oe({},Da),{},{"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})||{})}},I2=class extends Zo{constructor(e,t={},r){const n=e.replace(/\/$/,""),s=oe(oe({},Da),{},{"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");if(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})||{})}},D2=class extends Zo{constructor(e,t={},r){const n=e.replace(/\/$/,""),s=oe(oe({},Da),{},{"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})||{})}},L2=class extends D2{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new $2(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)}},$2=class extends O2{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,oe(oe({},e),{},{vectorBucketName:r.vectorBucketName}))}
269async listIndexes(e={}){var t=()=>super.listIndexes,r=this;return t().call(r,oe(oe({},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 M2(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},M2=class extends I2{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,oe(oe({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(e){var t=()=>super.getVectors,r=this;return t().call(r,oe(oe({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,r=this;return t().call(r,oe(oe({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,r=this;return t().call(r,oe(oe({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,r=this;return t().call(r,oe(oe({},e),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},F2=class extends j2{constructor(e,t={},r,n){super(e,t,r,n)}from(e){return new P2(this.url,this.headers,e,this.fetch)}get vectors(){return new L2(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new A2(this.url+"/iceberg",this.headers,this.fetch)}};function xu(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 Wb="2.105.1",Ys=30*1e3,nh=3,bd=nh*Ys,U2="http://localhost:9999",B2="supabase.auth.token",z2={"X-Client-Info":`gotrue-js/${Wb}`},sh="X-Supabase-Api-Version",Hb={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},W2=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,H2=10*60*1e3;class ga 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 V(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class V2 extends ga{constructor(t,r,n){super(t,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function q2(e){return V(e)&&e.name==="AuthApiError"}class lr extends ga{constructor(t,r){super(t),this.name="AuthUnknownError",this.originalError=r}}class nn extends ga{constructor(t,r,n,s){super(t,n,s),this.name=r,this.status=n}}class et extends nn{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function wl(e){return V(e)&&e.name==="AuthSessionMissingError"}class $s extends nn{constructor(){super("Auth session or user missing","AuthInvalidToken
269ResponseError",500,void 0)}}class xl extends nn{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class bl extends nn{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 K2(e){return V(e)&&e.name==="AuthImplicitGrantRedirectError"}class Tv extends nn{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 G2 extends nn{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 oh extends nn{constructor(t,r){super(t,"AuthRetryableFetchError",r,void 0)}}function Sd(e){return V(e)&&e.name==="AuthRetryableFetchError"}class Nv extends nn{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 ih extends nn{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const kc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Pv=` 270\r=`.split(""),Y2=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<Pv.length;t+=1)e[Pv[t].charCodeAt(0)]=-2;for(let t=0;t<kc.length;t+=1)e[kc[t].charCodeAt(0)]=t;return e})();function Rv(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(kc[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(kc[n]),t.queuedBits-=6}}function Vb(e,t,r){const n=Y2[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 jv(e){const t=[],r=i=>{t.push(String.fromCodePoint(i))},n={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},o=i=>{X2(i,n,r)};for(let i=0;i<e.length;i+=1)Vb(e.charCodeAt(i),s,o);return t.join("")}function J2(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 Q2(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}J2(n,t)}}function X2(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 wo(e){const t=[],r={queue:0,queuedBits:0},n=s=>{t.push(s)};for(let s=0;s<e.length;s+=1)Vb(e.charCodeAt(s),r,n);return new Uint8Array(t)}function Z2(e){const t=[];return Q2(e,r=>t.push(r)),new Uint8Array(t)}function ls(e){const t=[],r={queue:0,queuedBits:0},n=s=>{t.push(s)};return e.forEach(s=>Rv(s,r,n)),Rv(null,r,n),t.join("")}function eO(e){return Math.round(Date.now()/1e3)+e}function tO(){return Symbol("auth-callback")}const st=()=>typeof window<"u"&&typeof document<"u",Zn={tested:!1,writable:!1},qb=()=>{if(!st())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Zn.tested)return Zn.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Zn.tested=!0,Zn.writable=!0}catch{Zn.tested=!0,Zn.writable=!1}return Zn.writable};function rO(e){const t={},r=new URL(e);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEac
270h((s,o)=>{t[o]=s})}catch{}return r.searchParams.forEach((n,s)=>{t[s]=n}),t}const Kb=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),nO=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Js=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},es=async(e,t)=>{const r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch{return r}},nt=async(e,t)=>{await e.removeItem(t)};class bu{constructor(){this.promise=new bu.promiseConstructor((t,r)=>{this.resolve=t,this.reject=r})}}bu.promiseConstructor=Promise;function Sl(e){const t=e.split(".");if(t.length!==3)throw new ih("Invalid JWT structure");for(let n=0;n<t.length;n++)if(!W2.test(t[n]))throw new ih("JWT not in base64url format");return{header:JSON.parse(jv(t[0])),payload:JSON.parse(jv(t[1])),signature:wo(t[2]),raw:{header:t[0],payload:t[1]}}}async function sO(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function oO(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 iO(e){return("0"+e.toString(16)).substr(-2)}function aO(){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,iO).join("")}async function lO(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 cO(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 lO(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Ms(e,t,r=!1){const n=aO();let s=n;r&&(s+="/recovery"),await Js(e,`${t}-code-verifier`,s);const o=await cO(n);return[o,n===o?"plain":"s256"]}const uO=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function dO(e){const t=e.headers.get(sh);if(!t||!t.match(uO))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function fO(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 hO(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 pO=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Fr(e){if(!pO.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function tr(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 Ed(){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 mO(e,t){return new Proxy(e,{get:(r,n,s)=>{if(n==="__isInsecureUserWarningProxy")return!0;
270if(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 Av(e){return JSON.parse(JSON.stringify(e))}const ss=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),gO=[502,503,504,520,521,522,523,524,530];async function Ov(e){var t;if(!nO(e))throw new oh(ss(e),0);if(gO.includes(e.status))throw new oh(ss(e),e.status);let r;try{r=await e.json()}catch(o){throw new lr(ss(o),o)}let n;const s=dO(e);if(s&&s.getTime()>=Hb["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 Nv(ss(r),e.status,((t=r.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(n==="session_not_found")throw new et}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 Nv(ss(r),e.status,r.weak_password.reasons);throw new V2(ss(r),e.status||500,n)}const vO=(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 J(e,t,r,n){var s;const o=Object.assign({},n==null?void 0:n.headers);o[sh]||(o[sh]=Hb["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 yO(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 yO(e,t,r,n,s,o){const i=vO(t,n,s,o);let a;try{a=await e(r,Object.assign({},i))}catch(l){throw console.error(l),new oh(ss(l),0)}if(a.ok||await Ov(a),n!=null&&n.noResolveJson)return a;try{return await a.json()}catch(l){await Ov(l)}}function Ht(e){var t;let r=null;bO(e)&&(r=Object.assign({},e),e.expires_at||(r.expires_at=eO(e.expires_in)));const n=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:r,user:n},error:null}}function Iv(e){const t=Ht(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 vn(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function wO(e){return{data:e,error:null}}function xO(e){const{action_link:t,email_otp:r,hashed_token:n,redirect_to:s,verification_type:o}=e,i=xu(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 Dv(e){return e}function bO(e){return e.access_token&&e.refresh_token&&e.expires_in}const _d=["global","local","others"];class SO{constructor({url:t="",headers:r={},fetch:n,experimental:s}){this.url=t,this.headers=r,this.fetch=Kb(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=_d[0]){if(_d.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${_d.join(", ")}`);try{return await J(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(n){if(V(n))return{data:null,error:n};throw n}}async inviteUserByEmail(t,r={}){try{return await J(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:vn})}catch(n){if(V(n))return{data:{user:null},error:n};throw n}}async generateLink(t){try{const{options:r}=t,n=xu(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 J(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:xO,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(V(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(t){try{return await J(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:vn})}catch(r){if(V(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},d=await J(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:Dv});if(d.error)throw d.error;const f=await d.json(),h=(i=d.headers.get("x-total-count"))!==null&&i!==void 0?i:0,v=(l=(a=d.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&l!==void 0?l:[];return v.length>0&&(v.forEach(w=>{const m=parseInt(w.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(w.split(";")[1].split("=")[1]);c[`${b}Page`]=m}),c.total=parseInt(h)),{data:Object.assign(Object.assign({},f),c),error:null}}catch(c){if(V(c))return{data:{users:[]},error:c};throw c}}async getUserById(t){Fr(t);try{return await J(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:vn})}catch(r){if(V(r))return{data:{user:null},error:r};throw r}}async updateUserById(t,r){Fr(t);try{return await J(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:r,headers:this.headers,xform:vn})}catch(n){if(V(n))return{data:{user:null},error:n};throw n}}async deleteUser(t,r=!1){Fr(t);
270try{return await J(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:r},xform:vn})}catch(n){if(V(n))return{data:{user:null},error:n};throw n}}async _listFactors(t){Fr(t.userId);try{const{data:r,error:n}=await J(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(V(r))return{data:null,error:r};throw r}}async _deleteFactor(t){Fr(t.userId),Fr(t.id);try{return{data:await J(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(r){if(V(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},d=await J(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:Dv});if(d.error)throw d.error;const f=await d.json(),h=(i=d.headers.get("x-total-count"))!==null&&i!==void 0?i:0,v=(l=(a=d.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&l!==void 0?l:[];return v.length>0&&(v.forEach(w=>{const m=parseInt(w.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(w.split(";")[1].split("=")[1]);c[`${b}Page`]=m}),c.total=parseInt(h)),{data:Object.assign(Object.assign({},f),c),error:null}}catch(c){if(V(c))return{data:{clients:[]},error:c};throw c}}async _createOAuthClient(t){try{return await J(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(V(r))return{data:null,error:r};throw r}}async _getOAuthClient(t){try{return await J(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(V(r))return{data:null,error:r};throw r}}async _updateOAuthClient(t,r){try{return await J(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(V(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(t){try{return await J(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(V(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(t){try{return await J(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(V(r))return{data:null,error:r};throw r}}async _listCustomProviders(t){try{const r={};return t!=null&&t.type&&(r.type=t.type),await J(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(V(r))return{data:{providers:[]},error:r};throw r}}async _createCustomProvider(t){try{return await J(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:t,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(V(r))return{data:null,error:r};throw r}}async _getCustomProvider(t){try{return await J(this.fetch,"GET",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(V(r))return{data:null,error:r};throw r}}async _updateCustomProvider(t,r){try{return await J(this.fetch,"PUT",`${this.url}/admin/custom-providers/${t}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(V(n))return{data:null,error:n};throw n}}async _deleteCustomProvider(t){try{return await J(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(V(r))return{data:null,error:r};throw r}}async _adminListPasskeys(t){tr(this.experimental),Fr(t.userId);try{return await J(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/passkeys`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(V(r))return{data:null,error:r};throw r}}async _adminDeletePasskey(t){tr(this.experimental),Fr(t.userId),Fr
270(t.passkeyId);try{return await J(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/passkeys/${t.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(V(r))return{data:null,error:r};throw r}}}function Lv(e={}){return{getItem:t=>e[t]||null,setItem:(t,r)=>{e[t]=r},removeItem:t=>{delete e[t]}}}const _r={debug:!!(globalThis&&qb()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class Gb extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class $v extends Gb{}async function EO(e,t,r){_r.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const n=new globalThis.AbortController;let s;t>0&&(s=setTimeout(()=>{n.abort(),_r.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t)),await Promise.resolve();try{return await globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async o=>{if(o){clearTimeout(s),_r.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,o.name);try{return await r()}finally{_r.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,o.name)}}else{if(t===0)throw _r.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new $v(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(_r.debug)try{const i=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(i,null," "))}catch(i){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",i)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),clearTimeout(s),await r()}})}catch(o){if(t>0&&clearTimeout(s),(o==null?void 0:o.name)==="AbortError"&&t>0){if(n.signal.aborted)return _r.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire timeout, recovering by stealing lock",e),console.warn(`@supabase/gotrue-js: Lock "${e}" was not released within ${t}ms. This may indicate an orphaned lock from a component unmount (e.g., React Strict Mode). Forcefully acquiring the lock to recover.`),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,{mode:"exclusive",steal:!0},async i=>{if(i){_r.debug&&console.log("@supabase/gotrue-js: navigatorLock: recovered (stolen)",e,i.name);try{return await r()}finally{_r.debug&&console.log("@supabase/gotrue-js: navigatorLock: released (stolen)",e,i.name)}}else return console.warn("@supabase/gotrue-js: Navigator LockManager returned null lock even with steal: true"),await r()}));throw _r.debug&&console.log("@supabase/gotrue-js: navigatorLock: lock was stolen by another request",e),new $v(`Lock "${e}" was released because another request stole it`)}throw o}}function _O(){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 Yb(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function CO(e){return parseInt(e,16)}function kO(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,n=>n.toString(16).padStart(2,"0")).join("")}function TO(e){var t;const{chainId:r,domain:n,expirationTime:s,issuedAt:o=new Date,nonce:i,notBefore:a,requestId:l,resources:c,scheme:d,uri:f,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(!f)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}`);
270if(!((t=e.statement)===null||t===void 0)&&t.includes(` 271`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const v=Yb(e.address),w=d?`${d}://${n}`:n,m=e.statement?`${e.statement} 272`:"",b=`${w} wants you to sign in with your Ethereum account: 273${v} 274 275${m}`;let g=`URI: ${f} 276Version: ${h} 277Chain ID: ${r}${i?` 278Nonce: ${i}`:""} 279Issued At: ${o.toISOString()}`;if(s&&(g+=` 280Expiration Time: ${s.toISOString()}`),a&&(g+=` 281Not Before: ${a.toISOString()}`),l&&(g+=` 282Request ID: ${l}`),c){let y=` 283Resources:`;for(const x of c){if(!x||typeof x!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${x}`);y+=` 284- ${x}`}g+=y}return`${b} 285${g}`}class Ge 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}}class Tc extends Ge{constructor(t,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:t}),this.name="WebAuthnUnknownError",this.originalError=r}}function NO({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 Ge({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 Ge({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 Ge({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 Ge({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 Ge({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new Ge({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 Ge({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new Ge({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(Jb(i)){if(o.rp.id!==i)return new Ge({message:`The RP ID "${o.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Ge({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 Ge({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 Ge({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 Ge({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function PO({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 Ge({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new Ge({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const n=window.location.hostname;if(Jb(n)){if(r.rpId!==n)return new Ge({message:`The RP ID "${r.rpId}
285" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Ge({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new Ge({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 Ge({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class RO{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 ah=new RO;function Mv(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=xu(e,["challenge","user","excludeCredentials"]),o=wo(t).buffer,i=Object.assign(Object.assign({},r),{id:wo(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:wo(c.id).buffer,type:c.type||"public-key",transports:c.transports})}}return a}function Fv(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=xu(e,["challenge","allowCredentials"]),s=wo(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:wo(a.id).buffer,type:a.type||"public-key",transports:a.transports})}}return o}function Uv(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:ls(new Uint8Array(e.response.attestationObject)),clientDataJSON:ls(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function Bv(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:ls(new Uint8Array(s.authenticatorData)),clientDataJSON:ls(new Uint8Array(s.clientDataJSON)),signature:ls(new Uint8Array(s.signature)),userHandle:s.userHandle?ls(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(t=r.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function Jb(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function Nc(){var e,t;return!!(st()&&"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 Qb(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Tc("Browser returned unexpected credential type",t)}:{data:null,error:new Tc("Empty credential response",t)}}catch(t){return{data:null,error:NO({error:t,options:e})}}}async function Xb(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Tc("Browser returned unexpected credential type",t)}:{data:null,error:new Tc("Empty credential response",t)}}
285catch(t){return{data:null,error:PO({error:t,options:e})}}}const jO={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},AO={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Pc(...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]=Pc(a,i):n[o]=Pc(i)}else n[o]=i}return n}function OO(e,t){return Pc(jO,e,t||{})}function IO(e,t){return Pc(AO,e,t||{})}class DO{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??ah.createNewAbortSignal();if(a.webauthn.type==="create"){const{user:d}=a.webauthn.credential_options.publicKey;if(!d.name){const f=n;if(f)d.name=`${d.id}:${f}`;else{const v=(await this.client.getUser()).data.user,w=((i=v==null?void 0:v.user_metadata)===null||i===void 0?void 0:i.name)||(v==null?void 0:v.email)||(v==null?void 0:v.id)||"User";d.name=`${d.id}:${w}`}}d.displayName||(d.displayName=d.name)}switch(a.webauthn.type){case"create":{const d=OO(a.webauthn.credential_options.publicKey,o==null?void 0:o.create),{data:f,error:h}=await Qb({publicKey:d,signal:c});return f?{data:{factorId:t,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:f}},error:null}:{data:null,error:h}}case"request":{const d=IO(a.webauthn.credential_options.publicKey,o==null?void 0:o.request),{data:f,error:h}=await Xb(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:d,signal:c}));return f?{data:{factorId:t,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:f}},error:null}:{data:null,error:h}}}}catch(a){return V(a)?{data:null,error:a}:{data:null,error:new lr("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 ga("rpId is required for WebAuthn authentication")};try{if(!Nc())return{data:null,error:new lr("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 V(i)?{data:null,error:i}:{data:null,error:new lr("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 ga("rpId is required for WebAuthn registration")};try{if(!Nc())return{data:null,error:new lr("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(d=>{var f;return(f=d.data)===null||f===void 0?void 0:f.all.find(h=>h.factor_type==="webauthn"&&h.friendly_name===t&&h.status!=="unverified")}).then(d=>d?this.client.mfa.unenroll({factorId:d==null?void 0:d.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 V(i)?{data:null,error:i}:{data:null,error:new lr("Unexpected error in register",i)}}}}_O();const LO={url:U2,storageKey:B2,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:z2,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}};async function zv(e,t,r){return await r()}const Fs={};class va{get jwks(){var t,r;return(r=(t=Fs[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(t){Fs[this.storageKey]=Object.assign(Object.assign({},Fs[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,r;return(r=(t=Fs[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){Fs[this.storageKey]=Object.assign(Object.assign({},Fs[this.storageKey]),{cachedAt:t})}constructor(t){var r,n,s,o;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const i=Object.assign(Object.assign({},LO),t);if(this.storageKey=i.storageKey,this.instanceID=(r=va.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,va.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.instanceID>0&&st()){const a=`${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(a),this.logDebugMessages&&console.trace(a)}if(this.persistSession=i.persistSession,this.autoRefreshToken=i.autoRefreshToken,this.experimental=(n=i.experimental)!==null&&n!==void 0?n:{},this.admin=new SO({url:i.url,headers:i.headers,fetch:i.fetch,experimental:this.experimental}),this.url=i.url,this.headers=i.headers,this.fetch=Kb(i.fetch),this.lock=i.lock||zv,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,this.throwOnError=i.throwOnError,this.lockAcquireTimeout=i.lockAcquireTimeout,i.lock?this.lock=i.lock:this.persistSession&&st()&&(!((s=globalThis==null?void 0:globalThis.navigator)===null||s===void 0)&&s.locks)?this.lock=EO:this.lock=zv,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 DO(this)}
285,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?(i.storage?this.storage=i.storage:qb()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Lv(this.memoryStorage)),i.userStorage&&(this.userStorage=i.userStorage)):(this.memoryStorage={},this.storage=Lv(this.memoryStorage)),st()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(a){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",a)}(o=this.broadcastChannel)===null||o===void 0||o.addEventListener("message",async a=>{this._debug("received broadcast notification from other tab or client",a);try{await this._notifyAllSubscribers(a.data.event,a.data.session,!1)}catch(l){this._debug("#broadcastChannel","error",l)}})}i.skipAutoInitialize||this.initialize().catch(a=>{this._debug("#initialize()","error",a)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${Wb}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let r={},n="none";if(st()&&(r=rO(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),st()&&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),K2(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 V(r)?this._returnResult({error:r}):this._returnResult({error:new lr("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var r,n,s;try{const o=await J(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:Ht}),{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(V(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:d,password:f,options:h}=t;let v=null,w=null;this.flowType==="pkce"&&([v,w]=await Ms(this.storage,this.storageKey)),o=await J(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:h==null?void 0:h.emailRedirectTo,body:{email:d,password:f,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:v,code_challenge_method:w},xform:Ht})}else if("phone"in t){const{phone:d,password:f,options:h}=t;o=await J(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:f,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:Ht})}else throw new xl("You must provide either an email or phone number and a password");const{data:i,error:a}=o;if(a||!i)return await nt(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 nt(this.storage,`${this.storageKey}-code-verifier`),V(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 J(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:Iv})}else if("phone"in t){const{phone:o,password:i,options:a}=t;r=await J(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:Iv})}else throw new xl("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 $s;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(V(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
285ptions)===null||o===void 0?void 0:o.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>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,d,f,h;let v,w;if("message"in t)v=t.message,w=t.signature;else{const{chain:m,wallet:b,statement:g,options:y}=t;let x;if(st())if(typeof b=="object")x=b;else{const N=window;if("ethereum"in N&&typeof N.ethereum=="object"&&"request"in N.ethereum&&typeof N.ethereum.request=="function")x=N.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"||!(y!=null&&y.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");x=b}const S=new URL((r=y==null?void 0:y.url)!==null&&r!==void 0?r:window.location.href),E=await x.request({method:"eth_requestAccounts"}).then(N=>N).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 C=Yb(E[0]);let _=(n=y==null?void 0:y.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!_){const N=await x.request({method:"eth_chainId"});_=CO(N)}const k={domain:S.host,address:C,statement:g,uri:S.href,version:"1",chainId:_,nonce:(s=y==null?void 0:y.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(i=(o=y==null?void 0:y.signInWithEthereum)===null||o===void 0?void 0:o.issuedAt)!==null&&i!==void 0?i:new Date,expirationTime:(a=y==null?void 0:y.signInWithEthereum)===null||a===void 0?void 0:a.expirationTime,notBefore:(l=y==null?void 0:y.signInWithEthereum)===null||l===void 0?void 0:l.notBefore,requestId:(c=y==null?void 0:y.signInWithEthereum)===null||c===void 0?void 0:c.requestId,resources:(d=y==null?void 0:y.signInWithEthereum)===null||d===void 0?void 0:d.resources};v=TO(k),w=await x.request({method:"personal_sign",params:[kO(v),C]})}try{const{data:m,error:b}=await J(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:v,signature:w},!((f=t.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(h=t.options)===null||h===void 0?void 0:h.captchaToken}}:null),xform:Ht});if(b)throw b;if(!m||!m.session||!m.user){const g=new $s;return this._returnResult({data:{user:null,session:null},error:g})}return m.session&&(await this._saveSession(m.session),await this._notifyAllSubscribers("SIGNED_IN",m.session)),this._returnResult({data:Object.assign({},m),error:b})}catch(m){if(V(m))return this._returnResult({data:{user:null,session:null},error:m});throw m}}async signInWithSolana(t){var r,n,s,o,i,a,l,c,d,f,h,v;let w,m;if("message"in t)w=t.message,m=t.signature;else{const{chain:b,wallet:g,statement:y,options:x}=t;let S;if(st())if(typeof g=="object")S=g;else{const C=window;if("solana"in C&&typeof C.solana=="object"&&("signIn"in C.solana&&typeof C.solana.signIn=="function"||"signMessage"in C.solana&&typeof C.solana.signMessage=="function"))S=C.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 g!="object"||!(x!=null&&x.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");S=g}const E=new URL((r=x==null?void 0:x.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in S&&S.signIn){const C=await S.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},x==null?void 0:x.signInWithSolana),{version:"1",domain:E.host,uri:E.href}),y?{statement:y}:null));let _;if(Array.isArray(C)&&C[0]&&typeof C[0]=="object")_=C[0];else if(C&&typeof C=="object"&&"signedMessage"in C&&"signature"in C)_=C;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in _&&"signature"in _&&(typeof _.signedMessage=="string"||_.signedMessage instanceof Uint8Array)&&_.signature instanceof Uint8Array)w=typeof _.signedMessage=="string"?_.signedMessage:new TextDecoder().decode(_.signedMessage),m=_.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");w=[`${E.host} wants you to sign in with your Solana account:`,S.publicKey.toBase58(),...y?["",y,""]:[""],"Version: 1",`URI: ${E.href}`,`Issued At: ${(s=(n=x==null?void 0:x.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((o=x==null?void 0:x.signInWithSolana)===null||o===void 0)&&o.notBefore?[`Not Before: ${x.signInWithSolana.notBefore}`]:[],...!((i=x==null?void 0:x.signInWithSolana)===null||i===void 0)&&i.expirationTime?[`Expiration Time: ${x.signInWithSolana.expirationTime}`]:[],...!((a=x==null?void 0:x.signInWithSolana)===null||a===void 0)&&a.chainId?[`Chain ID: ${x.signInWithSolana.chainId}`]:[],...!((l=x==null?void 0:x.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${x.signInWithSolana.nonce}`]:[],...!((c=x==null?void 0:x.signInWithSolana)===null||c===void 0)&&c.requestId?[`Request ID: ${x.signInWithSolana.requestId}`]:[],...!((f=(d=x==null?void 0:x.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||f===void 0)&&f.length?["Resources",...x.signInWithSolana.resources.map(_=>`- ${_}`)]:[]].join(` 286`);const C=await S.signMessage(new TextEncoder().encode(w),"utf8");if(!C||!(C instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");m=C}}try{const{data:b,error:g}=await J(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:w,signature:ls(m)}
286,!((h=t.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(v=t.options)===null||v===void 0?void 0:v.captchaToken}}:null),xform:Ht});if(g)throw g;if(!b||!b.session||!b.user){const y=new $s;return this._returnResult({data:{user:null,session:null},error:y})}return b.session&&(await this._saveSession(b.session),await this._notifyAllSubscribers("SIGNED_IN",b.session)),this._returnResult({data:Object.assign({},b),error:g})}catch(b){if(V(b))return this._returnResult({data:{user:null,session:null},error:b});throw b}}async _exchangeCodeForSession(t){const r=await es(this.storage,`${this.storageKey}-code-verifier`),[n,s]=(r??"").split("/");try{if(!n&&this.flowType==="pkce")throw new G2;const{data:o,error:i}=await J(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:n},xform:Ht});if(await nt(this.storage,`${this.storageKey}-code-verifier`),i)throw i;if(!o||!o.session||!o.user){const a=new $s;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 nt(this.storage,`${this.storageKey}-code-verifier`),V(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 J(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:Ht}),{data:l,error:c}=a;if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!l||!l.session||!l.user){const d=new $s;return this._returnResult({data:{user:null,session:null},error:d})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:l,error:c})}catch(r){if(V(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,d=null;this.flowType==="pkce"&&([c,d]=await Ms(this.storage,this.storageKey));const{error:f}=await J(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:d},redirectTo:l==null?void 0:l.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:f})}if("phone"in t){const{phone:a,options:l}=t,{data:c,error:d}=await J(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:d})}throw new xl("You must provide either an email or phone number.")}catch(a){if(await nt(this.storage,`${this.storageKey}-code-verifier`),V(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 J(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:o}}),redirectTo:s,xform:Ht});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(V(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 Ms(this.storage,this.storageKey));const c=await J(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:wO});return!((o=c.data)===null||o===void 0)&&o.url&&st()&&!(!((i=t.options)===null||i===void 0)&&i.skipBrowserRedirect)&&window.location.assign(c.data.url),this._returnResult(c)}catch(a){if(await nt(this.storage,`${this.storageKey}-code-verifier`),V(a))return this._returnResult({data:null,error:a});throw a}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>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 et;const{error:s}=await J(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(V(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,{error:i}=await J(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:s,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},redirectTo:o==null?void 0:o.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:i})}else if("phone"in t){const{phone:n,type:s,options:o}=t,{data:i,error:a}=await J(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 xl("You must provide either an email or phone number and a type")}catch(r){if(V(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async r=>r))}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.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const r=await es(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
286id"),await this._removeSession())),!t)return{data:{session:null},error:null};const n=t.expires_at?t.expires_at*1e3-Date.now()<bd:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",t.expires_at),!n){if(this.userStorage){const i=await es(this.userStorage,this.storageKey+"-user");i!=null&&i.user?t.user=i.user:t.user=Ed()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const i={value:this.suppressGetSessionWarning};t.user=mO(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);return o?this._returnResult({data:{session:null},error:o}):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;const r=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(t){try{return t?await J(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:vn}):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 et}:await J(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:vn})})}catch(r){if(V(r))return wl(r)&&(await this._removeSession(),await nt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(t,r={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>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 et;const i=s.session;let a=null,l=null;this.flowType==="pkce"&&t.email!=null&&([a,l]=await Ms(this.storage,this.storageKey));const{data:c,error:d}=await J(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:vn});if(d)throw d;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 nt(this.storage,`${this.storageKey}-code-verifier`),V(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new et;const r=Date.now()/1e3;let n=r,s=!0,o=null;const{payload:i}=Sl(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(V(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>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 et;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(V(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(t,r){var n;try{if(!st())throw new bl("No browser detected.");
286if(t.error||t.error_description||t.error_code)throw new bl(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 Tv("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new bl("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 Tv("No code detected.");const{data:x,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:x.session,redirectType:(n=x.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:d}=t;if(!i||!l||!a||!d)throw new bl("No session defined in URL");const f=Math.round(Date.now()/1e3),h=parseInt(l);let v=f+h;c&&(v=parseInt(c));const w=v-f;w*1e3<=Ys&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${w}s, should have been closer to ${h}s`);const m=v-h;f-m>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",m,v,f):f-m<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",m,v,f);const{data:b,error:g}=await this._getUser(i);if(g)throw g;const y={provider_token:s,provider_refresh_token:o,access_token:i,expires_in:h,expires_at:v,refresh_token:a,token_type:d,user:b.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:y,redirectType:t.type},error:null})}catch(s){if(V(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_description)}async _isPKCECallback(t){const r=await es(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&r)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async r=>{var n;const{data:s,error:o}=r;if(o&&!wl(o))return this._returnResult({error:o});const i=(n=s.session)===null||n===void 0?void 0:n.access_token;if(i){const{error:a}=await this.admin.signOut(i,t);if(a&&!(q2(a)&&(a.status===404||a.status===401||a.status===403)||wl(a)))return this._returnResult({error:a})}return t!=="others"&&(await this._removeSession(),await nt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const r=tO(),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,await this._acquireLock(this.lockAcquireTimeout,async()=>{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),wl(o)?console.warn(o):console.error(o)}})}async resetPasswordForEmail(t,r={}){let n=null,s=null;this.flowType==="pkce"&&([n,s]=await Ms(this.storage,this.storageKey,!0));try{return await J(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 nt(this.storage,`${this.storageKey}-code-verifier`),V(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(V(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,d;const{data:f,error:h}=o;if(h)throw h;const v=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 J(this.fetch,"GET",v,{headers:this.headers,jwt:(d=(c=f.session)===null||c===void 0?void 0:c.access_token)!==null&&d!==void 0?d:void 0})});if(s)throw s;return st()&&!(!((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(V(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:d}=t,f=await J(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:d,link_identity:!0,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},xform:Ht}),{data:h,error:v}=f;return v?this._returnResult({data:{user:null,session:null},error:v}):!h||!h.session||!h.user?this._returnResult({data:{user:null,session:null},error:new $s}):(h.session&&(await this._saveSession(h.session),await this._notifyAllSubscribers("USER_UPDATED",h.session)),this._returnResult({data:h,error:v}))}catch(s){if(await nt(this.storage,`${this.storageKey}-code-verifier`),V(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;
286return await J(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(V(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(t){const r=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(r,"begin");try{const n=Date.now();return await oO(async s=>(s>0&&await sO(200*Math.pow(2,s-1)),this._debug(r,"refreshing attempt",s),await J(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:Ht})),(s,o)=>{const i=200*Math.pow(2,s);return o&&Sd(o)&&Date.now()+i-n<Ys})}catch(n){if(this._debug(r,"error",n),V(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),st()&&!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 es(this.storage,this.storageKey);if(s&&this.userStorage){let i=await es(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!i&&(i={user:s.user},await Js(this.userStorage,this.storageKey+"-user",i)),s.user=(t=i==null?void 0:i.user)!==null&&t!==void 0?t:Ed()}else if(s&&!s.user&&!s.user){const i=await es(this.storage,this.storageKey+"-user");i&&(i!=null&&i.user)?(s.user=i.user,await nt(this.storage,this.storageKey+"-user"),await Js(this.storage,this.storageKey,s)):s.user=Ed()}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()<bd;if(this._debug(n,`session has${o?"":" not"} expired with margin of ${bd}s`),o){if(this.autoRefreshToken&&s.refresh_token){const{error:i}=await this._callRefreshToken(s.refresh_token);i&&(console.error(i),Sd(i)||(this._debug(n,"refresh failed with a non-retryable error, removing the session",i),await this._removeSession()))}}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 et;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const s=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new bu;const{data:o,error:i}=await this._refreshAccessToken(t);if(i)throw i;if(!o.session)throw new et;await this._saveSession(o.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",o.session);const a={data:o.session,error:null};return this.refreshingDeferred.resolve(a),a}catch(o){if(this._debug(s,"error",o),V(o)){const i={data:null,error:o};return Sd(o)||await this._removeSession(),(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){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,await nt(this.storage,`${this.storageKey}-code-verifier`);const r=Object.assign({},t),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await Js(this.userStorage,this.storageKey+"-user",{user:r.user});const s=Object.assign({},r);delete s.user;const o=Av(s);await Js(this.storage,this.storageKey,o)}else{const s=Av(r);await Js(this.storage,this.storageKey,s)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await nt(this.storage,this.storageKey),await nt(this.storage,this.storageKey+"-code-verifier"),await nt(this.storage,this.storageKey+"-user"),this.userStorage&&await nt(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;
286try{t&&st()&&(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(),Ys);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 _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");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)/Ys);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${Ys}ms, refresh threshold is ${nh} ticks`),s<=nh&&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.isAcquireTimeout||t instanceof Gb)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!st()||!(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})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(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 Ms(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 J(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(V(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 J(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(V(r))return this._returnResult({data:null,error:r});throw r}}async _verify(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var n;const{data:s,error:o}=r;if(o)return this._returnResult({data:null,error:o});const i=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?Uv(t.webauthn.credential_response):Bv(t.webauthn.credential_response)})}:{code:t.code}),{data:a,error:l}=await J(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:i,headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});return l?this._returnResult({data:null,error:l}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+a.expires_in},a)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",a),this._returnResult({data:a,error:l}))})}catch(r){if(V(r))return this._returnResult({data:null,error:r});throw r}})}async _challenge(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async r=>{var n;const{data:s,error:o}=r;if(o)return this._returnResult({data:null,error:o});const i=await J(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token});if(i.error)return i;const{data:a}=i;if(a.type!=="webauthn")return{data:a,error:null};switch(a.webauthn.type){case"create":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:Mv(a.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},a),{webauthn:Object.assign(Object.assign({},a.webauthn),{credential_options:Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:Fv(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(V(r))return this._returnResult({data:null,error:r});throw 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:v}=Sl(t);let w=null;v.aal&&(w=v.aal);let m=w;const{data:{user:b},error:g}=await this.getUser(t);if(g)return this._returnResult({data:null,error:g});((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&&(m="aal2");const x=v.amr||[];return{data:{currentLevel:w,nextLevel:m,currentAuthenticationMethods:x},error:null}}catch(v){if(V(v))return this._returnResult({data:null,error:v});throw v}const{data:{session:i},error:a}
286=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}=Sl(i.access_token);let c=null;l.aal&&(c=l.aal);let d=c;((o=(s=i.user.factors)===null||s===void 0?void 0:s.filter(v=>v.status==="verified"))!==null&&o!==void 0?o:[]).length>0&&(d="aal2");const h=l.amr||[];return{data:{currentLevel:c,nextLevel:d,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 J(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 et})})}catch(r){if(V(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 et});const i=await J(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&&st()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(i.data.redirect_url),i})}catch(n){if(V(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 et});const i=await J(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&&st()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(i.data.redirect_url),i})}catch(n){if(V(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 J(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 et})})}catch(t){if(V(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 J(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 et})})}catch(r){if(V(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+H2>s)return n;const{data:o,error:i}=await J(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:v,error:w}
286=await this.getSession();if(w||!v.session)return this._returnResult({data:null,error:w});n=v.session.access_token}const{header:s,payload:o,signature:i,raw:{header:a,payload:l}}=Sl(n);r!=null&&r.allowExpired||fO(o.exp);const c=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!c){const{error:v}=await this.getUser(n);if(v)throw v;return{data:{claims:o,header:s,signature:i},error:null}}const d=hO(s.alg),f=await crypto.subtle.importKey("jwk",c,d,!0,["verify"]);if(!await crypto.subtle.verify(d,f,i,Z2(`${a}.${l}`)))throw new ih("Invalid JWT signature");return{data:{claims:o,header:s,signature:i},error:null}}catch(n){if(V(n))return this._returnResult({data:null,error:n});throw n}}async signInWithPasskey(t){var r,n,s;tr(this.experimental);try{if(!Nc())return this._returnResult({data:null,error:new lr("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=Fv(o.options),l=(s=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.signal)!==null&&s!==void 0?s:ah.createNewAbortSignal(),{data:c,error:d}=await Xb({publicKey:a,signal:l});if(d||!c)return this._returnResult({data:null,error:d??new lr("WebAuthn ceremony failed",null)});const f=Bv(c);return this._verifyPasskeyAuthentication({challengeId:o.challenge_id,credential:f})}catch(o){if(V(o))return this._returnResult({data:null,error:o});throw o}}async registerPasskey(t){var r,n;tr(this.experimental);try{if(!Nc())return this._returnResult({data:null,error:new lr("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=Mv(s.options),a=(n=(r=t==null?void 0:t.options)===null||r===void 0?void 0:r.signal)!==null&&n!==void 0?n:ah.createNewAbortSignal(),{data:l,error:c}=await Qb({publicKey:i,signal:a});if(c||!l)return this._returnResult({data:null,error:c??new lr("WebAuthn ceremony failed",null)});const d=Uv(l);return this._verifyPasskeyRegistration({challengeId:s.challenge_id,credential:d})}catch(s){if(V(s))return this._returnResult({data:null,error:s});throw s}}async _startPasskeyRegistration(){tr(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 et});const{data:s,error:o}=await J(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(V(t))return this._returnResult({data:null,error:t});throw t}}async _verifyPasskeyRegistration(t){tr(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 et});const{data:o,error:i}=await J(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(V(r))return this._returnResult({data:null,error:r});throw r}}async _startPasskeyAuthentication(t){var r;tr(this.experimental);try{const{data:n,error:s}=await J(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(V(n))return this._returnResult({data:null,error:n});throw n}}async _verifyPasskeyAuthentication(t){tr(this.experimental);try{const{data:r,error:n}=await J(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:t.challengeId,credential:t.credential},xform:Ht});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(V(r))return this._returnResult({data:null,error:r});throw r}}async _listPasskeys(){tr(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 et});const{data:s,error:o}=await J(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(V(t))return this._returnResult({data:null,error:t});throw t}}async _updatePasskey(t){tr(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 et});const{data:o,error:i}=await J(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(V(r))return this._returnResult({data:null,error:r});throw r}}async _deletePasskey(t){tr(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 et});const{error:o}
286=await J(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(V(r))return this._returnResult({data:null,error:r});throw r}}}va.nextInstanceID={};const $O=va,MO="2.105.1";let _i="";typeof Deno<"u"?_i="deno":typeof document<"u"?_i="web":typeof navigator<"u"&&navigator.product==="ReactNative"?_i="react-native":_i="node";const FO={"X-Client-Info":`supabase-js-${_i}/${MO}`},UO={headers:FO},BO={schema:"public"},zO={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},WO={};function ya(e){"@babel/helpers - typeof";return ya=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},ya(e)}function HO(e,t){if(ya(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ya(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function VO(e){var t=HO(e,"string");return ya(t)=="symbol"?t:t+""}function qO(e,t,r){return(t=VO(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wv(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 We(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Wv(Object(r),!0).forEach(function(n){qO(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wv(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}const KO=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),GO=()=>Headers,YO=(e,t,r)=>{const n=KO(r),s=GO();return async(o,i)=>{var a;const l=(a=await t())!==null&&a!==void 0?a:e;let c=new s(i==null?void 0:i.headers);return c.has("apikey")||c.set("apikey",e),c.has("Authorization")||c.set("Authorization",`Bearer ${l}`),n(o,We(We({},i),{},{headers:c}))}};function JO(e){return e.endsWith("/")?e:e+"/"}function QO(e,t){var r,n;const{db:s,auth:o,realtime:i,global:a}=e,{db:l,auth:c,realtime:d,global:f}=t,h={db:We(We({},l),s),auth:We(We({},c),o),realtime:We(We({},d),i),storage:{},global:We(We(We({},f),a),{},{headers:We(We({},(r=f==null?void 0:f.headers)!==null&&r!==void 0?r:{}),(n=a==null?void 0:a.headers)!==null&&n!==void 0?n:{})}),accessToken:async()=>""};return e.accessToken?h.accessToken=e.accessToken:delete h.accessToken,h}function XO(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(JO(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var ZO=class extends $O{constructor(e){super(e)}},eI=class{constructor(e,t,r){var n,s;this.supabaseUrl=e,this.supabaseKey=t;const o=XO(e);if(!t)throw new Error("supabaseKey is required.");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:BO,realtime:WO,auth:We(We({},zO),{},{storageKey:i}),global:UO},l=QO(r??{},a);if(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:(d,f)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(f)} 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=YO(t,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(We({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},l.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(d=>this.realtime.setAuth(d)).catch(d=>console.warn("Failed to set initial Realtime auth token:",d)),this.rest=new NA(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 F2(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new yA(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,r)}
286channel(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 _getAccessToken(){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:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:s,storageKey:o,flowType:i,lock:a,debug:l,throwOnError:c,experimental:d},f,h){const v={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new ZO({url:this.authUrl.href,headers:We(We({},v),f),storageKey:o,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,userStorage:s,flowType:i,lock:a,debug:l,throwOnError:c,experimental:d,fetch:h,hasCustomAuthorizationHeader:Object.keys(this.headers).some(w=>w.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new l2(this.realtimeUrl.href,We(We({},e),{},{params:We(We({},{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 tI=(e,t,r)=>new eI(e,t,r);function rI(){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)<=18:!1}rI()&&console.warn("â ï¸ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const nI="https://sisnilceyttzpdgvxifq.supabase.co",sI="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InNpc25pbGNleXR0enBkZ3Z4aWZxIiwicm9sZSI6ImFub24iLCJpYXQiOjE3Nzc4MzM2ODcsImV4cCI6MjA5MzQwOTY4N30.T5mtaRkZ1ustQMDD3XlesGfwDplX6aJiSggNuglhPSo",Xe=tI(nI,sI,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}}),La=()=>{const[e,t]=p.useState(null),[r,n]=p.useState(null),[s,o]=p.useState(!0),{toast:i}=W0();return p.useEffect(()=>{const{data:{subscription:v}}=Xe.auth.onAuthStateChange((w,m)=>{n(m),t((m==null?void 0:m.user)??null),o(!1),w==="SIGNED_IN"&&i({title:"Welcome!",description:"You have successfully signed in."})});return Xe.auth.getSession().then(({data:{session:w}})=>{n(w),t((w==null?void 0:w.user)??null),o(!1)}),()=>v.unsubscribe()},[i]),{user:e,session:r,loading:s,signInWithGoogle:async()=>{const v=`${window.location.origin}/auth`,{error:w}=await Xe.auth.signInWithOAuth({provider:"google",options:{redirectTo:v}});w&&i({title:"Error",description:w.message,variant:"destructive"})},signInWithApple:async()=>{const v=`${window.location.origin}/auth`,{error:w}=await Xe.auth.signInWithOAuth({provider:"apple",options:{redirectTo:v}});w&&i({title:"Error",description:w.message,variant:"destructive"})},signInWithGitHub:async()=>{const v=`${window.location.origin}/auth`,{error:w}=await Xe.auth.signInWithOAuth({provider:"github",options:{redirectTo:v}});w&&i({title:"Error",description:w.message,variant:"destructive"})},signInWithEmail:async(v,w)=>{const{error:m}=await Xe.auth.signInWithPassword({email:v,password:w});return m?(i({title:"Error",description:m.message,variant:"destructive"}),{error:m}):{error:null}},signUpWithEmail:async(v,w)=>{const m=`${window.location.origin}/auth`,{error:b}=await Xe.auth.signUp({email:v,password:w,options:{emailRedirectTo:m}});return b?(i({title:"Error",description:b.message,variant:"destructive"}),{error:b}):(i({title:"Success",description:"Please check your email to confirm your account."}),{error:null})},signOut:async()=>{const{error:v}=await Xe.auth.signOut();i(v?{title:"Error",description:v.message,variant:"destructive"}:{title:"Signed out",description:"You have been successfully signed out."})}}},ei=({variant:e="ghost",size:t="sm",className:r})=>{const n=()=>{window.open("https://www.paypal.com/donate/[email protected]&no_recurring=0¤cy_code=USD","_blank")};return u.jsxs(re,{variant:e,size:t,onClick:n,className:`text-red-500 hover:text-red-600 ${r}`,children:[u.jsx(KT,{className:"h-4 w-4 mr-2"}),"Support"]})},oI=()=>{var a;const e=gu(),{user:t,signOut:r}=La(),[n,s]=$i("workout-stats",{currentLevel:"beginner",streak:0,totalWorkouts:0,currentDay:1}),o=l=>{s({...n,currentLevel:l}),e("/workout")},i=[{id:"beginner",title:"Beginner",description:"4-day split routine with foundational exercises",features:["Fixed exercise plan","Basic movements","Perfect for starters"],icon:Og,color:"bg-secondary"},{id:"intermediate",title:"Intermediate",description:"Varied routines with moderate complexity",features:["Multiple workout options","Progressive overload","Equipment variety"],icon:cr,color:"bg-primary/10"},{id:"professional",title:"Professional",description:"Advanced training protocols and techniques",features:["Complex movements","Supersets & drop sets","Competition prep"],icon:Dg,color:"bg-
286accent"}];return u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsx("nav",{className:"border-b",children:u.jsxs("div",{className:"container mx-auto px-4 py-4 flex justify-between items-center",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(cr,{className:"h-8 w-8 text-primary"}),u.jsx("span",{className:"text-xl font-bold",children:"GymFlow"})]}),u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx(ei,{}),t?u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsxs("span",{className:"text-sm text-muted-foreground",children:["Welcome, ",((a=t.user_metadata)==null?void 0:a.full_name)||t.email]}),u.jsx(re,{variant:"outline",onClick:r,children:"Sign Out"})]}):u.jsxs(re,{variant:"outline",onClick:()=>e("/auth"),children:[u.jsx(su,{className:"h-4 w-4 mr-2"}),"Sign In"]})]})]})}),u.jsxs("div",{className:"container mx-auto px-4 py-12",children:[u.jsxs("div",{className:"text-center space-y-6 mb-12",children:[u.jsxs("div",{className:"flex items-center justify-center gap-3",children:[u.jsx(cr,{className:"h-12 w-12 text-primary"}),u.jsx("h1",{className:"text-4xl font-bold",children:"GymFlow"})]}),u.jsx("p",{className:"text-xl text-muted-foreground max-w-2xl mx-auto",children:"Your personal workout companion. Track progress, follow structured plans, and build the habit that transforms your life."}),u.jsxs("div",{className:"flex items-center justify-center gap-2",children:[u.jsx(Lg,{className:"h-5 w-5 text-primary"}),u.jsx("span",{className:"text-sm text-muted-foreground",children:"No login required ⢠All data stored locally"})]})]}),u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"text-center",children:[u.jsx("h2",{className:"text-2xl font-semibold mb-2",children:"Choose Your Level"}),u.jsx("p",{className:"text-muted-foreground",children:"Select the workout intensity that matches your experience"})]}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 max-w-6xl mx-auto",children:i.map(l=>{const c=l.icon;return u.jsxs(Pe,{className:"hover:shadow-lg transition-shadow cursor-pointer group",children:[u.jsxs(Dt,{className:"text-center",children:[u.jsx("div",{className:`mx-auto w-16 h-16 rounded-full ${l.color} flex items-center justify-center mb-4 group-hover:scale-110 transition-transform`,children:u.jsx(c,{className:"h-8 w-8 text-primary"})}),u.jsx(Lt,{className:"text-xl",children:l.title}),u.jsx("p",{className:"text-sm text-muted-foreground",children:l.description})]}),u.jsxs(Oe,{className:"space-y-4",children:[u.jsx("div",{className:"space-y-2",children:l.features.map((d,f)=>u.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[u.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-primary"}),u.jsx("span",{children:d})]},f))}),u.jsx(re,{onClick:()=>o(l.id),className:"w-full",variant:l.id===n.currentLevel?"default":"outline",children:l.id===n.currentLevel?"Continue":"Select Level"})]})]},l.id)})})]}),u.jsx("div",{className:"mt-16 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[{icon:Og,title:"Structured Plans",desc:"Follow proven workout routines"},{icon:Lg,title:"Exercise Demos",desc:"AI-generated workout demonstrations"},{icon:Dg,title:"Track Progress",desc:"Monitor your fitness journey"},{icon:cr,title:"Stay Motivated",desc:"Build lasting workout habits"}].map((l,c)=>u.jsx(Pe,{className:"text-center",children:u.jsxs(Oe,{className:"p-6",children:[u.jsx(l.icon,{className:"h-8 w-8 text-primary mx-auto mb-3"}),u.jsx("h3",{className:"font-semibold mb-2",children:l.title}),u.jsx("p",{className:"text-sm text-muted-foreground",children:l.desc})]})},c))})]})]})},iI=nu("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 Et({className:e,variant:t,...r}){return u.jsx("div",{className:ie(iI({variant:t}),e),...r})}var Bp="Progress",zp=100,[aI,r4]=vr(Bp),[lI,cI]=aI(Bp),Zb=p.forwardRef((e,t)=>
286{const{__scopeProgress:r,value:n=null,max:s,getValueLabel:o=uI,...i}=e;(s||s===0)&&!Hv(s)&&console.error(dI(`${s}`,"Progress"));const a=Hv(s)?s:zp;n!==null&&!Vv(n,a)&&console.error(fI(`${n}`,"Progress"));const l=Vv(n,a)?n:null,c=Rc(l)?o(l,a):void 0;return u.jsx(lI,{scope:r,value:l,max:a,children:u.jsx(X.div,{"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":Rc(l)?l:void 0,"aria-valuetext":c,role:"progressbar","data-state":rS(l,a),"data-value":l??void 0,"data-max":a,...i,ref:t})})});Zb.displayName=Bp;var eS="ProgressIndicator",tS=p.forwardRef((e,t)=>{const{__scopeProgress:r,...n}=e,s=cI(eS,r);return u.jsx(X.div,{"data-state":rS(s.value,s.max),"data-value":s.value??void 0,"data-max":s.max,...n,ref:t})});tS.displayName=eS;function uI(e,t){return`${Math.round(e/t*100)}%`}function rS(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Rc(e){return typeof e=="number"}function Hv(e){return Rc(e)&&!isNaN(e)&&e>0}function Vv(e,t){return Rc(e)&&!isNaN(e)&&e<=t&&e>=0}function dI(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${zp}\`.`}function fI(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: 287 - a positive number 288 - less than the value passed to \`max\` (or ${zp} if no \`max\` prop is set) 289 - \`null\` or \`undefined\` if the progress is indeterminate. 290 291Defaulting to \`null\`.`}var nS=Zb,hI=tS;const sS=p.forwardRef(({className:e,value:t,...r},n)=>u.jsx(nS,{ref:n,className:ie("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...r,children:u.jsx(hI,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));sS.displayName=nS.displayName;var pI=p.createContext(void 0);function Su(e){const t=p.useContext(pI);return e||t||"ltr"}var Cd="rovingFocusGroup.onEntryFocus",mI={bubbles:!1,cancelable:!0},Eu="RovingFocusGroup",[lh,oS,gI]=wp(Eu),[vI,iS]=vr(Eu,[gI]),[yI,wI]=vI(Eu),aS=p.forwardRef((e,t)=>u.jsx(lh.Provider,{scope:e.__scopeRovingFocusGroup,children:u.jsx(lh.Slot,{scope:e.__scopeRovingFocusGroup,children:u.jsx(xI,{...e,ref:t})})}));aS.displayName=Eu;var xI=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:s=!1,dir:o,currentTabStopId:i,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:d=!1,...f}=e,h=p.useRef(null),v=le(t,h),w=Su(o),[m=null,b]=Fn({prop:i,defaultProp:a,onChange:l}),[g,y]=p.useState(!1),x=ke(c),S=oS(r),E=p.useRef(!1),[C,_]=p.useState(0);return p.useEffect(()=>{const k=h.current;if(k)return k.addEventListener(Cd,x),()=>k.removeEventListener(Cd,x)},[x]),u.jsx(yI,{scope:r,orientation:n,dir:w,loop:s,currentTabStopId:m,onItemFocus:p.useCallback(k=>b(k),[b]),onItemShiftTab:p.useCallback(()=>y(!0),[]),onFocusableItemAdd:p.useCallback(()=>_(k=>k+1),[]),onFocusableItemRemove:p.useCallback(()=>_(k=>k-1),[]),children:u.jsx(X.div,{tabIndex:g||C===0?-1:0,"data-orientation":n,...f,ref:v,style:{outline:"none",...e.style},onMouseDown:q(e.onMouseDown,()=>{E.current=!0}),onFocus:q(e.onFocus,k=>{const N=!E.current;if(k.target===k.currentTarget&&N&&!g){const j=new CustomEvent(Cd,mI);if(k.currentTarget.dispatchEvent(j),!j.defaultPrevented){const R=S().filter(H=>H.focusable),T=R.find(H=>H.active),A=R.find(H=>H.id===m),W=[T,A,...R].filter(Boolean).map(H=>H.ref.current);uS(W,d)}}E.current=!1}),onBlur:q(e.onBlur,()=>y(!1))})})}),lS="RovingFocusGroupItem",cS=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:s=!1,tabStopId:o,...i}=e,a=fr(),l=o||a,c=wI(lS,r),d=c.currentTabStopId===l,f=oS(r),{onFocusableItemAdd:h,onFocusableItemRemove:v}=c;return p.useEffect(()=>{if(n)return h(),()=>v()},[n,h,v]),u.jsx(lh.ItemSlot,{scope:r,id:l,focusable:n,active:s,children:u.jsx(X.span,{tabIndex:d?0:-1,"data-orientation":c.orientation,...i,ref:t,onMouseDown:q(e.onMouseDown,w=>{n?c.onItemFocus(l):w.preventDefault()}),onFocus:q(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:q(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){c.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const m=EI(w,c.orientation,c.dir);if(m!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let g=f().filter(y=>y.focusable).map(y=>y.ref.current);if(m==="last")g.reverse();else if(m==="prev"||m==="next"){m==="prev"&&g.reverse();const y=g.indexOf(w.currentTarget);g=c.loop?_I(g,y+1):g.slice(y+1)}setTimeout(()=>uS(g))}})})})});cS.displayName=lS;var bI={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function SI(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function EI(e,t,r){const n=SI(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return bI[n]}function uS(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function _I(e,t){return e.map((r,n)=>e[(t+n)%e.length])}
vendor: 4,606 bytes, line 291
291var CI=aS,kI=cS,Wp="Tabs",[TI,n4]=vr(Wp,[iS]),dS=iS(),[NI,Hp]=TI(Wp),fS=p.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:s,defaultValue:o,orientation:i="horizontal",dir:a,activationMode:l="automatic",...c}=e,d=Su(a),[f,h]=Fn({prop:n,onChange:s,defaultProp:o});return u.jsx(NI,{scope:r,baseId:fr(),value:f,onValueChange:h,orientation:i,dir:d,activationMode:l,children:u.jsx(X.div,{dir:d,"data-orientation":i,...c,ref:t})})});fS.displayName=Wp;var hS="TabsList",pS=p.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...s}=e,o=Hp(hS,r),i=dS(r);return u.jsx(CI,{asChild:!0,...i,orientation:o.orientation,dir:o.dir,loop:n,children:u.jsx(X.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});pS.displayName=hS;var mS="TabsTrigger",gS=p.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:s=!1,...o}=e,i=Hp(mS,r),a=dS(r),l=wS(i.baseId,n),c=xS(i.baseId,n),d=n===i.value;return u.jsx(kI,{asChild:!0,...a,focusable:!s,active:d,children:u.jsx(X.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":c,"data-state":d?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:l,...o,ref:t,onMouseDown:q(e.onMouseDown,f=>{!s&&f.button===0&&f.ctrlKey===!1?i.onValueChange(n):f.preventDefault()}),onKeyDown:q(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&i.onValueChange(n)}),onFocus:q(e.onFocus,()=>{const f=i.activationMode!=="manual";!d&&!s&&f&&i.onValueChange(n)})})})});gS.displayName=mS;var vS="TabsContent",yS=p.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:s,children:o,...i}=e,a=Hp(vS,r),l=wS(a.baseId,n),c=xS(a.baseId,n),d=n===a.value,f=p.useRef(d);return p.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),u.jsx(yr,{present:s||d,children:({present:h})=>u.jsx(X.div,{"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!h,id:c,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:h&&o})})});yS.displayName=vS;function wS(e,t){return`${e}-trigger-${t}`}function xS(e,t){return`${e}-content-${t}`}var PI=fS,bS=pS,SS=gS,ES=yS;const Vp=PI,_u=p.forwardRef(({className:e,...t},r)=>u.jsx(bS,{ref:r,className:ie("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));_u.displayName=bS.displayName;const In=p.forwardRef(({className:e,...t},r)=>u.jsx(SS,{ref:r,className:ie("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));In.displayName=SS.displayName;const Dn=p.forwardRef(({className:e,...t},r)=>u.jsx(ES,{ref:r,className:ie("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Dn.displayName=ES.displayName;function ch(e,[t,r]){return Math.min(r,Math.max(t,e))}var RI="DismissableLayer",uh="dismissableLayer.update",jI="dismissableLayer.pointerDownOutside",AI="dismissableLayer.focusOutside",qv,_S=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),CS=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:a,...l}=e,c=p.useContext(_S),[d,f]=p.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=p.useState({}),w=le(t,_=>f(_)),m=Array.from(c.layers),[b]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=m.indexOf(b),y=d?m.indexOf(d):-1,x=c.layersWithOutsidePointerEventsDisabled.size>0,S=y>=g,E=DI(_=>{const k=_.target,N=[...c.branches].some(j=>j.contains(k));!S||N||(s==null||s(_),i==null||i(_),_.defaultPrevented||a==null||a())},h),C=LI(_=>{const k=_.target;[...c.branches].some(j=>j.contains(k))||(o==null||o(_),i==null||i(_),_.defaultPrevented||a==null||a())},h);return eu(_=>{y===c.layers.size-1&&(n==null||n(_),!_.defaultPrevented&&a&&(_.preventDefault(),a()))},h),p.useEffect(()=>{if(d)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(qv=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),Kv(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=qv)}},[d,h,r,c]),p.useEffect(()=>()=>
vendor: 10,260 bytes, line 291
291{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),Kv())},[d,c]),p.useEffect(()=>{const _=()=>v({});return document.addEventListener(uh,_),()=>document.removeEventListener(uh,_)},[]),u.jsx(X.div,{...l,ref:w,style:{pointerEvents:x?S?"auto":"none":void 0,...e.style},onFocusCapture:q(e.onFocusCapture,C.onFocusCapture),onBlurCapture:q(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:q(e.onPointerDownCapture,E.onPointerDownCapture)})});CS.displayName=RI;var OI="DismissableLayerBranch",II=p.forwardRef((e,t)=>{const r=p.useContext(_S),n=p.useRef(null),s=le(t,n);return p.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),u.jsx(X.div,{...e,ref:s})});II.displayName=OI;function DI(e,t=globalThis==null?void 0:globalThis.document){const r=ke(e),n=p.useRef(!1),s=p.useRef(()=>{});return p.useEffect(()=>{const o=a=>{if(a.target&&!n.current){let l=function(){kS(jI,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 LI(e,t=globalThis==null?void 0:globalThis.document){const r=ke(e),n=p.useRef(!1);return p.useEffect(()=>{const s=o=>{o.target&&!n.current&&kS(AI,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 Kv(){const e=new CustomEvent(uh);document.dispatchEvent(e)}function kS(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?Ra(s,o):s.dispatchEvent(o)}var kd=0;function $I(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Gv()),document.body.insertAdjacentElement("beforeend",e[1]??Gv()),kd++,()=>{kd===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),kd--}},[])}function Gv(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var Td="focusScope.autoFocusOnMount",Nd="focusScope.autoFocusOnUnmount",Yv={bubbles:!1,cancelable:!0},MI="FocusScope",Cu=p.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...i}=e,[a,l]=p.useState(null),c=ke(s),d=ke(o),f=p.useRef(null),h=le(t,m=>l(m)),v=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(n){let m=function(x){if(v.paused||!a)return;const S=x.target;a.contains(S)?f.current=S:dn(f.current,{select:!0})},b=function(x){if(v.paused||!a)return;const S=x.relatedTarget;S!==null&&(a.contains(S)||dn(f.current,{select:!0}))},g=function(x){if(document.activeElement===document.body)for(const E of x)E.removedNodes.length>0&&dn(a)};document.addEventListener("focusin",m),document.addEventListener("focusout",b);const y=new MutationObserver(g);return a&&y.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",m),document.removeEventListener("focusout",b),y.disconnect()}}},[n,a,v.paused]),p.useEffect(()=>{if(a){Qv.add(v);const m=document.activeElement;if(!a.contains(m)){const g=new CustomEvent(Td,Yv);a.addEventListener(Td,c),a.dispatchEvent(g),g.defaultPrevented||(FI(HI(TS(a)),{select:!0}),document.activeElement===m&&dn(a))}return()=>{a.removeEventListener(Td,c),setTimeout(()=>{const g=new CustomEvent(Nd,Yv);a.addEventListener(Nd,d),a.dispatchEvent(g),g.defaultPrevented||dn(m??document.body,{select:!0}),a.removeEventListener(Nd,d),Qv.remove(v)},0)}}},[a,c,d,v]);const w=p.useCallback(m=>{if(!r&&!n||v.paused)return;const b=m.key==="Tab"&&!m.altKey&&!m.ctrlKey&&!m.metaKey,g=document.activeElement;if(b&&g){const y=m.currentTarget,[x,S]=UI(y);x&&S?!m.shiftKey&&g===S?(m.preventDefault(),r&&dn(x,{select:!0})):m.shiftKey&&g===x&&(m.preventDefault(),r&&dn(S,{select:!0})):g===y&&m.preventDefault()}},[r,n,v.paused]);return u.jsx(X.div,{tabIndex:-1,...i,ref:h,onKeyDown:w})});Cu.displayName=MI;function FI(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(dn(n,{select:t}),document.activeElement!==r)return}function UI(e){const t=TS(e),r=Jv(t,e),n=Jv(t.reverse(),e);return[r,n]}function TS(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 Jv(e,t){for(const r of e)if(!BI(r,{upTo:t}))return r}function BI(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 zI(e){return e instanceof HTMLInputElement&&"select"in e}function dn(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&zI(e)&&t&&e.select()}}var Qv=WI();function WI(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Xv(e,t),e.unshift(t)},remove(t){var r;e=Xv(e,t),(r=e[0])==null||r.resume()}}}function Xv(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function HI(e){return e.filter(t=>t.tagName!=="A")}var VI="Portal",NS=p.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[s,o]=p.useState(!1);$e(()=>o(!0),[]);const i=r||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Pa.createPortal(u.jsx(X.div,{...n,ref:t}),i):null});NS.displayName=VI;function PS(e){const t=p.useRef({value:e,previous:e});return p.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var qI=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Us=new WeakMap,El=new WeakMap,_l={},Pd=0,RS=function(e){return e&&(e.host||RS(e.parentNode))},KI=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=RS(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})},GI=function(e,t,r,n){var s=KI(t,Array.isArray(e)?e:[e]);_l[r]||(_l[r]=new WeakMap);var o=_l[r],i=[],a=new Set,l=new Set(s),c=function(f){!f||a.has(f)||(a.add(f),c(f.parentNode))};s.forEach(c);var d=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(h){if(a.has(h))d(h);else try{var v=h.getAttribute(n),w=v!==null&&v!=="false",m=(Us.get(h)||0)+1,b=(o.get(h)||0)+1;Us.set(h,m),o.set(h,b),i.push(h),m===1&&w&&El.set(h,!0),b===1&&h.setAttribute(r,"true"),w||h.setAttribute(n,"true")}catch(g){console.error("aria-hidden: cannot operate on ",h,g)}})};return d(t),a.clear(),Pd++,function(){i.forEach(function(f){var h=Us.get(f)-1,v=o.get(f)-1;Us.set(f,h),o.set(f,v),h||(El.has(f)||f.removeAttribute(n),El.delete(f)),v||f.removeAttribute(r)}),Pd--,Pd||(Us=new WeakMap,Us=new WeakMap,El=new WeakMap,_l={})}},qp=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),s=qI(e);return s?(n.push.apply(n,Array.from(s.querySelectorAll("[aria-live]"))),GI(n,s,r,"aria-hidden")):function(){return null}},Ve=function(){return Ve=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},Ve.apply(this,arguments)};function ku(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 Kp(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 xo="right-scroll-bar-position",bo="width-before-scroll-bar",YI="with-scroll-bars-hidden",JI="--removed-body-scroll-bar-size";function Rd(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function QI(e,t){var r=p.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 XI=typeof window<"u"?p.useLayoutEffect:p.useEffect,Zv=new WeakMap;function Gp(e,t){var r=QI(null,function(n){return e.forEach(function(s){return Rd(s,n)})});return XI(function(){var n=Zv.get(r);if(n){var s=new Set(n),o=new Set(e),i=r.current;s.forEach(function(a){o.has(a)||Rd(a,null)}),o.forEach(function(a){s.has(a)||Rd(a,i)})}Zv.set(r,e)},[e]),r}function ZI(e){return e}function eD(e,t){t===void 0&&(t=ZI);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 d=i;i=[],d.forEach(o)},c=function(){return Promise.resolve().then(l)};c(),r={push:function(d){i.push(d),c()},filter:function(d){return i=i.filter(d),r}}}};return s}function Yp(e){e===void 0&&(e={});var t=eD(null);return t.options=Ve({async:!0,ssr:!1},e),t}var jS=function(e){var t=e.sideCar,r=ku(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 p.createElement(n,Ve({},r))};
vendor: 4,557 bytes, lines 291-328
291jS.isSideCarExport=!0;function Jp(e,t){return e.useMedium(t),jS}var AS=Yp(),jd=function(){},Tu=p.forwardRef(function(e,t){var r=p.useRef(null),n=p.useState({onScrollCapture:jd,onWheelCapture:jd,onTouchMoveCapture:jd}),s=n[0],o=n[1],i=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,v=e.noIsolation,w=e.inert,m=e.allowPinchZoom,b=e.as,g=b===void 0?"div":b,y=e.gapMode,x=ku(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=h,E=Gp([r,t]),C=Ve(Ve({},x),s);return p.createElement(p.Fragment,null,d&&p.createElement(S,{sideCar:AS,removeScrollBar:c,shards:f,noIsolation:v,inert:w,setCallbacks:o,allowPinchZoom:!!m,lockRef:r,gapMode:y}),i?p.cloneElement(p.Children.only(a),Ve(Ve({},C),{ref:E})):p.createElement(g,Ve({},C,{className:l,ref:E}),a))});Tu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Tu.classNames={fullWidth:bo,zeroRight:xo};var tD=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function rD(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=tD();return t&&e.setAttribute("nonce",t),e}function nD(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function sD(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var oD=function(){var e=0,t=null;return{add:function(r){e==0&&(t=rD())&&(nD(t,r),sD(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},iD=function(){var e=oD();return function(t,r){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},Nu=function(){var e=iD(),t=function(r){var n=r.styles,s=r.dynamic;return e(n,s),null};return t},aD={left:0,top:0,right:0,gap:0},Ad=function(e){return parseInt(e||"",10)||0},lD=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[Ad(r),Ad(n),Ad(s)]},cD=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return aD;var t=lD(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])}},uD=Nu(),So="data-scroll-locked",dD=function(e,t,r,n){var s=e.left,o=e.top,i=e.right,a=e.gap;return r===void 0&&(r="margin"),` 292 .`.concat(YI,` { 293 overflow: hidden `).concat(n,`; 294 padding-right: `).concat(a,"px ").concat(n,`; 295 } 296 body[`).concat(So,`] { 297 overflow: hidden `).concat(n,`; 298 overscroll-behavior: contain; 299 `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&` 300 padding-left: `.concat(s,`px; 301 padding-top: `).concat(o,`px; 302 padding-right: `).concat(i,`px; 303 margin-left:0; 304 margin-top:0; 305 margin-right: `).concat(a,"px ").concat(n,`; 306 `),r==="padding"&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),` 307 } 308 309 .`).concat(xo,` { 310 right: `).concat(a,"px ").concat(n,`; 311 } 312 313 .`).concat(bo,` { 314 margin-right: `).concat(a,"px ").concat(n,`; 315 } 316 317 .`).concat(xo," .").concat(xo,` { 318 right: 0 `).concat(n,`; 319 } 320 321 .`).concat(bo," .").concat(bo,` { 322 margin-right: 0 `).concat(n,`; 323 } 324 325 body[`).concat(So,`] { 326 `).concat(JI,": ").concat(a,`px; 327 } 328`)},ey=function(){var e=parseInt(document.body.getAttribute(So)||"0",10);return isFinite(e)?e:0},fD=function(){p.useEffect(function(){return document.body.setAttribute(So,(ey()+1).toString()),function(){var e=ey()-1;e<=0?document.body.removeAttribute(So):document.body.setAttribute(So,e.toString())}},[])},Qp=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,s=n===void 0?"margin":n;fD();var o=p.useMemo(function(){return cD(s)},[s]);return p.createElement(uD,{styles:dD(o,!t,s,r?"":"!important")})},dh=!1;if(typeof window<"u")try{var Cl=Object.defineProperty({},"passive",{get:function(){return dh=!0,!0}});window.addEventListener("test",Cl,Cl),window.removeEventListener("test",Cl,Cl)}catch{dh=!1}var Bs=dh?{passive:!1}:!1,hD=function(e){return e.tagName==="TEXTAREA"},OS=function(e,t){var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!hD(e)&&r[t]==="visible")},pD=function(e){return OS(e,"overflowY")},mD=function(e){return OS(e,"overflowX")},ty=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=IS(e,n);if(s){var o=DS(e,n),i=o[1],a=o[2];if(i>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1}
vendor: 21,654 bytes, lines 328-331
328,gD=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},vD=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},IS=function(e,t){return e==="v"?pD(t):mD(t)},DS=function(e,t){return e==="v"?gD(t):vD(t)},yD=function(e,t){return e==="h"&&t==="rtl"?-1:1},wD=function(e,t,r,n,s){var o=yD(e,window.getComputedStyle(t).direction),i=o*n,a=r.target,l=t.contains(a),c=!1,d=i>0,f=0,h=0;do{var v=DS(e,a),w=v[0],m=v[1],b=v[2],g=m-b-o*w;(w||g)&&IS(e,a)&&(f+=g,h+=w),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&(Math.abs(f)<1||!s)||!d&&(Math.abs(h)<1||!s))&&(c=!0),c},kl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ry=function(e){return[e.deltaX,e.deltaY]},ny=function(e){return e&&"current"in e?e.current:e},xD=function(e,t){return e[0]===t[0]&&e[1]===t[1]},bD=function(e){return` 329 .block-interactivity-`.concat(e,` {pointer-events: none;} 330 .allow-interactivity-`).concat(e,` {pointer-events: all;} 331`)},SD=0,zs=[];function ED(e){var t=p.useRef([]),r=p.useRef([0,0]),n=p.useRef(),s=p.useState(SD++)[0],o=p.useState(Nu)[0],i=p.useRef(e);p.useEffect(function(){i.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var m=Kp([e.lockRef.current],(e.shards||[]).map(ny),!0).filter(Boolean);return m.forEach(function(b){return b.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=p.useCallback(function(m,b){if("touches"in m&&m.touches.length===2)return!i.current.allowPinchZoom;var g=kl(m),y=r.current,x="deltaX"in m?m.deltaX:y[0]-g[0],S="deltaY"in m?m.deltaY:y[1]-g[1],E,C=m.target,_=Math.abs(x)>Math.abs(S)?"h":"v";if("touches"in m&&_==="h"&&C.type==="range")return!1;var k=ty(_,C);if(!k)return!0;if(k?E=_:(E=_==="v"?"h":"v",k=ty(_,C)),!k)return!1;if(!n.current&&"changedTouches"in m&&(x||S)&&(n.current=E),!E)return!0;var N=n.current||E;return wD(N,b,m,N==="h"?x:S,!0)},[]),l=p.useCallback(function(m){var b=m;if(!(!zs.length||zs[zs.length-1]!==o)){var g="deltaY"in b?ry(b):kl(b),y=t.current.filter(function(E){return E.name===b.type&&(E.target===b.target||b.target===E.shadowParent)&&xD(E.delta,g)})[0];if(y&&y.should){b.cancelable&&b.preventDefault();return}if(!y){var x=(i.current.shards||[]).map(ny).filter(Boolean).filter(function(E){return E.contains(b.target)}),S=x.length>0?a(b,x[0]):!i.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),c=p.useCallback(function(m,b,g,y){var x={name:m,delta:b,target:g,should:y,shadowParent:_D(g)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(S){return S!==x})},1)},[]),d=p.useCallback(function(m){r.current=kl(m),n.current=void 0},[]),f=p.useCallback(function(m){c(m.type,ry(m),m.target,a(m,e.lockRef.current))},[]),h=p.useCallback(function(m){c(m.type,kl(m),m.target,a(m,e.lockRef.current))},[]);p.useEffect(function(){return zs.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,Bs),document.addEventListener("touchmove",l,Bs),document.addEventListener("touchstart",d,Bs),function(){zs=zs.filter(function(m){return m!==o}),document.removeEventListener("wheel",l,Bs),document.removeEventListener("touchmove",l,Bs),document.removeEventListener("touchstart",d,Bs)}},[]);var v=e.removeScrollBar,w=e.inert;return p.createElement(p.Fragment,null,w?p.createElement(o,{styles:bD(s)}):null,v?p.createElement(Qp,{gapMode:e.gapMode}):null)}function _D(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const CD=Jp(AS,ED);var LS=p.forwardRef(function(e,t){return p.createElement(Tu,Ve({},e,{ref:t,sideCar:CD}))});LS.classNames=Tu.classNames;var kD=[" ","Enter","ArrowUp","ArrowDown"],TD=[" ","Enter"],$a="Select",[Pu,Ru,ND]=wp($a),[ti,s4]=vr($a,[ND,cu]),ju=cu(),[PD,Gn]=ti($a),[RD,jD]=ti($a),$S=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:s,onOpenChange:o,value:i,defaultValue:a,onValueChange:l,dir:c,name:d,autoComplete:f,disabled:h,required:v}=e,w=ju(t),[m,b]=p.useState(null),[g,y]=p.useState(null),[x,S]=p.useState(!1),E=Su(c),[C=!1,_]=Fn({prop:n,defaultProp:s,onChange:o}),[k,N]=Fn({prop:i,defaultProp:a,onChange:l}),j=p.useRef(null),R=m?!!m.closest("form"):!0,[T,A]=p.useState(new Set),L=Array.from(T).map(W=>W.props.value).join(";");return u.jsx(AR,{...w,children:u.jsxs(PD,{required:v,scope:t,trigger:m,onTriggerChange:b,valueNode:g,onValueNodeChange:y,valueNodeHasChildren:x,onValueNodeHasChildrenChange:S,contentId:fr(),value:k,onValueChange:N,open:C,onOpenChange:_,dir:E,triggerPointerDownPosRef:j,disabled:h,children:[u.jsx(Pu.Provider,{scope:t,children:u.jsx(RD,{scope:e.__scopeSelect,onNativeOptionAdd:p.useCallback(W=>{A(H=>new Set(H).add(W))},[]),onNativeOptionRemove:p.useCallback(W=>{A(H=>{const ee=new Set(H);return ee.delete(W),ee})},[]),children:r})}),R?u.jsxs(l1,{"aria-hidden":!0,required:v,tabIndex:-1,name:d,autoComplete:f,value:k,onChange:W=>N(W.target.value),disabled:h,children:[k===void 0?u.jsx("option",{value:""}):null,Array.from(T)]},L):null]})})};$S.displayName=$a;var MS="SelectTrigger",FS=p.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...s}=e,o=ju(r),i=Gn(MS,r),a=i.disabled||n,l=le(t,i.onTriggerChange),c=Ru(r),[d,f,h]=c1(w=>{const m=c().filter(y=>!y.disabled),b=m.find(y=>y.value===i.value),g=u1(m,w,b);g!==void 0&&i.onValueChange(g.value)}),v=()=>{a||(i.onOpenChange(!0),h())};return u.jsx(Xx,{asChild:!0,...o,children:u.jsx(X.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":a1(i.value)?"":void 0,...s,ref:l,onClick:q(s.onClick,w=>{w.currentTarget.focus()}),onPointerDown:q(s.onPointerDown,w=>{const m=w.target;m.hasPointerCapture(w.pointerId)&&m.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&(v(),i.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)},w.preventDefault())}),onKeyDown:q(s.onKeyDown,w=>{const m=d.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&f(w.key),!(m&&w.key===" ")&&kD.includes(w.key)&&(v(),w.preventDefault())})})})});FS.displayName=MS;var US="SelectValue",BS=p.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,children:o,placeholder:i="",...a}=e,l=Gn(US,r),{onValueNodeHasChildrenChange:c}=l,d=o!==void 0,f=le(t,l.onValueNodeChange);return $e(()=>{c(d)},[c,d]),u.jsx(X.span,{...a,ref:f,style:{pointerEvents:"none"},children:a1(l.value)?u.jsx(u.Fragment,{children:i}):o})});BS.displayName=US;var AD="SelectIcon",zS=p.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...s}=e;return u.jsx(X.span,{"aria-hidden":!0,...s,ref:t,children:n||"â¼"})});zS.displayName=AD;var OD="SelectPortal",WS=e=>u.jsx(NS,{asChild:!0,...e});WS.displayName=OD;var Es="SelectContent",HS=p.forwardRef((e,t)=>{const r=Gn(Es,e.__scopeSelect),[n,s]=p.useState();if($e(()=>{s(new DocumentFragment)},[]),!r.open){const o=n;return o?Kn.createPortal(u.jsx(VS,{scope:e.__scopeSelect,children:u.jsx(Pu.Slot,{scope:e.__scopeSelect,children:u.jsx("div",{children:e.children})})}),o):null}return u.jsx(qS,{...e,ref:t})});HS.displayName=Es;var Hr=10,[VS,Yn]=ti(Es),ID="SelectContentImpl",qS=p.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:i,side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:v,sticky:w,hideWhenDetached:m,avoidCollisions:b,...g}=e,y=Gn(Es,r),[x,S]=p.useState(null),[E,C]=p.useState(null),_=le(t,I=>S(I)),[k,N]=p.useState(null),[j,R]=p.useState(null),T=Ru(r),[A,L]=p.useState(!1),W=p.useRef(!1);p.useEffect(()=>{if(x)return qp(x)},[x]),$I();const H=p.useCallback(I=>{const[U,...Z]=T().map(M=>M.ref.current),[ne]=Z.slice(-1),Q=document.activeElement;for(const M of I)if(M===Q||(M==null||M.scrollIntoView({block:"nearest"}),M===U&&E&&(E.scrollTop=0),M===ne&&E&&(E.scrollTop=E.scrollHeight),M==null||M.focus(),document.activeElement!==Q))return},[T,E]),ee=p.useCallback(()=>H([k,x]),[H,k,x]);p.useEffect(()=>{A&&ee()},[A,ee]);const{onOpenChange:P,triggerPointerDownPosRef:$}=y;p.useEffect(()=>{if(x){let I={x:0,y:0};const U=ne=>{var Q,M;I={x:Math.abs(Math.round(ne.pageX)-(((Q=$.current)==null?void 0:Q.x)??0)),y:Math.abs(Math.round(ne.pageY)-(((M=$.current)==null?void 0:M.y)??0))}},Z=ne=>{I.x<=10&&I.y<=10?ne.preventDefault():x.contains(ne.target)||P(!1),document.removeEventListener("pointermove",U),$.current=null};return $.current!==null&&(document.addEventListener("pointermove",U),document.addEventListener("pointerup",Z,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",U),document.removeEventListener("pointerup",Z,{capture:!0})}}},[x,P,$]),p.useEffect(()=>{const I=()=>P(!1);return window.addEventListener("blur",I),window.addEventListener("resize",I),()=>{window.removeEventListener("blur",I),window.removeEventListener("resize",I)}},[P]);const[K,B]=c1(I=>{const U=T().filter(Q=>!Q.disabled),Z=U.find(Q=>Q.ref.current===document.activeElement),ne=u1(U,I,Z);ne&&setTimeout(()=>ne.ref.current.focus())}),Y=p.useCallback((I,U,Z)=>{const ne=!W.current&&!Z;(y.value!==void 0&&y.value===U||ne)&&(N(I),ne&&(W.current=!0))},[y.value]),ae=p.useCallback(()=>x==null?void 0:x.focus(),[x]),ue=p.useCallback((I,U,Z)=>{const ne=!W.current&&!Z;(y.value!==void 0&&y.value===U||ne)&&R(I)},[y.value]),_e=n==="popper"?fh:KS,O=_e===fh?{side:a,sideOffset:l,align:c,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:v,sticky:w,hideWhenDetached:m,avoidCollisions:b}:{};return u.jsx(VS,{scope:r,content:x,viewport:E,onViewportChange:C,itemRefCallback:Y,selectedItem:k,onItemLeave:ae,itemTextRefCallback:ue,focusSelectedItem:ee,selectedItemText:j,position:n,isPositioned:A,searchRef:K,children:u.jsx(LS,{as:Mn,allowPinchZoom:!0,children:u.jsx(Cu,{asChild:!0,trapped:y.open,onMountAutoFocus:I=>{I.preventDefault()},onUnmountAutoFocus:q(s,I=>{var U;(U=y.trigger)==null||U.focus({preventScroll:!0}),I.preventDefault()}),children:u.jsx(CS,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:I=>I.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:u.jsx(_e,{role:"listbox",id:y.contentId,"data-state":y.open?"open":"closed",dir:y.dir,onContextMenu:I=>I.preventDefault(),...g,...O,onPlaced:()=>L(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:q(g.onKeyDown,I=>{const U=I.ctrlKey||I.altKey||I.metaKey;if(I.key==="Tab"&&I.preventDefault(),!U&&I.key.length===1&&B(I.key),["ArrowUp","ArrowDown","Home","End"].includes(I.key)){let ne=T().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);if(["ArrowUp","End"].includes(I.key)&&(ne=ne.slice().reverse()),["ArrowUp","ArrowDown"].includes(I.key)){const Q=I.target,M=ne.indexOf(Q);ne=ne.slice(M+1)}setTimeout(()=>H(ne)),I.preventDefault()}})})})})})})});qS.displayName=ID;var DD="SelectItemAlignedPosition",KS=p.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...s}=e,o=Gn(Es,r),i=Yn(Es,r),[a,l]=p.useState(null),[c,d]=p.useState(null),f=le(t,_=>d(_)),h=Ru(r),v=p.useRef(!1),w=p.useRef(!0),{viewport:m,selectedItem:b,selectedItemText:g,focusSelectedItem:y}=i,x=p.useCallback(()=>{if(o.trigger&&o.valueNode&&a&&c&&m&&b&&g){const _=o.trigger.getBoundingClientRect(),k=c.getBoundingClientRect(),N=o.valueNode.getBoundingClientRect(),j=g.getBoundingClientRect();if(o.dir!=="rtl"){const Q=j.left-k.left,M=N.left-Q,te=_.left-M,se=_.width+te,he=Math.max(se,k.width),ye=window.innerWidth-Hr,Ke=ch(M,[Hr,ye-he]);a.style.minWidth=se+"px",a.style.left=Ke+"px"}else{const Q=k.right-j.right,M=window.innerWidth-N.right-Q,te=window.innerWidth-_.right-M,se=_.width+te,he=Math.max(se,k.width),ye=window.innerWidth-Hr,Ke=ch(M,[Hr,ye-he]);a.style.minWidth=se+"px",a.style.right=Ke+"px"}const R=h(),T=window.innerHeight-Hr*2,A=m.scrollHeight,L=window.getComputedStyle(c),W=parseInt(L.borderTopWidth,10),H=parseInt(L.paddingTop,10),ee=parseInt(L.borderBottomWidth,10),P=parseInt(L.paddingBottom,10),$=W+H+A+P+ee,K=Math.min(b.offsetHeight*5,$),B=window.getComputedStyle(m),Y=parseInt(B.paddingTop,10),ae=parseInt(B.paddingBottom,10),ue=_.top+_.height/2-Hr,_e=T-ue,O=b.offsetHeight/2,I=b.offsetTop+O,U=W+H+I,Z=$-U;if(U<=ue){const Q=b===R[R.length-1].ref.current;a.style.bottom="0px";const M=c.clientHeight-m.offsetTop-m.offsetHeight,te=Math.max(_e,O+(Q?ae:0)+M+ee),se=U+te;a.style.height=se+"px"}else{const Q=b===R[0].ref.current;a.style.top="0px";const te=Math.max(ue,W+m.offsetTop+(Q?Y:0)+O)+Z;a.style.height=te+"px",m.scrollTop=U-ue+m.offsetTop}a.style.margin=`${Hr}px 0`,a.style.minHeight=K+"px",a.style.maxHeight=T+"px",n==null||n(),requestAnimationFrame(()=>v.current=!0)}},[h,o.trigger,o.valueNode,a,c,m,b,g,o.dir,n]);$e(()=>x(),[x]);const[S,E]=p.useState();$e(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);const C=p.useCallback(_=>{_&&w.current===!0&&(x(),y==null||y(),w.current=!1)},[x,y]);return u.jsx($D,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:v,onScrollButtonChange:C,children:u.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:u.jsx(X.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});KS.displayName=DD;var LD="SelectPopperPosition",fh=p.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:s=Hr,...o}=e,i=ju(r);return u.jsx(Zx,{...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)"}})});fh.displayName=LD;var[$D,Xp]=ti(Es,{}),hh="SelectViewport",GS=p.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...s}=e,o=Yn(hh,r),i=Xp(hh,r),a=le(t,o.onViewportChange),l=p.useRef(0);return u.jsxs(u.Fragment,{children:[u.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}),u.jsx(Pu.Slot,{scope:r,children:u.jsx(X.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:a,style:{position:"relative",flex:1,overflow:"auto",...s.style},onScroll:q(s.onScroll,c=>{const d=c.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=i;if(h!=null&&h.current&&f){const v=Math.abs(l.current-d.scrollTop);if(v>0){const w=window.innerHeight-Hr*2,m=parseFloat(f.style.minHeight),b=parseFloat(f.style.height),g=Math.max(m,b);if(g<w){const y=g+v,x=Math.min(w,y),S=y-x;f.style.height=x+"px",f.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,f.style.justifyContent="flex-end")}}}l.current=d.scrollTop})})})]})});GS.displayName=hh;var YS="SelectGroup",[MD,FD]=ti(YS),UD=p.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=fr();return u.jsx(MD,{scope:r,id:s,children:u.jsx(X.div,{role:"group","aria-labelledby":s,...n,ref:t})})});UD.displayName=YS;var JS="SelectLabel",QS=p.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=FD(JS,r);return u.jsx(X.div,{id:s.id,...n,ref:t})});QS.displayName=JS;var jc="SelectItem",[BD,XS]=ti(jc),ZS=p.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:s=!1,textValue:o,...i}=e,a=Gn(jc,r),l=Yn(jc,r),c=a.value===n,[d,f]=p.useState(o??""),[h,v]=p.useState(!1),w=le(t,g=>{var y;return(y=l.itemRefCallback)==null?void 0:y.call(l,g,n,s)}),m=fr(),b=()=>{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 u.jsx(BD,{scope:r,value:n,disabled:s,textId:m,isSelected:c,onItemTextChange:p.useCallback(g=>{f(y=>y||((g==null?void 0:g.textContent)??"").trim())},[]),children:u.jsx(Pu.ItemSlot,{scope:r,value:n,disabled:s,textValue:d,children:u.jsx(X.div,{role:"option","aria-labelledby":m,"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:w,onFocus:q(i.onFocus,()=>v(!0)),onBlur:q(i.onBlur,()=>v(!1)),onPointerUp:q(i.onPointerUp,b),onPointerMove:q(i.onPointerMove,g=>{var y;s?(y=l.onItemLeave)==null||y.call(l):g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:q(i.onPointerLeave,g=>{var y;g.currentTarget===document.activeElement&&((y=l.onItemLeave)==null||y.call(l))}),onKeyDown:q(i.onKeyDown,g=>{var x;((x=l.searchRef)==null?void 0:x.current)!==""&&g.key===" "||(TD.includes(g.key)&&b(),g.key===" "&&g.preventDefault())})})})})});ZS.displayName=jc;var Ci="SelectItemText",e1=p.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:s,...o}=e,i=Gn(Ci,r),a=Yn(Ci,r),l=XS(Ci,r),c=jD(Ci,r),[d,f]=p.useState(null),h=le(t,g=>f(g),l.onItemTextChange,g=>{var y;return(y=a.itemTextRefCallback)==null?void 0:y.call(a,g,l.value,l.disabled)}),v=d==null?void 0:d.textContent,w=p.useMemo(()=>u.jsx("option",{value:l.value,disabled:l.disabled,children:v},l.value),[l.disabled,l.value,v]),{onNativeOptionAdd:m,onNativeOptionRemove:b}=c;return $e(()=>(m(w),()=>b(w)),[m,b,w]),u.jsxs(u.Fragment,{children:[u.jsx(X.span,{id:l.textId,...o,ref:h}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?Kn.createPortal(o.children,i.valueNode):null]})});e1.displayName=Ci;var t1="SelectItemIndicator",r1=p.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return XS(t1,r).isSelected?u.jsx(X.span,{"aria-hidden":!0,...n,ref:t}):null});r1.displayName=t1;var ph="SelectScrollUpButton",n1=p.forwardRef((e,t)=>{const r=Yn(ph,e.__scopeSelect),n=Xp(ph,e.__scopeSelect),[s,o]=p.useState(!1),i=le(t,n.onScrollButtonChange);return $e(()=>{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?u.jsx(o1,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop-l.offsetHeight)}}):null});n1.displayName=ph;var mh="SelectScrollDownButton",s1=p.forwardRef((e,t)=>{const r=Yn(mh,e.__scopeSelect),n=Xp(mh,e.__scopeSelect),[s,o]=p.useState(!1),i=le(t,n.onScrollButtonChange);return $e(()=>{if(r.viewport&&r.isPositioned){let a=function(){const c=l.scrollHeight-l.clientHeight,d=Math.ceil(l.scrollTop)<c;o(d)};const l=r.viewport;return a(),l.addEventListener("scroll",a),()=>l.removeEventListener("scroll",a)}},[r.viewport,r.isPositioned]),s?u.jsx(o1,{...e,ref:i,onAutoScroll:()=>{const{viewport:a,selectedItem:l}=r;a&&l&&(a.scrollTop=a.scrollTop+l.offsetHeight)}}):null});s1.displayName=mh;var o1=p.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...s}=e,o=Yn("SelectScrollButton",r),i=p.useRef(null),a=Ru(r),l=p.useCallback(()=>{i.current!==null&&(window.clearInterval(i.current),i.current=null)},[]);return p.useEffect(()=>()=>l(),[l]),$e(()=>{var d;const c=a().find(f=>f.ref.current===document.activeElement);(d=c==null?void 0:c.ref.current)==null||d.scrollIntoView({block:"nearest"})},[a]),u.jsx(X.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:q(s.onPointerDown,()=>{i.current===null&&(i.current=window.setInterval(n,50))}),onPointerMove:q(s.onPointerMove,()=>{var c;(c=o.onItemLeave)==null||c.call(o),i.current===null&&(i.current=window.setInterval(n,50))}),onPointerLeave:q(s.onPointerLeave,()=>{l()})})}),zD="SelectSeparator",i1=p.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return u.jsx(X.div,{"aria-hidden":!0,...n,ref:t})});i1.displayName=zD;var gh="SelectArrow",WD=p.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,s=ju(r),o=Gn(gh,r),i=Yn(gh,r);return o.open&&i.position==="popper"?u.jsx(eb,{...s,...n,ref:t}):null});WD.displayName=gh;function a1(e){return e===""||e===void 0}var l1=p.forwardRef((e,t)=>{const{value:r,...n}=e,s=p.useRef(null),o=le(t,s),i=PS(r);return p.useEffect(()=>{const a=s.current,l=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(l,"value").set;if(i!==r&&d){const f=new Event("change",{bubbles:!0});d.call(a,r),a.dispatchEvent(f)}},[i,r]),u.jsx(ja,{asChild:!0,children:u.jsx("select",{...n,ref:o,defaultValue:r})})});l1.displayName="BubbleSelect";function c1(e){const t=ke(e),r=p.useRef(""),n=p.useRef(0),s=p.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=p.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,s,o]}function u1(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=HD(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 HD(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var VD=$S,d1=FS,qD=BS,KD=zS,GD=WS,f1=HS,YD=GS,h1=QS,p1=ZS,JD=e1,QD=r1,m1=n1,g1=s1,v1=i1;const Wo=VD,Ho=qD,_s=p.forwardRef(({className:e,children:t,...r},n)=>u.jsxs(d1,{ref:n,className:ie("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
331ing-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,u.jsx(KD,{asChild:!0,children:u.jsx(wx,{className:"h-4 w-4 opacity-50"})})]}));_s.displayName=d1.displayName;const y1=p.forwardRef(({className:e,...t},r)=>u.jsx(m1,{ref:r,className:ie("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(VT,{className:"h-4 w-4"})}));y1.displayName=m1.displayName;const w1=p.forwardRef(({className:e,...t},r)=>u.jsx(g1,{ref:r,className:ie("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(wx,{className:"h-4 w-4"})}));w1.displayName=g1.displayName;const Cs=p.forwardRef(({className:e,children:t,position:r="popper",...n},s)=>u.jsx(GD,{children:u.jsxs(f1,{ref:s,className:ie("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:[u.jsx(y1,{}),u.jsx(YD,{className:ie("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),u.jsx(w1,{})]})}));Cs.displayName=f1.displayName;const XD=p.forwardRef(({className:e,...t},r)=>u.jsx(h1,{ref:r,className:ie("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));XD.displayName=h1.displayName;const Yr=p.forwardRef(({className:e,children:t,...r},n)=>u.jsxs(p1,{ref:n,className:ie("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(QD,{children:u.jsx(Ep,{className:"h-4 w-4"})})}),u.jsx(JD,{children:t})]}));Yr.displayName=p1.displayName;const ZD=p.forwardRef(({className:e,...t},r)=>u.jsx(v1,{ref:r,className:ie("-mx-1 my-1 h-px bg-muted",e),...t}));ZD.displayName=v1.displayName;function eL(e){return Object.prototype.toString.call(e)==="[object Object]"}function sy(e){return eL(e)||Array.isArray(e)}function tL(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function Zp(e,t){const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;const s=JSON.stringify(Object.keys(e.breakpoints||{})),o=JSON.stringify(Object.keys(t.breakpoints||{}));return s!==o?!1:r.every(i=>{const a=e[i],l=t[i];return typeof a=="function"?`${a}`==`${l}`:!sy(a)||!sy(l)?a===l:Zp(a,l)})}function oy(e){return e.concat().sort((t,r)=>t.name>r.name?1:-1).map(t=>t.options)}function rL(e,t){if(e.length!==t.length)return!1;const r=oy(e),n=oy(t);return r.every((s,o)=>{const i=n[o];return Zp(s,i)})}function em(e){return typeof e=="number"}function vh(e){return typeof e=="string"}function Au(e){return typeof e=="boolean"}function iy(e){return Object.prototype.toString.call(e)==="[object Object]"}function Fe(e){return Math.abs(e)}function tm(e){return Math.sign(e)}function Bi(e,t){return Fe(e-t)}function nL(e,t){if(e===0||t===0||Fe(e)<=Fe(t))return 0;const r=Bi(Fe(e),Fe(t));return Fe(r/e)}function wa(e){return xa(e).map(Number)}function hr(e){return e[Ma(e)]}function Ma(e){return Math.max(0,e.length-1)}function rm(e,t){return t===Ma(e)}function ay(e,t=0){return Array.from(Array(e),(r,n)=>t+n)}function xa(e){return Object.keys(e)}function x1(e,t){return[e,t].reduce((r,n)=>(xa(n).forEach(s=>{const o=r[s],i=n[s],a=iy(o)&&iy(i);r[s]=a?x1(o,i):i}),r),{})}function yh(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function sL(e,t){const r={start:n,center:s,end:o};function n(){return 0}function s(l){return o(l)/2}function o(l){return t-l}function i(l,c){return vh(e)?r[e](l):e(t,l,c)}return{measure:i}}function ba(){let e=[];function t(s,o,i,a={passive:!0}){let l;if("addEventListener"in s)s.addEventListener(o,i,a),l=()=>s.removeEventListener(o,i,a);else{const c=s;c.addListener(i),l=()=>c.removeListener(i)}return e.push(l),n}function r(){e=e.filter(s=>s())}const n={add:t,clear:r};return n}function oL(e,t,r,n){const s=ba(),o=1e3/60;let i=null,a=0,l=0;function c(){s.add(e,"visibilitychange",()=>{e.hidden&&w()})}function d(){v(),s.clear()}function f(b){if(!l)return;
vendor: 5,684 bytes, line 331
331i||(i=b);const g=b-i;for(i=b,a+=g;a>=o;)r(o),a-=o;const y=a/o;n(y),l&&t.requestAnimationFrame(f)}function h(){l||(l=t.requestAnimationFrame(f))}function v(){t.cancelAnimationFrame(l),i=null,a=0,l=0}function w(){i=null,a=0}return{init:c,destroy:d,start:h,stop:v,update:()=>r(o),render:n}}function iL(e,t){const r=t==="rtl",n=e==="y",s=n?"y":"x",o=n?"x":"y",i=!n&&r?-1:1,a=d(),l=f();function c(w){const{height:m,width:b}=w;return n?m:b}function d(){return n?"top":r?"right":"left"}function f(){return n?"bottom":r?"left":"right"}function h(w){return w*i}return{scroll:s,cross:o,startEdge:a,endEdge:l,measureSize:c,direction:h}}function ks(e=0,t=0){const r=Fe(e-t);function n(c){return c<e}function s(c){return c>t}function o(c){return n(c)||s(c)}function i(c){return o(c)?n(c)?e:t:c}function a(c){return r?c-r*Math.ceil((c-t)/r):c}return{length:r,max:t,min:e,constrain:i,reachedAny:o,reachedMax:s,reachedMin:n,removeOffset:a}}function b1(e,t,r){const{constrain:n}=ks(0,e),s=e+1;let o=i(t);function i(h){return r?Fe((s+h)%s):n(h)}function a(){return o}function l(h){return o=i(h),f}function c(h){return d().set(a()+h)}function d(){return b1(e,a(),r)}const f={get:a,set:l,add:c,clone:d};return f}function aL(e,t,r,n,s,o,i,a,l,c,d,f,h,v,w,m,b,g,y){const{cross:x,direction:S}=e,E=["INPUT","SELECT","TEXTAREA"],C={passive:!1},_=ba(),k=ba(),N=ks(50,225).constrain(v.measure(20)),j={mouse:300,touch:400},R={mouse:500,touch:600},T=w?43:25;let A=!1,L=0,W=0,H=!1,ee=!1,P=!1,$=!1;function K(M){if(!y)return;function te(he){(Au(y)||y(M,he))&&O(he)}const se=t;_.add(se,"dragstart",he=>he.preventDefault(),C).add(se,"touchmove",()=>{},C).add(se,"touchend",()=>{}).add(se,"touchstart",te).add(se,"mousedown",te).add(se,"touchcancel",U).add(se,"contextmenu",U).add(se,"click",Z,!0)}function B(){_.clear(),k.clear()}function Y(){const M=$?r:t;k.add(M,"touchmove",I,C).add(M,"touchend",U).add(M,"mousemove",I,C).add(M,"mouseup",U)}function ae(M){const te=M.nodeName||"";return E.includes(te)}function ue(){return(w?R:j)[$?"mouse":"touch"]}function _e(M,te){const se=f.add(tm(M)*-1),he=d.byDistance(M,!w).distance;return w||Fe(M)<N?he:b&&te?he*.5:d.byIndex(se.get(),0).distance}function O(M){const te=yh(M,n);$=te,P=w&&te&&!M.buttons&&A,A=Bi(s.get(),i.get())>=2,!(te&&M.button!==0)&&(ae(M.target)||(H=!0,o.pointerDown(M),c.useFriction(0).useDuration(0),s.set(i),Y(),L=o.readPoint(M),W=o.readPoint(M,x),h.emit("pointerDown")))}function I(M){if(!yh(M,n)&&M.touches.length>=2)return U(M);const se=o.readPoint(M),he=o.readPoint(M,x),ye=Bi(se,L),Ke=Bi(he,W);if(!ee&&!$&&(!M.cancelable||(ee=ye>Ke,!ee)))return U(M);const lt=o.pointerMove(M);ye>m&&(P=!0),c.useFriction(.3).useDuration(.75),a.start(),s.add(S(lt)),M.preventDefault()}function U(M){const se=d.byDistance(0,!1).index!==f.get(),he=o.pointerUp(M)*ue(),ye=_e(S(he),se),Ke=nL(he,ye),lt=T-10*Ke,ge=g+Ke/50;ee=!1,H=!1,k.clear(),c.useDuration(lt).useFriction(ge),l.distance(ye,!w),$=!1,h.emit("pointerUp")}function Z(M){P&&(M.stopPropagation(),M.preventDefault(),P=!1)}function ne(){return H}return{init:K,destroy:B,pointerDown:ne}}function lL(e,t){let n,s;function o(f){return f.timeStamp}function i(f,h){const w=`client${(h||e.scroll)==="x"?"X":"Y"}`;return(yh(f,t)?f:f.touches[0])[w]}function a(f){return n=f,s=f,i(f)}function l(f){const h=i(f)-i(s),v=o(f)-o(n)>170;return s=f,v&&(n=f),h}function c(f){if(!n||!s)return 0;const h=i(s)-i(n),v=o(f)-o(n),w=o(f)-o(s)>170,m=h/v;return v&&!w&&Fe(m)>.1?m:0}return{pointerDown:a,pointerMove:l,pointerUp:c,readPoint:i}}function cL(){function e(r){const{offsetTop:n,offsetLeft:s,offsetWidth:o,offsetHeight:i}=r;return{top:n,right:s+o,bottom:n+i,left:s,width:o,height:i}}return{measure:e}}function uL(e){function t(n){return e*(n/100)}return{measure:t}}function dL(e,t,r,n,s,o,i){const a=[e].concat(n);let l,c,d=[],f=!1;function h(b){return s.measureSize(i.measure(b))}function v(b){if(!o)return;c=h(e),d=n.map(h);function g(y){for(const x of y){if(f)return;const S=x.target===e,E=n.indexOf(x.target),C=S?c:d[E],_=h(S?e:n[E]);if(Fe(_-C)>=.5){b.reInit(),t.emit("resize");break}}}l=new ResizeObserver(y=>{(Au(o)||o(b,y))&&g(y)}),r.requestAnimationFrame(()=>{a.forEach(y=>l.observe(y))})}function w(){f=!0,l&&l.disconnect()}return{init:v,destroy:w}}function fL(e,t,r,n,s,o){let i=0,a=0,l=s,c=o,d=e.get(),f=0;function h(C){const _=C/1e3,k=l*_,N=n.get()-e.get(),j=!l;let R=0;return j?(i=0,r.set(n),e.set(n),R=N):(r.set(e),i+=N/k,i*=c,d+=i,e.add(i*_),R=d-f),a=tm(R),f=d,E}function v(){const C=n.get()-t.get();return Fe(C)<.001}function w(){return l}function m(){return a}function b(){return i}function g(){return x(s)}function y(){return S(o)}function x(C){return l=C,E}function S(C){return c=C,E}const E={direction:m,duration:w,velocity:b,seek:h,settled:v,useBaseFriction:y,useBaseDuration:g,useFriction:S,useDuration:x};return E}function hL(e,t,r,n,s){const o=s.measure(10),i=s.measure(50),a=ks(.1,.99);let l=!1;function c(){return!(l||!e.reachedAny(r.get())||!e.reachedAny(t.get()))}function d(v){if(!c())return;const w=e.reachedMin(t.get())?"min":"max",m=Fe(e[w]-t.get()),b=r.get()-t.get(),g=a.constrain(m/i);r.subtract(b*g),!v&&Fe(b)<o&&(r.set(e.constrain(r.get())),n.useDuration(25).useBaseFriction())}function f(v){l=!v}return{shouldConstrain:c,constrain:d,toggleActive:f}}function pL(e,t,r,n,s){const o=ks(-t+e,0),i=f(),a=d(),l=h();function c(w,m){return Bi(w,m)<1}function d(){const w=i[0],m=hr(i),b=i.lastIndexOf(w),g=i.indexOf(m)+1;return ks(b,g)}function f(){return r.map((w,m)=>{const{min:b,max:g}=o,y=o.constrain(w),x=!m,S=rm(r,m);return x?g:S||c(b,y)?b:c(g,y)?g:y}).map(w=>parseFloat(w.toFixed(3)))}function h(){if(t<=e+s)return[o.max];if(n==="keepSnaps")return i;const{min:w,max:m}=a;return i.slice(w,m)}
vendor: 11,277 bytes, line 331
331return{snapsContained:l,scrollContainLimit:a}}function mL(e,t,r){const n=t[0],s=r?n-e:hr(t);return{limit:ks(s,n)}}function gL(e,t,r,n){const o=t.min+.1,i=t.max+.1,{reachedMin:a,reachedMax:l}=ks(o,i);function c(h){return h===1?l(r.get()):h===-1?a(r.get()):!1}function d(h){if(!c(h))return;const v=e*(h*-1);n.forEach(w=>w.add(v))}return{loop:d}}function vL(e){const{max:t,length:r}=e;function n(o){const i=o-t;return r?i/-r:0}return{get:n}}function yL(e,t,r,n,s){const{startEdge:o,endEdge:i}=e,{groupSlides:a}=s,l=f().map(t.measure),c=h(),d=v();function f(){return a(n).map(m=>hr(m)[i]-m[0][o]).map(Fe)}function h(){return n.map(m=>r[o]-m[o]).map(m=>-Fe(m))}function v(){return a(c).map(m=>m[0]).map((m,b)=>m+l[b])}return{snaps:c,snapsAligned:d}}function wL(e,t,r,n,s,o){const{groupSlides:i}=s,{min:a,max:l}=n,c=d();function d(){const h=i(o),v=!e||t==="keepSnaps";return r.length===1?[o]:v?h:h.slice(a,l).map((w,m,b)=>{const g=!m,y=rm(b,m);if(g){const x=hr(b[0])+1;return ay(x)}if(y){const x=Ma(o)-hr(b)[0]+1;return ay(x,hr(b)[0])}return w})}return{slideRegistry:c}}function xL(e,t,r,n,s){const{reachedAny:o,removeOffset:i,constrain:a}=n;function l(w){return w.concat().sort((m,b)=>Fe(m)-Fe(b))[0]}function c(w){const m=e?i(w):a(w),b=t.map((y,x)=>({diff:d(y-m,0),index:x})).sort((y,x)=>Fe(y.diff)-Fe(x.diff)),{index:g}=b[0];return{index:g,distance:m}}function d(w,m){const b=[w,w+r,w-r];if(!e)return w;if(!m)return l(b);const g=b.filter(y=>tm(y)===m);return g.length?l(g):hr(b)-r}function f(w,m){const b=t[w]-s.get(),g=d(b,m);return{index:w,distance:g}}function h(w,m){const b=s.get()+w,{index:g,distance:y}=c(b),x=!e&&o(b);if(!m||x)return{index:g,distance:w};const S=t[g]-y,E=w+d(S,0);return{index:g,distance:E}}return{byDistance:h,byIndex:f,shortcut:d}}function bL(e,t,r,n,s,o,i){function a(f){const h=f.distance,v=f.index!==t.get();o.add(h),h&&(n.duration()?e.start():(e.update(),e.render(1),e.update())),v&&(r.set(t.get()),t.set(f.index),i.emit("select"))}function l(f,h){const v=s.byDistance(f,h);a(v)}function c(f,h){const v=t.clone().set(f),w=s.byIndex(v.get(),h);a(w)}return{distance:l,index:c}}function SL(e,t,r,n,s,o,i,a){const l={passive:!0,capture:!0};let c=0;function d(v){if(!a)return;function w(m){if(new Date().getTime()-c>10)return;i.emit("slideFocusStart"),e.scrollLeft=0;const y=r.findIndex(x=>x.includes(m));em(y)&&(s.useDuration(0),n.index(y,0),i.emit("slideFocus"))}o.add(document,"keydown",f,!1),t.forEach((m,b)=>{o.add(m,"focus",g=>{(Au(a)||a(v,g))&&w(b)},l)})}function f(v){v.code==="Tab"&&(c=new Date().getTime())}return{init:d}}function ki(e){let t=e;function r(){return t}function n(l){t=i(l)}function s(l){t+=i(l)}function o(l){t-=i(l)}function i(l){return em(l)?l:l.get()}return{get:r,set:n,add:s,subtract:o}}function S1(e,t){const r=e.scroll==="x"?o:i,n=t.style;let s=!1;function o(f){return`translate3d(${f}px,0px,0px)`}function i(f){return`translate3d(0px,${f}px,0px)`}function a(f){s||(n.transform=r(e.direction(f)))}function l(f){s=!f}function c(){s||(n.transform="",t.getAttribute("style")||t.removeAttribute("style"))}return{clear:c,to:a,toggleActive:l}}function EL(e,t,r,n,s,o,i,a,l){const d=wa(s),f=wa(s).reverse(),h=g().concat(y());function v(_,k){return _.reduce((N,j)=>N-s[j],k)}function w(_,k){return _.reduce((N,j)=>v(N,k)>0?N.concat([j]):N,[])}function m(_){return o.map((k,N)=>({start:k-n[N]+.5+_,end:k+t-.5+_}))}function b(_,k,N){const j=m(k);return _.map(R=>{const T=N?0:-r,A=N?r:0,L=N?"end":"start",W=j[R][L];return{index:R,loopPoint:W,slideLocation:ki(-1),translate:S1(e,l[R]),target:()=>a.get()>W?T:A}})}function g(){const _=i[0],k=w(f,_);return b(k,r,!1)}function y(){const _=t-i[0]-1,k=w(d,_);return b(k,-r,!0)}function x(){return h.every(({index:_})=>{const k=d.filter(N=>N!==_);return v(k,t)<=.1})}function S(){h.forEach(_=>{const{target:k,translate:N,slideLocation:j}=_,R=k();R!==j.get()&&(N.to(R),j.set(R))})}function E(){h.forEach(_=>_.translate.clear())}return{canLoop:x,clear:E,loop:S,loopPoints:h}}function _L(e,t,r){let n,s=!1;function o(l){if(!r)return;function c(d){for(const f of d)if(f.type==="childList"){l.reInit(),t.emit("slidesChanged");break}}n=new MutationObserver(d=>{s||(Au(r)||r(l,d))&&c(d)}),n.observe(e,{childList:!0})}function i(){n&&n.disconnect(),s=!0}return{init:o,destroy:i}}function CL(e,t,r,n){const s={};let o=null,i=null,a,l=!1;function c(){a=new IntersectionObserver(w=>{l||(w.forEach(m=>{const b=t.indexOf(m.target);s[b]=m}),o=null,i=null,r.emit("slidesInView"))},{root:e.parentElement,threshold:n}),t.forEach(w=>a.observe(w))}function d(){a&&a.disconnect(),l=!0}function f(w){return xa(s).reduce((m,b)=>{const g=parseInt(b),{isIntersecting:y}=s[g];return(w&&y||!w&&!y)&&m.push(g),m},[])}function h(w=!0){if(w&&o)return o;if(!w&&i)return i;const m=f(w);return w&&(o=m),w||(i=m),m}return{init:c,destroy:d,get:h}}function kL(e,t,r,n,s,o){const{measureSize:i,startEdge:a,endEdge:l}=e,c=r[0]&&s,d=w(),f=m(),h=r.map(i),v=b();function w(){if(!c)return 0;const y=r[0];return Fe(t[a]-y[a])}function m(){if(!c)return 0;const y=o.getComputedStyle(hr(n));return parseFloat(y.getPropertyValue(`margin-${l}`))}function b(){return r.map((y,x,S)=>{const E=!x,C=rm(S,x);return E?h[x]+d:C?h[x]+f:S[x+1][a]-y[a]}).map(Fe)}return{slideSizes:h,slideSizesWithGaps:v,startGap:d,endGap:f}}function TL(e,t,r,n,s,o,i,a,l){const{startEdge:c,endEdge:d,direction:f}=e,h=em(r);function v(g,y){return wa(g).filter(x=>x%y===0).map(x=>g.slice(x,x+y))}function w(g){return g.length?wa(g).reduce((y,x,S)=>{const E=hr(y)||0,C=E===0,_=x===Ma(g),k=s[c]-o[E][c],N=s[c]-o[x][d],j=!n&&C?f(i):0,R=!n&&_?f(a):0,T=Fe(N-R-(k+j));return S&&T>t+l&&y.push(x),_&&y.push(g.length),y},[]).map((y,x,S)=>{const E=Math.max(S[x-1]||0);return g.slice(E,y)}):[]}function m(g){return h?v(g,r):w(g)}return{groupSlides:m}}function NL(e,t,r,n,s,o,i){const{align:a,axis:l,direction:c,startIndex:d,loop:f,duration:h,dragFree:v,dragThreshold:w,inViewThreshold:m,slidesToScroll:b,skipSnaps:g,containScroll:y,watchResize:x,watchSlides:S,watchDrag:E,watchFocus:C}=o,_=2,k=cL(),N=k.measure(t),j=r.map(k.measure),R=iL(l,c),T=R.measureSize(N),A=uL(T),L=sL(a,T),W=!f&&!!y,H=f||!!y,{slideSizes:ee,slideSizesWithGaps:P,startGap:$,endGap:K}=kL(R,N,j,r,H,s),B=TL(R,T,b,f,N,j,$,K,_),{snaps:Y,snapsAligned:ae}=yL(R,L,N,j,B),ue=-hr(Y)+hr(P),{snapsContained:_e,scrollContainLimit:O}=pL(T,ue,ae,y,_),I=W?_e:ae,{limit:U}=mL(ue,I,f),Z=b1(Ma(I),d,f),ne=Z.clone(),Q=wa(r),M=({dragHandler:Zt,scrollBody:oi,scrollBounds:As,options:{loop:Qn}},ii)=>{Qn||As.constrain(Zt.pointerDown()),oi.seek(ii)},te=({scrollBody:Zt,translate:oi,location:As,offsetLocation:Qn,scrollLooper:ii,slideLooper:ai,dragHandler:Sr,animation:Fu,eventHandler:ce,scrollBounds:Ce,options:{loop:be}},Pt)=>{const Rt=Zt.settled(),Os=!Ce.shouldConstrain(),Ha=be?Rt:Rt&&Os;Ha&&!Sr.pointerDown()&&(Fu.stop(),ce.emit("settle")),Ha||ce.emit("scroll");const S_=As.get()*Pt+lt.get()*(1-Pt);Qn.set(S_),be&&(ii.loop(Zt.direction()),ai.loop()),oi.to(Qn.get())},se=oL(n,s,Zt=>M(br,Zt),Zt=>te(br,Zt)),he=.68,ye=I[Z.get()],Ke=ki(ye),lt=ki(ye),ge=ki(ye),ct=ki(ye),Jn=fL(Ke,ge,lt,ct,h,he),ri=xL(f,I,ue,U,ct),on=bL(se,Z,ne,Jn,ri,ct,i),za=vL(U),ni=ba(),si=CL(t,r,i,m),{slideRegistry:$r}=wL(W,y,I,O,B,Q),Wa=SL(e,r,$r,on,Jn,ni,i,C),br={ownerDocument:n,ownerWindow:s,eventHandler:i,containerRect:N,slideRects:j,animation:se,axis:R,dragHandler:aL(R,e,n,s,ct,lL(R,s),Ke,se,on,Jn,ri,Z,i,A,v,w,g,he,E),eventStore:ni,percentOfView:A,index:Z,indexPrevious:ne,limit:U,location:Ke,offsetLocation:ge,previousLocation:lt,options:o,resizeHandler:dL(t,i,s,r,R,x,k),scrollBody:Jn,scrollBounds:hL(U,ge,ct,Jn,A),scrollLooper:gL(ue,U,ge,[Ke,ge,lt,ct]),scrollProgress:za,scrollSnapList:I.map(za.get),scrollSnaps:I,scrollTarget:ri,scrollTo:on,slideLooper:EL(R,T,ue,ee,P,Y,I,ge,r),slideFocus:Wa,slidesHandler:_L(t,i,S),slidesInView:si,slideIndexes:Q,slideRegistry:$r,slidesToScroll:B,target:ct,translate:S1(R,t)};return br}function PL(){let e={},t;function r(c){t=c}function n(c){return e[c]||[]}function s(c){return n(c).forEach(d=>d(t,c)),l}function o(c,d){return e[c]=n(c).concat([d]),l}function i(c,d){return e[c]=n(c).filter(f=>f!==d),l}function a(){e={}}const l={init:r,emit:s,off:i,on:o,clear:a};return l}const RL={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function jL(e){function t(o,i){return x1(o,i||{})}function r(o){const i=o.breakpoints||{},a=xa(i).filter(l=>e.matchMedia(l).matches).map(l=>i[l]).reduce((l,c)=>t(l,c),{});return t(o,a)}function n(o){return o.map(i=>xa(i.breakpoints||{})).reduce((i,a)=>i.concat(a),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:r,optionsMediaQueries:n}}function AL(e){let t=[];function r(o,i){return t=i.filter(({options:a})=>e.optionsAtMedia(a).active!==!1),t.forEach(a=>a.init(o,e)),i.reduce((a,l)=>Object.assign(a,{[l.name]:l}),{})}function n(){t=t.filter(o=>o.destroy())}return{init:r,destroy:n}}function Ac(e,t,r){const n=e.ownerDocument,s=n.defaultView,o=jL(s),i=AL(o),a=ba(),l=PL(),{mergeOptions:c,optionsAtMedia:d,optionsMediaQueries:f}=o,{on:h,off:v,emit:w}=l,m=R;let b=!1,g,y=c(RL,Ac.globalOptions),x=c(y),S=[],E,C,_;function k(){const{container:Q,slides:M}=x;C=(vh(Q)?e.querySelector(Q):Q)||e.children[0];const se=vh(M)?C.querySelectorAll(M):M;_=[].slice.call(se||C.children)}function N(Q){const M=NL(e,C,_,n,s,Q,l);if(Q.loop&&!M.slideLooper.canLoop()){const te=Object.assign({},Q,{loop:!1});return N(te)}return M}function j(Q,M){b||(y=c(y,Q),x=d(y),S=M||S,k(),g=N(x),f([y,...S.map(({options:te})=>te)]).forEach(te=>a.add(te,"change",R)),x.active&&(g.translate.to(g.location.get()),g.animation.init(),g.slidesInView.init(),g.slideFocus.init(ne),g.eventHandler.init(ne),g.resizeHandler.init(ne),g.slidesHandler.init(ne),g.options.loop&&g.slideLooper.loop(),C.offsetParent&&_.length&&g.dragHandler.init(ne),E=i.init(ne,S)))}function R(Q,M){const te=B();T(),j(c({startIndex:te},Q),M),l.emit("reInit")}function T(){g.dragHandler.destroy(),g.eventStore.clear(),g.translate.clear(),g.slideLooper.clear(),g.resizeHandler.destroy(),g.slidesHandler.destroy(),g.slidesInView.destroy(),g.animation.destroy(),i.destroy(),a.clear()}function A(){b||(b=!0,a.clear(),T(),l.emit("destroy"),l.clear())}function L(Q,M,te){!x.active||b||(g.scrollBody.useBaseFriction().useDuration(M===!0?0:x.duration),g.scrollTo.index(Q,te||0))}function W(Q){const M=g.index.add(1).get();L(M,Q,-1)}function H(Q){const M=g.index.add(-1).get();L(M,Q,1)}function ee(){return g.index.add(1).get()!==B()}function P(){return g.index.add(-1).get()!==B()}function $(){return g.scrollSnapList}function K(){return g.scrollProgress.get(g.location.get())}function B(){return g.index.get()}function Y(){return g.indexPrevious.get()}function ae(){return g.slidesInView.get()}function ue(){return g.slidesInView.get(!1)}function _e(){return E}function O(){return g}function I(){return e}function U(){return C}function Z(){return _}const ne={canScrollNext:ee,canScrollPrev:P,containerNode:U,internalEngine:O,destroy:A,off:v,on:h,emit:w,plugins:_e,previousScrollSnap:Y,reInit:m,rootNode:I,scrollNext:W,scrollPrev:H,scrollProgress:K,scrollSnapList:$,scrollTo:L,selectedScrollSnap:B,slideNo
331des:Z,slidesInView:ae,slidesNotInView:ue};return j(t,r),setTimeout(()=>l.emit("init"),0),ne}Ac.globalOptions=void 0;function nm(e={},t=[]){const r=p.useRef(e),n=p.useRef(t),[s,o]=p.useState(),[i,a]=p.useState(),l=p.useCallback(()=>{s&&s.reInit(r.current,n.current)},[s]);return p.useEffect(()=>{Zp(r.current,e)||(r.current=e,l())},[e,l]),p.useEffect(()=>{rL(n.current,t)||(n.current=t,l())},[t,l]),p.useEffect(()=>{if(tL()&&i){Ac.globalOptions=nm.globalOptions;const c=Ac(i,r.current,n.current);return o(c),()=>c.destroy()}else o(void 0)},[i,o]),[a,s]}nm.globalOptions=void 0;const De=p.forwardRef(({className:e,type:t,...r},n)=>u.jsx("input",{type:t,className:ie("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}));De.displayName="Input";var OL="Label",E1=p.forwardRef((e,t)=>u.jsx(X.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())}}));E1.displayName=OL;var _1=E1;const IL=nu("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Se=p.forwardRef(({className:e,...t},r)=>u.jsx(_1,{ref:r,className:ie(IL(),e),...t}));Se.displayName=_1.displayName;function DL({exercise:e,onUpdate:t}){const[r,n]=p.useState(!1),[s,o]=p.useState(e.sets.toString()),[i,a]=p.useState(e.reps),l=()=>{const d=parseInt(s);d>0&&i.trim()&&(t(e.id,{sets:d,reps:i.trim()}),n(!1))},c=()=>{o(e.sets.toString()),a(e.reps),n(!1)};return r?u.jsx(Pe,{className:"border-primary/50",children:u.jsxs(Oe,{className:"p-3 space-y-3",children:[u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx(Se,{htmlFor:"sets",className:"text-xs",children:"Sets"}),u.jsx(De,{id:"sets",type:"number",min:"1",max:"10",value:s,onChange:d=>o(d.target.value),className:"h-8 text-sm"})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(Se,{htmlFor:"reps",className:"text-xs",children:"Reps"}),u.jsx(De,{id:"reps",value:i,onChange:d=>a(d.target.value),placeholder:"e.g., 8-12",className:"h-8 text-sm"})]})]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsxs(re,{size:"sm",onClick:l,className:"h-7 text-xs flex-1",children:[u.jsx(Ep,{className:"h-3 w-3 mr-1"}),"Save"]}),u.jsxs(re,{variant:"outline",size:"sm",onClick:c,className:"h-7 text-xs flex-1",children:[u.jsx(ou,{className:"h-3 w-3 mr-1"}),"Cancel"]})]})]})}):u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[u.jsxs("div",{className:"text-center",children:[u.jsx("div",{className:"font-medium",children:e.sets}),u.jsx("div",{className:"text-muted-foreground",children:"Sets"})]}),u.jsxs("div",{className:"text-center",children:[u.jsx("div",{className:"font-medium",children:e.reps}),u.jsx("div",{className:"text-muted-foreground",children:"Reps"})]})]}),u.jsx(re,{variant:"ghost",size:"sm",onClick:()=>n(!0),className:"h-8 w-8 p-0",children:u.jsx(XT,{className:"h-3 w-3"})})]})}function LL({exerciseId:e,exerciseName:t,onTimeUpdate:r}){const[n,s]=p.useState(!1),[o,i]=p.useState(0),[a,l]=p.useState(null);p.useEffect(()=>{let v;return n&&a&&(v=setInterval(()=>{const w=Date.now(),m=Math.floor((w-a)/1e3);i(m)},1e3)),()=>{v&&clearInterval(v)}},[n,a]);const c=v=>{const w=Math.floor(v/60),m=v%60;return`${w.toString().padStart(2,"0")}:${m.toString().padStart(2,"0")}`},d=()=>{s(!0),l(Date.now()-o*1e3)},f=()=>{s(!1)},h=()=>{s(!1),r&&o>0&&r(e,o),i(0),l(null)};return u.jsx(Pe,{className:"border-primary/20",children:u.jsx(Oe,{className:"p-3",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(_p,{className:"h-4 w-4 text-primary"}),u.jsxs("div",{children:[u.jsx("div",{className:"text-sm font-medium",children:t}),u.jsx("div",{className:"text-xs text-muted-foreground",children:"Exercise Timer"})]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:"text-lg font-mono font-semibold",children:c(o)}
331),u.jsxs("div",{className:"flex gap-1",children:[n?u.jsx(re,{variant:"outline",size:"sm",onClick:f,className:"h-8 w-8 p-0",children:u.jsx(QT,{className:"h-3 w-3"})}):u.jsx(re,{variant:"outline",size:"sm",onClick:d,className:"h-8 w-8 p-0",children:u.jsx(oa,{className:"h-3 w-3"})}),(n||o>0)&&u.jsx(re,{variant:"outline",size:"sm",onClick:h,className:"h-8 w-8 p-0",children:u.jsx(rN,{className:"h-3 w-3"})})]})]})]})})})}function $L({workout:e,onSetComplete:t,onSetUndo:r,onShowDemo:n,onExerciseUpdate:s,onTimeUpdate:o}){const[i,a]=nm({loop:!1,align:"center"}),[l,c]=$i(`live-workout-index-${e.date}`,0),[d,f]=p.useState(l),[h,v]=p.useState(!1);p.useEffect(()=>{if(!a)return;const g=()=>{const y=a.selectedScrollSnap();f(y),c(y)};return a.on("select",g),a.on("reInit",g),()=>{a.off("select",g),a.off("reInit",g)}},[a,c]),p.useEffect(()=>{if(!a)return;const g=Math.min(l,e.exercises.length-1);a.scrollTo(g,!0)},[a,e.exercises.length]),p.useEffect(()=>{if(!a)return;const g=y=>{var S;const x=(S=y.target)==null?void 0:S.tagName;x==="INPUT"||x==="TEXTAREA"||(y.key==="ArrowLeft"&&a.scrollPrev(),y.key==="ArrowRight"&&a.scrollNext())};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[a]),p.useEffect(()=>{if(!h)return;const g=document.body.style.overflow;document.body.style.overflow="hidden";const y=x=>{x.key==="Escape"&&v(!1)};return window.addEventListener("keydown",y),()=>{document.body.style.overflow=g,window.removeEventListener("keydown",y)}},[h]);const w=()=>a==null?void 0:a.scrollPrev(),m=()=>a==null?void 0:a.scrollNext(),b=e.exercises;return u.jsxs("div",{className:h?"fixed inset-0 z-50 bg-background overflow-y-auto overflow-x-hidden p-3 sm:p-6 space-y-4":"space-y-4",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("span",{className:"text-sm text-muted-foreground",children:["Exercise ",d+1," / ",b.length]}),u.jsx(re,{variant:"outline",size:"sm",onClick:()=>v(g=>!g),"aria-label":h?"Exit fullscreen":"Enter fullscreen",children:h?u.jsxs(u.Fragment,{children:[u.jsx(ou,{className:"h-4 w-4 mr-1"})," Exit"]}):u.jsxs(u.Fragment,{children:[u.jsx(YT,{className:"h-4 w-4 mr-1"})," Fullscreen"]})})]}),u.jsx("div",{className:"flex items-center justify-center gap-2 flex-wrap",children:b.map((g,y)=>{const x=(e.completedSets[g.id]||0)>=g.sets,S=y===d;return u.jsx("button",{onClick:()=>a==null?void 0:a.scrollTo(y),"aria-label":`Go to exercise ${y+1}`,className:`h-2.5 rounded-full transition-all ${S?"w-6 bg-primary":x?"w-2.5 bg-primary/70":"w-2.5 bg-muted"}`},g.id)})}),u.jsxs("div",{className:"relative",children:[u.jsx("div",{className:"overflow-hidden",ref:i,children:u.jsx("div",{className:"flex",children:b.map(g=>u.jsx("div",{className:"min-w-0 shrink-0 grow-0 basis-full px-1",children:u.jsx(ML,{exercise:g,completedSets:e.completedSets[g.id]||0,onSetComplete:t,onSetUndo:r,onShowDemo:n,onExerciseUpdate:s,onTimeUpdate:o})},g.id))})}),u.jsx(re,{variant:"outline",size:"icon",onClick:w,disabled:d===0,className:"hidden md:flex absolute -left-4 top-1/2 -translate-y-1/2 rounded-full shadow-md","aria-label":"Previous exercise",children:u.jsx(Lf,{className:"h-5 w-5"})}),u.jsx(re,{variant:"outline",size:"icon",onClick:m,disabled:d>=b.length-1,className:"hidden md:flex absolute -right-4 top-1/2 -translate-y-1/2 rounded-full shadow-md","aria-label":"Next exercise",children:u.jsx($f,{className:"h-5 w-5"})})]}),u.jsxs("div",{className:"flex items-center justify-between md:hidden",children:[u.jsxs(re,{variant:"outline",size:"sm",onClick:w,disabled:d===0,children:[u.jsx(Lf,{className:"h-4 w-4 mr-1"})," Prev"]}),u.jsxs("span",{className:"text-sm text-muted-foreground",children:[d+1," / ",b.length]}),u.jsxs(re,{variant:"outline",size:"sm",onClick:m,disabled:d>=b.length-1,children:["Next ",u.jsx($f,{className:"h-4 w-4 ml-1"})]})]})]})}function ML({exercise:e,completedSets:t,onSetComplete:r,onSetUndo:n,onShowDemo:s,onExerciseUpdate:o,onTimeUpdate:i}){const a=t>=e.sets,l=t/e.sets*100;return u.jsx(Pe,{className:`overflow-hidden ${a?"border-primary/60":""}`,children:u.jsxs(Oe,{className:"p-4 sm:p-6 space-y-5 animate-fade-in",children:[u.jsx("button",{type:"button",onClick:()=>s(e),className:"block w-full group","aria-label":"Show exercise demo",children:u.jsxs("div",{className:"mx-auto aspect-square w-full max-w-[360px] rounded-xl overflow-hidden bg-muted relative",children:[e.gifUrl?u.jsx("img",{src:e.gifUrl,alt:`${e.name} demonstration`,className:"h-full w-full object-cover transition-transform group-hover:scale-[1.02]"}):u.jsxs("div",{className:"h-full w-full flex flex-col items-center justify-center text-muted-foreground gap-2",children:[u.jsx(oa,{className:"h-12 w-12"}),u.jsx("span",{className:"text-sm",children:"Tap to load demo"})]}),a&&u.jsx("div",{className:"absolute top-2 right-2 bg-primary text-primary-foreground rounded-full p-1.5
331shadow",children:u.jsx(qT,{className:"h-5 w-5"})})]})}),u.jsxs("div",{className:"text-center space-y-2",children:[u.jsx("h2",{className:"text-2xl sm:text-3xl font-bold leading-tight",children:e.name}),u.jsxs("div",{className:"flex items-center justify-center gap-2 flex-wrap",children:[u.jsx(Et,{variant:"outline",children:e.muscle}),u.jsxs(Et,{variant:"secondary",children:[e.sets," sets à ",e.reps]}),u.jsxs(Et,{variant:"outline",className:"flex items-center gap-1",children:[u.jsx(_p,{className:"h-3 w-3"})," ",e.restTime,"s rest"]})]})]}),e.description&&u.jsx("p",{className:"text-sm text-muted-foreground text-center max-w-prose mx-auto",children:e.description}),u.jsx("div",{className:"grid grid-cols-1 gap-2",children:u.jsx(DL,{exercise:e,onUpdate:o})}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex justify-between text-sm",children:[u.jsx("span",{className:"text-muted-foreground",children:"Progress"}),u.jsxs("span",{className:"font-medium",children:[t," / ",e.sets," sets"]})]}),u.jsx("div",{className:"w-full bg-muted rounded-full h-2.5 overflow-hidden",children:u.jsx("div",{className:"bg-primary h-full rounded-full transition-all",style:{width:`${l}%`}})})]}),u.jsx(LL,{exerciseId:e.id,exerciseName:e.name,onTimeUpdate:i}),u.jsxs("div",{className:"flex gap-2",children:[u.jsxs(re,{size:"lg",className:"flex-1 h-14 text-base",onClick:()=>r(e.id),disabled:a,variant:a?"outline":"default",children:[u.jsx(Uo,{className:"h-5 w-5 mr-2"}),a?"All sets done":`Mark set ${t+1} done`]}),t>0&&u.jsx(re,{variant:"outline",size:"lg",className:"h-14 w-14 p-0",onClick:()=>n(e.id),"aria-label":"Undo last set",children:u.jsx(JT,{className:"h-5 w-5"})})]})]})})}function FL(e,t){const r=p.createContext(t),n=o=>{const{children:i,...a}=o,l=p.useMemo(()=>a,Object.values(a));return u.jsx(r.Provider,{value:l,children:i})};n.displayName=e+"Provider";function s(o){const i=p.useContext(r);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[n,s]}function UL(e,t=[]){let r=[];function n(o,i){const a=p.createContext(i),l=r.length;r=[...r,i];const c=f=>{var g;const{scope:h,children:v,...w}=f,m=((g=h==null?void 0:h[e])==null?void 0:g[l])||a,b=p.useMemo(()=>w,Object.values(w));return u.jsx(m.Provider,{value:b,children:v})};c.displayName=o+"Provider";function d(f,h){var m;const v=((m=h==null?void 0:h[e])==null?void 0:m[l])||a,w=p.useContext(v);if(w)return w;if(i!==void 0)return i;throw new Error(`\`${f}\` must be used within \`${o}\``)}return[c,d]}const s=()=>{const o=r.map(i=>p.createContext(i));return function(a){const l=(a==null?void 0:a[e])||o;return p.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return s.scopeName=e,[n,BL(s,...t)]}function BL(...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 f=l(o)[`__scope${c}`];return{...a,...f}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function zL(e,t){return p.useReducer((r,n)=>t[r][n]??r,e)}var Ou=e=>{const{present:t,children:r}=e,n=WL(t),s=typeof r=="function"?r({present:n.isPresent}):p.Children.only(r),o=le(n.ref,HL(s));return typeof r=="function"||n.isPresent?p.cloneElement(s,{ref:o}):null};Ou.displayName="Presence";function WL(e){const[t,r]=p.useState(),n=p.useRef({}),s=p.useRef(e),o=p.useRef("none"),i=e?"mounted":"unmounted",[a,l]=zL(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const c=Tl(n.current);o.current=a==="mounted"?c:"none"},[a]),$e(()=>{const c=n.current,d=s.current;if(d!==e){const h=o.current,v=Tl(c);e?l("MOUNT"):v==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&h!==v?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,l]),$e(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,f=v=>{const m=Tl(n.current).includes(v.animationName);if(v.target===t&&m&&(l("ANIMATION_END"),!s.current)){const b=t.style.animationFillMode;t.style.animationFillMode="forwards",c=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},h=v=>{v.target===t&&(o.current=Tl(n.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(c),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:p.useCallback(c=>{c&&(n.current=getComputedStyle(c)),r(c)},[])}}function Tl(e){return(e==null?void 0:e.animationName)||"none"}function HL(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 Od=0;function VL(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ly()),document.body.insertAdjacentElement("beforeend",e[1]??ly()),Od++,()=>{Od===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Od--}},[])}function ly(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.
vendor: 11,731 bytes, lines 331-338
331style.position="fixed",e.style.pointerEvents="none",e}var C1=Yp(),Id=function(){},Iu=p.forwardRef(function(e,t){var r=p.useRef(null),n=p.useState({onScrollCapture:Id,onWheelCapture:Id,onTouchMoveCapture:Id}),s=n[0],o=n[1],i=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,v=e.noIsolation,w=e.inert,m=e.allowPinchZoom,b=e.as,g=b===void 0?"div":b,y=e.gapMode,x=ku(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=h,E=Gp([r,t]),C=Ve(Ve({},x),s);return p.createElement(p.Fragment,null,d&&p.createElement(S,{sideCar:C1,removeScrollBar:c,shards:f,noIsolation:v,inert:w,setCallbacks:o,allowPinchZoom:!!m,lockRef:r,gapMode:y}),i?p.cloneElement(p.Children.only(a),Ve(Ve({},C),{ref:E})):p.createElement(g,Ve({},C,{className:l,ref:E}),a))});Iu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Iu.classNames={fullWidth:bo,zeroRight:xo};var wh=!1;if(typeof window<"u")try{var Nl=Object.defineProperty({},"passive",{get:function(){return wh=!0,!0}});window.addEventListener("test",Nl,Nl),window.removeEventListener("test",Nl,Nl)}catch{wh=!1}var Ws=wh?{passive:!1}:!1,qL=function(e){return e.tagName==="TEXTAREA"},k1=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!qL(e)&&r[t]==="visible")},KL=function(e){return k1(e,"overflowY")},GL=function(e){return k1(e,"overflowX")},cy=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=T1(e,n);if(s){var o=N1(e,n),i=o[1],a=o[2];if(i>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},YL=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},JL=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},T1=function(e,t){return e==="v"?KL(t):GL(t)},N1=function(e,t){return e==="v"?YL(t):JL(t)},QL=function(e,t){return e==="h"&&t==="rtl"?-1:1},XL=function(e,t,r,n,s){var o=QL(e,window.getComputedStyle(t).direction),i=o*n,a=r.target,l=t.contains(a),c=!1,d=i>0,f=0,h=0;do{var v=N1(e,a),w=v[0],m=v[1],b=v[2],g=m-b-o*w;(w||g)&&T1(e,a)&&(f+=g,h+=w),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&(Math.abs(f)<1||!s)||!d&&(Math.abs(h)<1||!s))&&(c=!0),c},Pl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},uy=function(e){return[e.deltaX,e.deltaY]},dy=function(e){return e&&"current"in e?e.current:e},ZL=function(e,t){return e[0]===t[0]&&e[1]===t[1]},e$=function(e){return` 332 .block-interactivity-`.concat(e,` {pointer-events: none;} 333 .allow-interactivity-`).concat(e,` {pointer-events: all;} 334`)},t$=0,Hs=[];function r$(e){var t=p.useRef([]),r=p.useRef([0,0]),n=p.useRef(),s=p.useState(t$++)[0],o=p.useState(Nu)[0],i=p.useRef(e);p.useEffect(function(){i.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var m=Kp([e.lockRef.current],(e.shards||[]).map(dy),!0).filter(Boolean);return m.forEach(function(b){return b.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=p.useCallback(function(m,b){if("touches"in m&&m.touches.length===2||m.type==="wheel"&&m.ctrlKey)return!i.current.allowPinchZoom;var g=Pl(m),y=r.current,x="deltaX"in m?m.deltaX:y[0]-g[0],S="deltaY"in m?m.deltaY:y[1]-g[1],E,C=m.target,_=Math.abs(x)>Math.abs(S)?"h":"v";if("touches"in m&&_==="h"&&C.type==="range")return!1;var k=cy(_,C);if(!k)return!0;if(k?E=_:(E=_==="v"?"h":"v",k=cy(_,C)),!k)return!1;if(!n.current&&"changedTouches"in m&&(x||S)&&(n.current=E),!E)return!0;var N=n.current||E;return XL(N,b,m,N==="h"?x:S,!0)},[]),l=p.useCallback(function(m){var b=m;if(!(!Hs.length||Hs[Hs.length-1]!==o)){var g="deltaY"in b?uy(b):Pl(b),y=t.current.filter(function(E){return E.name===b.type&&(E.target===b.target||b.target===E.shadowParent)&&ZL(E.delta,g)})[0];if(y&&y.should){b.cancelable&&b.preventDefault();return}if(!y){var x=(i.current.shards||[]).map(dy).filter(Boolean).filter(function(E){return E.contains(b.target)}),S=x.length>0?a(b,x[0]):!i.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),c=p.useCallback(function(m,b,g,y){var x={name:m,delta:b,target:g,should:y,shadowParent:n$(g)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(S){return S!==x})},1)},[]),d=p.useCallback(function(m){r.current=Pl(m),n.current=void 0},[]),f=p.useCallback(function(m){c(m.type,uy(m),m.target,a(m,e.lockRef.current))},[]),h=p.useCallback(function(m){c(m.type,Pl(m),m.target,a(m,e.lockRef.current))},[]);p.useEffect(function(){return Hs.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,Ws),document.addEventListener("touchmove",l,Ws),document.addEventListener("touchstart",d,Ws),function(){Hs=Hs.filter(function(m){return m!==o}),document.removeEventListener("wheel",l,Ws),document.removeEventListener("touchmove",l,Ws),document.removeEventListener("touchstart",d,Ws)}},[]);var v=e.removeScrollBar,w=e.inert;return p.createElement(p.Fragment,null,w?p.createElement(o,{styles:e$(s)}):null,v?p.createElement(Qp,{gapMode:e.gapMode}):null)}function n$(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const s$=Jp(C1,r$);var P1=p.forwardRef(function(e,t){return p.createElement(Iu,Ve({},e,{ref:t,sideCar:s$}))});P1.classNames=Iu.classNames;var sm="Dialog",[R1,o4]=UL(sm),[o$,wr]=R1(sm),j1=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:o,modal:i=!0}=e,a=p.useRef(null),l=p.useRef(null),[c=!1,d]=Fn({prop:n,defaultProp:s,onChange:o});return u.jsx(o$,{scope:t,triggerRef:a,contentRef:l,contentId:fr(),titleId:fr(),descriptionId:fr(),open:c,onOpenChange:d,onOpenToggle:p.useCallback(()=>d(f=>!f),[d]),modal:i,children:r})};j1.displayName=sm;var A1="DialogTrigger",O1=p.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=wr(A1,r),o=le(t,s.triggerRef);return u.jsx(X.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":am(s.open),...n,ref:o,onClick:q(e.onClick,s.onOpenToggle)})});O1.displayName=A1;var om="DialogPortal",[i$,I1]=R1(om,{forceMount:void 0}),D1=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:s}=e,o=wr(om,t);return u.jsx(i$,{scope:t,forceMount:r,children:p.Children.map(n,i=>u.jsx(Ou,{present:r||o.open,children:u.jsx(tb,{asChild:!0,container:s,children:i})}))})};D1.displayName=om;var Oc="DialogOverlay",L1=p.forwardRef((e,t)=>{const r=I1(Oc,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=wr(Oc,e.__scopeDialog);return o.modal?u.jsx(Ou,{present:n||o.open,children:u.jsx(a$,{...s,ref:t})}):null});L1.displayName=Oc;var a$=p.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=wr(Oc,r);return u.jsx(P1,{as:Mn,allowPinchZoom:!0,shards:[s.contentRef],children:u.jsx(X.div,{"data-state":am(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Ts="DialogContent",$1=p.forwardRef((e,t)=>{const r=I1(Ts,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=wr(Ts,e.__scopeDialog);return u.jsx(Ou,{present:n||o.open,children:o.modal?u.jsx(l$,{...s,ref:t}):u.jsx(c$,{...s,ref:t})})});$1.displayName=Ts;var l$=p.forwardRef((e,t)=>{const r=wr(Ts,e.__scopeDialog),n=p.useRef(null),s=le(t,r.contentRef,n);return p.useEffect(()=>{const o=n.current;if(o)return qp(o)},[]),u.jsx(M1,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:q(e.onCloseAutoFocus,o=>{var i;o.preventDefault(),(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:q(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&o.preventDefault()}),onFocusOutside:q(e.onFocusOutside,o=>o.preventDefault())})}),c$=p.forwardRef((e,t)=>{const r=wr(Ts,e.__scopeDialog),n=p.useRef(!1),s=p.useRef(!1);return u.jsx(M1,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,o),o.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),o.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:o=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=o.target;((c=r.triggerRef.current)==null?void 0:c.contains(i))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),M1=p.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:o,...i}=e,a=wr(Ts,r),l=p.useRef(null),c=le(t,l);return VL(),u.jsxs(u.Fragment,{children:[u.jsx(Cu,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:o,children:u.jsx(kp,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":am(a.open),...i,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(u$,{titleId:a.titleId}),u.jsx(f$,{contentRef:l,descriptionId:a.descriptionId})]})]})}),im="DialogTitle",F1=p.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=wr(im,r);return u.jsx(X.h2,{id:s.titleId,...n,ref:t})});F1.displayName=im;var U1="DialogDescription",B1=p.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=wr(U1,r);return u.jsx(X.p,{id:s.descriptionId,...n,ref:t})});B1.displayName=U1;var z1="DialogClose",W1=p.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=wr(z1,r);return u.jsx(X.button,{type:"button",...n,ref:t,onClick:q(e.onClick,()=>s.onOpenChange(!1))})});W1.displayName=z1;function am(e){return e?"open":"closed"}var H1="DialogTitleWarning",[i4,V1]=FL(H1,{contentName:Ts,titleName:im,docsSlug:"dialog"}),u$=({titleId:e})=>{const t=V1(H1),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 335 336If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 337 338For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},d$="DialogDescriptionWarning",f$=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${V1(d$).contentName}}.`;return p.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},h$=j1,p$=O1,m$=D1,q1=L1,K1=$1,G1=F1,Y1=B1,g$=W1;const Du=h$,J1=p$,v$=m$,Q1=p.forwardRef(({className:e,...t},r)=>u.jsx(q1,{ref:r,className:ie("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));Q1.displayName=q1.displayName;const Fa=p.forwardRef(({className:e,children:t,...r},n)=>u.jsxs(v$,{children:[u.jsx(Q1,{}),u.jsxs(K1,{ref:n,className:ie("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,u.jsxs(g$,{className:"absolute right-4 top-4 roun
338ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[u.jsx(ou,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Fa.displayName=K1.displayName;const Ua=({className:e,...t})=>u.jsx("div",{className:ie("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Ua.displayName="DialogHeader";const xh=({className:e,...t})=>u.jsx("div",{className:ie("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});xh.displayName="DialogFooter";const Ba=p.forwardRef(({className:e,...t},r)=>u.jsx(G1,{ref:r,className:ie("text-lg font-semibold leading-none tracking-tight",e),...t}));Ba.displayName=G1.displayName;const X1=p.forwardRef(({className:e,...t},r)=>u.jsx(Y1,{ref:r,className:ie("text-sm text-muted-foreground",e),...t}));X1.displayName=Y1.displayName;const y$="wss://ws-api.runware.ai/v1";class w${constructor(t){Xn(this,"ws",null);Xn(this,"apiKey",null);Xn(this,"connectionSessionUUID",null);Xn(this,"messageCallbacks",new Map);Xn(this,"isAuthenticated",!1);Xn(this,"connectionPromise",null);this.apiKey=t,this.connectionPromise=this.connect()}connect(){return new Promise((t,r)=>{this.ws=new WebSocket(y$),this.ws.onopen=()=>{console.log("WebSocket connected"),this.authenticate().then(t).catch(r)},this.ws.onmessage=n=>{var o,i;console.log("WebSocket message received:",n.data);const s=JSON.parse(n.data);if(s.error||s.errors){console.error("WebSocket error response:",s);const a=s.errorMessage||((i=(o=s.errors)==null?void 0:o[0])==null?void 0:i.message)||"An error occurred";xe.error(a);return}s.data&&s.data.forEach(a=>{if(a.taskType==="authentication")console.log("Authentication successful, session UUID:",a.connectionSessionUUID),this.connectionSessionUUID=a.connectionSessionUUID,this.isAuthenticated=!0;else{const l=this.messageCallbacks.get(a.taskUUID);l&&(l(a),this.messageCallbacks.delete(a.taskUUID))}})},this.ws.onerror=n=>{console.error("WebSocket error:",n),xe.error("Connection error. Please try again."),r(n)},this.ws.onclose=()=>{console.log("WebSocket closed, attempting to reconnect..."),this.isAuthenticated=!1,setTimeout(()=>{this.connectionPromise=this.connect()},1e3)}})}authenticate(){return new Promise((t,r)=>{if(!this.ws||this.ws.readyState!==WebSocket.OPEN){r(new Error("WebSocket not ready for authentication"));return}const n=[{taskType:"authentication",apiKey:this.apiKey,...this.connectionSessionUUID&&{connectionSessionUUID:this.connectionSessionUUID}}];console.log("Sending authentication message");const s=o=>{var a,l,c;((l=(a=JSON.parse(o.data).data)==null?void 0:a[0])==null?void 0:l.taskType)==="authentication"&&((c=this.ws)==null||c.removeEventListener("message",s),t())};this.ws.addEventListener("message",s),this.ws.send(JSON.stringify(n))})}async generateImage(t){await this.connectionPromise,(!this.ws||this.ws.readyState!==WebSocket.OPEN||!this.isAuthenticated)&&(this.connectionPromise=this.connect(),await this.connectionPromise);const r=crypto.randomUUID();return new Promise((n,s)=>{var i;const o=[{taskType:"imageInference",taskUUID:r,model:t.model||"runware:100@1",width:512,height:512,numberResults:t.numberResults||1,outputFormat:t.outputFormat||"GIF",steps:4,CFGScale:t.CFGScale||1,scheduler:t.scheduler||"FlowMatchEulerDiscreteScheduler",strength:t.strength||.8,lora:t.lora||[],...t}];t.seed||delete o[0].seed,o[0].model==="runware:100@1"&&delete o[0].promptWeighting,console.log("Sending image generation message:",o),this.messageCallbacks.set(r,a=>{a.error?s(new Error(a.errorMessage)):n(a)}),(i=this.ws)==null||i.send(JSON.stringify(o))})}}function x$({exercise:e,isOpen:t,onClose:r,onGifGenerated:n}){const[s,o]=p.useState(""),[i,a]=p.useState(!1),[l,c]=p.useState(!1);if(!e)return null;const d=async()=>{if(!s.trim()){c(!0);return}a(!0);try{const f=new w$(s),h=`Professional fitness demonstration GIF showing proper form for ${e.name} exercise, ${e.muscle} muscle group, clear side view, proper technique, gym setting, athletic person demonstrating`,v=await f.generateImage({positivePrompt:h,outputFormat:"GIF",width:512,height:512});n(e.id,v.imageURL),xe.success("Exercise GIF generated successfully!")}catch(f){console.error("Error generating GIF:",f),xe.error("Failed to generate GIF. Please check your API key.")}finally{a(!1)}};return u.jsx(Du,{open:t,onOpenChange:r,children:u.jsxs(Fa,{className:"max-w-2xl",children:[u.jsx(Ua,{children:u.jsxs(Ba,{className:"flex items-center gap-2",children:[u.jsx(oa,{className:"h-5 w-5"}),e.name]})}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"bg-muted rounded-lg p-4",children:[u.jsxs("h3",{className:"font-semibold text-lg mb-2",children:["Target Muscle: ",e.muscle]}),u.jsx("p",{className:"text-muted-foreground mb-3",children:e.description}),u.jsxs("div",{className:"grid grid-cols-3 gap-4 text-sm",children:[u.jsxs("div",{children:[u.jsx("span",{className:"font-medium",children:"Sets:"})," ",e.sets]}),u.jsxs("div",{children:[u.jsx("span",{className:"font-medium",children:"Reps:"})," ",e.reps]}),u.jsxs("div",{children:[u.jsx("span",{className:"font-medium",children:"Rest:"})," ",e.restTime,"s"]})]})]}),e.gifUrl?u.jsx("div",{className:"flex justify-center",children:u.jsx("img",{src:e.gifUrl,alt:`${e.name} demonstration`,className:"rounded-lg border max-w-full h-auto"})}):u.jsx("div",{className:"space-y-4",children:u.jsxs("div",{className:"bg-secondary/50 rounded-lg p-6 text-center",children:[u.jsx(oa,{className:"h-12 w-12 mx-auto mb-2 text-muted-foreground"}),u.jsx("p",{className:"text-muted-foreground mb-4",children:"No demonstration GIF available"}),l&&u.jsxs("div",{className:"space-y-2 mb-4",children:[u.jsx(De,{type:"password",placeholder:"Enter your Runware API key",value:s,onChange:f=>o(f.target.value)}),u.jsxs("p",{className:"text-xs text-muted-foreground",children:["Get your API key from ",u.jsx("a",{href:"https://runware.ai/",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"runware.ai"})]})]}),u.jsx(re,{onClick:d,disabled:i,className:"w-full sm:w-auto",children:i?u.jsxs(u.Fragment,{children:[u.jsx(GT,{className:"h-4 w-4 mr-2 animate-spin"}),"Generating..."]}):"Generate Exercise GIF"})]})})]})]})})}function b$({workoutHistory:e,onDateClick:t}){const[r,n]=p.useState(new Date),s=new Date,o=r.getFullYear(),i=r.getMonth(),a=new Date(o,i,1),l=new Date(o,i+1,0),c=a.getDay(),d=l.getDate(),f=Array.from({length:d},(y,x)=>x+1),h=Array.from({length:c},(y,x)=>null),v=["January","February","March","April","May","June","July","August","September","October","November","December"],w=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],m=y=>{const x=new Date(o,i,y).toDateString(),S=e.find(C=>C.date===x&&C.completed);if(!S)return null;const E=S.exercises.map(C=>C.muscle.toLowerCase());return E.includes("chest")?{name:"Chest",color:"bg-red-500"}:E.includes("back")?{name:"Back",color:"bg-blue-500"}:E.includes("shoulders")?{name:"Shoulders",color:"bg-yellow-500"}:E.includes("biceps")?{name:"Biceps",color:"bg-green-500"}:E.includes("triceps")?{name:"Triceps",color:"bg-purple-500"}:E.includes("quads")||E.includes("hamstrings")?{name:"Legs",color:"bg-orange-500"}:{name:"Mixed",color:"bg-gray-500"}},b=y=>{n(x=>{const S=new Date(x);return y==="prev"?S.setMonth(x.getMonth()-1):S.setMonth(x.getMonth()+1),S})},g=y=>s.getDate()===y&&s.getMonth()===i&&s.getFullYear()===o;return u.jsxs(Pe,{children:[u.jsx(Dt,{children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs(Lt,{className:"flex items-center gap-2",children:[u.jsx(Df,{className:"h-5 w-5"}),"Workout Calendar"]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(re,{variant:"outline",size:"sm",onClick:()=>b("prev"),children:u.jsx(Lf,{className:"h-4 w-4"})}),u.jsxs("span",{className:"min-w-[140px] text-center font-medium",children:[v[i]," ",o]}),u.jsx(re,{variant:"outline",size:"sm",onClick:()=>b("next"),children:u.jsx($f,{className:"h-4 w-4"})})]})]})}),u.jsx(Oe,{children:u.jsxs("div",{className:"space-y-4",children:[u.jsx("div",{className:"grid grid-cols-7 gap-1",children:w.map(y=>u.jsx("div",{className:"p-2 text-center text-sm font-medium text-muted-foreground",children:y},y))}),u.jsxs("div",{className:"grid grid-cols-7 gap-1",children:[h.map((y,x)=>u.jsx("div",{className:"p-2 h-12"},`padding-${x}`)),f.map(y=>{const x=m(y),S=g(y),E=new Date(o,i,y).toDateString(),C=e.find(_=>_.date===E&&_.completed);return u.jsxs("div",{className:` 339 p-2 h-12 flex flex-col items-center justify-center text-sm relative 340 rounded-md transition-colors 341 ${S?"bg-primary text-primary-foreground font-semibold":"hover:bg-muted"} 342 ${C?"cursor-pointer":""} 343 `,onClick:()=>C&&(t==null?void 0:t(C)),children:[u.jsx("span",{className:x&&!S?"text-white font-medium":"",children:y}),x&&u.jsxs("div",{className:` 344 absolute inset-0 rounded-md opacity-80 flex items-center justify-center 345 ${x.color} 346 `,children:[u.jsx("span",{className:"text-white text-xs font-medium",children:y}),u.jsx("div",{className:"absolute bottom-0.5 left-1/2 transform -translate-x-1/2",children:u.jsx("div",{className:"w-1 h-1 bg-white rounded-full"})})]})]},y)})]}),u.jsxs("div",{className:"flex flex-wrap gap-2 pt-4 border-t",children:[u.jsx("div",{className:"text-sm text-muted-foreground mb-2 w-full",children:"Muscle Groups:"}),[{name:"Chest",color:"bg-red-500"},{name:"Back",color:"bg-blue-500"},{name:"Shoulders",color:"bg-yellow-500"},{name:"Biceps",color:"bg-green-500"},{name:"Triceps",color:"bg-purple-500"},{name:"Legs",color:"bg-orange-500"}].map(y=>u.jsxs(Et,{variant:"outline",className:"text-xs",children:[u.jsx("div",{className:`w-2 h-2 rounded-full ${y.c
346olor} mr-1`}),y.name]},y.name))]})]})})]})}function S$(e,t){return p.useReducer((r,n)=>t[r][n]??r,e)}var lm="ScrollArea",[Z1,a4]=vr(lm),[E$,Xt]=Z1(lm),eE=p.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:s,scrollHideDelay:o=600,...i}=e,[a,l]=p.useState(null),[c,d]=p.useState(null),[f,h]=p.useState(null),[v,w]=p.useState(null),[m,b]=p.useState(null),[g,y]=p.useState(0),[x,S]=p.useState(0),[E,C]=p.useState(!1),[_,k]=p.useState(!1),N=le(t,R=>l(R)),j=Su(s);return u.jsx(E$,{scope:r,type:n,dir:j,scrollHideDelay:o,scrollArea:a,viewport:c,onViewportChange:d,content:f,onContentChange:h,scrollbarX:v,onScrollbarXChange:w,scrollbarXEnabled:E,onScrollbarXEnabledChange:C,scrollbarY:m,onScrollbarYChange:b,scrollbarYEnabled:_,onScrollbarYEnabledChange:k,onCornerWidthChange:y,onCornerHeightChange:S,children:u.jsx(X.div,{dir:j,...i,ref:N,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})})});eE.displayName=lm;var tE="ScrollAreaViewport",rE=p.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:s,...o}=e,i=Xt(tE,r),a=p.useRef(null),l=le(t,a,i.onViewportChange);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),u.jsx(X.div,{"data-radix-scroll-area-viewport":"",...o,ref:l,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:u.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});rE.displayName=tE;var Lr="ScrollAreaScrollbar",cm=p.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=Xt(Lr,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:i}=s,a=e.orientation==="horizontal";return p.useEffect(()=>(a?o(!0):i(!0),()=>{a?o(!1):i(!1)}),[a,o,i]),s.type==="hover"?u.jsx(_$,{...n,ref:t,forceMount:r}):s.type==="scroll"?u.jsx(C$,{...n,ref:t,forceMount:r}):s.type==="auto"?u.jsx(nE,{...n,ref:t,forceMount:r}):s.type==="always"?u.jsx(um,{...n,ref:t}):null});cm.displayName=Lr;var _$=p.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=Xt(Lr,e.__scopeScrollArea),[o,i]=p.useState(!1);return p.useEffect(()=>{const a=s.scrollArea;let l=0;if(a){const c=()=>{window.clearTimeout(l),i(!0)},d=()=>{l=window.setTimeout(()=>i(!1),s.scrollHideDelay)};return a.addEventListener("pointerenter",c),a.addEventListener("pointerleave",d),()=>{window.clearTimeout(l),a.removeEventListener("pointerenter",c),a.removeEventListener("pointerleave",d)}}},[s.scrollArea,s.scrollHideDelay]),u.jsx(yr,{present:r||o,children:u.jsx(nE,{"data-state":o?"visible":"hidden",...n,ref:t})})}),C$=p.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=Xt(Lr,e.__scopeScrollArea),o=e.orientation==="horizontal",i=$u(()=>l("SCROLL_END"),100),[a,l]=S$("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return p.useEffect(()=>{if(a==="idle"){const c=window.setTimeout(()=>l("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(c)}},[a,s.scrollHideDelay,l]),p.useEffect(()=>{const c=s.viewport,d=o?"scrollLeft":"scrollTop";if(c){let f=c[d];const h=()=>{const v=c[d];f!==v&&(l("SCROLL"),i()),f=v};return c.addEventListener("scroll",h),()=>c.removeEventListener("scroll",h)}},[s.viewport,o,l,i]),u.jsx(yr,{present:r||a!=="hidden",children:u.jsx(um,{"data-state":a==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:q(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:q(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),nE=p.forwardRef((e,t)=>{const r=Xt(Lr,e.__scopeScrollArea),{forceMount:n,...s}=e,[o,i]=p.useState(!1),a=e.orientation==="horizontal",l=$u(()=>{if(r.viewport){const c=r.viewport.offsetWidth<r.viewport.scrollWidth,d=r.viewport.offsetHeight<r.viewport.scrollHeight;i(a?c:d)}},10);return Vo(r.viewport,l),Vo(r.content,l),u.jsx(yr,{present:n||o,children:u.jsx(um,{"data-state":o?"visible":"hidden",...s,ref:t})})}),um=p.forwardRef((e,t)=>
vendor: 4,360 bytes, line 346
346{const{orientation:r="vertical",...n}=e,s=Xt(Lr,e.__scopeScrollArea),o=p.useRef(null),i=p.useRef(0),[a,l]=p.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=lE(a.viewport,a.content),d={...n,sizes:a,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:h=>o.current=h,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:h=>i.current=h};function f(h,v){return j$(h,i.current,a,v)}return r==="horizontal"?u.jsx(k$,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const h=s.viewport.scrollLeft,v=fy(h,a,s.dir);o.current.style.transform=`translate3d(${v}px, 0, 0)`}},onWheelScroll:h=>{s.viewport&&(s.viewport.scrollLeft=h)},onDragScroll:h=>{s.viewport&&(s.viewport.scrollLeft=f(h,s.dir))}}):r==="vertical"?u.jsx(T$,{...d,ref:t,onThumbPositionChange:()=>{if(s.viewport&&o.current){const h=s.viewport.scrollTop,v=fy(h,a);o.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:h=>{s.viewport&&(s.viewport.scrollTop=h)},onDragScroll:h=>{s.viewport&&(s.viewport.scrollTop=f(h))}}):null}),k$=p.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,o=Xt(Lr,e.__scopeScrollArea),[i,a]=p.useState(),l=p.useRef(null),c=le(t,l,o.onScrollbarXChange);return p.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),u.jsx(oE,{"data-orientation":"horizontal",...s,ref:c,sizes:r,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Lu(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(o.viewport){const h=o.viewport.scrollLeft+d.deltaX;e.onWheelScroll(h),uE(h,f)&&d.preventDefault()}},onResize:()=>{l.current&&o.viewport&&i&&n({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:Dc(i.paddingLeft),paddingEnd:Dc(i.paddingRight)}})}})}),T$=p.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...s}=e,o=Xt(Lr,e.__scopeScrollArea),[i,a]=p.useState(),l=p.useRef(null),c=le(t,l,o.onScrollbarYChange);return p.useEffect(()=>{l.current&&a(getComputedStyle(l.current))},[l]),u.jsx(oE,{"data-orientation":"vertical",...s,ref:c,sizes:r,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Lu(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(o.viewport){const h=o.viewport.scrollTop+d.deltaY;e.onWheelScroll(h),uE(h,f)&&d.preventDefault()}},onResize:()=>{l.current&&o.viewport&&i&&n({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:Dc(i.paddingTop),paddingEnd:Dc(i.paddingBottom)}})}})}),[N$,sE]=Z1(Lr),oE=p.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:s,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:d,onResize:f,...h}=e,v=Xt(Lr,r),[w,m]=p.useState(null),b=le(t,N=>m(N)),g=p.useRef(null),y=p.useRef(""),x=v.viewport,S=n.content-n.viewport,E=ke(d),C=ke(l),_=$u(f,10);function k(N){if(g.current){const j=N.clientX-g.current.left,R=N.clientY-g.current.top;c({x:j,y:R})}}return p.useEffect(()=>{const N=j=>{const R=j.target;(w==null?void 0:w.contains(R))&&E(j,S)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[x,w,S,E]),p.useEffect(C,[n,C]),Vo(w,_),Vo(v.content,_),u.jsx(N$,{scope:r,scrollbar:w,hasThumb:s,onThumbChange:ke(o),onThumbPointerUp:ke(i),onThumbPositionChange:C,onThumbPointerDown:ke(a),children:u.jsx(X.div,{...h,ref:b,style:{position:"absolute",...h.style},onPointerDown:q(e.onPointerDown,N=>{N.button===0&&(N.target.setPointerCapture(N.pointerId),g.current=w.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),k(N))}),onPointerMove:q(e.onPointerMove,k),onPointerUp:q(e.onPointerUp,N=>{const j=N.target;j.hasPointerCapture(N.pointerId)&&j.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=y.current,v.viewport&&(v.viewport.style.scrollBehavior=""),g.current=null})})})}),Ic="ScrollAreaThumb",iE=p.forwardRef((e,t)=>
vendor: 4,879 bytes, line 346
346{const{forceMount:r,...n}=e,s=sE(Ic,e.__scopeScrollArea);return u.jsx(yr,{present:r||s.hasThumb,children:u.jsx(P$,{ref:t,...n})})}),P$=p.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...s}=e,o=Xt(Ic,r),i=sE(Ic,r),{onThumbPositionChange:a}=i,l=le(t,f=>i.onThumbChange(f)),c=p.useRef(),d=$u(()=>{c.current&&(c.current(),c.current=void 0)},100);return p.useEffect(()=>{const f=o.viewport;if(f){const h=()=>{if(d(),!c.current){const v=A$(f,a);c.current=v,a()}};return a(),f.addEventListener("scroll",h),()=>f.removeEventListener("scroll",h)}},[o.viewport,d,a]),u.jsx(X.div,{"data-state":i.hasThumb?"visible":"hidden",...s,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:q(e.onPointerDownCapture,f=>{const v=f.target.getBoundingClientRect(),w=f.clientX-v.left,m=f.clientY-v.top;i.onThumbPointerDown({x:w,y:m})}),onPointerUp:q(e.onPointerUp,i.onThumbPointerUp)})});iE.displayName=Ic;var dm="ScrollAreaCorner",aE=p.forwardRef((e,t)=>{const r=Xt(dm,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?u.jsx(R$,{...e,ref:t}):null});aE.displayName=dm;var R$=p.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,s=Xt(dm,r),[o,i]=p.useState(0),[a,l]=p.useState(0),c=!!(o&&a);return Vo(s.scrollbarX,()=>{var f;const d=((f=s.scrollbarX)==null?void 0:f.offsetHeight)||0;s.onCornerHeightChange(d),l(d)}),Vo(s.scrollbarY,()=>{var f;const d=((f=s.scrollbarY)==null?void 0:f.offsetWidth)||0;s.onCornerWidthChange(d),i(d)}),c?u.jsx(X.div,{...n,ref:t,style:{width:o,height:a,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Dc(e){return e?parseInt(e,10):0}function lE(e,t){const r=e/t;return isNaN(r)?0:r}function Lu(e){const t=lE(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function j$(e,t,r,n="ltr"){const s=Lu(r),o=s/2,i=t||o,a=s-i,l=r.scrollbar.paddingStart+i,c=r.scrollbar.size-r.scrollbar.paddingEnd-a,d=r.content-r.viewport,f=n==="ltr"?[0,d]:[d*-1,0];return cE([l,c],f)(e)}function fy(e,t,r="ltr"){const n=Lu(t),s=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-s,i=t.content-t.viewport,a=o-n,l=r==="ltr"?[0,i]:[i*-1,0],c=ch(e,l);return cE([0,i],[0,a])(c)}function cE(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function uE(e,t){return e>0&&e<t}var A$=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function s(){const o={left:e.scrollLeft,top:e.scrollTop},i=r.left!==o.left,a=r.top!==o.top;(i||a)&&t(),r=o,n=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(n)};function $u(e,t){const r=ke(e),n=p.useRef(0);return p.useEffect(()=>()=>window.clearTimeout(n.current),[]),p.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function Vo(e,t){const r=ke(t);$e(()=>{let n=0;if(e){const s=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return s.observe(e),()=>{window.cancelAnimationFrame(n),s.unobserve(e)}}},[e,r])}var dE=eE,O$=rE,I$=aE;const bh=p.forwardRef(({className:e,children:t,...r},n)=>u.jsxs(dE,{ref:n,className:ie("relative overflow-hidden",e),...r,children:[u.jsx(O$,{className:"h-full w-full rounded-[inherit]",children:t}),u.jsx(fE,{}),u.jsx(I$,{})]}));bh.displayName=dE.displayName;const fE=p.forwardRef(({className:e,orientation:t="vertical",...r},n)=>u.jsx(cm,{ref:n,orientation:t,className:ie("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...r,children:u.jsx(iE,{className:"relative flex-1 rounded-full bg-border"})}));fE.displayName=cm.displayName;const D$=["Chest","Back","Shoulders","Biceps","Triceps","Legs","Core","Forearms","Glutes","Calves"],L$=({open:e,onOpenChange:t,onExerciseAdded:r})=>{const[n,s]=p.useState("existing"),[o,i]=p.useState([]),[a,l]=p.useState(""),[c,d]=p.useState(!1),[f,h]=p.useState(""),[v,w]=p.useState(""),[m,b]=p.useState("3"),[g,y]=p.useState("10"),[x,S]=p.useState("60"),[E,C]=p.useState("");p.useEffect(()=>{e&&n==="existing"&&_()},[e,n]);const _=async()=>{d(!0);try{const{data:R,error:T}=await Xe.from("exercises").select("id, name, muscle, description, gif_url, equipment, level").order("name").limit(1e3);if(T)throw T;i(R||[])}catch(R){console.error("Error fetching exercises:",R),xe.error("Failed to load exercises")}finally{d(!1)}},k=()=>{const R=o.find(A=>A.id===a);if(!R){xe.error("Please select an exercise");return}const T={id:crypto.randomUUID(),name:R.name,muscle:R.muscle,sets:parseInt(m),reps:g,restTime:parseInt(x),description:R.description||"",gifUrl:R.gif_url};r(T),j(),t(!1),xe.success("Exercise added to workout!")}
346,N=async()=>{if(!f||!v){xe.error("Please fill in all required fields");return}d(!0);try{const{data:{user:R}}=await Xe.auth.getUser();if(!R){xe.error("You must be signed in to create an exercise"),d(!1);return}const{data:T,error:A}=await Xe.from("exercises").insert({name:f,muscle:v,description:E,created_by:R.id}).select().single();if(A)throw A;const L={id:crypto.randomUUID(),name:f,muscle:v,sets:parseInt(m),reps:g,restTime:parseInt(x),description:E};r(L),j(),t(!1),xe.success("New exercise created and added!")}catch(R){console.error("Error creating exercise:",R),xe.error("Failed to create exercise")}finally{d(!1)}},j=()=>{s("existing"),l(""),h(""),w(""),b("3"),y("10"),S("60"),C("")};return u.jsx(Du,{open:e,onOpenChange:t,children:u.jsxs(Fa,{className:"max-w-2xl max-h-[90vh]",children:[u.jsxs(Ua,{children:[u.jsx(Ba,{children:"Add Exercise to Workout"}),u.jsx(X1,{children:"Select an existing exercise or create a new one"})]}),u.jsxs(Vp,{value:n,onValueChange:R=>s(R),children:[u.jsxs(_u,{className:"grid w-full grid-cols-2",children:[u.jsx(In,{value:"existing",children:"Select Existing"}),u.jsx(In,{value:"new",children:"Create New"})]}),u.jsxs(Dn,{value:"existing",className:"space-y-4",children:[u.jsx(bh,{className:"h-[300px] pr-4",children:u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{children:[u.jsx(Se,{children:"Select Exercise"}),u.jsxs(Wo,{value:a,onValueChange:l,children:[u.jsx(_s,{children:u.jsx(Ho,{placeholder:"Choose an exercise..."})}),u.jsx(Cs,{children:o.map(R=>u.jsxs(Yr,{value:R.id,children:[R.name," (",R.muscle,")"]},R.id))})]})]}),u.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[u.jsxs("div",{children:[u.jsx(Se,{htmlFor:"sets-existing",children:"Sets"}),u.jsx(De,{id:"sets-existing",type:"number",min:"1",value:m,onChange:R=>b(R.target.value)})]}),u.jsxs("div",{children:[u.jsx(Se,{htmlFor:"reps-existing",children:"Reps"}),u.jsx(De,{id:"reps-existing",value:g,onChange:R=>y(R.target.value),placeholder:"e.g. 10 or 8-12"})]}),u.jsxs("div",{children:[u.jsx(Se,{htmlFor:"rest-existing",children:"Rest (sec)"}),u.jsx(De,{id:"rest-existing",type:"number",min:"0",value:x,onChange:R=>S(R.target.value)})]})]})]})}),u.jsxs(xh,{children:[u.jsx(re,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),u.jsx(re,{onClick:k,disabled:!a||c,children:"Add Exercise"})]})]}),u.jsxs(Dn,{value:"new",className:"space-y-4",children:[u.jsx(bh,{className:"h-[300px] pr-4",children:u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{children:[u.jsx(Se,{htmlFor:"muscle-group",children:"Body Part *"}),u.jsxs(Wo,{value:v,onValueChange:w,children:[u.jsx(_s,{children:u.jsx(Ho,{placeholder:"Select muscle group..."})}),u.jsx(Cs,{children:D$.map(R=>u.jsx(Yr,{value:R,children:R},R))})]})]}),u.jsxs("div",{children:[u.jsx(Se,{htmlFor:"exercise-name",children:"Exercise Name *"}),u.jsx(De,{id:"exercise-name",value:f,onChange:R=>h(R.target.value),placeholder:"e.g. Barbell Bench Press"})]}),u.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[u.jsxs("div",{children:[u.jsx(Se,{htmlFor:"sets-new",children:"Sets"}),u.jsx(De,{id:"sets-new",type:"number",min:"1",value:m,onChange:R=>b(R.target.value)})]}),u.jsxs("div",{children:[u.jsx(Se,{htmlFor:"reps-new",children:"Reps"}),u.jsx(De,{id:"reps-new",value:g,onChange:R=>y(R.target.value),placeholder:"e.g. 10 or 8-12"})]}),u.jsxs("div",{children:[u.jsx(Se,{htmlFor:"rest-new",children:"Rest (sec)"}),u.jsx(De,{id:"rest-new",type:"number",min:"0",value:x,onChange:R=>S(R.target.value)})]})]}),u.jsxs("div",{children:[u.jsx(Se,{htmlFor:"description",children:"Description (optional)"}),u.jsx(De,{id:"description",value:E,onChange:R=>C(R.target.value),placeholder:"Any notes or instructions..."})]})]})}),u.jsxs(xh,{children:[u.jsx(re,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),u.jsx(re,{onClick:N,disabled:!f||!v||c,children:"Create & Add"})]})]})]})]})})},Te=e=>`https://raw.githubusercontent.com/yuhonas/free-exercise-db/main/exercises/${e}/0.jpg`,$$={level:"beginner",days:[{day:1,name:"Chest & Biceps & Traps",exercises:[{id:"bench-press",name:"Bench Press",muscle:"Chest",sets:4,reps:"8-12",restTime:90,description:"Lie on bench, grip bar wider than shoulders, lower to chest, press up explosively",gifUrl:Te("Dumbbell_Bench_Press")},{id:"incline-dumbbell-press",name:"Incline Dumbbell Press",muscle:"Chest",sets:3,reps:"10-12",restTime:60,description:"Set bench to 30-45° incline, press dumbbells from chest level to full extension",gifUrl:Te("Incline_Dumbbell_Press")},{id:"chest-fly",name:"Chest Fly",muscle:"Chest",sets:3,reps:"12-15",restTime:60,description:"Lie flat, arms wide with slight bend, bring dumbbells together over chest",gifUrl:Te("Dumbbell_Flyes")},{id:"push-ups",name:"Push-ups",muscle:"Chest",sets:3,reps:"To failure",restTime:45,description:"Start in plank, lower chest to ground, push back up maintaining straight line",gifUrl:Te("Pushups")},{id:"barbell-curl",name:"Barbell Curl",muscle:"Biceps",sets:3,reps:"10-12",restTime:60,description:"Stand tall, curl bar up by contracting biceps, slowly lower with control",gifUrl:Te("Barbell_Curl")},{id:"hammer-curl",name:"Hammer Curl",muscle:"Biceps",sets:3,reps:"12-15",restTime:45,description:"Hold dumbbells with neutral grip, curl up keeping wrists straight",gifUrl:Te("Alternate_Hammer_Curl")},{id:"concentration-curl",name:"Concentration Curl",muscle:"Biceps",sets:2,reps:"12-15",restTime:45,description:"Sit, brace elbow on inner thigh, curl dumbbell with full range of motion",gifUrl:Te("Concentration_Curls")},{id:"dumbbell-shrugs",name:"Dumbbell Shrugs",muscle:"Traps",sets:3,reps:"15-20",restTime:45,description:"Hold dumbbells at sides, shrug shoulders straight up, squeeze at top",gifUrl:Te("Dumbbell_Shrug")}]},{day:2,name:"Shoulders & Triceps & Abs",exercises:[{id:"overhead-press",name:"Overhead Press",muscle:"Shoulders",sets:4,reps:"8-10",restTime:90,description:"Press bar or dumbbells from shoulder level to overhead, keep core tight",gifUrl:Te("Standing_Military_Press")}
vendor: 18,541 bytes, lines 346-353
346,{id:"lateral-raise",name:"Lateral Raise",muscle:"Shoulders",sets:3,reps:"12-15",restTime:60,description:"Raise dumbbells out to sides until parallel with ground, control the descent",gifUrl:Te("Side_Lateral_Raise")},{id:"front-raise",name:"Front Raise",muscle:"Shoulders",sets:3,reps:"12-15",restTime:60,description:"Raise dumbbell forward to shoulder height, keep slight bend in elbow",gifUrl:Te("Front_Dumbbell_Raise")},{id:"reverse-fly",name:"Reverse Fly",muscle:"Shoulders",sets:3,reps:"15-20",restTime:45,description:"Bend forward, pull dumbbells back squeezing shoulder blades together",gifUrl:Te("Reverse_Flyes")},{id:"skull-crusher",name:"Skull Crusher",muscle:"Triceps",sets:3,reps:"10-12",restTime:60,description:"Lie flat, lower bar to forehead by bending elbows, extend back up",gifUrl:Te("EZ-Bar_Skullcrusher")},{id:"tricep-pushdown",name:"Tricep Pushdown",muscle:"Triceps",sets:3,reps:"12-15",restTime:45,description:"Push cable down extending elbows fully, slowly return with control",gifUrl:Te("Triceps_Pushdown")},{id:"overhead-extension",name:"Overhead Extension",muscle:"Triceps",sets:2,reps:"12-15",restTime:45,description:"Hold dumbbell overhead, lower behind head, extend back up",gifUrl:Te("Standing_Dumbbell_Triceps_Extension")},{id:"plank",name:"Plank",muscle:"Abs",sets:3,reps:"60 seconds",restTime:60,description:"Hold straight line from head to heels, engage core throughout",gifUrl:Te("Plank")}]},{day:3,name:"Back & Calves",exercises:[{id:"pull-up",name:"Pull-up",muscle:"Back",sets:4,reps:"6-10",restTime:90,description:"Hang from bar, pull body up until chin over bar, control descent",gifUrl:Te("Pullups")},{id:"barbell-row",name:"Barbell Row",muscle:"Back",sets:4,reps:"8-12",restTime:90,description:"Bend forward, pull bar to lower chest squeezing shoulder blades",gifUrl:Te("Bent_Over_Barbell_Row")},{id:"lat-pulldown",name:"Lat Pulldown",muscle:"Back",sets:3,reps:"10-12",restTime:60,description:"Pull cable down to upper chest, squeeze lats at bottom",gifUrl:Te("Wide-Grip_Lat_Pulldown")},{id:"seated-cable-row",name:"Seated Cable Row",muscle:"Back",sets:3,reps:"12-15",restTime:60,description:"Pull cable to torso, squeeze shoulder blades, control return",gifUrl:Te("Seated_Cable_Rows")},{id:"standing-calf-raise",name:"Standing Calf Raise",muscle:"Calves",sets:4,reps:"15-20",restTime:45,description:"Rise up on toes as high as possible, pause at top, lower slowly",gifUrl:Te("Standing_Calf_Raises")}]},{day:4,name:"Legs & Lower Back",exercises:[{id:"squat",name:"Squat",muscle:"Quads",sets:4,reps:"8-12",restTime:120,description:"Lower hips back and down, keep chest up, drive through heels to stand",gifUrl:Te("Barbell_Squat")},{id:"lunge",name:"Lunge",muscle:"Quads/Glutes",sets:3,reps:"10 each leg",restTime:60,description:"Step forward, lower back knee toward ground, push back to start",gifUrl:Te("Dumbbell_Lunges")},{id:"leg-press",name:"Leg Press",muscle:"Quads",sets:3,reps:"12-15",restTime:90,description:"Press weight with feet, lower with control, push through heels",gifUrl:Te("Leg_Press")},{id:"leg-extension",name:"Leg Extension",muscle:"Quads",sets:3,reps:"15-20",restTime:45,description:"Extend legs from seated position, squeeze quads at top",gifUrl:Te("Leg_Extensions")},{id:"hyperextension",name:"Hyperextension",muscle:"Lower Back",sets:3,reps:"15-20",restTime:45,description:"Lower torso down, raise back up using lower back muscles",gifUrl:Te("Hyperextensions_Back_Extensions")}]}]};var M$="DismissableLayer",Sh="dismissableLayer.update",F$="dismissableLayer.pointerDownOutside",U$="dismissableLayer.focusOutside",hy,hE=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),pE=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:s,onFocusOutside:o,onInteractOutside:i,onDismiss:a,...l}=e,c=p.useContext(hE),[d,f]=p.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=p.useState({}),w=le(t,_=>f(_)),m=Array.from(c.layers),[b]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=m.indexOf(b),y=d?m.indexOf(d):-1,x=c.layersWithOutsidePointerEventsDisabled.size>0,S=y>=g,E=W$(_=>{const k=_.target,N=[...c.branches].some(j=>j.contains(k));!S||N||(s==null||s(_),i==null||i(_),_.defaultPrevented||a==null||a())},h),C=H$(_=>{const k=_.target;[...c.branches].some(j=>j.contains(k))||(o==null||o(_),i==null||i(_),_.defaultPrevented||a==null||a())},h);return eu(_=>{y===c.layers.size-1&&(n==null||n(_),!_.defaultPrevented&&a&&(_.preventDefault(),a()))},h),p.useEffect(()=>{if(d)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(hy=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),py(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=hy)}},[d,h,r,c]),p.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),py())},[d,c]),p.useEffect(()=>{const _=()=>v({});return document.addEventListener(Sh,_),()=>document.removeEventListener(Sh,_)},[]),u.jsx(X.div,{...l,ref:w,style:{pointerEvents:x?S?"auto":"none":void 0,...e.style},onFocusCapture:q(e.onFocusCapture,C.onFocusCapture),onBlurCapture:q(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:q(e.onPointerDownCapture,E.onPointerDownCapture)})});pE.displayName=M$;var B$="DismissableLayerBranch",z$=p.forwardRef((e,t)=>{const r=p.useContext(hE),n=p.useRef(null),s=le(t,n);return p.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),u.jsx(X.div,{...e,ref:s})});z$.displayName=B$;function W$(e,t=globalThis==null?void 0:globalThis.document){const r=ke(e),n=p.useRef(!1),s=p.useRef(()=>{});return p.useEffect(()=>{const o=a=>{if(a.target&&!n.current){let l=function(){mE(F$,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 H$(e,t=globalThis==null?void 0:globalThis.document){const r=ke(e),n=p.useRef(!1);return p.useEffect(()=>{const s=o=>{o.target&&!n.current&&mE(U$,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 py(){const e=new CustomEvent(Sh);document.dispatchEvent(e)}function mE(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?Ra(s,o):s.dispatchEvent(o)}var V$="Portal",gE=p.forwardRef((e,t)=>{var a;const{container:r,...n}=e,[s,o]=p.useState(!1);$e(()=>o(!0),[]);const i=r||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return i?Pa.createPortal(u.jsx(X.div,{...n,ref:t}),i):null});gE.displayName=V$;var Dd=0;function q$(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??my()),document.body.insertAdjacentElement("beforeend",e[1]??my()),Dd++,()=>{Dd===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Dd--}},[])}function my(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var vE=Yp(),Ld=function(){},Mu=p.forwardRef(function(e,t){var r=p.useRef(null),n=p.useState({onScrollCapture:Ld,onWheelCapture:Ld,onTouchMoveCapture:Ld}),s=n[0],o=n[1],i=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,v=e.noIsolation,w=e.inert,m=e.allowPinchZoom,b=e.as,g=b===void 0?"div":b,y=e.gapMode,x=ku(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=h,E=Gp([r,t]),C=Ve(Ve({},x),s);return p.createElement(p.Fragment,null,d&&p.createElement(S,{sideCar:vE,removeScrollBar:c,shards:f,noIsolation:v,inert:w,setCallbacks:o,allowPinchZoom:!!m,lockRef:r,gapMode:y}),i?p.cloneElement(p.Children.only(a),Ve(Ve({},C),{ref:E})):p.createElement(g,Ve({},C,{className:l,ref:E}),a))});Mu.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Mu.classNames={fullWidth:bo,zeroRight:xo};var Eh=!1;if(typeof window<"u")try{var Rl=Object.defineProperty({},"passive",{get:function(){return Eh=!0,!0}});window.addEventListener("test",Rl,Rl),window.removeEventListener("test",Rl,Rl)}catch{Eh=!1}var Vs=Eh?{passive:!1}:!1,K$=function(e){return e.tagName==="TEXTAREA"},yE=function(e,t){var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!K$(e)&&r[t]==="visible")},G$=function(e){return yE(e,"overflowY")},Y$=function(e){return yE(e,"overflowX")},gy=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var s=wE(e,n);if(s){var o=xE(e,n),i=o[1],a=o[2];if(i>a)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},J$=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Q$=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},wE=function(e,t){return e==="v"?G$(t):Y$(t)},xE=function(e,t){return e==="v"?J$(t):Q$(t)},X$=function(e,t){return e==="h"&&t==="rtl"?-1:1},Z$=function(e,t,r,n,s){var o=X$(e,window.getComputedStyle(t).direction),i=o*n,a=r.target,l=t.contains(a),c=!1,d=i>0,f=0,h=0;do{var v=xE(e,a),w=v[0],m=v[1],b=v[2],g=m-b-o*w;(w||g)&&wE(e,a)&&(f+=g,h+=w),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&(Math.abs(f)<1||!s)||!d&&(Math.abs(h)<1||!s))&&(c=!0),c},jl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},vy=function(e){return[e.deltaX,e.deltaY]},yy=function(e){return e&&"current"in e?e.current:e},eM=function(e,t){return e[0]===t[0]&&e[1]===t[1]},tM=function(e){return` 347 .block-interactivity-`.concat(e,` {pointer-events: none;} 348 .allow-interactivity-`).concat(e,` {pointer-events: all;} 349`)},rM=0,qs=[];function nM(e){var t=p.useRef([]),r=p.useRef([0,0]),n=p.useRef(),s=p.useState(rM++)[0],o=p.useState(Nu)[0],i=p.useRef(e);p.useEffect(function(){i.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var m=Kp([e.lockRef.current],(e.shards||[]).map(yy),!0).filter(Boolean);return m.forEach(function(b){return b.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),m.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=p.useCallback(function(m,b){if("touches"in m&&m.touches.length===2)return!i.current.allowPinchZoom;var g=jl(m),y=r.current,x="deltaX"in m?m.deltaX:y[0]-g[0],S="deltaY"in m?m.deltaY:y[1]-g[1],E,C=m.target,_=Math.abs(x)>Math.abs(S)?"h":"v";if("touches"in m&&_==="h"&&C.type==="range")return!1;var k=gy(_,C);if(!k)return!0;if(k?E=_:(E=_==="v"?"h":"v",k=gy(_,C)),!k)return!1;if(!n.current&&"changedTouches"in m&&(x||S)&&(n.current=E),!E)return!0;var N=n.current||E;return Z$(N,b,m,N==="h"?x:S,!0)},[]),l=p.useCallback(function(m){var b=m;if(!(!qs.length||qs[qs.length-1]!==o)){var g="deltaY"in b?vy(b):jl(b),y=t.current.filter(function(E){return E.name===b.type&&(E.target===b.target||b.target===E.shadowParent)&&eM(E.delta,g)})[0];if(y&&y.should){b.cancelable&&b.preventDefault();return}if(!y){var x=(i.current.shards||[]).map(yy).filter(Boolean).filter(function(E){return E.contains(b.target)}),S=x.length>0?a(b,x[0]):!i.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),c=p.useCallback(function(m,b,g,y){var x={name:m,delta:b,target:g,should:y,shadowParent:sM(g)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(S){return S!==x})},1)},[]),d=p.useCallback(function(m){r.current=jl(m),n.current=void 0},[]),f=p.useCallback(function(m){c(m.type,vy(m),m.target,a(m,e.lockRef.current))},[]),h=p.useCallback(function(m){c(m.type,jl(m),m.target,a(m,e.lockRef.current))},[]);p.useEffect(function(){return qs.push(o),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,Vs),document.addEventListener("touchmove",l,Vs),document.addEventListener("touchstart",d,Vs),function(){qs=qs.filter(function(m){return m!==o}),document.removeEventListener("wheel",l,Vs),document.removeEventListener("touchmove",l,Vs),document.removeEventListener("touchstart",d,Vs)}},[]);var v=e.removeScrollBar,w=e.inert;return p.createElement(p.Fragment,null,w?p.createElement(o,{styles:tM(s)}):null,v?p.createElement(Qp,{gapMode:e.gapMode}):null)}function sM(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const oM=Jp(vE,nM);var bE=p.forwardRef(function(e,t){return p.createElement(Mu,Ve({},e,{ref:t,sideCar:oM}))});bE.classNames=Mu.classNames;var fm="Dialog",[SE,EE]=vr(fm),[iM,xr]=SE(fm),_E=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:s,onOpenChange:o,modal:i=!0}=e,a=p.useRef(null),l=p.useRef(null),[c=!1,d]=Fn({prop:n,defaultProp:s,onChange:o});return u.jsx(iM,{scope:t,triggerRef:a,contentRef:l,contentId:fr(),titleId:fr(),descriptionId:fr(),open:c,onOpenChange:d,onOpenToggle:p.useCallback(()=>d(f=>!f),[d]),modal:i,children:r})};_E.displayName=fm;var CE="DialogTrigger",kE=p.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=xr(CE,r),o=le(t,s.triggerRef);return u.jsx(X.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":mm(s.open),...n,ref:o,onClick:q(e.onClick,s.onOpenToggle)})});kE.displayName=CE;var hm="DialogPortal",[aM,TE]=SE(hm,{forceMount:void 0}),NE=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:s}=e,o=xr(hm,t);return u.jsx(aM,{scope:t,forceMount:r,children:p.Children.map(n,i=>u.jsx(yr,{present:r||o.open,children:u.jsx(gE,{asChild:!0,container:s,children:i})}))})};NE.displayName=hm;var Lc="DialogOverlay",PE=p.forwardRef((e,t)=>{const r=TE(Lc,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=xr(Lc,e.__scopeDialog);return o.modal?u.jsx(yr,{present:n||o.open,children:u.jsx(lM,{...s,ref:t})}):null});PE.displayName=Lc;var lM=p.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=xr(Lc,r);return u.jsx(bE,{as:Mn,allowPinchZoom:!0,shards:[s.contentRef],children:u.jsx(X.div,{"data-state":mm(s.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Ns="DialogContent",RE=p.forwardRef((e,t)=>{const r=TE(Ns,e.__scopeDialog),{forceMount:n=r.forceMount,...s}=e,o=xr(Ns,e.__scopeDialog);return u.jsx(yr,{present:n||o.open,children:o.modal?u.jsx(cM,{...s,ref:t}):u.jsx(uM,{...s,ref:t})})});RE.displayName=Ns;var cM=p.forwardRef((e,t)=>{const r=xr(Ns,e.__scopeDialog),n=p.useRef(null),s=le(t,r.contentRef,n);return p.useEffect(()=>{const o=n.current;if(o)return qp(o)},[]),u.jsx(jE,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:q(e.onCloseAutoFocus,o=>{var i;o.preventDefault(),(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:q(e.onPointerDownOutside,o=>{const i=o.detail.originalEvent,a=i.button===0&&i.ctrlKey===!0;(i.button===2||a)&&o.preventDefault()}),onFocusOutside:q(e.onFocusOutside,o=>o.preventDefault())})}),uM=p.forwardRef((e,t)=>{const r=xr(Ns,e.__scopeDialog),n=p.useRef(!1),s=p.useRef(!1);return u.jsx(jE,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var i,a;(i=e.onCloseAutoFocus)==null||i.call(e,o),o.defaultPrevented||(n.current||(a=r.triggerRef.current)==null||a.focus(),o.preventDefault()),n.current=!1,s.current=!1},onInteractOutside:o=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const i=o.target;((c=r.triggerRef.current)==null?void 0:c.contains(i))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})}),jE=p.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:s,onCloseAutoFocus:o,...i}=e,a=xr(Ns,r),l=p.useRef(null),c=le(t,l);return q$(),u.jsxs(u.Fragment,{children:[u.jsx(Cu,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:s,onUnmountAutoFocus:o,children:u.jsx(pE,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":mm(a.open),...i,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(fM,{titleId:a.titleId}),u.jsx(pM,{contentRef:l,descriptionId:a.descriptionId})]})]})}),pm="DialogTitle",AE=p.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=xr(pm,r);return u.jsx(X.h2,{id:s.titleId,...n,ref:t})});AE.displayName=pm;var OE="DialogDescription",IE=p.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=xr(OE,r);return u.jsx(X.p,{id:s.descriptionId,...n,ref:t})});IE.displayName=OE;var DE="DialogClose",LE=p.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,s=xr(DE,r);return u.jsx(X.button,{type:"button",...n,ref:t,onClick:q(e.onClick,()=>s.onOpenChange(!1))})});LE.displayName=DE;function mm(e){return e?"open":"closed"}var $E="DialogTitleWarning",[dM,ME]=nT($E,{contentName:Ns,titleName:pm,docsSlug:"dialog"}),fM=({titleId:e})=>{const t=ME($E),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 350 351If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 352 353For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},hM="DialogDescriptionWarning",pM=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ME(hM).contentName}}.`;return p.useEffect(()=>{var o;const s=(o=e.current)==null?void 0:o.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},mM=_E,gM=kE,vM=NE,yM=PE,wM=RE,xM=AE,bM=IE,FE=LE,UE="AlertDialog",[SM,l4]=vr(UE,[EE]),sn=EE(),BE=e=>{const{__scopeAlertDialog:t,...r}=e,n=sn(t);return u.jsx(mM,{...n,...r,modal:!0})};BE.displayName=UE;var EM="AlertDialogTrigger",zE=p.forwardRef((e,t)=>
353{const{__scopeAlertDialog:r,...n}=e,s=sn(r);return u.jsx(gM,{...s,...n,ref:t})});zE.displayName=EM;var _M="AlertDialogPortal",WE=e=>{const{__scopeAlertDialog:t,...r}=e,n=sn(t);return u.jsx(vM,{...n,...r})};WE.displayName=_M;var CM="AlertDialogOverlay",HE=p.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=sn(r);return u.jsx(yM,{...s,...n,ref:t})});HE.displayName=CM;var Eo="AlertDialogContent",[kM,TM]=SM(Eo),VE=p.forwardRef((e,t)=>{const{__scopeAlertDialog:r,children:n,...s}=e,o=sn(r),i=p.useRef(null),a=le(t,i),l=p.useRef(null);return u.jsx(dM,{contentName:Eo,titleName:qE,docsSlug:"alert-dialog",children:u.jsx(kM,{scope:r,cancelRef:l,children:u.jsxs(wM,{role:"alertdialog",...o,...s,ref:a,onOpenAutoFocus:q(s.onOpenAutoFocus,c=>{var d;c.preventDefault(),(d=l.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[u.jsx(yp,{children:n}),u.jsx(PM,{contentRef:i})]})})})});VE.displayName=Eo;var qE="AlertDialogTitle",KE=p.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=sn(r);return u.jsx(xM,{...s,...n,ref:t})});KE.displayName=qE;var GE="AlertDialogDescription",YE=p.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=sn(r);return u.jsx(bM,{...s,...n,ref:t})});YE.displayName=GE;var NM="AlertDialogAction",JE=p.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,s=sn(r);return u.jsx(FE,{...s,...n,ref:t})});JE.displayName=NM;var QE="AlertDialogCancel",XE=p.forwardRef((e,t)=>{const{__scopeAlertDialog:r,...n}=e,{cancelRef:s}=TM(QE,r),o=sn(r),i=le(t,s);return u.jsx(FE,{...o,...n,ref:i})});XE.displayName=QE;var PM=({contentRef:e})=>{const t=`\`${Eo}\` requires a description for the component to be accessible for screen reader users. 354 355You can add a description to the \`${Eo}\` by passing a \`${GE}\` component as a child, which also benefits sighted users by adding visible context to the dialog. 356 357Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Eo}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. 358 359For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return p.useEffect(()=>{var n;document.getElementById((n=e.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},RM=BE,jM=zE,AM=WE,ZE=HE,e_=VE,t_=JE,r_=XE,n_=KE,s_=YE;const OM=RM,IM=jM,DM=AM,o_=p.forwardRef(({className:e,...t},r)=>u.jsx(ZE,{className:ie("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:r}));o_.displayName=ZE.displayName;const i_=p.forwardRef(({className:e,...t},r)=>u.jsxs(DM,{children:[u.jsx(o_,{}),u.jsx(e_,{ref:r,className:ie("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));i_.displayName=e_.displayName;const a_=({className:e,...t})=>u.jsx("div",{className:ie("flex flex-col space-y-2 text-center sm:text-left",e),...t});a_.displayName="AlertDialogHeader";const l_=({className:e,...t})=>u.jsx("div",{className:ie("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});l_.displayName="AlertDialogFooter";const c_=p.forwardRef(({className:e,...t},r)=>u.jsx(n_,{ref:r,className:ie("text-lg font-semibold",e),...t}));c_.displayName=n_.displayName;const u_=p.forwardRef(({className:e,...t},r)=>u.jsx(s_,{ref:r,className:ie("text-sm text-muted-foreground",e),...t}));u_.displayName=s_.displayName;const d_=p.forwardRef(({className:e,...t},r)=>u.jsx(t_,{ref:r,className:ie(Mp(),e),...t}));d_.displayName=t_.displayName;const f_=p.forwardRef(({className:e,...t},r)=>u.jsx(r_,{ref:r,className:ie(Mp({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));f_.displayName=r_.displayName;const LM=()=>{var ue,_e;const{user:e,loading:t,signOut:r}=La(),[n,s]=$i("workout-stats",{currentLevel:"beginner",streak:0,totalWorkouts:0,currentDay:1}),[o,i]=$i("workout-history",[]),[a,l]=$i("current-workout",null),[c,d]=p.useState(null),[f,h]=p.useState(!1),[v,w]=p.useState(n.currentDay),[m,b]=p.useState(null),[g,y]=p.useState("workout"),[x,S]=p.useState(null),[E,C]=p.useState(0),[_,k]=p.useState(!1),N=$$,j=N.days.find(O=>O.day===v);p.useEffect(()=>{const O=new Date().toDateString(),I=o.find(U=>U.date===O);if(!I&&j){const U={date:O,dayNumber:v,exercises:j.exercises,completedSets:{},completed:!1};l(U)}else I&&l(I)},[v,j,o]),p.useEffect(()=>{if(!a||a.exercises.filter(U=>!U.gifUrl).length===0)return;let I=!1;return(async()=>{const{data:U,error:Z}=await Xe.from("exercises").select("name, gif_url, image_urls").limit(1e3);if(Z||!U||I)return;const ne=te=>te.toLowerCase().replace(/[^a-z0-9\s]/g," ").split(/\s+/).filter(
359Boolean),Q=te=>{const se=ne(te);if(!se.length)return null;let he=null;for(const ye of U){const Ke=ne(ye.name),lt=se.filter(ct=>Ke.includes(ct)).length,ge=lt-Math.abs(Ke.length-se.length)*.1;lt===se.length&&(!he||ge>he.score)?he={row:ye,score:ge}:lt>=Math.ceil(se.length*.75)&&(!he||ge>he.score)&&(he={row:ye,score:ge})}return(he==null?void 0:he.row)??null},M=a.exercises.map(te=>{var ye;if(te.gifUrl)return te;const se=Q(te.name),he=(se==null?void 0:se.gif_url)||((ye=se==null?void 0:se.image_urls)==null?void 0:ye[0]);return he?{...te,gifUrl:he}:te});M.some((te,se)=>te.gifUrl!==a.exercises[se].gifUrl)&&l({...a,exercises:M})})(),()=>{I=!0}},[a==null?void 0:a.date,a==null?void 0:a.exercises.length]);const R=O=>{const I=Math.floor(O/3600),U=Math.floor(O%3600/60),Z=O%60;return I>0?`${I.toString().padStart(2,"0")}:${U.toString().padStart(2,"0")}:${Z.toString().padStart(2,"0")}`:`${U.toString().padStart(2,"0")}:${Z.toString().padStart(2,"0")}`};if(p.useEffect(()=>{if(!a||a.completed||x)return;Object.values(a.completedSets).reduce((I,U)=>I+U,0)>0&&S(Date.now())},[a,x]),p.useEffect(()=>{let O;return x&&a&&!a.completed&&(O=window.setInterval(()=>{C(Math.floor((Date.now()-x)/1e3))},1e3)),()=>{O&&window.clearInterval(O)}},[x,a]),p.useEffect(()=>{a!=null&&a.completed&&(S(null),C(0))},[a==null?void 0:a.completed]),t)return u.jsx("div",{className:"min-h-screen flex items-center justify-center",children:u.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})});if(!e)return u.jsx(vu,{to:"/auth",replace:!0});const T=O=>{if(!a)return;const I=a.exercises.find(Q=>Q.id===O);if(!I)return;const U=a.completedSets[O]||0;if(U>=I.sets)return;const Z={...a,completedSets:{...a.completedSets,[O]:U+1}};if(Z.exercises.every(Q=>(Z.completedSets[Q.id]||0)>=Q.sets)&&!Z.completed){Z.completed=!0;const Q={...n,totalWorkouts:n.totalWorkouts+1,streak:n.streak+1,currentDay:n.currentDay===4?1:n.currentDay+1};s(Q),i(M=>[...M.filter(se=>se.date!==Z.date),Z]),xe.success("Workout completed! Great job! ðª")}l(Z)},A=O=>{if(!a)return;const I=a.completedSets[O]||0;if(I<=0)return;const U={...a,completedSets:{...a.completedSets,[O]:I-1},completed:!1};l(U),xe.info("Set undone")},L=(O,I)=>{if(!a)return;const U=a.exercises.map(Z=>Z.id===O?{...Z,...I}:Z);l({...a,exercises:U}),xe.success("Exercise updated")},W=(O,I)=>{console.log(`Exercise ${O} took ${I} seconds`)},H=O=>{d(O),h(!0)},ee=(O,I)=>{if(!a)return;const U=a.exercises.map(Z=>Z.id===O?{...Z,gifUrl:I}:Z);l({...a,exercises:U}),(c==null?void 0:c.id)===O&&d({...c,gifUrl:I})},P=()=>{if(!j)return;const I={date:new Date().toDateString(),dayNumber:n.currentDay,exercises:j.exercises,completedSets:{},completed:!1};l(I)},$=()=>{if(!a||a.completed)return;const O={...a,completed:!0},I={...n,totalWorkouts:n.totalWorkouts+1,streak:n.streak+1,currentDay:n.currentDay===4?1:n.currentDay+1};s(I),i(U=>[...U.filter(ne=>ne.date!==O.date),O]),l(O),S(null),C(0),xe.success("Workout finished!")},K=O=>{b(O),y("stats")},B=O=>{if(!a){xe.error("Please start a workout first");return}const I={...a,exercises:[...a.exercises,O]};l(I);const U=o.map(Z=>Z.date===I.date?I:Z);U.find(Z=>Z.date===I.date)||U.push(I),i(U)},Y=a?Object.values(a.completedSets).reduce((O,I)=>O+I,0)/a.exercises.reduce((O,I)=>O+I.sets,0)*100:0,ae=n.currentLevel==="intermediate"||n.currentLevel==="professional";return u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsx("div",{className:"border-b bg-card",children:u.jsx("div",{className:"container mx-auto px-4 py-4",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(cr,{className:"h-6 w-6 text-primary"}),u.jsx("h1",{className:"text-2xl font-bold",children:"GymFlow"})]}),u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsxs(Et,{variant:"outline",children:["Day ",n.currentDay,"/4"]}),u.jsxs(Et,{variant:"outline",children:["ð¥ ",n.streak]}),u.jsx(ei,{}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-sm text-muted-foreground",children:((ue=e.user_metadata)==null?void 0:ue.full_name)||e.email}),u.jsxs(re,{variant:"outline",size:"sm",onClick:r,children:[u.jsx(su,{className:"h-4 w-4 mr-2"}),"Sign Out"]})]})]})]})})}),u.jsx("div",{className:"container mx-auto px-4 py-6",children:u.jsxs(Vp,{value:g,onValueChange:y,className:"space-y-6",children:[u.jsxs("div",{className:"flex flex-col lg:flex-row gap-4 items-start lg:items-center justify-between",children:[u.jsxs(_u,{className:"grid w-full lg:w-auto grid-cols-3",children:[u.jsx(In,{value:"workout",children:"Today's Workout"}),u.jsx(In,{value:"calendar",children:"Calendar"}),u.jsx(In,{value:"stats",children:"Stats"})]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsxs(re,{variant:"outline",onClick:()=>window.location.href="/workout-build",size:"sm",children:[u.jsx(Uo,{className:"h-4 w-4 mr-2"}),"Build Workout"]}),u.jsxs(re,{variant:"outline",onClick:()=>window.location.href="/exercises",size:"sm",children:[u.jsx(sN,{className:"h-4 w-4 mr-2"}),"Manage Exercises"]})]})]}),u.jsxs(Dn,{value:"workout",className:"space-y-6",children:[u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[u.jsx(Pe,{children:u.jsxs(Oe,{className:"p-4 flex items-center gap-3",children:[u.jsx(Ig,{className:"h-8 w-8 text-primary"}),u.jsxs("div",{children:[u.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Workouts"}),u.jsx("p",{className:"text-2xl font-bold",children:n.totalWorkouts})]})]})}),u.jsx(Pe,{children:u.jsxs(Oe,{className:"p-4 flex items-center gap-3",children:[u.jsx(Df,{className:"h-8 w-8 text-primary"}),u.jsxs("div",{children:[u.jsx("p",{className:"text-sm text-muted-foreground",children:"Current Streak"}),u.jsxs("p",{className:"text-2xl font-bold",children:[n.streak," days"]})]})]})}),u.jsx(Pe,{children:u.jsxs(Oe,{className:"p-4 flex items-center gap-3",children:[u.jsx(cr,{className:"h-8 w-8 text-primary"}),u.jsxs("div",{children:[u.jsx("p",{className:"text-sm text-muted-foreground",children:"Level"}),u.jsx("p",{className:"text-2xl font-bold capitalize",children:n.currentLevel})]})]})})]}),u.jsxs(Pe,{children:[u.jsx(Dt,{children:u.jsxs(Lt,{className:"flex items-center gap-2",children:[u.jsx(cr,{className:"h-5 w-5"}),"Select Workout"]})}),u.jsx(Oe,{children:u.jsxs(Wo,{value:v.toString(),onValueChange:O=>w(parseInt(O)),children:[u.jsx(_s,{children:u.jsx(Ho,{placeholder:"Choose workout"})}),u.jsx(Cs,{children:N.days.map(O=>u.jsxs(Yr,{value:O.day.toString(),children:["Day ",O.day,": ",O.name]},O.day))})]})})]}),j&&u.jsxs(Pe,{children:[u.jsxs(Dt,{children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs(Lt,{className:"flex items-center gap-2",children:[u.jsx(oa,{className:"h-5 w-5"}),j.name]}),(a==null?void 0:a.completed)&&u.jsx(Et,{variant:"default",children:"Completed â"})]}),a&&!a.completed&&u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex justify-between text-sm",children:[u.jsx("span",{children:"Progress"}),u.jsxs("span",{children:[Math.round(Y),"%"]})]}),u.jsx(sS,{value:Y})]})]}),u.jsx(Oe,{children:a?u.jsxs("div",{className:"space-y-4",children:[u.jsx($L,{workout:a,onSetComplete:T,onSetUndo:A,onShowDemo:H,onExerciseUpdate:L,onT
359imeUpdate:W}),ae&&!a.completed&&u.jsxs(re,{variant:"outline",className:"w-full",onClick:()=>k(!0),children:[u.jsx(Uo,{className:"h-4 w-4 mr-2"}),"Add Custom Exercise"]})]}):u.jsxs("div",{className:"text-center py-8",children:[u.jsx("p",{className:"text-muted-foreground mb-4",children:"Ready to start today's workout?"}),u.jsx(re,{onClick:P,children:"Start Workout"})]})})]}),a&&!a.completed&&u.jsxs(u.Fragment,{children:[u.jsx(Pe,{className:"border-primary/20",children:u.jsxs(Oe,{className:"p-4 flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(_p,{className:"h-5 w-5 text-primary"}),u.jsx("span",{className:"text-sm text-muted-foreground",children:"Session Time"})]}),u.jsx("div",{className:"text-2xl font-mono font-semibold",children:R(E)})]})}),u.jsxs(OM,{children:[u.jsx(IM,{asChild:!0,children:u.jsx(re,{className:"w-full",size:"lg",children:"Finish Workout"})}),u.jsxs(i_,{children:[u.jsxs(a_,{children:[u.jsx(c_,{children:"Finish workout now?"}),u.jsx(u_,{children:"You havenât completed all sets. Do you want to finish and record todayâs workout?"})]}),u.jsxs(l_,{children:[u.jsx(f_,{children:"Cancel"}),u.jsx(d_,{onClick:$,children:"Finish"})]})]})]})]})]}),u.jsx(Dn,{value:"calendar",children:u.jsx(b$,{workoutHistory:o,onDateClick:K})}),u.jsxs(Dn,{value:"stats",className:"space-y-6",children:[u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[u.jsx(Pe,{children:u.jsxs(Oe,{className:"p-4 flex items-center gap-3",children:[u.jsx(Ig,{className:"h-8 w-8 text-primary"}),u.jsxs("div",{children:[u.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Workouts"}),u.jsx("p",{className:"text-2xl font-bold",children:n.totalWorkouts})]})]})}),u.jsx(Pe,{children:u.jsxs(Oe,{className:"p-4 flex items-center gap-3",children:[u.jsx(Df,{className:"h-8 w-8 text-primary"}),u.jsxs("div",{children:[u.jsx("p",{className:"text-sm text-muted-foreground",children:"Current Streak"}),u.jsxs("p",{className:"text-2xl font-bold",children:[n.streak," days"]})]})]})}),u.jsx(Pe,{children:u.jsxs(Oe,{className:"p-4 flex items-center gap-3",children:[u.jsx(cr,{className:"h-8 w-8 text-primary"}),u.jsxs("div",{children:[u.jsx("p",{className:"text-sm text-muted-foreground",children:"Level"}),u.jsx("p",{className:"text-2xl font-bold capitalize",children:n.currentLevel})]})]})})]}),o.length>0&&u.jsxs(Pe,{children:[u.jsx(Dt,{children:u.jsx(Lt,{children:"Completed Workouts"})}),u.jsx(Oe,{children:u.jsx("div",{className:"space-y-3",children:o.sort((O,I)=>new Date(I.date).getTime()-new Date(O.date).getTime()).map(O=>{const I=N.days.find(U=>U.day===O.dayNumber);return u.jsxs("div",{className:"border rounded-lg p-4 hover:bg-muted/50 cursor-pointer transition-colors",onClick:()=>b(O),children:[u.jsxs("div",{className:"flex items-center justify-between mb-2",children:[u.jsx("h4",{className:"font-medium",children:I==null?void 0:I.name}),u.jsx(Et,{variant:"outline",children:new Date(O.date).toLocaleDateString()})]}),u.jsxs("div",{className:"text-sm text-muted-foreground",children:[O.exercises.length," exercises ⢠Day ",O.dayNumber]})]},O.date)})})})]}),m&&u.jsxs(Pe,{children:[u.jsxs(Dt,{children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(Lt,{children:(_e=N.days.find(O=>O.day===m.dayNumber))==null?void 0:_e.name}),u.jsx(re,{variant:"ghost",size:"sm",onClick:()=>b(null),children:"â"})]}),u.jsx("p",{className:"text-sm text-muted-foreground",children:new Date(m.date).toLocaleDateString()})]}),u.jsx(Oe,{children:u.jsx("div",{className:"space-y-3",children:m.exercises.map(O=>u.jsxs("div",{className:"border rounded-lg p-3",children:[u.jsxs("div",{className:"flex items-center justify-between mb-2",children:[u.jsx("h5",{className:"font-medium",children:O.name}),u.jsx(Et,{variant:"outline",children:O.muscle})]}),u.jsxs("div",{className:"text-sm text-muted-foreground",children:["Sets: ",m.completedSets[O.id]||0,"/",O.sets," ⢠Reps: ",O.reps," ⢠Rest: ",O.restTime,"s"]})]},O.id))})})]}),u.jsxs(Pe,{children:[u.jsx(Dt,{children:u.jsx(Lt,{children:"All Workout Days"})}),u.jsx(Oe,{children:u.jsx("div",{className:"space-y-4",children:N.days.map(O=>{const I=o.some(U=>U.dayNumber===O.day);return u.jsxs("div",{className:`border rounded-lg p-4 ${I?"border-primary bg-primary/5":""}`,children:[u.jsxs("div",{className:"flex items-center justify-between mb-3",children:[u.jsx("h4",{className:"font-medium",children:O.name}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs(Et,{variant:"outline",children:["Day ",O.day]}),I&&u.jsx(Et,{variant:"default",children:"â"})]})]}),u.jsx("div",{className:"space-y-2",children:O.exercises.map(U=>u.jsxs("div",{className:"text-sm",children:[u.jsx("span",{className:"font-medium",children:U.name}),u.jsxs("span",{className:"text-muted-foreground ml-2",children:[U.sets," sets à ",U.reps," reps"]})]},U.id))})]},O.day)})})})]}),u.jsxs(Pe,{children:[u.jsx(Dt,{children:u.jsxs(Lt,{className:"flex items-center gap-2",children:[u.jsx(eN,{className:"h-5 w-5"}),"Change Level"]})}),u.jsx(Oe,{children:u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:["beginner","intermediate","professional"].map(O=>u.jsx(re,{variant:n.currentLevel===O?"default":"outline",onClick:()=>s({...n,currentLevel:O}),className:"capitalize",children:O},O))})})]})]})]})}),u.jsx(x$,{exercise:c,isOpen:f,onClose:()=>h(!1),onGifGenerated:ee}),u.jsx(L$,{open:_,onOpenChange:k,onExerciseAdded:B})]})};var $M="Separator",wy="horizontal",MM=["horizontal","vertical"],h_=p.forwardRef((e,t)=>
359{const{decorative:r,orientation:n=wy,...s}=e,o=FM(n)?n:wy,a=r?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return u.jsx(X.div,{"data-orientation":o,...a,...s,ref:t})});h_.displayName=$M;function FM(e){return MM.includes(e)}var p_=h_;const m_=p.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...n},s)=>u.jsx(p_,{ref:s,decorative:r,orientation:t,className:ie("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...n}));m_.displayName=p_.displayName;const UM=()=>{const{user:e,loading:t,signInWithGoogle:r,signInWithApple:n,signInWithGitHub:s,signInWithEmail:o,signUpWithEmail:i}=La(),[a,l]=p.useState(""),[c,d]=p.useState(""),[f,h]=p.useState(!1);if(t)return u.jsx("div",{className:"min-h-screen flex items-center justify-center",children:u.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})});if(e)return u.jsx(vu,{to:"/workout",replace:!0});const v=async m=>{m.preventDefault(),h(!0),await o(a,c),h(!1)},w=async m=>{m.preventDefault(),h(!0),await i(a,c),h(!1)};return u.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-background to-secondary/20 flex flex-col items-center justify-center p-4",children:[u.jsx("div",{className:"absolute top-4 right-4",children:u.jsx(ei,{})}),u.jsxs(Pe,{className:"w-full max-w-md",children:[u.jsxs(Dt,{className:"space-y-1",children:[u.jsx(Lt,{className:"text-2xl text-center",children:"Welcome to GymFlow"}),u.jsx(jb,{className:"text-center",children:"Sign in to your account or create a new one"})]}),u.jsxs(Oe,{className:"space-y-4",children:[u.jsxs("div",{className:"space-y-3",children:[u.jsxs(re,{variant:"outline",className:"w-full",onClick:r,disabled:f,children:[u.jsxs("svg",{className:"mr-2 h-4 w-4",viewBox:"0 0 24 24",children:[u.jsx("path",{fill:"currentColor",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),u.jsx("path",{fill:"currentColor",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),u.jsx("path",{fill:"currentColor",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),u.jsx("path",{fill:"currentColor",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),"Continue with Google"]}),u.jsxs(re,{variant:"outline",className:"w-full",onClick:n,disabled:f,children:[u.jsx("svg",{className:"mr-2 h-4 w-4",viewBox:"0 0 24 24",fill:"currentColor",children:u.jsx("path",{d:"M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701"})}),"Continue with Apple"]}),u.jsxs(re,{variant:"outline",className:"w-full",onClick:s,disabled:f,children:[u.jsx("svg",{className:"mr-2 h-4 w-4",viewBox:"0 0 24 24",fill:"currentColor",children:u.jsx("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})}),"Continue with GitHub"]})]}),u.jsxs("div",{className:"relative",children:[u.jsx("div",{className:"absolute inset-0 flex items-center",children:u.jsx(m_,{className:"w-full"})}),u.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:u.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"Or continue with email"})})]}),u.jsxs(Vp,{defaultValue:"signin",className:"w-full",children:[u.jsxs(_u,{className:"grid w-full grid-cols-2",children:[u.jsx(In,{value:"signin",children:"Sign In"}),u.jsx(In,{value:"signup",children:"Sign Up"})]}),u.jsx(Dn,{value:"signin",className:"space-y-4",children:u.jsxs("form",{onSubmit:v,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(Se,{htmlFor:"signin-email",children:"Email"}),u.jsx(De,{id:"signin-email",type:"email",placeholder:"Enter your email",value:a,onChange:m=>l(m.target.value),required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Se,{htmlFor:"signin-password",children:"Password"}),u.jsx(De,{id:"signin-password",type:"password",placeholder:"Enter your password",value:c,onChange:m=>d(m.target.value),required:!0})]}),u.jsx(re,{type:"submit",className:"w-full",disabled:f,children:f?"
359Signing in...":"Sign In"})]})}),u.jsx(Dn,{value:"signup",className:"space-y-4",children:u.jsxs("form",{onSubmit:w,className:"space-y-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(Se,{htmlFor:"signup-email",children:"Email"}),u.jsx(De,{id:"signup-email",type:"email",placeholder:"Enter your email",value:a,onChange:m=>l(m.target.value),required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Se,{htmlFor:"signup-password",children:"Password"}),u.jsx(De,{id:"signup-password",type:"password",placeholder:"Create a password",value:c,onChange:m=>d(m.target.value),required:!0,minLength:6})]}),u.jsx(re,{type:"submit",className:"w-full",disabled:f,children:f?"Creating account...":"Create Account"})]})})]})]})]})]})},$c=p.forwardRef(({className:e,...t},r)=>u.jsx("textarea",{className:ie("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));$c.displayName="Textarea";var gm="Checkbox",[BM,c4]=vr(gm),[zM,WM]=BM(gm),g_=p.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:n,checked:s,defaultChecked:o,required:i,disabled:a,value:l="on",onCheckedChange:c,...d}=e,[f,h]=p.useState(null),v=le(t,x=>h(x)),w=p.useRef(!1),m=f?!!f.closest("form"):!0,[b=!1,g]=Fn({prop:s,defaultProp:o,onChange:c}),y=p.useRef(b);return p.useEffect(()=>{const x=f==null?void 0:f.form;if(x){const S=()=>g(y.current);return x.addEventListener("reset",S),()=>x.removeEventListener("reset",S)}},[f,g]),u.jsxs(zM,{scope:r,state:b,disabled:a,children:[u.jsx(X.button,{type:"button",role:"checkbox","aria-checked":gs(b)?"mixed":b,"aria-required":i,"data-state":w_(b),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:v,onKeyDown:q(e.onKeyDown,x=>{x.key==="Enter"&&x.preventDefault()}),onClick:q(e.onClick,x=>{g(S=>gs(S)?!0:!S),m&&(w.current=x.isPropagationStopped(),w.current||x.stopPropagation())})}),m&&u.jsx(HM,{control:f,bubbles:!w.current,name:n,value:l,checked:b,required:i,disabled:a,style:{transform:"translateX(-100%)"}})]})});g_.displayName=gm;var v_="CheckboxIndicator",y_=p.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...s}=e,o=WM(v_,r);return u.jsx(yr,{present:n||gs(o.state)||o.state===!0,children:u.jsx(X.span,{"data-state":w_(o.state),"data-disabled":o.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});y_.displayName=v_;var HM=e=>{const{control:t,checked:r,bubbles:n=!0,...s}=e,o=p.useRef(null),i=PS(r),a=zx(t);return p.useEffect(()=>{const l=o.current,c=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(c,"checked").set;if(i!==r&&f){const h=new Event("click",{bubbles:n});l.indeterminate=gs(r),f.call(l,gs(r)?!1:r),l.dispatchEvent(h)}},[i,r,n]),u.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:gs(r)?!1:r,...s,tabIndex:-1,ref:o,style:{...e.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function gs(e){return e==="indeterminate"}function w_(e){return gs(e)?"indeterminate":e?"checked":"unchecked"}var x_=g_,VM=y_;const b_=p.forwardRef(({className:e,...t},r)=>u.jsx(x_,{ref:r,className:ie("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:u.jsx(VM,{className:ie("flex items-center justify-center text-current"),children:u.jsx(Ep,{className:"h-4 w-4"})})}));b_.displayName=x_.displayName;const qM=()=>{var R;const{user:e,loading:t,signOut:r}=La(),n=gu(),[s,o]=p.useState({name:"",description:"",target_muscles:[],exercises:[]}),[i,a]=p.useState([]),[l,c]=p.useState([]),[d,f]=p.useState(!1),[h,v]=p.useState(""),[w,m]=p.useState("all"),[b,g]=p.useState(!1),y=["chest","back","shoulders","biceps","triceps","legs","glutes","core","cardio","full body"];p.useEffect(()=>{e&&(x(),S())},[e]);const x=async()=>{try{const{data:T,error:A}=await Xe.from("exercises").select("*").order("name");if(A)throw A;a(T||[])}catch(T){console.error("Error fetching exercises:",T),xe.error("Failed to fetch exercises")}},S=async()=>{try{const{data:T,error:A}=await Xe.from("workouts").select("*").order("name");if(A)throw A;const L=(T||[]).map(W=>({id:W.id,name:W.name,description:W.description||"",target_muscles:W.target_muscles,exercises:Array.isArray(W.exercises)?W.exercises:[]}));c(L)}catch(T){console.error("Error fetching workouts:",T),xe.error("Failed to fetch workouts")}},E=T=>{o(A=>({...A,target_muscles:A.target_muscles.includes(T)?A.target_muscles.filter(L=>L!==T):[...A.target_muscles,T]}))},C=T=>{o(A=>({...A,exercises:[...A.exercises,{...T,sets:3,reps:"12",rest_time:60}]})),xe.success(`Added ${T.name} to workout`)},_=T=>{o(A=>({...A,exercises:A.exercises.filter(L=>L.id!==T)}))},k=(T,A)=>{o(L=>({...L,exercises:L.exercises.map(W=>W.id===T?{...W,...A}:W)}))},N=async()=>
359{if(!s.name.trim()){xe.error("Please enter a workout name");return}if(s.exercises.length===0){xe.error("Please add at least one exercise");return}f(!0);try{const{error:T}=await Xe.from("workouts").insert({name:s.name,description:s.description,target_muscles:s.target_muscles,exercises:s.exercises.map(A=>({id:A.id,name:A.name,muscle:A.muscle,sets:A.sets||3,reps:A.reps||"12",rest_time:A.rest_time||60,description:A.description}))});if(T)throw T;xe.success("Workout saved successfully!"),o({name:"",description:"",target_muscles:[],exercises:[]}),S()}catch(T){console.error("Error saving workout:",T),xe.error("Failed to save workout")}finally{f(!1)}},j=i.filter(T=>{const A=T.name.toLowerCase().includes(h.toLowerCase())||T.muscle.toLowerCase().includes(h.toLowerCase()),L=w==="all"||T.muscle.toLowerCase()===w;return A&&L});return t?u.jsx("div",{className:"min-h-screen flex items-center justify-center",children:u.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):e?u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsx("div",{className:"border-b bg-card",children:u.jsx("div",{className:"container mx-auto px-4 py-4",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsxs(re,{variant:"ghost",size:"sm",onClick:()=>n("/workout"),children:[u.jsx(yx,{className:"h-4 w-4 mr-2"}),"Back"]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(cr,{className:"h-6 w-6 text-primary"}),u.jsx("h1",{className:"text-2xl font-bold",children:"Workout Builder"})]})]}),u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx(ei,{}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-sm text-muted-foreground",children:((R=e.user_metadata)==null?void 0:R.full_name)||e.email}),u.jsxs(re,{variant:"outline",size:"sm",onClick:r,children:[u.jsx(su,{className:"h-4 w-4 mr-2"}),"Sign Out"]})]})]})]})})}),u.jsxs("div",{className:"container mx-auto px-4 py-6 space-y-6",children:[u.jsxs(Pe,{children:[u.jsx(Dt,{children:u.jsx(Lt,{children:"Workout Details"})}),u.jsxs(Oe,{className:"space-y-4",children:[u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(Se,{htmlFor:"workout-name",children:"Workout Name"}),u.jsx(De,{id:"workout-name",placeholder:"Enter workout name",value:s.name,onChange:T=>o(A=>({...A,name:T.target.value}))})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Se,{htmlFor:"workout-description",children:"Description (Optional)"}),u.jsx($c,{id:"workout-description",placeholder:"Describe your workout",value:s.description,onChange:T=>o(A=>({...A,description:T.target.value}))})]})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Se,{children:"Target Muscle Groups"}),u.jsx("div",{className:"flex flex-wrap gap-2",children:y.map(T=>u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx(b_,{id:T,checked:s.target_muscles.includes(T),onCheckedChange:()=>E(T)}),u.jsx(Se,{htmlFor:T,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 capitalize",children:T})]},T))})]})]})]}),u.jsxs(Pe,{children:[u.jsx(Dt,{children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs(Lt,{children:["Workout Exercises (",s.exercises.length,")"]}),u.jsxs(Du,{open:b,onOpenChange:g,children:[u.jsx(J1,{asChild:!0,children:u.jsxs(re,{children:[u.jsx(Uo,{className:"h-4 w-4 mr-2"}),"Add Exercise"]})}),u.jsxs(Fa,{className:"max-w-4xl max-h-[80vh] overflow-y-auto",children:[u.jsx(Ua,{children:u.jsx(Ba,{children:"Add Exercise to Workout"})}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[u.jsxs("div",{className:"relative",children:[u.jsx(xx,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),u.jsx(De,{placeholder:"Search exercises...",value:h,onChange:T=>v(T.target.value),className:"pl-10"})]}),u.jsxs(Wo,{value:w,onValueChange:m,children:[u.jsx(_s,{children:u.jsx(Ho,{placeholder:"Filter by muscle"})}),u.jsxs(Cs,{children:[u.jsx(Yr,{value:"all",children:"All Muscles"}),y.map(T=>u.jsx(Yr,{value:T,className:"capitalize",children:T},T))]})]})]}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 max-h-96 overflow-y-auto",children:j.map(T=>u.jsx(Pe,{className:"cursor-pointer hover:shadow-md transition-shadow",children:u.jsx(Oe,{className:"p-4",children:u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("h4",{className:"font-medium",children:T.name}),u.jsx(Et,{variant:"secondary",className:"capitalize",children:T.muscle})]}),T.description&&u.jsx("p",{className:"text-sm text-muted-foreground",children:T.description}),u.jsx(re,{size:"sm",onClick:()=>{C(T),g(!1)},className:"w-full",children:"Add to Workout"})]})})},T.id))}),j.length===0&&u.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No exercises found. Try adjusting your search or create new exercises."})]})]})]})]})}),u.jsx(Oe,{children:s.exercises.length===0?u.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'No exercises added yet. Click "Add Exercise" to get started.'}):u.jsx("div",{className:"space-y-4",children:s.exercises.map(T=>u.jsx(Pe,{className:"p-4",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex-1 space-y-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("h4",{className:"font-medium",children:T.name}),u.jsx(Et,{variant:"outline",className:"capitalize",children:T.muscle})]}),u.jsxs("div",{className:"grid grid-cols-3 gap-4 max-w-md",children:[u.jsxs("div",{children:[u.jsx(Se,{className:"text-xs",children:"Sets"}),u.jsx(De,{type:"number",value:T.sets||3,onChange:A=>k(T.id,{sets:parseInt(A.target.value)||3}),min:"1",max:"10"})]}),u.jsxs("div",{children:[u.jsx(Se,{className:"text-xs",children:"Reps"}),u.jsx(De,{value:T.reps||"12",onChange:A=>k(T.id,{reps:A.target.value}),placeholder:"12"})]}),u.jsxs("div",{children:[u.jsx(Se,{className:"text-xs",children:"Rest (sec)"}),u.jsx(De,{type:"number",value:T.rest_time||60,onChange:A=>k(T.id,{rest_time:parseInt(A.target.value)||60}),min:"15",max:"300"})]})]})]}),u.jsx(re,{variant:"destructive",size:"sm",onClick:()=>_(T.id),children:"Remove"})]})},T.id))})})]}),u.jsx("div",{className:"flex justify-end",children:u.jsxs(re,{onClick:N,disabled:d||!s.name.trim()||s.exercises.length===0,size:"lg",children:[u.jsx(ZT,{className:"h-4 w-4 mr-2"}
359),d?"Saving...":"Save Workout"]})})]})]}):u.jsx(vu,{to:"/auth",replace:!0})},KM=()=>{var R;const{user:e,loading:t,signOut:r}=La(),n=gu(),[s,o]=p.useState([]),[i,a]=p.useState(!1),[l,c]=p.useState(""),[d,f]=p.useState("all"),[h,v]=p.useState(!1),[w,m]=p.useState(null),[b,g]=p.useState({name:"",muscle:"",description:"",instructions:"",gif_url:""}),y=["abdominals","abductors","adductors","biceps","calves","chest","forearms","glutes","hamstrings","lats","lower back","middle back","neck","quadriceps","shoulders","traps","triceps"];p.useEffect(()=>{e&&x()},[e]);const x=async()=>{try{const{data:T,error:A}=await Xe.from("exercises").select("*").order("name");if(A)throw A;o(T||[])}catch(T){console.error("Error fetching exercises:",T),xe.error("Failed to fetch exercises")}},S=()=>{g({name:"",muscle:"",description:"",instructions:"",gif_url:""}),m(null)},E=()=>{S(),v(!0)},C=T=>{g({name:T.name,muscle:T.muscle,description:T.description||"",instructions:T.instructions||"",gif_url:T.gif_url||""}),m(T),v(!0)},_=async T=>{if(T.preventDefault(),!b.name.trim()||!b.muscle){xe.error("Please fill in name and muscle group");return}a(!0);try{if(w){const{error:A}=await Xe.from("exercises").update({name:b.name,muscle:b.muscle,description:b.description||null,instructions:b.instructions||null,gif_url:b.gif_url||null}).eq("id",w.id);if(A)throw A;xe.success("Exercise updated successfully!")}else{const{error:A}=await Xe.from("exercises").insert({name:b.name,muscle:b.muscle,description:b.description||null,instructions:b.instructions||null,gif_url:b.gif_url||null});if(A)throw A;xe.success("Exercise created successfully!")}S(),v(!1),x()}catch(A){console.error("Error saving exercise:",A),xe.error("Failed to save exercise")}finally{a(!1)}},k=async T=>{if(confirm(`Are you sure you want to delete "${T.name}"?`))try{const{error:A}=await Xe.from("exercises").delete().eq("id",T.id);if(A)throw A;xe.success("Exercise deleted successfully!"),x()}catch(A){console.error("Error deleting exercise:",A),xe.error("Failed to delete exercise")}},N=s.filter(T=>{const A=T.name.toLowerCase().includes(l.toLowerCase())||T.muscle.toLowerCase().includes(l.toLowerCase()),L=d==="all"||T.muscle.toLowerCase()===d;return A&&L}),j=T=>T.created_by===(e==null?void 0:e.id);return t?u.jsx("div",{className:"min-h-screen flex items-center justify-center",children:u.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})}):e?u.jsxs("div",{className:"min-h-screen bg-background",children:[u.jsx("div",{className:"border-b bg-card",children:u.jsx("div",{className:"container mx-auto px-4 py-4",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsxs(re,{variant:"ghost",size:"sm",onClick:()=>n("/workout"),children:[u.jsx(yx,{className:"h-4 w-4 mr-2"}),"Back"]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(cr,{className:"h-6 w-6 text-primary"}),u.jsx("h1",{className:"text-2xl font-bold",children:"Exercise Manager"})]})]}),u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx(ei,{}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"text-sm text-muted-foreground",children:((R=e.user_metadata)==null?void 0:R.full_name)||e.email}),u.jsxs(re,{variant:"outline",size:"sm",onClick:r,children:[u.jsx(su,{className:"h-4 w-4 mr-2"}),"Sign Out"]})]})]})]})})}),u.jsxs("div",{className:"container mx-auto px-4 py-6 space-y-6",children:[u.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between",children:[u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 flex-1 max-w-2xl",children:[u.jsxs("div",{className:"relative",children:[u.jsx(xx,{className:"absolute left-3 top-3 h-4 w-4 text-muted-foreground"}),u.jsx(De,{placeholder:"Search exercises...",value:l,onChange:T=>c(T.target.value),className:"pl-10"})]}),u.jsxs(Wo,{value:d,onValueChange:f,children:[u.jsx(_s,{children:u.jsx(Ho,{placeholder:"Filter by muscle"})}),u.jsxs(Cs,{children:[u.jsx(Yr,{value:"all",children:"All Muscles"}),y.map(T=>u.jsx(Yr,{value:T,className:"capitalize",children:T},T))]})]})]}),u.jsxs(Du,{open:h,onOpenChange:v,children:[u.jsx(J1,{asChild:!0,children:u.jsxs(re,{onClick:E,children:[u.jsx(Uo,{className:"h-4 w-4 mr-2"}),"Create Exercise"]})}),u.jsxs(Fa,{className:"max-w-2xl",children:[u.jsx(Ua,{children:u.jsx(Ba,{children:w?"Edit Exercise":"Create New Exercise"})}),u.jsxs("form",{onSubmit:_,className:"space-y-4",children:[u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(Se,{htmlFor:"name",children:"Exercise Name *"}),u.jsx(De,{id:"name",placeholder:"e.g., Push Up",value:b.name,onChange:T=>g(A=>({...A,name:T.target.value})),required:!0})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Se,{htmlFor:"muscle",children:"Muscle Group *"}),u.jsxs(Wo,{value:b.muscle,onValueChange:T=>g(A=>({...A,muscle:T})),children:[u.jsx(_s,{children:u.jsx(Ho,{placeholder:"Select muscle group"})}),u.jsx(Cs,{children:y.map(T=>u.jsx(Yr,{value:T,className:"capitalize",children:T},T))})]})]})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Se,{htmlFor:"description",children:"Description"}),u.jsx($c,{id:"description",placeholder:"Brief description of the exercise",value:b.description,onChange:T=>g(A=>({...A,description:T.target.value})),rows:3})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Se,{htmlFor:"instructions",children:"Instructions"}),u.jsx($c,{id:"instructions",placeholder:"Step-by-step instructions",value:b.instructions,onChange:T=>g(A=>({...A,instructions:T.target.value})),rows:4})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Se,{htmlFor:"gif_url",children:"GIF URL (Optional)"}),u.jsx(De,{id:"gif_url",type:"url",placeholder:"https://example.com/exercise.g
359if",value:b.gif_url,onChange:T=>g(A=>({...A,gif_url:T.target.value}))})]}),u.jsxs("div",{className:"flex justify-end gap-2",children:[u.jsx(re,{type:"button",variant:"outline",onClick:()=>v(!1),children:"Cancel"}),u.jsx(re,{type:"submit",disabled:i,children:i?"Saving...":w?"Update":"Create"})]})]})]})]})]}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:N.map(T=>u.jsxs(Pe,{className:"hover:shadow-md transition-shadow",children:[u.jsx(Dt,{children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx(Lt,{className:"text-lg",children:T.name}),u.jsx(Et,{variant:"secondary",className:"capitalize",children:T.muscle})]})}),u.jsxs(Oe,{className:"space-y-3",children:[T.description&&u.jsx("p",{className:"text-sm text-muted-foreground",children:T.description}),T.instructions&&u.jsxs("div",{className:"space-y-1",children:[u.jsx("h4",{className:"text-sm font-medium",children:"Instructions:"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:T.instructions.length>100?T.instructions.substring(0,100)+"...":T.instructions})]}),T.gif_url&&u.jsx("div",{className:"w-full h-32 bg-muted rounded flex items-center justify-center",children:u.jsx("img",{src:T.gif_url,alt:T.name,className:"max-w-full max-h-full object-contain",onError:A=>{A.currentTarget.style.display="none"}})}),j(T)&&u.jsxs("div",{className:"flex gap-2 pt-2",children:[u.jsxs(re,{variant:"outline",size:"sm",onClick:()=>C(T),className:"flex-1",children:[u.jsx(tN,{className:"h-4 w-4 mr-2"}),"Edit"]}),u.jsxs(re,{variant:"destructive",size:"sm",onClick:()=>k(T),className:"flex-1",children:[u.jsx(nN,{className:"h-4 w-4 mr-2"}),"Delete"]})]}),u.jsxs("div",{className:"text-xs text-muted-foreground pt-2",children:["Created: ",new Date(T.created_at).toLocaleDateString(),T.created_by===(e==null?void 0:e.id)&&u.jsx("span",{className:"ml-2 text-primary font-medium",children:"Your exercise"})]})]})]},T.id))}),N.length===0&&u.jsxs("div",{className:"text-center py-12",children:[u.jsx(cr,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),u.jsx("h3",{className:"text-lg font-medium mb-2",children:"No exercises found"}),u.jsx("p",{className:"text-muted-foreground mb-4",children:l||d!=="all"?"Try adjusting your search or filter criteria.":"Get started by creating your first exercise."}),!l&&d==="all"&&u.jsxs(re,{onClick:E,children:[u.jsx(Uo,{className:"h-4 w-4 mr-2"}),"Create Your First Exercise"]})]})]})]}):u.jsx(vu,{to:"/auth",replace:!0})},GM=()=>{const e=mu();return p.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),u.jsxs("div",{className:"min-h-screen flex flex-col bg-background",children:[u.jsx("nav",{className:"border-b p-4",children:u.jsx("div",{className:"container mx-auto flex justify-end",children:u.jsx(ei,{})})}),u.jsx("div",{className:"flex-1 flex items-center justify-center",children:u.jsxs("div",{className:"text-center",children:[u.jsx("h1",{className:"text-4xl font-bold mb-4",children:"404"}),u.jsx("p",{className:"text-xl text-muted-foreground mb-4",children:"Oops! Page not found"}),u.jsx("a",{href:"/",className:"text-primary hover:underline",children:"Return to Home"})]})})]})},YM=new bj,JM=()=>u.jsx(Ej,{client:YM,children:u.jsxs(ZR,{children:[u.jsx(UN,{}),u.jsx(mP,{}),u.jsx(hA,{children:u.jsxs(uA,{children:[u.jsx(ns,{path:"/",element:u.jsx(oI,{})}),u.jsx(ns,{path:"/auth",element:u.jsx(UM,{})}),u.jsx(ns,{path:"/workout",element:u.jsx(LM,{})}),u.jsx(ns,{path:"/workout-build",element:u.jsx(qM,{})}),u.jsx(ns,{path:"/exercises",element:u.jsx(KM,{})}),u.jsx(ns,{path:"*",element:u.jsx(GM,{})})]})})]})});z0(document.getElementById("root")).render(u.jsx(JM,{}));
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.