vendor: 4,140 bytes, lines 1-9
1var ky=e=>{throw TypeError(e)};var Vd=(e,t,n)=>t.has(e)||ky("Cannot "+n);var A=(e,t,n)=>(Vd(e,t,"read from private field"),n?n.call(e):t.get(e)),be=(e,t,n)=>t.has(e)?ky("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),de=(e,t,n,r)=>(Vd(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),wt=(e,t,n)=>(Vd(e,t,"access private method"),n);var Ol=(e,t,n,r)=>({set _(s){de(e,t,s,n)},get _(){return A(e,t,r)}});function BT(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function Lx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $x={exports:{}},Wu={},Fx={exports:{}},xe={};/** 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 ml=Symbol.for("react.element"),zT=Symbol.for("react.portal"),WT=Symbol.for("react.fragment"),HT=Symbol.for("react.strict_mode"),qT=Symbol.for("react.profiler"),KT=Symbol.for("react.provider"),GT=Symbol.for("react.context"),YT=Symbol.for("react.forward_ref"),JT=Symbol.for("react.suspense"),QT=Symbol.for("react.memo"),XT=Symbol.for("react.lazy"),_y=Symbol.iterator;function ZT(e){return e===null||typeof e!="object"?null:(e=_y&&e[_y]||e["@@iterator"],typeof e=="function"?e:null)}var Ux={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Vx=Object.assign,Bx={};function Po(e,t,n){this.props=e,this.context=t,this.refs=Bx,this.updater=n||Ux}Po.prototype.isReactComponent={};Po.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")};Po.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function zx(){}zx.prototype=Po.prototype;function om(e,t,n){this.props=e,this.context=t,this.refs=Bx,this.updater=n||Ux}var am=om.prototype=new zx;am.constructor=om;Vx(am,Po.prototype);am.isPureReactComponent=!0;var Ey=Array.isArray,Wx=Object.prototype.hasOwnProperty,lm={current:null},Hx={key:!0,ref:!0,__self:!0,__source:!0};function qx(e,t,n){var r,s={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)Wx.call(t,r)&&!Hx.hasOwnProperty(r)&&(s[r]=t[r]);var a=arguments.length-2;if(a===1)s.children=n;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(r in a=e.defaultProps,a)s[r]===void 0&&(s[r]=a[r]);return{$$typeof:ml,type:e,key:i,ref:o,props:s,_owner:lm.current}}function eP(e,t){return{$$typeof:ml,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function cm(e){return typeof e=="object"&&e!==null&&e.$$typeof===ml}function tP(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Cy=/\/+/g;function Bd(e,t){return typeof e=="object"&&e!==null&&e.key!=null?tP(""+e.key):t.toString(36)}
vendor: 4,786 bytes, lines 9-17
9function bc(e,t,n,r,s){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case ml:case zT:o=!0}}if(o)return o=e,s=s(o),e=r===""?"."+Bd(o,0):r,Ey(s)?(n="",e!=null&&(n=e.replace(Cy,"$&/")+"/"),bc(s,t,n,"",function(c){return c})):s!=null&&(cm(s)&&(s=eP(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(Cy,"$&/")+"/")+e)),t.push(s)),1;if(o=0,r=r===""?".":r+":",Ey(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+Bd(i,a);o+=bc(i,t,n,l,s)}else if(l=ZT(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+Bd(i,a++),o+=bc(i,t,n,l,s);else if(i==="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 o}function Ml(e,t,n){if(e==null)return e;var r=[],s=0;return bc(e,r,"","",function(i){return t.call(n,i,s++)}),r}function nP(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ot={current:null},Sc={transition:null},rP={ReactCurrentDispatcher:Ot,ReactCurrentBatchConfig:Sc,ReactCurrentOwner:lm};function Kx(){throw Error("act(...) is not supported in production builds of React.")}xe.Children={map:Ml,forEach:function(e,t,n){Ml(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ml(e,function(){t++}),t},toArray:function(e){return Ml(e,function(t){return t})||[]},only:function(e){if(!cm(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};xe.Component=Po;xe.Fragment=WT;xe.Profiler=qT;xe.PureComponent=om;xe.StrictMode=HT;xe.Suspense=JT;xe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=rP;xe.act=Kx;xe.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Vx({},e.props),s=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=lm.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)Wx.call(t,l)&&!Hx.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:ml,type:e.type,key:s,ref:i,props:r,_owner:o}};xe.createContext=function(e){return e={$$typeof:GT,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:KT,_context:e},e.Consumer=e};xe.createElement=qx;xe.createFactory=function(e){var t=qx.bind(null,e);return t.type=e,t};xe.createRef=function(){return{current:null}};xe.forwardRef=function(e){return{$$typeof:YT,render:e}};xe.isValidElement=cm;xe.lazy=function(e){return{$$typeof:XT,_payload:{_status:-1,_result:e},_init:nP}};xe.memo=function(e,t){return{$$typeof:QT,type:e,compare:t===void 0?null:t}};xe.startTransition=function(e){var t=Sc.transition;Sc.transition={};try{e()}finally{Sc.transition=t}};xe.unstable_act=Kx;xe.useCallback=function(e,t){return Ot.current.useCallback(e,t)};xe.useContext=function(e){return Ot.current.useContext(e)};xe.useDebugValue=function(){};xe.useDeferredValue=function(e){return Ot.current.useDeferredValue(e)};xe.useEffect=function(e,t){return Ot.current.useEffect(e,t)};xe.useId=function(){return Ot.current.useId()};xe.useImperativeHandle=function(e,t,n){return Ot.current.useImperativeHandle(e,t,n)};xe.useInsertionEffect=function(e,t){return Ot.current.useInsertionEffect(e,t)};xe.useLayoutEffect=function(e,t){return Ot.current.useLayoutEffect(e,t)};xe.useMemo=function(e,t){return Ot.current.useMemo(e,t)};xe.useReducer=function(e,t,n){return Ot.current.useReducer(e,t,n)};xe.useRef=function(e){return Ot.current.useRef(e)};xe.useState=function(e){return Ot.current.useState(e)};xe.useSyncExternalStore=function(e,t,n){return Ot.current.useSyncExternalStore(e,t,n)};xe.useTransition=function(){return Ot.current.useTransition()};xe.version="18.3.1";Fx.exports=xe;var m=Fx.exports;const U=Lx(m),Hu=BT({__proto__:null,default:U},[m]);/** 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 sP=m,iP=Symbol.for("react.element"),oP=Symbol.for("react.fragment"),aP=Object.prototype.hasOwnProperty,lP=sP.__SECRET_INT
vendor: 11,405 bytes, lines 17-34
17ERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,cP={key:!0,ref:!0,__self:!0,__source:!0};function Gx(e,t,n){var r,s={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)aP.call(t,r)&&!cP.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:iP,type:e,key:i,ref:o,props:s,_owner:lP.current}}Wu.Fragment=oP;Wu.jsx=Gx;Wu.jsxs=Gx;$x.exports=Wu;var u=$x.exports,Yx={exports:{}},nn={},Jx={exports:{}},Qx={};/** 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(N,P){var F=N.length;N.push(P);e:for(;0<F;){var O=F-1>>>1,$=N[O];if(0<s($,P))N[O]=P,N[F]=$,F=O;else break e}}function n(N){return N.length===0?null:N[0]}function r(N){if(N.length===0)return null;var P=N[0],F=N.pop();if(F!==P){N[0]=F;e:for(var O=0,$=N.length,Y=$>>>1;O<Y;){var W=2*(O+1)-1,fe=N[W],ke=W+1,ae=N[ke];if(0>s(fe,F))ke<$&&0>s(ae,fe)?(N[O]=ae,N[ke]=F,O=ke):(N[O]=fe,N[W]=F,O=W);else if(ke<$&&0>s(ae,F))N[O]=ae,N[ke]=F,O=ke;else break e}}return P}function s(N,P){var F=N.sortIndex-P.sortIndex;return F!==0?F:N.id-P.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],c=[],d=1,f=null,h=3,p=!1,v=!1,g=!1,b=typeof setTimeout=="function"?setTimeout:null,w=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(N){for(var P=n(c);P!==null;){if(P.callback===null)r(c);else if(P.startTime<=N)r(c),P.sortIndex=P.expirationTime,t(l,P);else break;P=n(c)}}function S(N){if(g=!1,x(N),!v)if(n(l)!==null)v=!0,L(k);else{var P=n(c);P!==null&&Z(S,P.startTime-N)}}function k(N,P){v=!1,g&&(g=!1,w(_),_=-1),p=!0;var F=h;try{for(x(P),f=n(l);f!==null&&(!(f.expirationTime>P)||N&&!I());){var O=f.callback;if(typeof O=="function"){f.callback=null,h=f.priorityLevel;var $=O(f.expirationTime<=P);P=e.unstable_now(),typeof $=="function"?f.callback=$:f===n(l)&&r(l),x(P)}else r(l);f=n(l)}if(f!==null)var Y=!0;else{var W=n(c);W!==null&&Z(S,W.startTime-P),Y=!1}return Y}finally{f=null,h=F,p=!1}}var E=!1,C=null,_=-1,j=5,T=-1;function I(){return!(e.unstable_now()-T<j)}function M(){if(C!==null){var N=e.unstable_now();T=N;var P=!0;try{P=C(!0,N)}finally{P?H():(E=!1,C=null)}}else E=!1}var H;if(typeof y=="function")H=function(){y(M)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,G=D.port2;D.port1.onmessage=M,H=function(){G.postMessage(null)}}else H=function(){b(M,0)};function L(N){C=N,E||(E=!0,H())}function Z(N,P){_=b(function(){N(e.unstable_now())},P)}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(N){N.callback=null},e.unstable_continueExecution=function(){v||p||(v=!0,L(k))},e.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<N?Math.floor(1e3/N):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(N){switch(h){case 1:case 2:case 3:var P=3;break;default:P=h}var F=h;h=P;try{return N()}finally{h=F}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(N,P){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var F=h;h=N;try{return P()}finally{h=F}},e.unstable_scheduleCallback=function(N,P,F){var O=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?O+F:O):F=O,N){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=F+$,N={id:d++,callback:P,priorityLevel:N,startTime:F,expirationTime:$,sortIndex:-1},F>O?(N.sortIndex=F,t(c,N),n(l)===null&&N===n(c)&&(g?(w(_),_=-1):g=!0,Z(S,F-O))):(N.sortIndex=$,t(l,N),v||p||(v=!0,L(k))),N},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(N){var P=h;return function(){var F=h;h=P;try{return N.apply(this,arguments)}finally{h=F}}}})(Qx);Jx.exports=Qx;var uP=Jx.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 dP=m,en=uP;function B(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);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 Xx=new Set,Pa={};function hi(e,t){yo(e,t),yo(e+"Capture",t)}function yo(e,t){for(Pa[e]=t,e=0;e<t.length;e++)Xx.add(t[e])}var Er=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rh=Object.prototype.hasOwnProperty,fP=/^[: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]*$/,Ty={},Py={};function hP(e){return rh.call(Py,e)?!0:rh.call(Ty,e)?!1:fP.test(e)?Py[e]=!0:(Ty[e]=!0,!1)}function pP(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function mP(e,t,n,r){if(t===null||typeof t>"u"||pP(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Mt(e,t,n,r,s,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var vt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){vt[e]=new Mt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];vt[t]=new Mt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){vt[e]=new Mt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){vt[e]=new Mt(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){vt[e]=new Mt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){vt[e]=new Mt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){vt[e]=new Mt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){vt[e]=new Mt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){vt[e]=new Mt(e,5,!1,e.toLowerCase(),null,!1,!1)});var um=/[\-:]([a-z])/g;function dm(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(um,dm);vt[t]=new Mt(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(um,dm);vt[t]=new Mt(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(um,dm);vt[t]=new Mt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){vt[e]=new Mt(e,1,!1,e.toLowerCase(),null,!1,!1)});vt.xlinkHref=new Mt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){vt[e]=new Mt(e,1,!1,e.toLowerCase(),null,!0,!0)});function fm(e,t,n,r){var s=vt.hasOwnProperty(t)?vt[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(mP(t,n,s,r)&&(n=null),r||s===null?hP(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Rr=dP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Il=Symbol.for("react.element"),Mi=Symbol.for("react.portal"),Ii=Symbol.for("react.fragment"),hm=Symbol.for("react.strict_mode"),sh=Symbol.for("react.profiler"),Zx=Symbol.for("react.provider"),eb=Symbol.for("react.context"),pm=Symbol.for("react.forward_ref"),ih=Symbol.for("react.suspense"),oh=Symbol.for("react.suspense_list"),mm=Symbol.for("react.memo"),Wr=Symbol.for("react.lazy"),tb=Symbol.for("react.offscreen"),jy=Symbol.iterator;function Ho(e){return e===null||typeof e!="object"?null:(e=jy&&e[jy]||e["@@iterator"],typeof e=="function"?e:null)}var He=Object.assign,zd;function ia(e){if(zd===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);zd=t&&t[1]||""}return` 34`+zd+e}var Wd=!1;function Hd(e,t){if(!e||Wd)return"";Wd=!0;var n=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 r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}
vendor: 14,768 bytes, lines 34-37
34catch(c){if(c&&r&&typeof c.stack=="string"){for(var s=c.stack.split(` 35`),i=r.stack.split(` 36`),o=s.length-1,a=i.length-1;1<=o&&0<=a&&s[o]!==i[a];)a--;for(;1<=o&&0<=a;o--,a--)if(s[o]!==i[a]){if(o!==1||a!==1)do if(o--,a--,0>a||s[o]!==i[a]){var l=` 37`+s[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{Wd=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ia(e):""}function gP(e){switch(e.tag){case 5:return ia(e.type);case 16:return ia("Lazy");case 13:return ia("Suspense");case 19:return ia("SuspenseList");case 0:case 2:case 15:return e=Hd(e.type,!1),e;case 11:return e=Hd(e.type.render,!1),e;case 1:return e=Hd(e.type,!0),e;default:return""}}function ah(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 Ii:return"Fragment";case Mi:return"Portal";case sh:return"Profiler";case hm:return"StrictMode";case ih:return"Suspense";case oh:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case eb:return(e.displayName||"Context")+".Consumer";case Zx:return(e._context.displayName||"Context")+".Provider";case pm:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case mm:return t=e.displayName||null,t!==null?t:ah(e.type)||"Memo";case Wr:t=e._payload,e=e._init;try{return ah(e(t))}catch{}}return null}function yP(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 ah(t);case 8:return t===hm?"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 gs(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function nb(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function vP(e){var t=nb(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Dl(e){e._valueTracker||(e._valueTracker=vP(e))}function rb(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=nb(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Kc(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 lh(e,t){var n=t.checked;return He({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Ny(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=gs(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function sb(e,t){t=t.checked,t!=null&&fm(e,"checked",t,!1)}function ch(e,t){sb(e,t);var n=gs(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?uh(e,t.type,n):t.hasOwnProperty("defaultValue")&&uh(e,t.type,gs(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ry(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function uh(e,t,n){(t!=="number"||Kc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var oa=Array.isArray;function Qi(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+gs(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function dh(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(B(91));return He({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ay(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(B(92));if(oa(n)){if(1<n.length)throw Error(B(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:gs(n)}}function ib(e,t){var n=gs(t.value),r=gs(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Oy(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function ob(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 fh(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?ob(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ll,ab=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ll=Ll||document.createElement("div"),Ll.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ll.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ja(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var fa={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},wP=["Webkit","ms","Moz","O"];Object.keys(fa).forEach(function(e){wP.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),fa[t]=fa[e]})});function lb(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||fa.hasOwnProperty(e)&&fa[e]?(""+t).trim():t+"px"}function cb(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=lb(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var xP=He({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 hh(e,t){if(t){if(xP[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(B(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(B(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(B(61))}if(t.style!=null&&typeof t.style!="object")throw Error(B(62))}}function ph(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var mh=null;function gm(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var gh=null,Xi=null,Zi=null;function My(e){if(e=vl(e)){if(typeof gh!="function")throw Error(B(280));var t=e.stateNode;t&&(t=Ju(t),gh(e.stateNode,e.type,t))}}function ub(e){Xi?Zi?Zi.push(e):Zi=[e]:Xi=e}function db(){if(Xi){var e=Xi,t=Zi;if(Zi=Xi=null,My(e),t)for(e=0;e<t.length;e++)My(t[e])}}function fb(e,t){return e(t)}function hb(){}var qd=!1;function pb(e,t,n){if(qd)return e(t,n);qd=!0;try{return fb(e,t,n)}finally{qd=!1,(Xi!==null||Zi!==null)&&(hb(),db())}}function Na(e,t){var n=e.stateNode;if(n===null)return null;var r=Ju(n);if(r===null)return null;n=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(B(231,t,typeof n));return n}var yh=!1;if(Er)try{var qo={};Object.defineProperty(qo,"passive",{get:function(){yh=!0}}),window.addEventListener("test",qo,qo),window.removeEventListener("test",qo,qo)}catch{yh=!1}function bP(e,t,n,r,s,i,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(d){this.onError(d)}}var ha=!1,Gc=null,Yc=!1,vh=null,SP={onError:function(e){ha=!0,Gc=e}};function kP(e,t,n,r,s,i,o,a,l){ha=!1,Gc=null,bP.apply(SP,arguments)}function _P(e,t,n,r,s,i,o,a,l){if(kP.apply(this,arguments),ha){if(ha){var c=Gc;ha=!1,Gc=null}else throw Error(B(198));Yc||(Yc=!0,vh=c)}}function pi(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function mb(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 Iy(e){if(pi(e)!==e)throw Error(B(188))}function EP(e){var t=e.alternate;if(!t){if(t=pi(e),t===null)throw Error(B(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var i=s.alternate;if(i===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===n)return Iy(s),e;if(i===r)return Iy(s),t;i=i.sibling}throw Error(B(188))}if(n.return!==r.return)n=s,r=i;else{for(var o=!1,a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o){for(a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o)throw Error(B(189))}}if(n.alternate!==r)throw Error(B(190))}if(n.tag!==3)throw Error(B(188));return n.stateNode.current===n?e:t}function gb(e){return e=EP(e),e!==null?yb(e):null}function yb(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=yb(e);if(t!==null)return t;e=e.sibling}return null}var vb=en.unstable_scheduleCallback,Dy=en.unstable_cancelCallback,CP=en.unstable_shouldYield,TP=en.unstable_requestPaint,Xe=en.unstable_now,PP=en.unstable_getCurrentPriorityLevel,ym=en.unstable_ImmediatePriority,wb=en.unstable_UserBlockingPriority,Jc=en.unstable_NormalPriority,jP=en.unstable_LowPriority,xb=en.unstable_IdlePriority,qu=null,rr=null;function NP(e){if(rr&&typeof rr.onCommitFiberRoot=="function")try{rr.onCommitFiberRoot(qu,e,void 0,(e.current.flags&128)===128)}catch{}}var Mn=Math.clz32?Math.clz32:OP,RP=Math.log,AP=Math.LN2;function OP(e){return e>>>=0,e===0?32:31-(RP(e)/AP|0)|0}var $l=64,Fl=4194304;function aa(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 Qc(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?r=aa(a):(i&=o,i!==0&&(r=aa(i)))}else o=n&~s,o!==0?r=aa(o):i!==0&&(r=aa(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Mn(t),s=1<<n,r|=e[n],t&=~s;return r}function MP(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 IP(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-Mn(i),a=1<<o,l=s[o];l===-1?(!(a&n)||a&r)&&(s[o]=MP(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function wh(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function bb(){var e=$l;return $l<<=1,!($l&4194240)&&($l=64),e}function Kd(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function gl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Mn(t),e[t]=n}function DP(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-Mn(n),i=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~i}}function vm(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Mn(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var Ne=0;function Sb(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var kb,wm,_b,Eb,Cb,xh=!1,Ul=[],os=null,as=null,ls=null,Ra=new Map,Aa=new Map,Kr=[],LP="mou
37sedown 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 Ly(e,t){switch(e){case"focusin":case"focusout":os=null;break;case"dragenter":case"dragleave":as=null;break;case"mouseover":case"mouseout":ls=null;break;case"pointerover":case"pointerout":Ra.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Aa.delete(t.pointerId)}}function Ko(e,t,n,r,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},t!==null&&(t=vl(t),t!==null&&wm(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function $P(e,t,n,r,s){switch(t){case"focusin":return os=Ko(os,e,t,n,r,s),!0;case"dragenter":return as=Ko(as,e,t,n,r,s),!0;case"mouseover":return ls=Ko(ls,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return Ra.set(i,Ko(Ra.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,Aa.set(i,Ko(Aa.get(i)||null,e,t,n,r,s)),!0}return!1}function Tb(e){var t=zs(e.target);if(t!==null){var n=pi(t);if(n!==null){if(t=n.tag,t===13){if(t=mb(n),t!==null){e.blockedOn=t,Cb(e.priority,function(){_b(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function kc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);mh=r,n.target.dispatchEvent(r),mh=null}else return t=vl(n),t!==null&&wm(t),e.blockedOn=n,!1;t.shift()}return!0}function $y(e,t,n){kc(e)&&n.delete(t)}function FP(){xh=!1,os!==null&&kc(os)&&(os=null),as!==null&&kc(as)&&(as=null),ls!==null&&kc(ls)&&(ls=null),Ra.forEach($y),Aa.forEach($y)}function Go(e,t){e.blockedOn===t&&(e.blockedOn=null,xh||(xh=!0,en.unstable_scheduleCallback(en.unstable_NormalPriority,FP)))}function Oa(e){function t(s){return Go(s,e)}if(0<Ul.length){Go(Ul[0],e);for(var n=1;n<Ul.length;n++){var r=Ul[n];r.blockedOn===e&&(r.blockedOn=null)}}for(os!==null&&Go(os,e),as!==null&&Go(as,e),ls!==null&&Go(ls,e),Ra.forEach(t),Aa.forEach(t),n=0;n<Kr.length;n++)r=Kr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Kr.length&&(n=Kr[0],n.blockedOn===null);)Tb(n),n.blockedOn===null&&Kr.shift()}var eo=Rr.ReactCurrentBatchConfig,Xc=!0;function UP(e,t,n,r){var s=Ne,i=eo.transition;eo.transition=null;try{Ne=1,xm(e,t,n,r)}finally{Ne=s,eo.transition=i}}function VP(e,t,n,r){var s=Ne,i=eo.transition;eo.transition=null;try{Ne=4,xm(e,t,n,r)}finally{Ne=s,eo.transition=i}}function xm(e,t,n,r){if(Xc){var s=bh(e,t,n,r);if(s===null)rf(e,t,r,Zc,n),Ly(e,r);else if($P(s,e,t,n,r))r.stopPropagation();else if(Ly(e,r),t&4&&-1<LP.indexOf(e)){for(;s!==null;){var i=vl(s);if(i!==null&&kb(i),i=bh(e,t,n,r),i===null&&rf(e,t,r,Zc,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else rf(e,t,r,null,n)}}var Zc=null;function bh(e,t,n,r){if(Zc=null,e=gm(r),e=zs(e),e!==null)if(t=pi(e),t===null)e=null;else if(n=t.tag,n===13){if(e=mb(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Zc=e,null}function Pb(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(PP()){case ym:return 1;case wb:return 4;case Jc:case jP:return 16;case xb:return 536870912;default:return 16}default:return 16}}var ns=null,bm=null,_c=null;function jb(){if(_c)return _c;var e,t=bm,n=t.length,r,s="value"in ns?ns.value:ns.textContent,i=s.length;for(e=0;e<n&&t[e]===s[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===s[i-r];r++);return _c=s.slice(e,1<r?1-r:void 0)}function Ec(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 Vl(){return!0}function Fy(){return!1}function rn(e){function t(n,r,s,i,o){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Vl:Fy,this.isPropagationStopped=Fy,this}return He(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Vl)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Vl)},persist:function(){},isPersistent:Vl}),t}var jo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sm=rn(jo),yl=He({},jo,{view:0,detail:0}),BP=rn(yl),Gd,Yd,Yo,Ku=He({},yl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:km,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!==Yo&&(Yo&&e.type==="mousemove"?(Gd=e.screenX-Yo.screenX,Yd=e.screenY-Yo.screenY):Yd=Gd=0,Yo=e),Gd)},movementY:function(e){return"movementY"in e?e.movementY:Yd}}),Uy=rn(Ku),zP=He({},Ku,{dataTransfer:0}),WP=rn(zP),HP=He({},yl,{relatedTarget:0}),Jd=rn(HP),qP=He({},jo,{animationName:0,elapsedTime:0,pseudoElement:0}),KP=rn(qP),GP=He({},jo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),YP=rn(GP),JP=He({},jo,{data:0}),Vy=rn(JP),QP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},XP={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"},ZP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ej(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ZP[e])?!!t[e]:!1}function km(){return ej}var tj=He({},yl,{key:function(e){if(e.key){var t=QP[e.key]||e.key;if(t!=="Unidentified")return t}
vendor: 4,181 bytes, line 37
37return e.type==="keypress"?(e=Ec(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?XP[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:km,charCode:function(e){return e.type==="keypress"?Ec(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ec(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),nj=rn(tj),rj=He({},Ku,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),By=rn(rj),sj=He({},yl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:km}),ij=rn(sj),oj=He({},jo,{propertyName:0,elapsedTime:0,pseudoElement:0}),aj=rn(oj),lj=He({},Ku,{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}),cj=rn(lj),uj=[9,13,27,32],_m=Er&&"CompositionEvent"in window,pa=null;Er&&"documentMode"in document&&(pa=document.documentMode);var dj=Er&&"TextEvent"in window&&!pa,Nb=Er&&(!_m||pa&&8<pa&&11>=pa),zy=" ",Wy=!1;function Rb(e,t){switch(e){case"keyup":return uj.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ab(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Di=!1;function fj(e,t){switch(e){case"compositionend":return Ab(t);case"keypress":return t.which!==32?null:(Wy=!0,zy);case"textInput":return e=t.data,e===zy&&Wy?null:e;default:return null}}function hj(e,t){if(Di)return e==="compositionend"||!_m&&Rb(e,t)?(e=jb(),_c=bm=ns=null,Di=!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 Nb&&t.locale!=="ko"?null:t.data;default:return null}}var pj={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 Hy(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!pj[e.type]:t==="textarea"}function Ob(e,t,n,r){ub(r),t=eu(t,"onChange"),0<t.length&&(n=new Sm("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ma=null,Ma=null;function mj(e){Wb(e,0)}function Gu(e){var t=Fi(e);if(rb(t))return e}function gj(e,t){if(e==="change")return t}var Mb=!1;if(Er){var Qd;if(Er){var Xd="oninput"in document;if(!Xd){var qy=document.createElement("div");qy.setAttribute("oninput","return;"),Xd=typeof qy.oninput=="function"}Qd=Xd}else Qd=!1;Mb=Qd&&(!document.documentMode||9<document.documentMode)}function Ky(){ma&&(ma.detachEvent("onpropertychange",Ib),Ma=ma=null)}function Ib(e){if(e.propertyName==="value"&&Gu(Ma)){var t=[];Ob(t,Ma,e,gm(e)),pb(mj,t)}}function yj(e,t,n){e==="focusin"?(Ky(),ma=t,Ma=n,ma.attachEvent("onpropertychange",Ib)):e==="focusout"&&Ky()}function vj(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Gu(Ma)}function wj(e,t){if(e==="click")return Gu(t)}function xj(e,t){if(e==="input"||e==="change")return Gu(t)}function bj(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ln=typeof Object.is=="function"?Object.is:bj;function Ia(e,t){if(Ln(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!rh.call(t,s)||!Ln(e[s],t[s]))return!1}return!0}function Gy(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Yy(e,t){var n=Gy(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Gy(n)}}function Db(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Db(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}
vendor: 4,105 bytes, line 37
37function Lb(){for(var e=window,t=Kc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Kc(e.document)}return t}function Em(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 Sj(e){var t=Lb(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Db(n.ownerDocument.documentElement,n)){if(r!==null&&Em(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=Yy(n,i);var o=Yy(n,r);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var kj=Er&&"documentMode"in document&&11>=document.documentMode,Li=null,Sh=null,ga=null,kh=!1;function Jy(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;kh||Li==null||Li!==Kc(r)||(r=Li,"selectionStart"in r&&Em(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ga&&Ia(ga,r)||(ga=r,r=eu(Sh,"onSelect"),0<r.length&&(t=new Sm("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Li)))}function Bl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var $i={animationend:Bl("Animation","AnimationEnd"),animationiteration:Bl("Animation","AnimationIteration"),animationstart:Bl("Animation","AnimationStart"),transitionend:Bl("Transition","TransitionEnd")},Zd={},$b={};Er&&($b=document.createElement("div").style,"AnimationEvent"in window||(delete $i.animationend.animation,delete $i.animationiteration.animation,delete $i.animationstart.animation),"TransitionEvent"in window||delete $i.transitionend.transition);function Yu(e){if(Zd[e])return Zd[e];if(!$i[e])return e;var t=$i[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in $b)return Zd[e]=t[n];return e}var Fb=Yu("animationend"),Ub=Yu("animationiteration"),Vb=Yu("animationstart"),Bb=Yu("transitionend"),zb=new Map,Qy="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 Ss(e,t){zb.set(e,t),hi(t,[e])}for(var ef=0;ef<Qy.length;ef++){var tf=Qy[ef],_j=tf.toLowerCase(),Ej=tf[0].toUpperCase()+tf.slice(1);Ss(_j,"on"+Ej)}Ss(Fb,"onAnimationEnd");Ss(Ub,"onAnimationIteration");Ss(Vb,"onAnimationStart");Ss("dblclick","onDoubleClick");Ss("focusin","onFocus");Ss("focusout","onBlur");Ss(Bb,"onTransitionEnd");yo("onMouseEnter",["mouseout","mouseover"]);yo("onMouseLeave",["mouseout","mouseover"]);yo("onPointerEnter",["pointerout","pointerover"]);yo("onPointerLeave",["pointerout","pointerover"]);hi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));
vendor: 4,770 bytes, line 37
37hi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));hi("onBeforeInput",["compositionend","keypress","textInput","paste"]);hi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));hi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));hi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var la="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(" "),Cj=new Set("cancel close invalid load scroll toggle".split(" ").concat(la));function Xy(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,_P(r,t,void 0,e),e.currentTarget=null}function Wb(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==i&&s.isPropagationStopped())break e;Xy(s,a,c),i=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,c=a.currentTarget,a=a.listener,l!==i&&s.isPropagationStopped())break e;Xy(s,a,c),i=l}}}if(Yc)throw e=vh,Yc=!1,vh=null,e}function Le(e,t){var n=t[Ph];n===void 0&&(n=t[Ph]=new Set);var r=e+"__bubble";n.has(r)||(Hb(t,e,2,!1),n.add(r))}function nf(e,t,n){var r=0;t&&(r|=4),Hb(n,e,r,t)}var zl="_reactListening"+Math.random().toString(36).slice(2);function Da(e){if(!e[zl]){e[zl]=!0,Xx.forEach(function(n){n!=="selectionchange"&&(Cj.has(n)||nf(n,!1,e),nf(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[zl]||(t[zl]=!0,nf("selectionchange",!1,t))}}function Hb(e,t,n,r){switch(Pb(t)){case 1:var s=UP;break;case 4:s=VP;break;default:s=xm}n=s.bind(null,t,n,e),s=void 0,!yh||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function rf(e,t,n,r,s){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===s||a.nodeType===8&&a.parentNode===s)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===s||l.nodeType===8&&l.parentNode===s))return;o=o.return}for(;a!==null;){if(o=zs(a),o===null)return;if(l=o.tag,l===5||l===6){r=i=o;continue e}a=a.parentNode}}r=r.return}pb(function(){var c=i,d=gm(n),f=[];e:{var h=zb.get(e);if(h!==void 0){var p=Sm,v=e;switch(e){case"keypress":if(Ec(n)===0)break e;case"keydown":case"keyup":p=nj;break;case"focusin":v="focus",p=Jd;break;case"focusout":v="blur",p=Jd;break;case"beforeblur":case"afterblur":p=Jd;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=Uy;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=WP;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=ij;break;case Fb:case Ub:case Vb:p=KP;break;case Bb:p=aj;break;case"scroll":p=BP;break;case"wheel":p=cj;break;case"copy":case"cut":case"paste":p=YP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=By}var g=(t&4)!==0,b=!g&&e==="scroll",w=g?h!==null?h+"Capture":null:h;g=[];for(var y=c,x;y!==null;){x=y;var S=x.stateNode;if(x.tag===5&&S!==null&&(x=S,w!==null&&(S=Na(y,w),S!=null&&g.push(La(y,S,x)))),b)break;y=y.return}0<g.length&&(h=new p(h,v,null,n,d),f.push({event:h,listeners:g}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==mh&&(v=n.relatedTarget||n.fromElement)&&(zs(v)||v[Cr]))break e;if((p||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,p?(v=n.relatedTarget||n.toElement,p=c,v=v?zs(v):null,v!==null&&(b=pi(v),v!==b||v.tag!==5&&v.tag!==6)&&(v=null)):(p=null,v=c),p!==v)){if(g=Uy,S="onMouseLeave",w="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(g=By,S="onPointerLeave",w="onPointerEnter",y="pointer"),b=p==null?h:Fi(p),x=v==null?h:Fi(v),h=new g(S,y+"leave",p,n,d),h.target=b,h.relatedTarget=x,S=null,zs(d)===c&&(g=new g(w,y+"enter",v,n,d),g.target=x,g.relatedTarget=b,S=g),b=S,p&&v)t:{for(g=p,w=v,y=0,x=g;x;x=wi(x))y++;for(x=0,S=w;S;S=wi(S))x++;for(;0<y-x;)g=wi(g),y--;for(;0<x-y;)w=wi(w),x--;for(;y--;){if(g===w||w!==null&&g===w.alternate)break t;g=wi(g),w=wi(w)}g=null}else g=null;p!==null&&Zy(f,h,p,g,!1),v!==null&&b!==null&&Zy(f,b,v,g,!0)}}
vendor: 7,582 bytes, lines 37-38
37e:{if(h=c?Fi(c):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var k=gj;else if(Hy(h))if(Mb)k=xj;else{k=vj;var E=yj}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(k=wj);if(k&&(k=k(e,c))){Ob(f,k,n,d);break e}E&&E(e,h,c),e==="focusout"&&(E=h._wrapperState)&&E.controlled&&h.type==="number"&&uh(h,"number",h.value)}switch(E=c?Fi(c):window,e){case"focusin":(Hy(E)||E.contentEditable==="true")&&(Li=E,Sh=c,ga=null);break;case"focusout":ga=Sh=Li=null;break;case"mousedown":kh=!0;break;case"contextmenu":case"mouseup":case"dragend":kh=!1,Jy(f,n,d);break;case"selectionchange":if(kj)break;case"keydown":case"keyup":Jy(f,n,d)}var C;if(_m)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else Di?Rb(e,n)&&(_="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(_="onCompositionStart");_&&(Nb&&n.locale!=="ko"&&(Di||_!=="onCompositionStart"?_==="onCompositionEnd"&&Di&&(C=jb()):(ns=d,bm="value"in ns?ns.value:ns.textContent,Di=!0)),E=eu(c,_),0<E.length&&(_=new Vy(_,e,null,n,d),f.push({event:_,listeners:E}),C?_.data=C:(C=Ab(n),C!==null&&(_.data=C)))),(C=dj?fj(e,n):hj(e,n))&&(c=eu(c,"onBeforeInput"),0<c.length&&(d=new Vy("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:c}),d.data=C))}Wb(f,t)})}function La(e,t,n){return{instance:e,listener:t,currentTarget:n}}function eu(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=Na(e,n),i!=null&&r.unshift(La(e,i,s)),i=Na(e,t),i!=null&&r.push(La(e,i,s))),e=e.return}return r}function wi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Zy(e,t,n,r,s){for(var i=t._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,s?(l=Na(n,i),l!=null&&o.unshift(La(n,l,a))):s||(l=Na(n,i),l!=null&&o.push(La(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Tj=/\r\n?/g,Pj=/\u0000|\uFFFD/g;function ev(e){return(typeof e=="string"?e:""+e).replace(Tj,` 38`).replace(Pj,"")}function Wl(e,t,n){if(t=ev(t),ev(e)!==t&&n)throw Error(B(425))}function tu(){}var _h=null,Eh=null;function Ch(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 Th=typeof setTimeout=="function"?setTimeout:void 0,jj=typeof clearTimeout=="function"?clearTimeout:void 0,tv=typeof Promise=="function"?Promise:void 0,Nj=typeof queueMicrotask=="function"?queueMicrotask:typeof tv<"u"?function(e){return tv.resolve(null).then(e).catch(Rj)}:Th;function Rj(e){setTimeout(function(){throw e})}function sf(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),Oa(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);Oa(t)}function cs(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 nv(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var No=Math.random().toString(36).slice(2),er="__reactFiber$"+No,$a="__reactProps$"+No,Cr="__reactContainer$"+No,Ph="__reactEvents$"+No,Aj="__reactListeners$"+No,Oj="__reactHandles$"+No;function zs(e){var t=e[er];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Cr]||n[er]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=nv(e);e!==null;){if(n=e[er])return n;e=nv(e)}return t}e=n,n=e.parentNode}return null}function vl(e){return e=e[er]||e[Cr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Fi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(B(33))}function Ju(e){return e[$a]||null}var jh=[],Ui=-1;function ks(e){return{current:e}}function Fe(e){0>Ui||(e.current=jh[Ui],jh[Ui]=null,Ui--)}function Ie(e,t){Ui++,jh[Ui]=e.current,e.current=t}var ys={},_t=ks(ys),Ut=ks(!1),ii=ys;function vo(e,t){var n=e.type.contextTypes;if(!n)return ys;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Vt(e){return e=e.childContextTypes,e!=null}function nu(){Fe(Ut),Fe(_t)}function rv(e,t,n){if(_t.current!==ys)throw Error(B(168));Ie(_t,t),Ie(Ut,n)}function qb(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(B(108,yP(e)||"Unknown",s));return He({},n,r)}function ru(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ys,ii=_t.current,Ie(_t,e),Ie(Ut,Ut.current),!0}function sv(e,t,n){var r=e.stateNode;if(!r)throw Error(B(169));n?(e=qb(e,t,ii),r.__reactInternalMemoizedMergedChildContext=e,Fe(Ut),Fe(_t),Ie(_t,e)):Fe(Ut),Ie(Ut,n)}var xr=null,Qu=!1,of=!1;function Kb(e){xr===null?xr=[e]:xr.push(e)}function Mj(e){Qu=!0,Kb(e)}function _s(){if(!of&&xr!==null){of=!0;var e=0,t=Ne;try{var n=xr;for(Ne=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}xr=null,Qu=!1}catch(s){throw xr!==null&&(xr=xr.slice(e+1)),vb(ym,_s),s}finally{Ne=t,of=!1}}return null}var Vi=[],Bi=0,su=null,iu=0,un=[],dn=0,oi=null,Sr=1,kr="";function Ds(e,t){Vi[Bi++]=iu,Vi[Bi++]=su,su=e,iu=t}function Gb(e,t,n){un[dn++]=Sr,un[dn++]=kr,un[dn++]=oi,oi=e;var r=Sr;e=kr;var s=32-Mn(r)-1;r&=~(1<<s),n+=1;var i=32-Mn(t)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,Sr=1<<32-Mn(t)+s|n<<s|r,kr=i+e}else Sr=1<<i|n<<s|r,kr=e}function Cm(e){e.return!==null&&(Ds(e,1),Gb(e,1,0))}function Tm(e){for(;e===su;)su=Vi[--Bi],Vi[Bi]=null,iu=Vi[--Bi],Vi[Bi]=null;for(;e===oi;)oi=un[--dn],un[dn]=null,kr=un[--dn],un[dn]=null,Sr=un[--dn],un[dn]=null}var Qt=null,Jt=null,Ue=!1,On=null;function Yb(e,t){var n=fn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function iv(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Qt=e,Jt=cs(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Qt=e,Jt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=oi!==null?{id:Sr,overflow:kr}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=fn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Qt=e,Jt=null,!0):!1;default:return!1}}function Nh(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Rh(e){if(Ue){var t=Jt;if(t){var n=t;if(!iv(e,t)){if(Nh(e))throw Error(B(418));t=cs(n.nextSibling);var r=Qt;t&&iv(e,t)?Yb(r,n):(e.flags=e.flags&-4097|2,Ue=!1,Qt=e)}}else{if(Nh(e))throw Error(B(418));e.flags=e.flags&-4097|2,Ue=!1,Qt=e}}}function ov(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Qt=e}function Hl(e){if(e!==Qt)return!1;if(!Ue)return ov(e),Ue=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ch(e.type,e.memoizedProps)),t&&(t=Jt)){if(Nh(e))throw Jb(),Error(B(418));for(;t;)Yb(e,t),t=cs(t.nextSibling)}if(ov(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317)
vendor: 25,627 bytes, lines 38-40
38);e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Jt=cs(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Jt=null}}else Jt=Qt?cs(e.stateNode.nextSibling):null;return!0}function Jb(){for(var e=Jt;e;)e=cs(e.nextSibling)}function wo(){Jt=Qt=null,Ue=!1}function Pm(e){On===null?On=[e]:On.push(e)}var Ij=Rr.ReactCurrentBatchConfig;function Jo(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(B(309));var r=n.stateNode}if(!r)throw Error(B(147,e));var s=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var a=s.refs;o===null?delete a[i]:a[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(B(284));if(!n._owner)throw Error(B(290,e))}return e}function ql(e,t){throw e=Object.prototype.toString.call(t),Error(B(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function av(e){var t=e._init;return t(e._payload)}function Qb(e){function t(w,y){if(e){var x=w.deletions;x===null?(w.deletions=[y],w.flags|=16):x.push(y)}}function n(w,y){if(!e)return null;for(;y!==null;)t(w,y),y=y.sibling;return null}function r(w,y){for(w=new Map;y!==null;)y.key!==null?w.set(y.key,y):w.set(y.index,y),y=y.sibling;return w}function s(w,y){return w=hs(w,y),w.index=0,w.sibling=null,w}function i(w,y,x){return w.index=x,e?(x=w.alternate,x!==null?(x=x.index,x<y?(w.flags|=2,y):x):(w.flags|=2,y)):(w.flags|=1048576,y)}function o(w){return e&&w.alternate===null&&(w.flags|=2),w}function a(w,y,x,S){return y===null||y.tag!==6?(y=hf(x,w.mode,S),y.return=w,y):(y=s(y,x),y.return=w,y)}function l(w,y,x,S){var k=x.type;return k===Ii?d(w,y,x.props.children,S,x.key):y!==null&&(y.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Wr&&av(k)===y.type)?(S=s(y,x.props),S.ref=Jo(w,y,x),S.return=w,S):(S=Ac(x.type,x.key,x.props,null,w.mode,S),S.ref=Jo(w,y,x),S.return=w,S)}function c(w,y,x,S){return y===null||y.tag!==4||y.stateNode.containerInfo!==x.containerInfo||y.stateNode.implementation!==x.implementation?(y=pf(x,w.mode,S),y.return=w,y):(y=s(y,x.children||[]),y.return=w,y)}function d(w,y,x,S,k){return y===null||y.tag!==7?(y=ni(x,w.mode,S,k),y.return=w,y):(y=s(y,x),y.return=w,y)}function f(w,y,x){if(typeof y=="string"&&y!==""||typeof y=="number")return y=hf(""+y,w.mode,x),y.return=w,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Il:return x=Ac(y.type,y.key,y.props,null,w.mode,x),x.ref=Jo(w,null,y),x.return=w,x;case Mi:return y=pf(y,w.mode,x),y.return=w,y;case Wr:var S=y._init;return f(w,S(y._payload),x)}if(oa(y)||Ho(y))return y=ni(y,w.mode,x,null),y.return=w,y;ql(w,y)}return null}function h(w,y,x,S){var k=y!==null?y.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return k!==null?null:a(w,y,""+x,S);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Il:return x.key===k?l(w,y,x,S):null;case Mi:return x.key===k?c(w,y,x,S):null;case Wr:return k=x._init,h(w,y,k(x._payload),S)}if(oa(x)||Ho(x))return k!==null?null:d(w,y,x,S,null);ql(w,x)}return null}function p(w,y,x,S,k){if(typeof S=="string"&&S!==""||typeof S=="number")return w=w.get(x)||null,a(y,w,""+S,k);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Il:return w=w.get(S.key===null?x:S.key)||null,l(y,w,S,k);case Mi:return w=w.get(S.key===null?x:S.key)||null,c(y,w,S,k);case Wr:var E=S._init;return p(w,y,x,E(S._payload),k)}if(oa(S)||Ho(S))return w=w.get(x)||null,d(y,w,S,k,null);ql(y,S)}return null}function v(w,y,x,S){for(var k=null,E=null,C=y,_=y=0,j=null;C!==null&&_<x.length;_++){C.index>_?(j=C,C=null):j=C.sibling;var T=h(w,C,x[_],S);if(T===null){C===null&&(C=j);break}e&&C&&T.alternate===null&&t(w,C),y=i(T,y,_),E===null?k=T:E.sibling=T,E=T,C=j}if(_===x.length)return n(w,C),Ue&&Ds(w,_),k;if(C===null){for(;_<x.length;_++)C=f(w,x[_],S),C!==null&&(y=i(C,y,_),E===null?k=C:E.sibling=C,E=C);return Ue&&Ds(w,_),k}for(C=r(w,C);_<x.length;_++)j=p(C,w,_,x[_],S),j!==null&&(e&&j.alternate!==null&&C.delete(j.key===null?_:j.key),y=i(j,y,_),E===null?k=j:E.sibling=j,E=j);return e&&C.forEach(function(I){return t(w,I)}),Ue&&Ds(w,_),k}function g(w,y,x,S){var k=Ho(x);if(typeof k!="function")throw Error(B(150));if(x=k.call(x),x==null)throw Error(B(151));for(var E=k=null,C=y,_=y=0,j=null,T=x.next();C!==null&&!T.done;_++,T=x.next()){C.index>_?(j=C,C=null):j=C.sibling;var I=h(w,C,T.value,S);if(I===null){C===null&&(C=j);break}e&&C&&I.alternate===null&&t(w,C),y=i(I,y,_),E===null?k=I:E.sibling=I,E=I,C=j}if(T.done)return n(w,C),Ue&&Ds(w,_),k;if(C===null){for(;!T.done;_++,T=x.next())T=f(w,T.value,S),T!==null&&(y=i(T,y,_),E===null?k=T:E.sibling=T,E=T);return Ue&&Ds(w,_),k}for(C=r(w,C);!T.done;_++,T=x.next())T=p(C,w,_,T.value,S),T!==null&&(e&&T.alternate!==null&&C.delete(T.key===null?_:T.key),y=i(T,y,_),E===null?k=T:E.sibling=T,E=T);return e&&C.forEach(function(M){return t(w,M)}),Ue&&Ds(w,_),k}function b(w,y,x,S){if(typeof x=="object"&&x!==null&&x.type===Ii&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Il:e:{for(var k=x.key,E=y;E!==null;){if(E.key===k){if(k=x.type,k===Ii){if(E.tag===7){n(w,E.sibling),y=s(E,x.props.children),y.return=w,w=y;break e}}else if(E.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Wr&&av(k)===E.type){n(w,E.sibling),y=s(E,x.props),y.ref=Jo(w,E,x),y.return=w,w=y;break e}n(w,E);break}else t(w,E);E=E.sibling}x.type===Ii?(y=ni(x.props.children,w.mode,S,x.key),y.return=w,w=y):(S=Ac(x.type,x.key,x.props,null,w.mode,S),S.ref=Jo(w,y,x),S.return=w,w=S)}return o(w);case Mi:e:{for(E=x.key;y!==null;){if(y.key===E)if(y.tag===4&&y.stateNode.containerInfo===x.containerInfo&&y.stateNode.implementation===x.implementation){n(w,y.sibling),y=s(y,x.children||[]),y.return=w,w=y;break e}else{n(w,y);break}else t(w,y);y=y.sibling}y=pf(x,w.mode,S),y.return=w,w=y}return o(w);case Wr:return E=x._init,b(w,y,E(x._payload),S)}if(oa(x))return v(w,y,x,S);if(Ho(x))return g(w,y,x,S);ql(w,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,y!==null&&y.tag===6?(n(w,y.sibling),y=s(y,x),y.return=w,w=y):(n(w,y),y=hf(x,w.mode,S),y.return=w,w=y),o(w)):n(w,y)}return b}var xo=Qb(!0),Xb=Qb(!1),ou=ks(null),au=null,zi=null,jm=null;function Nm(){jm=zi=au=null}function Rm(e){var t=ou.current;Fe(ou),e._currentValue=t}function Ah(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function to(e,t){au=e,jm=zi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ft=!0),e.firstContext=null)}function yn(e){var t=e._currentValue;if(jm!==e)if(e={context:e,memoizedValue:t,next:null},zi===null){if(au===null)throw Error(B(308));zi=e,au.dependencies={lanes:0,firstContext:e}}else zi=zi.next=e;return t}var Ws=null;function Am(e){Ws===null?Ws=[e]:Ws.push(e)}function Zb(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Am(t)):(n.next=s.next,s.next=n),t.interleaved=n,Tr(e,r)}function Tr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Hr=!1;function Om(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function e1(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 _r(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function us(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,_e&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,Tr(e,n)}return s=r.interleaved,s===null?(t.next=t,Am(r)):(t.next=s.next,s.next=t),r.interleaved=t,Tr(e,n)}function Cc(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,vm(e,n)}}function lv(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function lu(e,t,n,r){var s=e.updateQueue;Hr=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?i=c:o.next=c,o=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(i!==null){var f=s.baseState;o=0,d=c=l=null,a=i;do{var h=a.lane,p=a.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=e,g=a;switch(h=t,p=n,g.tag){case 1:if(v=g.payload,typeof v=="function"){f=v.call(p,f,h);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=g.payload,h=typeof v=="function"?v.call(p,f,h):v,h==null)break e;f=He({},f,h);break e;case 2:Hr=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[a]:h.push(a))}else p={eventTime:p,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=p,l=f):d=d.next=p,o|=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 o|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);li|=o,e.lanes=o,e.memoizedState=f}}function cv(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(B(191,s));s.call(r)}}}var wl={},sr=ks(wl),Fa=ks(wl),Ua=ks(wl);function Hs(e){if(e===wl)throw Error(B(174));return e}function Mm(e,t){switch(Ie(Ua,t),Ie(Fa,e),Ie(sr,wl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:fh(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=fh(t,e)}Fe(sr),Ie(sr,t)}function bo(){Fe(sr),Fe(Fa),Fe(Ua)}function t1(e){Hs(Ua.current);var t=Hs(sr.current),n=fh(t,e.type);t!==n&&(Ie(Fa,e),Ie(sr,n))}function Im(e){Fa.current===e&&(Fe(sr),Fe(Fa))}var ze=ks(0);function cu(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.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 af=[];function Dm(){for(var e=0;e<af.length;e++)af[e]._workInProgressVersionPrimary=null;af.length=0}var Tc=Rr.ReactCurrentDispatcher,lf=Rr.ReactCurrentBatchConfig,ai=0,We=null,ot=null,ct=null,uu=!1,ya=!1,Va=0,Dj=0;function xt(){throw Error(B(321))}function Lm(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ln(e[n],t[n]))return!1;return!0}function $m(e,t,n,r,s,i){if(ai=i,We=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Tc.current=e===null||e.memoizedState===null?Uj:Vj,e=n(r,s),ya){i=0;do{if(ya=!1,Va=0,25<=i)throw Error(B(301));i+=1,ct=ot=null,t.updateQueue=null,Tc.current=Bj,e=n(r,s)}while(ya)}if(Tc.current=du,t=ot!==null&&ot.next!==null,ai=0,ct=ot=We=null,uu=!1,t)throw Error(B(300));return e}function Fm(){var e=Va!==0;return Va=0,e}function Gn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ct===null?We.memoizedState=ct=e:ct=ct.next=e,ct}function vn(){if(ot===null){var e=We.alternate;e=e!==null?e.memoizedState:null}else e=ot.next;var t=ct===null?We.memoizedState:ct.next;if(t!==null)ct=t,ot=e;else{if(e===null)throw Error(B(310));ot=e,e={memoizedState:ot.memoizedState,baseState:ot.baseState,baseQueue:ot.baseQueue,queue:ot.queue,next:null},ct===null?We.memoizedState=ct=e:ct=ct.next=e}return ct}function Ba(e,t){return typeof t=="function"?t(e):t}function cf(e){var t=vn(),n=t.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=e;var r=ot,s=r.baseQueue,i=n.pending;if(i!==null){if(s!==null){var o=s.next;s.next=i.next,i.next=o}r.baseQueue=s=i,n.pending=null}if(s!==null){i=s.next,r=r.baseState;var a=o=null,l=null,c=i;do{var d=c.lane;if((ai&d)===d)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var f={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=f,o=r):l=l.next=f,We.lanes|=d,li|=d}c=c.next}while(c!==null&&c!==i);l===null?o=r:l.next=a,Ln(r,t.memoizedState)||(Ft=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do i=s.lane,We.lanes|=i,li|=i,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function uf(e){var t=vn(),n=t.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,i=t.memoizedState;if(s!==null){n.pending=null;var o=s=s.next;do i=e(i,o.action),o=o.next;while(o!==s);Ln(i,t.memoizedState)||(Ft=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function n1(){}function r1(e,t){var n=We,r=vn(),s=t(),i=!Ln(r.memoizedState,s);if(i&&(r.memoizedState=s,Ft=!0),r=r.queue,Um(o1.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||ct!==null&&ct.memoizedState.tag&1){if(n.flags|=2048,za(9,i1.bind(null,n,r,s,t),void 0,null),ut===null)throw Error(B(349));ai&30||s1(n,t,s)}return s}function s1(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=We.updateQueue,t===null?(t={lastEffect:null,stores:null},We.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function i1(e,t,n,r){t.value=n,t.getSnapshot=r,a1(t)&&l1(e)}function o1(e,t,n){return n(function(){a1(t)&&l1(e)})}function a1(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ln(e,n)}catch{return!0}}function l1(e){var t=Tr(e,1);t!==null&&In(t,e,1,-1)}function uv(e){var t=Gn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ba,lastRenderedState:e},t.queue=e,e=e.dispatch=Fj.bind(null,We,e),[t.memoizedState,e]}function za(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=We.updateQueue,t===null?(t={lastEffect:null,stores:null},We.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function c1(){return vn().memoizedState}function Pc(e,t,n,r){var s=Gn();We.flags|=e,s.memoizedState=za(1|t,n,void 0,r===void 0?null:r)}function Xu(e,t,n,r){var s=vn();r=r===void 0?null:r;var i=void 0;if(ot!==null){var o=ot.memoizedState;if(i=o.destroy,r!==null&&Lm(r,o.deps)){s.memoizedState=za(t,n,i,r);return}}We.flags|=e,s.memoizedState=za(1|t,n,i,r)}function dv(e,t){return Pc(8390656,8,e,t)}function Um(e,t){return Xu(2048,8,e,t)}function u1(e,t){return Xu(4,2,e,t)}function d1(e,t){return Xu(4,4,e,t)}function f1(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 h1(e,t,n){return n=n!=null?n.concat([e]):null,Xu(4,4,f1.bind(null,t,e),n)}function Vm(){}function p1(e,t){var n=vn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Lm(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function m1(e,t){var n=vn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Lm(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function g1(e,t,n){return ai&21?(Ln(n,t)||(n=bb(),We.lanes|=n,li|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ft=!0),e.memoizedState=n)}function Lj(e,t){var n=Ne;Ne=n!==0&&4>n?n:4,e(!0);var r=lf.transition;lf.transition={};try{e(!1),t()}finally{Ne=n,lf.transition=r}}function y1(){return vn().memoizedState}function $j(e,t,n){var r=fs(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},v1(e))w1(t,n);else if(n=Zb(e,t,n,r),n!==null){var s=At();In(n,e,r,s),x1(n,t,r)}}function Fj(e,t,n){var r=fs(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(v1(e))w1(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,a=i(o,n);if(s.hasEagerState=!0,s.eagerState=a,Ln(a,o)){var l=t.interleaved;l===null?(s.next=s,Am(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}n=Zb(e,t,s,r),n!==null&&(s=At(),In(n,e,r,s),x1(n,t,r))}}function v1(e){var t=e.alternate;return e===We||t!==null&&t===We}function w1(e,t){ya=uu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function x1(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,vm(e,n)}}var du={readContext:yn,useCallback:xt,useContext:xt,useEffect:xt,useImperativeHandle:xt,useInsertionEffect:xt,useLayoutEffect:xt,useMemo:xt,useReducer:xt,useRef:xt,useState:xt,useDebugValue:xt,useDeferredValue:xt,useTransition:xt,useMutableSource:xt,useSyncExternalStore:xt,useId:xt,unstable_isNewReconciler:!1},Uj={readContext:yn,useCallback:function(e,t){return Gn().memoizedState=[e,t===void 0?null:t],e},useContext:yn,useEffect:dv,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Pc(4194308,4,f1.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Pc(4194308,4,e,t)},useInsertionEffect:function(e,t){return Pc(4,2,e,t)},useMemo:function(e,t){var n=Gn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Gn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=$j.bind(null,We,e),[r.memoizedState,e]},useRef:function(e){var t=Gn();return e={current:e},t.memoizedState=e},useState:uv,useDebugValue:Vm,useDeferredValue:function(e){return Gn().memoizedState=e},useTransition:function(){var e=uv(!1),t=e[0];return e=Lj.bind(null,e[1]),Gn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=We,s=Gn();if(Ue){if(n===void 0)throw Error(B(407));n=n()}else{if(n=t(),ut===null)throw Error(B(349));ai&30||s1(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,dv(o1.bind(null,r,i,e),[e]),r.flags|=2048,za(9,i1.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Gn(),t=ut.identifierPrefix;if(Ue){var n=kr,r=Sr;n=(r&~(1<<32-Mn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Va++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Dj++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Vj={readContext:yn,useCallback:p1,useContext:yn,useEffect:Um,useImperativeHandle:h1,useInsertionEffect:u1,useLayoutEffect:d1,useMemo:m1,useReducer:cf,useRef:c1,useState:function(){return cf(Ba)},useDebugValue:Vm,useDeferredValue:function(e){var t=vn();return g1(t,ot.memoizedState,e)},useTransition:function(){var e=cf(Ba)[0],t=vn().memoizedState;return[e,t]},useMutableSource:n1,useSyncExternalStore:r1,useId:y1,unstable_isNewReconciler:!1},Bj={readContext:yn,useCallback:p1,useContext:yn,useEffect:Um,useImperativeHandle:h1,useInsertionEffect:u1,useLayoutEffect:d1,useMemo:m1,useReducer:uf,useRef:c1,useState:function(){return uf(Ba)},useDebugValue:Vm,useDeferredValue:function(e){var t=vn();return ot===null?t.memoizedState=e:g1(t,ot.memoizedState,e)},useTransition:function(){var e=uf(Ba)[0],t=vn().memoizedState;return[e,t]},useMutableSource:n1,useSyncExternalStore:r1,useId:y1,unstable_isNewReconciler:!1};function Cn(e,t){if(e&&e.defaultProps){t=He({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Oh(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:He({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Zu={isMounted:function(e){return(e=e._reactInternals)?pi(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=At(),s=fs(e),i=_r(r,s);i.payload=t,n!=null&&(i.callback=n),t=us(e,i,s),t!==null&&(In(t,e,s,r),Cc(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=At(),s=fs(e),i=_r(r,s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=us(e,i,s),t!==null&&(In(t,e,s,r),Cc(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=At(),r=fs(e),s=_r(n,r);s.tag=2,t!=null&&(s.callback=t),t=us(e,s,r),t!==null&&(In(t,e,r,n),Cc(t,e,r))}};function fv(e,t,n,r,s,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!Ia(n,r)||!Ia(s,i):!0}function b1(e,t,n){var r=!1,s=ys,i=t.contextType;return typeof i=="object"&&i!==null?i=yn(i):(s=Vt(t)?ii:_t.current,r=t.contextTypes,i=(r=r!=null)?vo(e,s):ys),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Zu,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function hv(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Zu.enqueueReplaceState(t,t.state,null)}function Mh(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},Om(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=yn(i):(i=Vt(t)?ii:_t.current,s.context=vo(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Oh(e,t,i,n),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&&Zu.enqueueReplaceState(s,s.state,null),lu(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function So(e,t){try{var n="",r=t;do n+=gP(r),r=r.return;while(r);var s=n}catch(i){s=` 39Error generating stack: `+i.message+` 40`+i.stack}return{value:e,source:t,stack:s,digest:null}}function df(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ih(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var zj=typeof WeakMap=="function"?WeakMap:Map;function S1(e,t,n){n=_r(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){hu||(hu=!0,Hh=r),Ih(e,t)},n}function k1(e,t,n){n=_r(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){Ih(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Ih(e,t),typeof r!="function"&&(ds===null?ds=new Set([this]):ds.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function pv(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new zj;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=r2.bind(null,e,t,n),t.then(e,e))}function mv(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 gv(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=_r(-1,1),t.tag=2,us(n,t,1))),n.lanes|=1),e)}var Wj=Rr.ReactCurrentOwner,Ft=!1;function Ct(e,t,n,r){t.child=e===null?Xb(t,null,n,r):xo(t,e.child,n,r)}function yv(e,t,n,r,s){n=n.render;var i=t.ref;return to(t,s),r=$m(e,t,n,r,i,s),n=Fm(),e!==null&&!Ft?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Pr(e,t,s)):(Ue&&n&&Cm(t),t.flags|=1,Ct(e,t,r,s),t.child)}function vv(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!Ym(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,_1(e,t,i,r,s)):(e=Ac(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:Ia,n(o,r)&&e.ref===t.ref)return Pr(e,t,s)}return t.flags|=1,e=hs(i,r),e.ref=t.ref,e.return=t,t.child=e}function _1(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(Ia(i,r)&&e.ref===t.ref)if(Ft=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(Ft=!0);else return t.lanes=e.lanes,Pr(e,t,s)}return Dh(e,t,n,r,s)}function E1(e,t,n){var r=t.pendingProps,s=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ie(Hi,Kt),Kt|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ie(Hi,Kt),Kt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Ie(Hi,Kt),Kt|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Ie(Hi,Kt),Kt|=r;return Ct(e,t,s,n),t.child}function C1(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}
vendor: 6,726 bytes, line 40
40function Dh(e,t,n,r,s){var i=Vt(n)?ii:_t.current;return i=vo(t,i),to(t,s),n=$m(e,t,n,r,i,s),r=Fm(),e!==null&&!Ft?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Pr(e,t,s)):(Ue&&r&&Cm(t),t.flags|=1,Ct(e,t,n,s),t.child)}function wv(e,t,n,r,s){if(Vt(n)){var i=!0;ru(t)}else i=!1;if(to(t,s),t.stateNode===null)jc(e,t),b1(t,n,r),Mh(t,n,r,s),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=yn(c):(c=Vt(n)?ii:_t.current,c=vo(t,c));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==c)&&hv(t,o,r,c),Hr=!1;var h=t.memoizedState;o.state=h,lu(t,r,o,s),l=t.memoizedState,a!==r||h!==l||Ut.current||Hr?(typeof d=="function"&&(Oh(t,n,d,r),l=t.memoizedState),(a=Hr||fv(t,n,a,r,h,l,c))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=c,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,e1(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:Cn(t.type,a),o.props=c,f=t.pendingProps,h=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=yn(l):(l=Vt(n)?ii:_t.current,l=vo(t,l));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==f||h!==l)&&hv(t,o,r,l),Hr=!1,h=t.memoizedState,o.state=h,lu(t,r,o,s);var v=t.memoizedState;a!==f||h!==v||Ut.current||Hr?(typeof p=="function"&&(Oh(t,n,p,r),v=t.memoizedState),(c=Hr||fv(t,n,c,r,h,v,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,v,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,v,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=v),o.props=r,o.state=v,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Lh(e,t,n,r,i,s)}function Lh(e,t,n,r,s,i){C1(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return s&&sv(t,n,!1),Pr(e,t,i);r=t.stateNode,Wj.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=xo(t,e.child,null,i),t.child=xo(t,null,a,i)):Ct(e,t,a,i),t.memoizedState=r.state,s&&sv(t,n,!0),t.child}function T1(e){var t=e.stateNode;t.pendingContext?rv(e,t.pendingContext,t.pendingContext!==t.context):t.context&&rv(e,t.context,!1),Mm(e,t.containerInfo)}function xv(e,t,n,r,s){return wo(),Pm(s),t.flags|=256,Ct(e,t,n,r),t.child}var $h={dehydrated:null,treeContext:null,retryLane:0};function Fh(e){return{baseLanes:e,cachePool:null,transitions:null}}function P1(e,t,n){var r=t.pendingProps,s=ze.current,i=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),Ie(ze,s&1),e===null)return Rh(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):(o=r.children,e=r.fallback,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=nd(o,r,0,null),e=ni(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Fh(n),t.memoizedState=$h,e):Bm(t,o));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return Hj(e,t,o,r,a,s,n);if(i){i=r.fallback,o=t.mode,s=e.child,a=s.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=hs(s,l),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=hs(a,i):(i=ni(i,o,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,o=e.child.memoizedState,o=o===null?Fh(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=$h,r}return i=e.child,e=i.sibling,r=hs(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Bm(e,t){return t=nd({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Kl(e,t,n,r){return r!==null&&Pm(r),xo(t,e.child,null,n),e=Bm(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Hj(e,t,n,r,s,i,o){if(n)return t.flags&256?(t.flags&=-257,r=df(Error(B(422))),Kl(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=nd({mode:"visible",children:r.children},s,0,null),i=ni(i,s,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&xo(t,e.child,null,o),t.child.memoizedState=Fh(o),t.memoizedState=$h,i);if(!(t.mode&1))return Kl(e,t,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(B(419)),r=df(i,r,void 0),Kl(e,t,o,r)}if(a=(o&e.childLanes)!==0,Ft||a){if(r=ut,r!==null){switch(o&-o){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&(r.suspendedLanes|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,Tr(e,s),In(r,e,s,-1))}return Gm(),r=df(Error(B(421))),Kl(e,t,o,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=s2.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,Jt=cs(s.nextSibling),Qt=t,Ue=!0,On=null,e!==null&&(un[dn++]=Sr,un[dn++]=kr,un[dn++]=oi,Sr=e.id,kr=e.overflow,oi=t),t=Bm(t,r.children),t.flags|=4096,t)}function bv(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ah(e.return,t,n)}
vendor: 5,381 bytes, line 40
40function ff(e,t,n,r,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function j1(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(Ct(e,t,r.children,n),r=ze.current,r&2)r=r&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&&bv(e,n,t);else if(e.tag===19)bv(e,n,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}r&=1}if(Ie(ze,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&cu(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),ff(t,!1,s,n,i);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&cu(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}ff(t,!0,n,null,i);break;case"together":ff(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function jc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Pr(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),li|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(B(153));if(t.child!==null){for(e=t.child,n=hs(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=hs(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function qj(e,t,n){switch(t.tag){case 3:T1(t),wo();break;case 5:t1(t);break;case 1:Vt(t.type)&&ru(t);break;case 4:Mm(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;Ie(ou,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ie(ze,ze.current&1),t.flags|=128,null):n&t.child.childLanes?P1(e,t,n):(Ie(ze,ze.current&1),e=Pr(e,t,n),e!==null?e.sibling:null);Ie(ze,ze.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return j1(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Ie(ze,ze.current),r)break;return null;case 22:case 23:return t.lanes=0,E1(e,t,n)}return Pr(e,t,n)}var N1,Uh,R1,A1;N1=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Uh=function(){};R1=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,Hs(sr.current);var i=null;switch(n){case"input":s=lh(e,s),r=lh(e,r),i=[];break;case"select":s=He({},s,{value:void 0}),r=He({},r,{value:void 0}),i=[];break;case"textarea":s=dh(e,s),r=dh(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=tu)}hh(n,r);var o;n=null;for(c in s)if(!r.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var a=s[c];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Pa.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var l=r[c];if(a=s!=null?s[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(i||(i=[]),i.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Pa.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Le("scroll",e),i||a===l||(i=[])):(i=i||[]).push(c,l))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};A1=function(e,t,n,r){n!==r&&(t.flags|=4)};function Qo(e,t){if(!Ue)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function bt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Kj(e,t,n){var r=t.pendingProps;switch(Tm(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bt(t),null;case 1:return Vt(t.type)&&nu(),bt(t),null;case 3:return r=t.stateNode,bo(),Fe(Ut),Fe(_t),Dm(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Hl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,On!==null&&(Gh(On),On=null))),Uh(e,t),bt(t),null;case 5:Im(t);var s=Hs(Ua.current);
vendor: 29,713 bytes, line 40
40if(n=t.type,e!==null&&t.stateNode!=null)R1(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(B(166));return bt(t),null}if(e=Hs(sr.current),Hl(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[er]=t,r[$a]=i,e=(t.mode&1)!==0,n){case"dialog":Le("cancel",r),Le("close",r);break;case"iframe":case"object":case"embed":Le("load",r);break;case"video":case"audio":for(s=0;s<la.length;s++)Le(la[s],r);break;case"source":Le("error",r);break;case"img":case"image":case"link":Le("error",r),Le("load",r);break;case"details":Le("toggle",r);break;case"input":Ny(r,i),Le("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Le("invalid",r);break;case"textarea":Ay(r,i),Le("invalid",r)}hh(n,i),s=null;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];o==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&Wl(r.textContent,a,e),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Wl(r.textContent,a,e),s=["children",""+a]):Pa.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&Le("scroll",r)}switch(n){case"input":Dl(r),Ry(r,i,!0);break;case"textarea":Dl(r),Oy(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=tu)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=ob(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[er]=t,e[$a]=r,N1(e,t,!1,!1),t.stateNode=e;e:{switch(o=ph(n,r),n){case"dialog":Le("cancel",e),Le("close",e),s=r;break;case"iframe":case"object":case"embed":Le("load",e),s=r;break;case"video":case"audio":for(s=0;s<la.length;s++)Le(la[s],e);s=r;break;case"source":Le("error",e),s=r;break;case"img":case"image":case"link":Le("error",e),Le("load",e),s=r;break;case"details":Le("toggle",e),s=r;break;case"input":Ny(e,r),s=lh(e,r),Le("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=He({},r,{value:void 0}),Le("invalid",e);break;case"textarea":Ay(e,r),s=dh(e,r),Le("invalid",e);break;default:s=r}hh(n,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?cb(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&ab(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&ja(e,l):typeof l=="number"&&ja(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Pa.hasOwnProperty(i)?l!=null&&i==="onScroll"&&Le("scroll",e):l!=null&&fm(e,i,l,o))}switch(n){case"input":Dl(e),Ry(e,r,!1);break;case"textarea":Dl(e),Oy(e);break;case"option":r.value!=null&&e.setAttribute("value",""+gs(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Qi(e,!!r.multiple,i,!1):r.defaultValue!=null&&Qi(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=tu)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return bt(t),null;case 6:if(e&&t.stateNode!=null)A1(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(B(166));if(n=Hs(Ua.current),Hs(sr.current),Hl(t)){if(r=t.stateNode,n=t.memoizedProps,r[er]=t,(i=r.nodeValue!==n)&&(e=Qt,e!==null))switch(e.tag){case 3:Wl(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Wl(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[er]=t,t.stateNode=r}return bt(t),null;case 13:if(Fe(ze),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ue&&Jt!==null&&t.mode&1&&!(t.flags&128))Jb(),wo(),t.flags|=98560,i=!1;else if(i=Hl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(B(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(B(317));i[er]=t}else wo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;bt(t),i=!1}else On!==null&&(Gh(On),On=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||ze.current&1?at===0&&(at=3):Gm())),t.updateQueue!==null&&(t.flags|=4),bt(t),null);case 4:return bo(),Uh(e,t),e===null&&Da(t.stateNode.containerInfo),bt(t),null;case 10:return Rm(t.type._context),bt(t),null;case 17:return Vt(t.type)&&nu(),bt(t),null;case 19:if(Fe(ze),i=t.memoizedState,i===null)return bt(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)Qo(i,!1);else{if(at!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=cu(e),o!==null){for(t.flags|=128,Qo(i,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ie(ze,ze.current&1|2),t.child}e=e.sibling}i.tail!==null&&Xe()>ko&&(t.flags|=128,r=!0,Qo(i,!1),t.lanes=4194304)}else{if(!r)if(e=cu(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Qo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Ue)return bt(t),null}else 2*Xe()-i.renderingStartTime>ko&&n!==1073741824&&(t.flags|=128,r=!0,Qo(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Xe(),t.sibling=null,n=ze.current,Ie(ze,r?n&1|2:n&1),t):(bt(t),null);case 22:case 23:return Km(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Kt&1073741824&&(bt(t),t.subtreeFlags&6&&(t.flags|=8192)):bt(t),null;case 24:return null;case 25:return null}throw Error(B(156,t.tag))}function Gj(e,t){switch(Tm(t),t.tag){case 1:return Vt(t.type)&&nu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return bo(),Fe(Ut),Fe(_t),Dm(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Im(t),null;case 13:if(Fe(ze),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(B(340));wo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Fe(ze),null;case 4:return bo(),null;case 10:return Rm(t.type._context),null;case 22:case 23:return Km(),null;case 24:return null;default:return null}}var Gl=!1,kt=!1,Yj=typeof WeakSet=="function"?WeakSet:Set,Q=null;function Wi(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Je(e,t,r)}else n.current=null}function Vh(e,t,n){try{n()}catch(r){Je(e,t,r)}}var Sv=!1;function Jj(e,t){if(_h=Xc,e=Lb(),Em(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,c=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==n||s!==0&&f.nodeType!==3||(a=o+s),f!==i||r!==0&&f.nodeType!==3||(l=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++c===s&&(a=o),h===i&&++d===r&&(l=o),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Eh={focusedElem:e,selectionRange:n},Xc=!1,Q=t;Q!==null;)if(t=Q,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Q=e;else for(;Q!==null;){t=Q;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var g=v.memoizedProps,b=v.memoizedState,w=t.stateNode,y=w.getSnapshotBeforeUpdate(t.elementType===t.type?g:Cn(t.type,g),b);w.__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(B(163))}}catch(S){Je(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,Q=e;break}Q=t.return}return v=Sv,Sv=!1,v}function va(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&Vh(t,n,i)}s=s.next}while(s!==r)}}function ed(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Bh(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function O1(e){var t=e.alternate;t!==null&&(e.alternate=null,O1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[er],delete t[$a],delete t[Ph],delete t[Aj],delete t[Oj])),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 M1(e){return e.tag===5||e.tag===3||e.tag===4}function kv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||M1(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 zh(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=tu));else if(r!==4&&(e=e.child,e!==null))for(zh(e,t,n),e=e.sibling;e!==null;)zh(e,t,n),e=e.sibling}function Wh(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Wh(e,t,n),e=e.sibling;e!==null;)Wh(e,t,n),e=e.sibling}var ht=null,Rn=!1;function Dr(e,t,n){for(n=n.child;n!==null;)I1(e,t,n),n=n.sibling}function I1(e,t,n){if(rr&&typeof rr.onCommitFiberUnmount=="function")try{rr.onCommitFiberUnmount(qu,n)}catch{}switch(n.tag){case 5:kt||Wi(n,t);case 6:var r=ht,s=Rn;ht=null,Dr(e,t,n),ht=r,Rn=s,ht!==null&&(Rn?(e=ht,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ht.removeChild(n.stateNode));break;case 18:ht!==null&&(Rn?(e=ht,n=n.stateNode,e.nodeType===8?sf(e.parentNode,n):e.nodeType===1&&sf(e,n),Oa(e)):sf(ht,n.stateNode));break;case 4:r=ht,s=Rn,ht=n.stateNode.containerInfo,Rn=!0,Dr(e,t,n),ht=r,Rn=s;break;case 0:case 11:case 14:case 15:if(!kt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Vh(n,t,o),s=s.next}while(s!==r)}Dr(e,t,n);break;case 1:if(!kt&&(Wi(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Je(n,t,a)}Dr(e,t,n);break;case 21:Dr(e,t,n);break;case 22:n.mode&1?(kt=(r=kt)||n.memoizedState!==null,Dr(e,t,n),kt=r):Dr(e,t,n);break;default:Dr(e,t,n)}}function _v(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Yj),t.forEach(function(r){var s=i2.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function bn(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:ht=a.stateNode,Rn=!1;break e;case 3:ht=a.stateNode.containerInfo,Rn=!0;break e;case 4:ht=a.stateNode.containerInfo,Rn=!0;break e}a=a.return}if(ht===null)throw Error(B(160));I1(i,o,s),ht=null,Rn=!1;var l=s.alternate;l!==null&&(l.return=null),s.return=null}catch(c){Je(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)D1(t,e),t=t.sibling}function D1(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(bn(t,e),Kn(e),r&4){try{va(3,e,e.return),ed(3,e)}catch(g){Je(e,e.return,g)}try{va(5,e,e.return)}catch(g){Je(e,e.return,g)}}break;case 1:bn(t,e),Kn(e),r&512&&n!==null&&Wi(n,n.return);break;case 5:if(bn(t,e),Kn(e),r&512&&n!==null&&Wi(n,n.return),e.flags&32){var s=e.stateNode;try{ja(s,"")}catch(g){Je(e,e.return,g)}}if(r&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&sb(s,i),ph(a,o);var c=ph(a,i);for(o=0;o<l.length;o+=2){var d=l[o],f=l[o+1];d==="style"?cb(s,f):d==="dangerouslySetInnerHTML"?ab(s,f):d==="children"?ja(s,f):fm(s,d,f,c)}switch(a){case"input":ch(s,i);break;case"textarea":ib(s,i);break;case"select":var h=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?Qi(s,!!i.multiple,p,!1):h!==!!i.multiple&&(i.defaultValue!=null?Qi(s,!!i.multiple,i.defaultValue,!0):Qi(s,!!i.multiple,i.multiple?[]:"",!1))}s[$a]=i}catch(g){Je(e,e.return,g)}}break;case 6:if(bn(t,e),Kn(e),r&4){if(e.stateNode===null)throw Error(B(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(g){Je(e,e.return,g)}}break;case 3:if(bn(t,e),Kn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Oa(t.containerInfo)}catch(g){Je(e,e.return,g)}break;case 4:bn(t,e),Kn(e);break;case 13:bn(t,e),Kn(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(Hm=Xe())),r&4&&_v(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(kt=(c=kt)||d,bn(t,e),kt=c):bn(t,e),Kn(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(Q=e,d=e.child;d!==null;){for(f=Q=d;Q!==null;){switch(h=Q,p=h.child,h.tag){case 0:case 11:case 14:case 15:va(4,h,h.return);break;case 1:Wi(h,h.return);var v=h.stateNode;if(typeof v.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(g){Je(r,n,g)}}break;case 5:Wi(h,h.return);break;case 22:if(h.memoizedState!==null){Cv(f);continue}}p!==null?(p.return=h,Q=p):Cv(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{s=f.stateNode,c?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=f.stateNode,l=f.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=lb("display",o))}catch(g){Je(e,e.return,g)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(g){Je(e,e.return,g)}}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:bn(t,e),Kn(e),r&4&&_v(e);break;case 21:break;default:bn(t,e),Kn(e)}}function Kn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(M1(n)){var r=n;break e}n=n.return}throw Error(B(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(ja(s,""),r.flags&=-33);var i=kv(e);Wh(e,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,a=kv(e);zh(e,a,o);break;default:throw Error(B(161))}}catch(l){Je(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Qj(e,t,n){Q=e,L1(e)}function L1(e,t,n){for(var r=(e.mode&1)!==0;Q!==null;){var s=Q,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||Gl;if(!o){var a=s.alternate,l=a!==null&&a.memoizedState!==null||kt;a=Gl;var c=kt;if(Gl=o,(kt=l)&&!c)for(Q=s;Q!==null;)o=Q,l=o.child,o.tag===22&&o.memoizedState!==null?Tv(s):l!==null?(l.return=o,Q=l):Tv(s);for(;i!==null;)Q=i,L1(i),i=i.sibling;Q=s,Gl=a,kt=c}Ev(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,Q=i):Ev(e)}}function Ev(e){for(;Q!==null;){var t=Q;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:kt||ed(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!kt)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:Cn(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&cv(t,i,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}cv(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.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&&Oa(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(B(163))}kt||t.flags&512&&Bh(t)}catch(h){Je(t,t.return,h)}}if(t===e){Q=null;break}if(n=t.sibling,n!==null){n.return=t.return,Q=n;break}Q=t.return}}function Cv(e){for(;Q!==null;){var t=Q;if(t===e){Q=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Q=n;break}Q=t.return}}function Tv(e){for(;Q!==null;){var t=Q;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ed(4,t)}catch(l){Je(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(l){Je(t,s,l)}}var i=t.return;try{Bh(t)}catch(l){Je(t,i,l)}break;case 5:var o=t.return;try{Bh(t)}catch(l){Je(t,o,l)}}}catch(l){Je(t,t.return,l)}if(t===e){Q=null;break}var a=t.sibling;if(a!==null){a.return=t.return,Q=a;break}Q=t.return}}var Xj=Math.ceil,fu=Rr.ReactCurrentDispatcher,zm=Rr.ReactCurrentOwner,pn=Rr.ReactCurrentBatchConfig,_e=0,ut=null,rt=null,gt=0,Kt=0,Hi=ks(0),at=0,Wa=null,li=0,td=0,Wm=0,wa=null,$t=null,Hm=0,ko=1/0,vr=null,hu=!1,Hh=null,ds=null,Yl=!1,rs=null,pu=0,xa=0,qh=null,Nc=-1,Rc=0;function At(){return _e&6?Xe():Nc!==-1?Nc:Nc=Xe()}function fs(e){return e.mode&1?_e&2&>!==0?gt&-gt:Ij.transition!==null?(Rc===0&&(Rc=bb()),Rc):(e=Ne,e!==0||(e=window.event,e=e===void 0?16:Pb(e.type)),e):1}function In(e,t,n,r){if(50<xa)throw xa=0,qh=null,Error(B(185));gl(e,n,r),(!(_e&2)||e!==ut)&&(e===ut&&(!(_e&2)&&(td|=n),at===4&&Gr(e,gt)),Bt(e,r),n===1&&_e===0&&!(t.mode&1)&&(ko=Xe()+500,Qu&&_s()))}function Bt(e,t){var n=e.callbackNode;IP(e,t);var r=Qc(e,e===ut?gt:0);if(r===0)n!==null&&Dy(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Dy(n),t===1)e.tag===0?Mj(Pv.bind(null,e)):Kb(Pv.bind(null,e)),Nj(function(){!(_e&6)&&_s()}),n=null;else{switch(Sb(r)){case 1:n=ym;break;case 4:n=wb;break;case 16:n=Jc;break;case 536870912:n=xb;break;default:n=Jc}n=H1(n,$1.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function $1(e,t){if(Nc=-1,Rc=0,_e&6)throw Error(B(327));var n=e.callbackNode;if(no()&&e.callbackNode!==n)return null;var r=Qc(e,e===ut?gt:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=mu(e,r);else{t=r;var s=_e;_e|=2;var i=U1();(ut!==e||gt!==t)&&(vr=null,ko=Xe()+500,ti(e,t));do try{t2();break}catch(a){F1(e,a)}while(!0);Nm(),fu.current=i,_e=s,rt!==null?t=0:(ut=null,gt=0,t=at)}if(t!==0){if(t===2&&(s=wh(e),s!==0&&(r=s,t=Kh(e,s))),t===1)throw n=Wa,ti(e,0),Gr(e,r),Bt(e,Xe()),n;if(t===6)Gr(e,r);else{if(s=e.current.alternate,!(r&30)&&!Zj(s)&&(t=mu(e,r),t===2&&(i=wh(e),i!==0&&(r=i,t=Kh(e,i))),t===1))throw n=Wa,ti(e,0),Gr(e,r),Bt(e,Xe()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(B(345));case 2:Ls(e,$t,vr);break;case 3:if(Gr(e,r),(r&130023424)===r&&(t=Hm+500-Xe(),10<t)){if(Qc(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){At(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Th(Ls.bind(null,e,$t,vr),t);break}Ls(e,$t,vr);break;case 4:if(Gr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var o=31-Mn(r);i=1<<o,o=t[o],o>s&&(s=o),r&=~i}if(r=s,r=Xe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Xj(r/1960))-r,10<r){e.timeoutHandle=Th(Ls.bind(null,e,$t,vr),r);break}Ls(e,$t,vr);break;case 5:Ls(e,$t,vr);break;default:throw Error(B(329))}}}return Bt(e,Xe()),e.callbackNode===n?$1.bind(null,e):null}function Kh(e,t){var n=wa;return e.current.memoizedState.isDehydrated&&(ti(e,t).flags|=256),e=mu(e,t),e!==2&&(t=$t,$t=n,t!==null&&Gh(t)),e}function Gh(e){$t===null?$t=e:$t.push.apply($t,e)}function Zj(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],i=s.getSnapshot;s=s.value;try{if(!Ln(i(),s))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 Gr(e,t){for(t&=~Wm,t&=~td,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Mn(t),r=1<<n;e[n]=-1,t&=~r}}function Pv(e){if(_e&6)throw Error(B(327));no();var t=Qc(e,0);if(!(t&1))return Bt(e,Xe()),null;var n=mu(e,t);if(e.tag!==0&&n===2){var r=wh(e);r!==0&&(t=r,n=Kh(e,r))}if(n===1)throw n=Wa,ti(e,0),Gr(e,t),Bt(e,Xe()),n;if(n===6)throw Error(B(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ls(e,$t,vr),Bt(e,Xe()),null}function qm(e,t){var n=_e;_e|=1;try{return e(t)}finally{_e=n,_e===0&&(ko=Xe()+500,Qu&&_s())}}function ci(e){rs!==null&&rs.tag===0&&!(_e&6)&&no();var t=_e;_e|=1;var n=pn.transition,r=Ne;try{if(pn.transition=null,Ne=1,e)return e()}finally{Ne=r,pn.transition=n,_e=t,!(_e&6)&&_s()}}function Km(){Kt=Hi.current,Fe(Hi)}function ti(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,jj(n)),rt!==null)for(n=rt.return;n!==null;){var r=n;switch(Tm(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&nu();break;case 3:bo(),Fe(Ut),Fe(_t),Dm();break;case 5:Im(r);break;case 4:bo();break;case 13:Fe(ze);break;case 19:Fe(ze);break;case 10:Rm(r.type._context);break;case 22:case 23:Km()}n=n.return}if(ut=e,rt=e=hs(e.current,null),gt=Kt=t,at=0,Wa=null,Wm=td=li=0,$t=wa=null,Ws!==null){for(t=0;t<Ws.length;t++)if(n=Ws[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=s,r.next=o}n.pending=r}Ws=null}return e}function F1(e,t){do{var n=rt;try{if(Nm(),Tc.current=du,uu){for(var r=We.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}uu=!1}if(ai=0,ct=ot=We=null,ya=!1,Va=0,zm.current=null,n===null||n.return===null){at=1,Wa=t,rt=null;break}e:{var i=e,o=n.return,a=n,l=t;if(t=gt,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 p=mv(o);if(p!==null){p.flags&=-257,gv(p,o,a,i,t),p.mode&1&&pv(i,c,t),t=p,l=c;var v=t.updateQueue;if(v===null){var g=new Set;g.add(l),t.updateQueue=g}else v.add(l);break e}else{if(!(t&1)){pv(i,c,t),Gm();break e}l=Error(B(426))}}else if(Ue&&a.mode&1){var b=mv(o);if(b!==null){!(b.flags&65536)&&(b.flags|=256),gv(b,o,a,i,t),Pm(So(l,a));break e}}i=l=So(l,a),at!==4&&(at=2),wa===null?wa=[i]:wa.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var w=S1(i,l,t);lv(i,w);break e;case 1:a=l;var y=i.type,x=i.stateNode;if(!(i.flags&128)&&(typeof y.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(ds===null||!ds.has(x)))){i.flags|=65536,t&=-t,i.lanes|=t;var S=k1(i,a,t);lv(i,S);break e}}i=i.return}while(i!==null)}B1(n)}catch(k){t=k,rt===n&&n!==null&&(rt=n=n.return);continue}break}while(!0)}function U1(){var e=fu.current;return fu.current=du,e===null?du:e}function Gm(){(at===0||at===3||at===2)&&(at=4),ut===null||!(li&268435455)&&!(td&268435455)||Gr(ut,gt)}function mu(e,t){var n=_e;_e|=2;var r=U1();(ut!==e||gt!==t)&&(vr=null,ti(e,t));do try{e2();break}catch(s){F1(e,s)}while(!0);if(Nm(),_e=n,fu.current=r,rt!==null)throw Error(B(261));return ut=null,gt=0,at}function e2(){for(;rt!==null;)V1(rt)}function t2(){for(;rt!==null&&!CP();)V1(rt)}function V1(e){var t=W1(e.alternate,e,Kt);e.memoizedProps=e.pendingProps,t===null?B1(e):rt=t,zm.current=null}function B1(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Gj(n,t),n!==null){n.flags&=32767,rt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{at=6,rt=null;return}}else if(n=Kj(n,t,Kt),n!==null){rt=n;return}if(t=t.sibling,t!==null){rt=t;return}rt=t=e}while(t!==null);at===0&&(at=5)}function Ls(e,t,n){var r=Ne,s=pn.transition;try{pn.transition=null,Ne=1,n2(e,t,n,r)}finally{pn.transition=s,Ne=r}return null}function n2(e,t,n,r){do no();while(rs!==null);if(_e&6)throw Error(B(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(B(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(DP(e,i),e===ut&&(rt=ut=null,gt=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Yl||(Yl=!0,H1(Jc,function(){return no(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=pn.transition,pn.transition=null;var o=Ne;Ne=1;var a=_e;_e|=4,zm.current=null,Jj(e,n),D1(n,e),Sj(Eh),Xc=!!_h,Eh=_h=null,e.current=n,Qj(n),TP(),_e=a,Ne=o,pn.transition=i}else e.current=n;if(Yl&&(Yl=!1,rs=e,pu=s),i=e.pendingLanes,i===0&&(ds=null),NP(n.stateNode),Bt(e,Xe()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(hu)throw hu=!1,e=Hh,Hh=null,e;return pu&1&&e.tag!==0&&no(),i=e.pendingLanes,i&1?e===qh?xa++:(xa=0,qh=e):xa=0,_s(),null}function no(){if(rs!==null){var e=Sb(pu),t=pn.transition,n=Ne;try{if(pn.transition=null,Ne=16>e?16:e,rs===null)var r=!1;else{if(e=rs,rs=null,pu=0,_e&6)throw Error(B(331));var s=_e;for(_e|=4,Q=e.current;Q!==null;){var i=Q,o=i.child;if(Q.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(Q=c;Q!==null;){var d=Q;switch(d.tag){case 0:case 11:case 15:va(8,d,i)}var f=d.child;if(f!==null)f.return=d,Q=f;else for(;Q!==null;){d=Q;var h=d.sibling,p=d.return;if(O1(d),d===c){Q=null;break}if(h!==null){h.return=p,Q=h;break}Q=p}}}var v=i.alternate;if(v!==null){var g=v.child;if(g!==null){v.child=null;do{var b=g.sibling;g.sibling=null,g=b}while(g!==null)}}Q=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,Q=o;else e:for(;Q!==null;){if(i=Q,i.flags&2048)switch(i.tag){case 0:case 11:case 15:va(9,i,i.return)}var w=i.sibling;if(w!==null){w.return=i.return,Q=w;break e}Q=i.return}}var y=e.current;for(Q=y;Q!==null;){o=Q;var x=o.child;if(o.subtreeFlags&2064&&x!==null)x.return=o,Q=x;else e:for(o=y;Q!==null;){if(a=Q,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:ed(9,a)}}catch(k){Je(a,a.return,k)}if(a===o){Q=null;break e}var S=a.sibling;if(S!==null){S.return=a.return,Q=S;break e}Q=a.return}}if(_e=s,_s(),rr&&typeof rr.onPostCommitFiberRoot=="function")try{rr.onPostCommitFiberRoot(qu,e)}catch{}r=!0}return r}finally{Ne=n,pn.transition=t}}return!1}function jv(e,t,n){t=So(n,t),t=S1(e,t,1),e=us(e,t,1),t=At(),e!==null&&(gl(e,1,t),Bt(e,t))}function Je(e,t,n){if(e.tag===3)jv(e,e,n);else for(;t!==null;){if(t.tag===3){jv(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ds===null||!ds.has(r))){e=So(n,e),e=k1(t,e,1),t=us(t,e,1),e=At(),t!==null&&(gl(t,1,e),Bt(t,e));break}}t=t.return}}function r2(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=At(),e.pingedLanes|=e.suspendedLanes&n,ut===e&&(gt&n)===n&&(at===4||at===3&&(gt&130023424)===gt&&500>Xe()-Hm?ti(e,0):Wm|=n),Bt(e,t)}function z1(e,t){t===0&&(e.mode&1?(t=Fl,Fl<<=1,!(Fl&130023424)&&(Fl=4194304)):t=1);var n=At();e=Tr(e,t),e!==null&&(gl(e,t,n),Bt(e,n))}function s2(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),z1(e,n)}function i2(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(B(314))}r!==null&&r.delete(t),z1(e,n)}var W1;W1=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ut.current)Ft=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ft=!1,qj(e,t,n);Ft=!!(e.flags&131072)}else Ft=!1,Ue&&t.flags&1048576&&Gb(t,iu,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;jc(e,t),e=t.pendingProps;var s=vo(t,_t.current);to(t,n),s=$m(null,t,r,e,s,n);var i=Fm();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,Vt(r)?(i=!0,ru(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Om(t),s.updater=Zu,t.stateNode=s,s._reactInternals=t,Mh(t,r,e,n),t=Lh(null,t,r,!0,i,n)):(t.tag=0,Ue&&i&&Cm(t),Ct(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(jc(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=a2(r),e=Cn(r,e),s){case 0:t=Dh(null,t,r,e,n);break e;case 1:t=wv(null,t,r,e,n);break e;case 11:t=yv(null,t,r,e,n);break e;case 14:t=vv(null,t,r,Cn(r.type,e),n);break e}throw Error(B(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Cn(r,s),Dh(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Cn(r,s),wv(e,t,r,s,n);case 3:e:{if(T1(t),e===null)throw Error(B(387));
vendor: 4,166 bytes, line 40
40r=t.pendingProps,i=t.memoizedState,s=i.element,e1(e,t),lu(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=So(Error(B(423)),t),t=xv(e,t,r,n,s);break e}else if(r!==s){s=So(Error(B(424)),t),t=xv(e,t,r,n,s);break e}else for(Jt=cs(t.stateNode.containerInfo.firstChild),Qt=t,Ue=!0,On=null,n=Xb(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(wo(),r===s){t=Pr(e,t,n);break e}Ct(e,t,r,n)}t=t.child}return t;case 5:return t1(t),e===null&&Rh(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,Ch(r,s)?o=null:i!==null&&Ch(r,i)&&(t.flags|=32),C1(e,t),Ct(e,t,o,n),t.child;case 6:return e===null&&Rh(t),null;case 13:return P1(e,t,n);case 4:return Mm(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=xo(t,null,r,n):Ct(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Cn(r,s),yv(e,t,r,s,n);case 7:return Ct(e,t,t.pendingProps,n),t.child;case 8:return Ct(e,t,t.pendingProps.children,n),t.child;case 12:return Ct(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,o=s.value,Ie(ou,r._currentValue),r._currentValue=o,i!==null)if(Ln(i.value,o)){if(i.children===s.children&&!Ut.current){t=Pr(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=_r(-1,n&-n),l.tag=2;var c=i.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}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Ah(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(B(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Ah(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}Ct(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,to(t,n),s=yn(s),r=r(s),t.flags|=1,Ct(e,t,r,n),t.child;case 14:return r=t.type,s=Cn(r,t.pendingProps),s=Cn(r.type,s),vv(e,t,r,s,n);case 15:return _1(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:Cn(r,s),jc(e,t),t.tag=1,Vt(r)?(e=!0,ru(t)):e=!1,to(t,n),b1(t,r,s),Mh(t,r,s,n),Lh(null,t,r,!0,e,n);case 19:return j1(e,t,n);case 22:return E1(e,t,n)}throw Error(B(156,t.tag))};function H1(e,t){return vb(e,t)}function o2(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fn(e,t,n,r){return new o2(e,t,n,r)}function Ym(e){return e=e.prototype,!(!e||!e.isReactComponent)}function a2(e){if(typeof e=="function")return Ym(e)?1:0;if(e!=null){if(e=e.$$typeof,e===pm)return 11;if(e===mm)return 14}return 2}function hs(e,t){var n=e.alternate;return n===null?(n=fn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ac(e,t,n,r,s,i){var o=2;if(r=e,typeof e=="function")Ym(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ii:return ni(n.children,s,i,t);case hm:o=8,s|=8;break;case sh:return e=fn(12,n,t,s|2),e.elementType=sh,e.lanes=i,e;case ih:return e=fn(13,n,t,s),e.elementType=ih,e.lanes=i,e;
vendor: 4,062 bytes, line 40
40case oh:return e=fn(19,n,t,s),e.elementType=oh,e.lanes=i,e;case tb:return nd(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Zx:o=10;break e;case eb:o=9;break e;case pm:o=11;break e;case mm:o=14;break e;case Wr:o=16,r=null;break e}throw Error(B(130,e==null?e:typeof e,""))}return t=fn(o,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function ni(e,t,n,r){return e=fn(7,e,r,t),e.lanes=n,e}function nd(e,t,n,r){return e=fn(22,e,r,t),e.elementType=tb,e.lanes=n,e.stateNode={isHidden:!1},e}function hf(e,t,n){return e=fn(6,e,null,t),e.lanes=n,e}function pf(e,t,n){return t=fn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function l2(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Kd(0),this.expirationTimes=Kd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Kd(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Jm(e,t,n,r,s,i,o,a,l){return e=new l2(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=fn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Om(i),e}function c2(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Mi,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function q1(e){if(!e)return ys;e=e._reactInternals;e:{if(pi(e)!==e||e.tag!==1)throw Error(B(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Vt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(B(171))}if(e.tag===1){var n=e.type;if(Vt(n))return qb(e,n,t)}return t}function K1(e,t,n,r,s,i,o,a,l){return e=Jm(n,r,!0,e,s,i,o,a,l),e.context=q1(null),n=e.current,r=At(),s=fs(n),i=_r(r,s),i.callback=t??null,us(n,i,s),e.current.lanes=s,gl(e,s,r),Bt(e,r),e}function rd(e,t,n,r){var s=t.current,i=At(),o=fs(s);return n=q1(n),t.context===null?t.context=n:t.pendingContext=n,t=_r(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=us(s,t,o),e!==null&&(In(e,s,o,i),Cc(e,s,o)),o}function gu(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 Nv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Qm(e,t){Nv(e,t),(e=e.alternate)&&Nv(e,t)}function u2(){return null}var G1=typeof reportError=="function"?reportError:function(e){console.error(e)};function Xm(e){this._internalRoot=e}sd.prototype.render=Xm.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(B(409));rd(e,t,null,null)};sd.prototype.unmount=Xm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ci(function(){rd(null,e,null,null)}),t[Cr]=null}};function sd(e){this._internalRoot=e}sd.prototype.unstable_scheduleHydration=function(e){if(e){var t=Eb();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Kr.length&&t!==0&&t<Kr[n].priority;n++);Kr.splice(n,0,e),n===0&&Tb(e)}};function Zm(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function id(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Rv(){}function d2(e,t,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var c=gu(o);i.call(c)}}var o=K1(t,r,e,0,null,!1,!1,"",Rv);return e._reactRootContainer=o,e[Cr]=o.current,Da(e.nodeType===8?e.parentNode:e),ci(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var c=gu(l);a.call(c)}}var l=Jm(e,0,!1,null,null,!1,!1,"",Rv);
vendor: 4,789 bytes, line 40
40return e._reactRootContainer=l,e[Cr]=l.current,Da(e.nodeType===8?e.parentNode:e),ci(function(){rd(t,l,n,r)}),l}function od(e,t,n,r,s){var i=n._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var a=s;s=function(){var l=gu(o);a.call(l)}}rd(t,o,e,s)}else o=d2(n,t,e,s,r);return gu(o)}kb=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=aa(t.pendingLanes);n!==0&&(vm(t,n|1),Bt(t,Xe()),!(_e&6)&&(ko=Xe()+500,_s()))}break;case 13:ci(function(){var r=Tr(e,1);if(r!==null){var s=At();In(r,e,1,s)}}),Qm(e,1)}};wm=function(e){if(e.tag===13){var t=Tr(e,134217728);if(t!==null){var n=At();In(t,e,134217728,n)}Qm(e,134217728)}};_b=function(e){if(e.tag===13){var t=fs(e),n=Tr(e,t);if(n!==null){var r=At();In(n,e,t,r)}Qm(e,t)}};Eb=function(){return Ne};Cb=function(e,t){var n=Ne;try{return Ne=e,t()}finally{Ne=n}};gh=function(e,t,n){switch(t){case"input":if(ch(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=Ju(r);if(!s)throw Error(B(90));rb(r),ch(r,s)}}}break;case"textarea":ib(e,n);break;case"select":t=n.value,t!=null&&Qi(e,!!n.multiple,t,!1)}};fb=qm;hb=ci;var f2={usingClientEntryPoint:!1,Events:[vl,Fi,Ju,ub,db,qm]},Xo={findFiberByHostInstance:zs,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},h2={bundleType:Xo.bundleType,version:Xo.version,rendererPackageName:Xo.rendererPackageName,rendererConfig:Xo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Rr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=gb(e),e===null?null:e.stateNode},findFiberByHostInstance:Xo.findFiberByHostInstance||u2,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 Jl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jl.isDisabled&&Jl.supportsFiber)try{qu=Jl.inject(h2),rr=Jl}catch{}}nn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=f2;nn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Zm(t))throw Error(B(200));return c2(e,t,null,n)};nn.createRoot=function(e,t){if(!Zm(e))throw Error(B(299));var n=!1,r="",s=G1;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Jm(e,1,!1,null,null,n,!1,r,s),e[Cr]=t.current,Da(e.nodeType===8?e.parentNode:e),new Xm(t)};nn.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(B(188)):(e=Object.keys(e).join(","),Error(B(268,e)));return e=gb(t),e=e===null?null:e.stateNode,e};nn.flushSync=function(e){return ci(e)};nn.hydrate=function(e,t,n){if(!id(t))throw Error(B(200));return od(null,e,t,!0,n)};nn.hydrateRoot=function(e,t,n){if(!Zm(e))throw Error(B(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=G1;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=K1(t,null,e,1,n??null,s,!1,i,o),e[Cr]=t.current,Da(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new sd(t)};nn.render=function(e,t,n){if(!id(t))throw Error(B(200));return od(null,e,t,!1,n)};nn.unmountComponentAtNode=function(e){if(!id(e))throw Error(B(40));return e._reactRootContainer?(ci(function(){od(null,null,e,!1,function(){e._reactRootContainer=null,e[Cr]=null})}),!0):!1};nn.unstable_batchedUpdates=qm;nn.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!id(n))throw Error(B(200));if(e==null||e._reactInternals===void 0)throw Error(B(38));return od(e,t,n,!1,r)};nn.version="18.3.1-next-f1338f8080-20240426";function Y1(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Y1)}catch(e){console.error(e)}}Y1(),Yx.exports=nn;var xl=Yx.exports;const J1=Lx(xl);var Q1,Av=xl;Q1=Av.createRoot,Av.hydrateRoot;const p2=1,m2=1e6;let mf=0;function g2(){return mf=(mf+1)%Number.MAX_SAFE_INTEGER,mf.toString()}const gf=new Map,Ov=e=>{if(gf.has(e))return;const t=setTimeout(()=>{gf.delete(e),ba({type:"REMOVE_TOAST",toastId:e})},m2);gf.set(e,t)},y2=(e,t)=>
40{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,p2)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?Ov(n):e.toasts.forEach(r=>{Ov(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Oc=[];let Mc={toasts:[]};function ba(e){Mc=y2(Mc,e),Oc.forEach(t=>{t(Mc)})}function v2({...e}){const t=g2(),n=s=>ba({type:"UPDATE_TOAST",toast:{...s,id:t}}),r=()=>ba({type:"DISMISS_TOAST",toastId:t});return ba({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:s=>{s||r()}}}),{id:t,dismiss:r,update:n}}function Ro(){const[e,t]=m.useState(Mc);return m.useEffect(()=>(Oc.push(t),()=>{const n=Oc.indexOf(t);n>-1&&Oc.splice(n,1)}),[e]),{...e,toast:v2,dismiss:n=>ba({type:"DISMISS_TOAST",toastId:n})}}function ne(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e==null||e(s),n===!1||!s.defaultPrevented)return t==null?void 0:t(s)}}function Mv(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Es(...e){return t=>{let n=!1;const r=e.map(s=>{const i=Mv(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():Mv(e[s],null)}}}}function qe(...e){return m.useCallback(Es(...e),e)}function w2(e,t){const n=m.createContext(t),r=i=>{const{children:o,...a}=i,l=m.useMemo(()=>a,Object.values(a));return u.jsx(n.Provider,{value:l,children:o})};r.displayName=e+"Provider";function s(i){const o=m.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,s]}function ur(e,t=[]){let n=[];function r(i,o){const a=m.createContext(o),l=n.length;n=[...n,o];const c=f=>{var w;const{scope:h,children:p,...v}=f,g=((w=h==null?void 0:h[e])==null?void 0:w[l])||a,b=m.useMemo(()=>v,Object.values(v));return u.jsx(g.Provider,{value:b,children:p})};c.displayName=i+"Provider";function d(f,h){var g;const p=((g=h==null?void 0:h[e])==null?void 0:g[l])||a,v=m.useContext(p);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[c,d]}const s=()=>{const i=n.map(o=>m.createContext(o));return function(a){const l=(a==null?void 0:a[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return s.scopeName=e,[r,x2(s,...t)]}function x2(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:l,scopeName:c})=>{const f=l(i)[`__scope${c}`];return{...a,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function Iv(e){const t=b2(e),n=m.forwardRef((r,s)=>{const{children:i,...o}=r,a=m.Children.toArray(i),l=a.find(k2);if(l){const c=l.props.children,d=a.map(f=>f===l?m.Children.count(c)>1?m.Children.only(null):m.isValidElement(c)?c.props.children:null:f);return u.jsx(t,{...o,ref:s,children:m.isValidElement(c)?m.cloneElement(c,void 0,d):null})}return u.jsx(t,{...o,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function b2(e){const t=m.forwardRef((n,r)=>{const{children:s,...i}=n;if(m.isValidElement(s)){const o=E2(s),a=_2(i,s.props);return s.type!==m.Fragment&&(a.ref=r?Es(r,o):o),m.cloneElement(s,a)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var S2=Symbol("radix.slottable");function k2(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===S2}function _2(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...a)=>{const l=i(...a);return s(...a),l}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function E2(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ad(e){const t=e+"CollectionProvider",[n,r]=ur(t),[s,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=g=>{const{scope:b,children:w}=g,y=U.useRef(null),x=U.useRef(new Map).current;return u.jsx(s,{scope:b,itemMap:x,collectionRef:y,children:w})};o.displayName=t;const a=e+"CollectionSlot",l=Iv(a),c=U.forwardRef((g,b)=>{const{scope:w,children:y}=g,x=i(a,w),S=qe(b,x.collectionRef);return u.jsx(l,{ref:S,children:y})});c.displayName=a;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=Iv(d),p=U.forwardRef((g,b)=>{const{scope:w,children:y,...x}=g,S=U.useRef(null),k=qe(b,S),E=i(d,w);return U.useEffect(()=>(E.itemMap.set(S,{ref:S,...x}
vendor: 9,695 bytes, line 40
40),()=>void E.itemMap.delete(S))),u.jsx(h,{[f]:"",ref:k,children:y})});p.displayName=d;function v(g){const b=i(e+"CollectionConsumer",g);return U.useCallback(()=>{const y=b.collectionRef.current;if(!y)return[];const x=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(b.itemMap.values()).sort((E,C)=>x.indexOf(E.ref.current)-x.indexOf(C.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:o,Slot:c,ItemSlot:p},v,r]}function C2(e){const t=T2(e),n=m.forwardRef((r,s)=>{const{children:i,...o}=r,a=m.Children.toArray(i),l=a.find(j2);if(l){const c=l.props.children,d=a.map(f=>f===l?m.Children.count(c)>1?m.Children.only(null):m.isValidElement(c)?c.props.children:null:f);return u.jsx(t,{...o,ref:s,children:m.isValidElement(c)?m.cloneElement(c,void 0,d):null})}return u.jsx(t,{...o,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function T2(e){const t=m.forwardRef((n,r)=>{const{children:s,...i}=n;if(m.isValidElement(s)){const o=R2(s),a=N2(i,s.props);return s.type!==m.Fragment&&(a.ref=r?Es(r,o):o),m.cloneElement(s,a)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var P2=Symbol("radix.slottable");function j2(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===P2}function N2(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...a)=>{const l=i(...a);return s(...a),l}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function R2(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var A2=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ee=A2.reduce((e,t)=>{const n=C2(`Primitive.${t}`),r=m.forwardRef((s,i)=>{const{asChild:o,...a}=s,l=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function eg(e,t){e&&xl.flushSync(()=>e.dispatchEvent(t))}function tn(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function O2(e,t=globalThis==null?void 0:globalThis.document){const n=tn(e);m.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var M2="DismissableLayer",Yh="dismissableLayer.update",I2="dismissableLayer.pointerDownOutside",D2="dismissableLayer.focusOutside",Dv,X1=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),bl=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:a,...l}=e,c=m.useContext(X1),[d,f]=m.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=m.useState({}),v=qe(t,C=>f(C)),g=Array.from(c.layers),[b]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),w=g.indexOf(b),y=d?g.indexOf(d):-1,x=c.layersWithOutsidePointerEventsDisabled.size>0,S=y>=w,k=$2(C=>{const _=C.target,j=[...c.branches].some(T=>T.contains(_));!S||j||(s==null||s(C),o==null||o(C),C.defaultPrevented||a==null||a())},h),E=F2(C=>{const _=C.target;[...c.branches].some(T=>T.contains(_))||(i==null||i(C),o==null||o(C),C.defaultPrevented||a==null||a())},h);return O2(C=>{y===c.layers.size-1&&(r==null||r(C),!C.defaultPrevented&&a&&(C.preventDefault(),a()))},h),m.useEffect(()=>{if(d)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(Dv=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(d)),c.layers.add(d),Lv(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Dv)}},[d,h,n,c]),m.useEffect(()=>()=>{d&&(c.layers.delete(d),c.layersWithOutsidePointerEventsDisabled.delete(d),Lv())},[d,c]),m.useEffect(()=>{const C=()=>p({});return document.addEventListener(Yh,C),()=>document.removeEventListener(Yh,C)},[]),u.jsx(Ee.div,{...l,ref:v,style:{pointerEvents:x?S?"auto":"none":void 0,...e.style},onFocusCapture:ne(e.onFocusCapture,E.onFocusCapture),onBlurCapture:ne(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:ne(e.onPointerDownCapture,k.onPointerDownCapture)})});bl.displayName=M2;var L2="DismissableLayerBranch",Z1=m.forwardRef((e,t)=>{const n=m.useContext(X1),r=m.useRef(null),s=qe(t,r);return m.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),u.jsx(Ee.div,{...e,ref:s})});Z1.displayName=L2;function $2(e,t=globalThis==null?void 0:globalThis.document){const n=tn(e),r=m.useRef(!1),s=m.useRef(()=>{});return m.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){eS(I2,n,c,{discrete:!0})};const c={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=l,t.addEventListener("click",s.current,{once:!0})):l()}else t.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function F2(e,t=globalThis==null?void 0:globalThis.document){const n=tn(e),r=m.useRef(!1);return m.useEffect(()=>{const s=i=>{i.target&&!r.current&&eS(D2,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function Lv(){const e=new CustomEvent(Yh);document.dispatchEvent(e)}function eS(e,t,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?eg(s,i):s.dispatchEvent(i)}var U2=bl,V2=Z1,ar=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},B2="Portal",ld=m.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[s,i]=m.useState(!1);ar(()=>i(!0),[]);const o=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?J1.createPortal(u.jsx(Ee.div,{...r,ref:t}),o):null});ld.displayName=B2;function z2(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var Un=e=>{const{present:t,children:n}=e,r=W2(t),s=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),i=qe(r.ref,H2(s));return typeof n=="function"||r.isPresent?m.cloneElement(s,{ref:i}):null};Un.displayName="Presence";function W2(e){const[t,n]=m.useState(),r=m.useRef(null),s=m.useRef(e),i=m.useRef("none"),o=e?"mounted":"unmounted",[a,l]=z2(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const c=Ql(r.current);i.current=a==="mounted"?c:"none"},[a]),ar(()=>{const c=r.current,d=s.current;if(d!==e){const h=i.current,p=Ql(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(d&&h!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,l]),ar(()=>{if(t){let c;const d=t.ownerDocument.defaultView??window,f=p=>{const g=Ql(r.current).includes(CSS.escape(p.animationName));if(p.target===t&&g&&(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=p=>{p.target===t&&(i.current=Ql(r.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:m.useCallback(c=>{r.current=c?getComputedStyle(c):null,n(c)},[])}}function Ql(e){return(e==null?void 0:e.animationName)||"none"}function H2(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var q2=Hu[" useInsertionEffect ".trim().toString()]||ar;function mi({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,i,o]=K2({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:s;{const d=m.useRef(e!==void 0);m.useEffect(()=>{const f=d.current;f!==a&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=a},[a,r])}const c=m.useCallback(d=>{var f;if(a){const h=G2(d)?d(e):d;h!==e&&((f=o.current)==null||f.call(o,h))}else i(d)},[a,e,i,o]);return[l,c]}function K2({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),s=m.useRef(n),i=m.useRef(t);return q2(()=>{i.current=t},[t]),m.useEffect(()=>{var o;s.current!==n&&((o=i.current)==null||o.call(i,n),s.current=n)},[n,s]),[n,r,i]}function G2(e){return typeof e=="function"}var Y2=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),J2="VisuallyHidden",cd=m.forwardRef((e,t)=>
40u.jsx(Ee.span,{...e,ref:t,style:{...Y2,...e.style}}));cd.displayName=J2;var Q2=cd,tg="ToastProvider",[ng,X2,Z2]=ad("Toast"),[tS]=ur("Toast",[Z2]),[eN,ud]=tS(tg),nS=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:o}=e,[a,l]=m.useState(null),[c,d]=m.useState(0),f=m.useRef(!1),h=m.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${tg}\`. Expected non-empty \`string\`.`),u.jsx(ng.Provider,{scope:t,children:u.jsx(eN,{scope:t,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:c,viewport:a,onViewportChange:l,onToastAdd:m.useCallback(()=>d(p=>p+1),[]),onToastRemove:m.useCallback(()=>d(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:h,children:o})})};nS.displayName=tg;var rS="ToastViewport",tN=["F8"],Jh="toast.viewportPause",Qh="toast.viewportResume",sS=m.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=tN,label:s="Notifications ({hotkey})",...i}=e,o=ud(rS,n),a=X2(n),l=m.useRef(null),c=m.useRef(null),d=m.useRef(null),f=m.useRef(null),h=qe(t,f,o.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=o.toastCount>0;m.useEffect(()=>{const b=w=>{var x;r.length!==0&&r.every(S=>w[S]||w.code===S)&&((x=f.current)==null||x.focus())};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[r]),m.useEffect(()=>{const b=l.current,w=f.current;if(v&&b&&w){const y=()=>{if(!o.isClosePausedRef.current){const E=new CustomEvent(Jh);w.dispatchEvent(E),o.isClosePausedRef.current=!0}},x=()=>{if(o.isClosePausedRef.current){const E=new CustomEvent(Qh);w.dispatchEvent(E),o.isClosePausedRef.current=!1}},S=E=>{!b.contains(E.relatedTarget)&&x()},k=()=>{b.contains(document.activeElement)||x()};return b.addEventListener("focusin",y),b.addEventListener("focusout",S),b.addEventListener("pointermove",y),b.addEventListener("pointerleave",k),window.addEventListener("blur",y),window.addEventListener("focus",x),()=>{b.removeEventListener("focusin",y),b.removeEventListener("focusout",S),b.removeEventListener("pointermove",y),b.removeEventListener("pointerleave",k),window.removeEventListener("blur",y),window.removeEventListener("focus",x)}}},[v,o.isClosePausedRef]);const g=m.useCallback(({tabbingDirection:b})=>{const y=a().map(x=>{const S=x.ref.current,k=[S,...pN(S)];return b==="forwards"?k:k.reverse()});return(b==="forwards"?y.reverse():y).flat()},[a]);return m.useEffect(()=>{const b=f.current;if(b){const w=y=>{var k,E,C;const x=y.altKey||y.ctrlKey||y.metaKey;if(y.key==="Tab"&&!x){const _=document.activeElement,j=y.shiftKey;if(y.target===b&&j){(k=c.current)==null||k.focus();return}const M=g({tabbingDirection:j?"backwards":"forwards"}),H=M.findIndex(D=>D===_);yf(M.slice(H+1))?y.preventDefault():j?(E=c.current)==null||E.focus():(C=d.current)==null||C.focus()}};return b.addEventListener("keydown",w),()=>b.removeEventListener("keydown",w)}},[a,g]),u.jsxs(V2,{ref:l,role:"region","aria-label":s.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&u.jsx(Xh,{ref:c,onFocusFromOutsideViewport:()=>{const b=g({tabbingDirection:"forwards"});yf(b)}}),u.jsx(ng.Slot,{scope:n,children:u.jsx(Ee.ol,{tabIndex:-1,...i,ref:h})}),v&&u.jsx(Xh,{ref:d,onFocusFromOutsideViewport:()=>{const b=g({tabbingDirection:"backwards"});yf(b)}})]})});sS.displayName=rS;var iS="ToastFocusProxy",Xh=m.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=e,i=ud(iS,n);return u.jsx(cd,{tabIndex:0,...s,ref:t,style:{position:"fixed"},onFocus:o=>{var c;const a=o.relatedTarget;!((c=i.viewport)!=null&&c.contains(a))&&r()}})});Xh.displayName=iS;var Sl="Toast",nN="toast.swipeStart",rN="toast.swipeMove",sN="toast.swipeCancel",iN="toast.swipeEnd",oS=m.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...o}=e,[a,l]=mi({prop:r,defaultProp:s??!0,onChange:i,caller:Sl});return u.jsx(Un,{present:n||a,children:u.jsx(lN,{open:a,...o,ref:t,onClose:()=>l(!1),onPause:tn(e.onPause),onResume:tn(e.onResume),onSwipeStart:ne(e.onSwipeStart,c=>{c.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ne(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:ne(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:ne(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)})})})});oS.displayName=Sl;var[oN,aN]=tS(Sl,{onClose(){}}),lN=m.forwardRef((e,t)=>
40{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:c,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:h,onSwipeEnd:p,...v}=e,g=ud(Sl,n),[b,w]=m.useState(null),y=qe(t,D=>w(D)),x=m.useRef(null),S=m.useRef(null),k=s||g.duration,E=m.useRef(0),C=m.useRef(k),_=m.useRef(0),{onToastAdd:j,onToastRemove:T}=g,I=tn(()=>{var G;(b==null?void 0:b.contains(document.activeElement))&&((G=g.viewport)==null||G.focus()),o()}),M=m.useCallback(D=>{!D||D===1/0||(window.clearTimeout(_.current),E.current=new Date().getTime(),_.current=window.setTimeout(I,D))},[I]);m.useEffect(()=>{const D=g.viewport;if(D){const G=()=>{M(C.current),c==null||c()},L=()=>{const Z=new Date().getTime()-E.current;C.current=C.current-Z,window.clearTimeout(_.current),l==null||l()};return D.addEventListener(Jh,L),D.addEventListener(Qh,G),()=>{D.removeEventListener(Jh,L),D.removeEventListener(Qh,G)}}},[g.viewport,k,l,c,M]),m.useEffect(()=>{i&&!g.isClosePausedRef.current&&M(k)},[i,k,g.isClosePausedRef,M]),m.useEffect(()=>(j(),()=>T()),[j,T]);const H=m.useMemo(()=>b?hS(b):null,[b]);return g.viewport?u.jsxs(u.Fragment,{children:[H&&u.jsx(cN,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:H}),u.jsx(oN,{scope:n,onClose:I,children:xl.createPortal(u.jsx(ng.ItemSlot,{scope:n,children:u.jsx(U2,{asChild:!0,onEscapeKeyDown:ne(a,()=>{g.isFocusedToastEscapeKeyDownRef.current||I(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:u.jsx(Ee.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":g.swipeDirection,...v,ref:y,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:ne(e.onKeyDown,D=>{D.key==="Escape"&&(a==null||a(D.nativeEvent),D.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,I()))}),onPointerDown:ne(e.onPointerDown,D=>{D.button===0&&(x.current={x:D.clientX,y:D.clientY})}),onPointerMove:ne(e.onPointerMove,D=>{if(!x.current)return;const G=D.clientX-x.current.x,L=D.clientY-x.current.y,Z=!!S.current,N=["left","right"].includes(g.swipeDirection),P=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,F=N?P(0,G):0,O=N?0:P(0,L),$=D.pointerType==="touch"?10:2,Y={x:F,y:O},W={originalEvent:D,delta:Y};Z?(S.current=Y,Xl(rN,f,W,{discrete:!1})):$v(Y,g.swipeDirection,$)?(S.current=Y,Xl(nN,d,W,{discrete:!1}),D.target.setPointerCapture(D.pointerId)):(Math.abs(G)>$||Math.abs(L)>$)&&(x.current=null)}),onPointerUp:ne(e.onPointerUp,D=>{const G=S.current,L=D.target;if(L.hasPointerCapture(D.pointerId)&&L.releasePointerCapture(D.pointerId),S.current=null,x.current=null,G){const Z=D.currentTarget,N={originalEvent:D,delta:G};$v(G,g.swipeDirection,g.swipeThreshold)?Xl(iN,p,N,{discrete:!0}):Xl(sN,h,N,{discrete:!0}),Z.addEventListener("click",P=>P.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),cN=e=>{const{__scopeToast:t,children:n,...r}=e,s=ud(Sl,t),[i,o]=m.useState(!1),[a,l]=m.useState(!1);return fN(()=>o(!0)),m.useEffect(()=>{const c=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(c)},[]),a?null:u.jsx(ld,{asChild:!0,children:u.jsx(cd,{...r,children:i&&u.jsxs(u.Fragment,{children:[s.label," ",n]})})})},uN="ToastTitle",aS=m.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return u.jsx(Ee.div,{...r,ref:t})});aS.displayName=uN;var dN="ToastDescription",lS=m.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return u.jsx(Ee.div,{...r,ref:t})});lS.displayName=dN;var cS="ToastAction",uS=m.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?u.jsx(fS,{altText:n,asChild:!0,children:u.jsx(rg,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${cS}\`. Expected non-empty \`string\`.`),null)});uS.displayName=cS;var dS="ToastClose",rg=m.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,s=aN(dS,n);return u.jsx(fS,{asChild:!0,children:u.jsx(Ee.button,{type:"button",...r,ref:t,onClick:ne(e.onClick,s.onClose)})})});rg.displayName=dS;var fS=m.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...s}=e;return u.jsx(Ee.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:t})});function hS(e){const t=[];
vendor: 7,725 bytes, lines 40-119
40return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),hN(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const o=r.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...hS(r))}}),t}function Xl(e,t,n,{discrete:r}){const s=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?eg(s,i):s.dispatchEvent(i)}var $v=(e,t,n=0)=>{const r=Math.abs(e.x),s=Math.abs(e.y),i=r>s;return t==="left"||t==="right"?i&&r>n:!i&&s>n};function fN(e=()=>{}){const t=tn(e);ar(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function hN(e){return e.nodeType===e.ELEMENT_NODE}function pN(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function yf(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var mN=nS,pS=sS,mS=oS,gS=aS,yS=lS,vS=uS,wS=rg;function xS(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=xS(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function bS(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=xS(e))&&(r&&(r+=" "),r+=t);return r}const Fv=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Uv=bS,sg=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return Uv(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=t,o=Object.keys(s).map(c=>{const d=n==null?void 0:n[c],f=i==null?void 0:i[c];if(d===null)return null;const h=Fv(d)||Fv(f);return s[c][h]}),a=n&&Object.entries(n).reduce((c,d)=>{let[f,h]=d;return h===void 0||(c[f]=h),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,d)=>{let{class:f,className:h,...p}=d;return Object.entries(p).every(v=>{let[g,b]=v;return Array.isArray(b)?b.includes({...i,...a}[g]):{...i,...a}[g]===b})?[...c,f,h]:c},[]);return Uv(e,o,l,n==null?void 0:n.class,n==null?void 0:n.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 gN=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),SS=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).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 yN={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 vN=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:o,...a},l)=>m.createElement("svg",{ref:l,...yN,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:SS("lucide",s),...a},[...o.map(([c,d])=>m.createElement(c,d)),...Array.isArray(i)?i:[i]]));/** 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 n=m.forwardRef(({className:r,...s},i)=>m.createElement(vN,{ref:i,iconNode:t,className:SS(`lucide-${gN(e)}`,r),...s}));return n.displayName=`${e}`,n};/** 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 dd=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 Zh=ve("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** 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 wN=ve("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/** 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 xN=ve("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/** 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 yu=ve("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 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 kS=ve("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** 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 bN=ve("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** 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 SN=ve("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** 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 kN=ve("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 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 _N=ve("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** 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 EN=ve("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** 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 vf=ve("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** 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 CN=ve("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/** 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 TN=ve("Diff",[["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 10h14",key:"elsbfy"}],["path",{d:"M5 21h14",key:"11awu3"}]]);/** 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 PN=ve("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);/** 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 vu=ve("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** 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 jN=ve("FolderDown",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"m15 13-3 3-3-3",key:"6j2sf0"}]]);/** 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 NN=ve("FolderGit2",[["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["path",{d:"M18 19c-2.8 0-5-2.2-5-5v8",key:"pkpw2h"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]]);/** 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 RN=ve("GitBranchPlus",[["path",{d:"M6 3v12",key:"qpgusn"}],["path",{d:"M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",key:"1d02ji"}],["path",{d:"M6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",key:"chk6ph"}],["path",{d:"M15 6a9 9 0 0 0-9 9",key:"or332x"}],["path",{d:"M18 15v6",key:"9wciyi"}],["path",{d:"M21 18h-6",key:"139f0c"}]]);/** 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 AN=ve("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** 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 _S=ve("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/** 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 ON=ve("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** 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 Pt=ve("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 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. 180 */const MN=ve("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** 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 ep=ve("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/** 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 IN=ve("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** 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 wf=ve("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** 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 DN=ve("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** 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 ES=ve("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/** 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 tp=ve("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** 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 LN=ve("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** 216 * @license lucide-react v0.462.0 - ISC 217 * 218 * This source code is licensed under the ISC license. 219 * See the LICENSE file in the root directory of this source tree. 220 */const $N=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"}]]);/** 221 * @license lucide-react v0.462.0 - ISC 222 * 223 * This source code is licensed under the ISC license. 224 * See the LICENSE file in the root directory of this source tree. 225 */const FN=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"}]]);/** 226 * @license lucide-react v0.462.0 - ISC 227 * 228 * This source code is licensed under the ISC license. 229 * See the LICENSE file in the root directory of this source tree. 230 */const UN=ve("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/** 231 * @license lucide-react v0.462.0 - ISC 232 * 233 * This source code is licensed under the ISC license. 234 * See the LICENSE file in the root directory of this source tree. 235 */const VN=ve("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** 236 * @license lucide-react v0.462.0 - ISC 237 * 238 * This source code is licensed under the ISC license. 239 * See the LICENSE file in the root directory of this source tree. 240 */const ig=ve("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** 241 * @license lucide-react v0.462.0 - ISC 242 * 243 * This source code is licensed under the ISC license. 244 * See the LICENSE file in the root directory of this source tree. 245 */const fd=ve("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}
vendor: 6,300 bytes, lines 245-250
245],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** 246 * @license lucide-react v0.462.0 - ISC 247 * 248 * This source code is licensed under the ISC license. 249 * See the LICENSE file in the root directory of this source tree. 250 */const BN=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"}]]),og="-",zN=e=>{const t=HN(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const a=o.split(og);return a[0]===""&&a.length!==1&&a.shift(),CS(a,t)||WN(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},CS=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?CS(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const i=e.join(og);return(o=t.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},Vv=/^\[(.+)\]$/,WN=e=>{if(Vv.test(e)){const t=Vv.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},HN=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return KN(Object.entries(e.classGroups),n).forEach(([i,o])=>{np(o,r,i,t)}),r},np=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const i=s===""?t:Bv(t,s);i.classGroupId=n;return}if(typeof s=="function"){if(qN(s)){np(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{np(o,Bv(t,i),n,r)})})},Bv=(e,t)=>{let n=e;return t.split(og).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},qN=e=>e.isThemeGetter,KN=(e,t)=>t?e.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,a])=>[t+o,a])):i);return[n,s]}):e,GN=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return s(i,o),o},set(i,o){n.has(i)?n.set(i,o):s(i,o)}}},TS="!",YN=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,s=t[0],i=t.length,o=a=>{const l=[];let c=0,d=0,f;for(let b=0;b<a.length;b++){let w=a[b];if(c===0){if(w===s&&(r||a.slice(b,b+i)===t)){l.push(a.slice(d,b)),d=b+i;continue}if(w==="/"){f=b;continue}}w==="["?c++:w==="]"&&c--}const h=l.length===0?a:a.substring(d),p=h.startsWith(TS),v=p?h.substring(1):h,g=f&&f>d?f-d:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:v,maybePostfixModifierPosition:g}};return n?a=>n({className:a,parseClassName:o}):o},JN=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},QN=e=>({cache:GN(e.cacheSize),parseClassName:YN(e),...zN(e)}),XN=/\s+/,ZN=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=t,i=[],o=e.trim().split(XN);let a="";for(let l=o.length-1;l>=0;l-=1){const c=o[l],{modifiers:d,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:p}=n(c);let v=!!p,g=r(v?h.substring(0,p):h);if(!g){if(!v){a=c+(a.length>0?" "+a:a);continue}if(g=r(h),!g){a=c+(a.length>0?" "+a:a);continue}v=!1}const b=JN(d).join(":"),w=f?b+TS:b,y=w+g;if(i.includes(y))continue;i.push(y);const x=s(g,v);for(let S=0;S<x.length;++S){const k=x[S];i.push(w+k)}a=c+(a.length>0?" "+a:a)}return a};function eR(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=PS(t))&&(r&&(r+=" "),r+=n);return r}const PS=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=PS(e[r]))&&(n&&(n+=" "),n+=t);return n};function tR(e,...t){let n,r,s,i=o;function o(l){const c=t.reduce((d,f)=>f(d),e());return n=QN(c),r=n.cache.get,s=n.cache.set,i=a,a(l)}function a(l){const c=r(l);if(c)return c;const d=ZN(l,n);return s(l,d),d}return function(){return i(eR.apply(null,arguments))}}const De=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},jS=/^\[(?:([a-z-]+):)?(.+)\]$/i,nR=/^\d+\/\d+$/,rR=new Set(["px","full","screen"]),sR=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,iR=/\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$/,oR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,aR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,lR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,mr=e=>ro(e)||rR.has(e)||nR.test(e),Lr=e=>Ao(e,"length",gR),ro=e=>!!e&&!Number.isNaN(Number(e)),xf=e=>Ao(e,"number",ro),Zo=e=>!!e&&Number.isInteger(Number(e)),cR=e=>e.endsWith("%")&&ro(e.slice(0,-1)),pe=e=>jS.test(e),$r=e=>sR.test(e),uR=new Set(["length","size","percentage"]),dR=e=>Ao(e,uR,NS),fR=e=>Ao(e,"position",NS),hR=new Set(["image","url"]),pR=e=>Ao(e,hR,vR),mR=e=>Ao(e,"",yR),ea=()=>!0,Ao=(e,t,n)=>{const r=jS.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},gR=e=>iR.test(e)&&!oR.test(e),NS=()=>!1,yR=e=>aR.test(e),vR=e=>lR.test(e),wR=()=>{const e=De("colors"),t=De("spacing"),n=De("blur"),r=De("brightness"),s=De("borderColor"),i=De("borderRadius"),o=De("borderSpacing"),a=De("borderWidth"),l=De("contrast"),c=De("grayscale"),d=De("hueRotate"),f=De("invert"),h=De("gap"),p=De("gradientColorStops"),v=De("gradientColorStopPositions"),g=De("inset"),b=De("margin"),w=De("opacity"),y=De("padding"),x=De("saturate"),S=De("scale"),k=De("sepia"),E=De("skew"),C=De("space"),_=De("translate"),j=()=>["auto","contain","none"],T=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto",pe,t],M=()=>[pe,t],H=()=>["",mr,Lr],D=()=>["auto",ro,pe],G=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],L=()=>["solid","dashed","dotted","double","none"],Z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],N=()=>["start","end","center","between","around","evenly","stretch"],P=()=>["","0",pe],F=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>[ro,pe];return{cacheSize:500,separator:":",theme:{colors:[ea],spacing:[mr,Lr],blur:["none","",$r,pe],brightness:O(),borderColor:[e],borderRadius:["n
250one","","full",$r,pe],borderSpacing:M(),borderWidth:H(),contrast:O(),grayscale:P(),hueRotate:O(),invert:P(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[cR,Lr],inset:I(),margin:I(),opacity:O(),padding:M(),saturate:O(),scale:O(),sepia:P(),skew:O(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",pe]}],container:["container"],columns:[{columns:[$r]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"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:[...G(),pe]}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Zo,pe]}],basis:[{basis:I()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",pe]}],grow:[{grow:P()}],shrink:[{shrink:P()}],order:[{order:["first","last","none",Zo,pe]}],"grid-cols":[{"grid-cols":[ea]}],"col-start-end":[{col:["auto",{span:["full",Zo,pe]},pe]}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":[ea]}],"row-start-end":[{row:["auto",{span:[Zo,pe]},pe]}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",pe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",pe]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...N()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...N(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...N(),"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":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",pe,t]}],"min-w":[{"min-w":[pe,t,"min","max","fit"]}],"max-w":[{"max-w":[pe,t,"none","full","min","max","fit","prose",{screen:[$r]},$r]}],h:[{h:[pe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[pe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[pe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[pe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",$r,Lr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",xf]}],"font-family":[{font:[ea]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",pe]}],"line-clamp":[{"line-clamp":["none",ro,xf]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",mr,pe]}],"list-image":[{"list-image":["none",pe]}],"list-style-type":[{list:["none","disc","decimal",pe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...L(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",mr,Lr]}],"underline-offset":[{"underline-offset":["auto",mr,pe]}],"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:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pe]}],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",pe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...G(),fR]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",dR]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},pR]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[v]}
vendor: 5,180 bytes, line 250
250],"gradient-via-pos":[{via:[v]}],"gradient-to-pos":[{to:[v]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"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":[w]}],"border-style":[{border:[...L(),"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":[w]}],"divide-style":[{divide:L()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...L()]}],"outline-offset":[{"outline-offset":[mr,pe]}],"outline-w":[{outline:[mr,Lr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[mr,Lr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",$r,mR]}],"shadow-color":[{shadow:[ea]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...Z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Z()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",$r,pe]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[x]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",pe]}],duration:[{duration:O()}],ease:[{ease:["linear","in","out","in-out",pe]}],delay:[{delay:O()}],animate:[{animate:["none","spin","ping","pulse","bounce",pe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[Zo,pe]}],"translate-x":[{"translate-x":[_]}],"translate-y":[{"translate-y":[_]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",pe]}],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",pe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}
vendor: 4,647 bytes, line 250
250],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",pe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[mr,Lr,xf]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},xR=tR(wR);function Re(...e){return xR(bS(e))}const bR=mN,RS=m.forwardRef(({className:e,...t},n)=>u.jsx(pS,{ref:n,className:Re("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));RS.displayName=pS.displayName;const SR=sg("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"}}),AS=m.forwardRef(({className:e,variant:t,...n},r)=>u.jsx(mS,{ref:r,className:Re(SR({variant:t}),e),...n}));AS.displayName=mS.displayName;const kR=m.forwardRef(({className:e,...t},n)=>u.jsx(vS,{ref:n,className:Re("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));kR.displayName=vS.displayName;const OS=m.forwardRef(({className:e,...t},n)=>u.jsx(wS,{ref:n,className:Re("absolute right-2 top-2 rounded-md p-1 text-foreground
250/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:u.jsx(fd,{className:"h-4 w-4"})}));OS.displayName=wS.displayName;const MS=m.forwardRef(({className:e,...t},n)=>u.jsx(gS,{ref:n,className:Re("text-sm font-semibold",e),...t}));MS.displayName=gS.displayName;const IS=m.forwardRef(({className:e,...t},n)=>u.jsx(yS,{ref:n,className:Re("text-sm opacity-90",e),...t}));IS.displayName=yS.displayName;function _R(){const{toasts:e}=Ro();return u.jsxs(bR,{children:[e.map(function({id:t,title:n,description:r,action:s,...i}){return u.jsxs(AS,{...i,children:[u.jsxs("div",{className:"grid gap-1",children:[n&&u.jsx(MS,{children:n}),r&&u.jsx(IS,{children:r})]}),s,u.jsx(OS,{})]},t)}),u.jsx(RS,{})]})}var zv=["light","dark"],ER="(prefers-color-scheme: dark)",CR=m.createContext(void 0),TR={setTheme:e=>{},themes:[]},PR=()=>{var e;return(e=m.useContext(CR))!=null?e:TR};m.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:i,value:o,attrs:a,nonce:l})=>{let c=i==="system",d=n==="class"?`var d=document.documentElement,c=d.classList;
250${`c.remove(${a.map(v=>`'${v}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,f=s?zv.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",h=(v,g=!1,b=!0)=>{let w=o?o[v]:v,y=g?v+"|| ''":`'${w}'`,x="";return s&&b&&!g&&zv.includes(v)&&(x+=`d.style.colorScheme = '${v}';`),n==="class"?g||w?x+=`c.add(${y})`:x+="null":w&&(x+=`d[s](n,${y})`),x},p=e?`!function(){${d}${h(e)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${c})){var t='${ER}',m=window.matchMedia(t);if(m.media!==t||m.matches){${h("dark")}}else{${h("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${h(o?"x[e]":"e",!0)}}${c?"":"else{"+h(i,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${h(o?"x[e]":"e",!0)}}else{${h(i,!1,!1)};}${f}}catch(t){}}();`;return m.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:p}})});var jR=e=>{switch(e){case"success":return AR;case"info":return MR;case"warning":return OR;case"error":return IR;default:return null}},NR=Array(12).fill(0),RR=({visible:e,className:t})=>U.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},U.createElement("div",{className:"sonner-spinner"},NR.map((n,r)=>U.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),AR=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.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"})),OR=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},U.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"})),MR=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.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"})),IR=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.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"})),DR=U.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"},U.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),U.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),LR=()=>{let[e,t]=U.useState(document.hidden);return U.useEffect(()=>{let n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},rp=1,$R=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,s=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:rp++,i=this.toasts.find(a=>a.id===s),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(a=>a.id===s?(this.publish({...a,...e,id:s,title:n}),{...a,...e,id:s,dismissible:o,title:n}):a):this.addToast({title:n,...r,dismissible:o,id:s}),s},this.dismiss=e=>
250(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),s=n!==void 0,i,o=r.then(async l=>{if(i=["resolve",l],U.isValidElement(l))s=!1,this.create({id:n,type:"default",message:l});else if(UR(l)&&!l.ok){s=!1;let c=typeof t.error=="function"?await t.error(`HTTP error! status: ${l.status}`):t.error,d=typeof t.description=="function"?await t.description(`HTTP error! status: ${l.status}`):t.description;this.create({id:n,type:"error",message:c,description:d})}else if(t.success!==void 0){s=!1;let c=typeof t.success=="function"?await t.success(l):t.success,d=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"success",message:c,description:d})}}).catch(async l=>{if(i=["reject",l],t.error!==void 0){s=!1;let c=typeof t.error=="function"?await t.error(l):t.error,d=typeof t.description=="function"?await t.description(l):t.description;this.create({id:n,type:"error",message:c,description:d})}}).finally(()=>{var l;s&&(this.dismiss(n),n=void 0),(l=t.finally)==null||l.call(t)}),a=()=>new Promise((l,c)=>o.then(()=>i[0]==="reject"?c(i[1]):l(i[1])).catch(c));return typeof n!="string"&&typeof n!="number"?{unwrap:a}:Object.assign(n,{unwrap:a})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||rp++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Lt=new $R,FR=(e,t)=>{let n=(t==null?void 0:t.id)||rp++;return Lt.addToast({title:e,...t,id:n}),n},UR=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",VR=FR,BR=()=>Lt.toasts,zR=()=>Lt.getActiveToasts();Object.assign(VR,{success:Lt.success,info:Lt.info,warning:Lt.warning,error:Lt.error,custom:Lt.custom,message:Lt.message,promise:Lt.promise,dismiss:Lt.dismiss,loading:Lt.loading},{getHistory:BR,getToasts:zR});function WR(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}WR(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
250left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
250:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);
250--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} 251`);function Zl(e){return e.label!==void 0}var HR=3,qR="32px",KR="16px",Wv=4e3,GR=356,YR=14,JR=20,QR=200;function Sn(...e){return e.filter(Boolean).join(" ")}function XR(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var ZR=e=>{var t,n,r,s,i,o,a,l,c,d,f;let{invert:h,toast:p,unstyled:v,interacting:g,setHeights:b,visibleToasts:w,heights:y,index:x,toasts:S,expanded:k,removeToast:E,defaultRichColors:C,closeButton:_,style:j,cancelButtonStyle:T,actionButtonStyle:I,className:M="",descriptionClassName:H="",duration:D,position:G,gap:L,loadingIcon:Z,expandByDefault:N,classNames:P,icons:F,closeButtonAriaLabel:O="Close toast",pauseWhenPageIsHidden:$}=e,[Y,W]=U.useState(null),[fe,ke]=U.useState(null),[ae,Pe]=U.useState(!1),[Ae,Qe]=U.useState(!1),[me,Et]=U.useState(!1),[zt,Wn]=U.useState(!1),[sn,on]=U.useState(!1),[Ce,pr]=U.useState(0),[Dt,Mr]=U.useState(0),wn=U.useRef(p.duration||D||Wv),js=U.useRef(null),z=U.useRef(null),ge=x===0,te=x+1<=w,he=p.type,Hn=p.dism
251issible!==!1,Bo=p.className||"",zo=p.descriptionClassName||"",Ir=U.useMemo(()=>y.findIndex(J=>J.toastId===p.id)||0,[y,p.id]),Wo=U.useMemo(()=>{var J;return(J=p.closeButton)!=null?J:_},[p.closeButton,_]),vi=U.useMemo(()=>p.duration||D||Wv,[p.duration,D]),Ns=U.useRef(0),qn=U.useRef(0),Rs=U.useRef(0),an=U.useRef(null),[As,R]=G.split("-"),V=U.useMemo(()=>y.reduce((J,ue,re)=>re>=Ir?J:J+ue.height,0),[y,Ir]),q=LR(),K=p.invert||h,ce=he==="loading";qn.current=U.useMemo(()=>Ir*L+V,[Ir,V]),U.useEffect(()=>{wn.current=vi},[vi]),U.useEffect(()=>{Pe(!0)},[]),U.useEffect(()=>{let J=z.current;if(J){let ue=J.getBoundingClientRect().height;return Mr(ue),b(re=>[{toastId:p.id,height:ue,position:p.position},...re]),()=>b(re=>re.filter(Be=>Be.toastId!==p.id))}},[b,p.id]),U.useLayoutEffect(()=>{if(!ae)return;let J=z.current,ue=J.style.height;J.style.height="auto";let re=J.getBoundingClientRect().height;J.style.height=ue,Mr(re),b(Be=>Be.find(Se=>Se.toastId===p.id)?Be.map(Se=>Se.toastId===p.id?{...Se,height:re}:Se):[{toastId:p.id,height:re,position:p.position},...Be])},[ae,p.title,p.description,b,p.id]);let we=U.useCallback(()=>{Qe(!0),pr(qn.current),b(J=>J.filter(ue=>ue.toastId!==p.id)),setTimeout(()=>{E(p)},QR)},[p,E,b,qn]);U.useEffect(()=>{if(p.promise&&he==="loading"||p.duration===1/0||p.type==="loading")return;let J;return k||g||$&&q?(()=>{if(Rs.current<Ns.current){let ue=new Date().getTime()-Ns.current;wn.current=wn.current-ue}Rs.current=new Date().getTime()})():wn.current!==1/0&&(Ns.current=new Date().getTime(),J=setTimeout(()=>{var ue;(ue=p.onAutoClose)==null||ue.call(p,p),we()},wn.current)),()=>clearTimeout(J)},[k,g,p,he,$,q,we]),U.useEffect(()=>{p.delete&&we()},[we,p.delete]);function ye(){var J,ue,re;return F!=null&&F.loading?U.createElement("div",{className:Sn(P==null?void 0:P.loader,(J=p==null?void 0:p.classNames)==null?void 0:J.loader,"sonner-loader"),"data-visible":he==="loading"},F.loading):Z?U.createElement("div",{className:Sn(P==null?void 0:P.loader,(ue=p==null?void 0:p.classNames)==null?void 0:ue.loader,"sonner-loader"),"data-visible":he==="loading"},Z):U.createElement(RR,{className:Sn(P==null?void 0:P.loader,(re=p==null?void 0:p.classNames)==null?void 0:re.loader),visible:he==="loading"})}return U.createElement("li",{tabIndex:0,ref:z,className:Sn(M,Bo,P==null?void 0:P.toast,(t=p==null?void 0:p.classNames)==null?void 0:t.toast,P==null?void 0:P.default,P==null?void 0:P[he],(n=p==null?void 0:p.classNames)==null?void 0:n[he]),"data-sonner-toast":"","data-rich-colors":(r=p.richColors)!=null?r:C,"data-styled":!(p.jsx||p.unstyled||v),"data-mounted":ae,"data-promise":!!p.promise,"data-swiped":sn,"data-removed":Ae,"data-visible":te,"data-y-position":As,"data-x-position":R,"data-index":x,"data-front":ge,"data-swiping":me,"data-dismissible":Hn,"data-type":he,"data-invert":K,"data-swipe-out":zt,"data-swipe-direction":fe,"data-expanded":!!(k||N&&ae),style:{"--index":x,"--toasts-before":x,"--z-index":S.length-x,"--offset":`${Ae?Ce:qn.current}px`,"--initial-height":N?"auto":`${Dt}px`,...j,...p.style},onDragEnd:()=>{Et(!1),W(null),an.current=null},onPointerDown:J=>{ce||!Hn||(js.current=new Date,pr(qn.current),J.target.setPointerCapture(J.pointerId),J.target.tagName!=="BUTTON"&&(Et(!0),an.current={x:J.clientX,y:J.clientY}))},onPointerUp:()=>{var J,ue,re,Be;if(zt||!Hn)return;an.current=null;let Se=Number(((J=z.current)==null?void 0:J.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),Wt=Number(((ue=z.current)==null?void 0:ue.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),xn=new Date().getTime()-((re=js.current)==null?void 0:re.getTime()),Ht=Y==="x"?Se:Wt,ln=Math.abs(Ht)/xn;if(Math.abs(Ht)>=JR||ln>.11){pr(qn.current),(Be=p.onDismiss)==null||Be.call(p,p),ke(Y==="x"?Se>0?"right":"left":Wt>0?"down":"up"),we(),Wn(!0),on(!1);return}Et(!1),W(null)},onPointerMove:J=>{var ue,re,Be,Se;if(!an.current||!Hn||((ue=window.getSelection())==null?void 0:ue.toString().length)>0)return;let Wt=J.clientY-an.current.y,xn=J.clientX-an.current.x,Ht=(re=e.swipeDirections)!=null?re:XR(G);!Y&&(Math.abs(xn)>1||Math.abs(Wt)>1)&&W(Math.abs(xn)>Math.abs(Wt)?"x":"y");let ln={x:0,y:0};Y==="y"?(Ht.includes("top")||Ht.includes("bottom"))&&(Ht.includes("top")&&Wt<0||Ht.includes("bottom")&&Wt>0)&&(ln.y=Wt):Y==="x"&&(Ht.includes("left")||Ht.includes("right"))&&(Ht.includes("left")&&xn<0||Ht.includes("right")&&xn>0)&&(ln.x=xn),(Math.abs(ln.x)>0||Math.abs(ln.y)>0)&&on(!0),(Be=z.current)==null||Be.style.setProperty("--swipe-amount-x",`${ln.x}px`),(Se=z.current)==null||Se.style.setProperty("--swipe-amount-y",`${ln.y}px`)}},Wo&&!p.jsx?U.createElement("button",{"aria-label":O,"data-disabled":ce,"data-close-button":!0,onClick:ce||!Hn?()=>{}:()=>{var J;we(),(J=p.onDismiss)==null||J.call(p,p)},className:Sn(P==null?void 0:P.closeButton,(s=p==null?void 0:p.classNames)==null?void 0:s.closeButton)},(i=F==null?void 0:F.close)!=null?i:DR):null,p.jsx||m.isValidElement(p.title)?p.jsx?p.jsx:typeof p.title=="function"?p.title():p.title:U.createElement(U.Fragment,null,he||p.icon||p.promise?U.createElement("div",{"data-icon":"",className:Sn(P==null?void 0:P.icon,(o=p==null?void 0:p.classNames)==null?void 0:o.icon)}
251,p.promise||p.type==="loading"&&!p.icon?p.icon||ye():null,p.type!=="loading"?p.icon||(F==null?void 0:F[he])||jR(he):null):null,U.createElement("div",{"data-content":"",className:Sn(P==null?void 0:P.content,(a=p==null?void 0:p.classNames)==null?void 0:a.content)},U.createElement("div",{"data-title":"",className:Sn(P==null?void 0:P.title,(l=p==null?void 0:p.classNames)==null?void 0:l.title)},typeof p.title=="function"?p.title():p.title),p.description?U.createElement("div",{"data-description":"",className:Sn(H,zo,P==null?void 0:P.description,(c=p==null?void 0:p.classNames)==null?void 0:c.description)},typeof p.description=="function"?p.description():p.description):null),m.isValidElement(p.cancel)?p.cancel:p.cancel&&Zl(p.cancel)?U.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||T,onClick:J=>{var ue,re;Zl(p.cancel)&&Hn&&((re=(ue=p.cancel).onClick)==null||re.call(ue,J),we())},className:Sn(P==null?void 0:P.cancelButton,(d=p==null?void 0:p.classNames)==null?void 0:d.cancelButton)},p.cancel.label):null,m.isValidElement(p.action)?p.action:p.action&&Zl(p.action)?U.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||I,onClick:J=>{var ue,re;Zl(p.action)&&((re=(ue=p.action).onClick)==null||re.call(ue,J),!J.defaultPrevented&&we())},className:Sn(P==null?void 0:P.actionButton,(f=p==null?void 0:p.classNames)==null?void 0:f.actionButton)},p.action.label):null))};function Hv(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function eA(e,t){let n={};return[e,t].forEach((r,s)=>{let i=s===1,o=i?"--mobile-offset":"--offset",a=i?KR:qR;function l(c){["top","right","bottom","left"].forEach(d=>{n[`${o}-${d}`]=typeof c=="number"?`${c}px`:c})}typeof r=="number"||typeof r=="string"?l(r):typeof r=="object"?["top","right","bottom","left"].forEach(c=>{r[c]===void 0?n[`${o}-${c}`]=a:n[`${o}-${c}`]=typeof r[c]=="number"?`${r[c]}px`:r[c]}):l(a)}),n}var tA=m.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:s=["altKey","KeyT"],expand:i,closeButton:o,className:a,offset:l,mobileOffset:c,theme:d="light",richColors:f,duration:h,style:p,visibleToasts:v=HR,toastOptions:g,dir:b=Hv(),gap:w=YR,loadingIcon:y,icons:x,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:k}=e,[E,C]=U.useState([]),_=U.useMemo(()=>Array.from(new Set([r].concat(E.filter($=>$.position).map($=>$.position)))),[E,r]),[j,T]=U.useState([]),[I,M]=U.useState(!1),[H,D]=U.useState(!1),[G,L]=U.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),Z=U.useRef(null),N=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=U.useRef(null),F=U.useRef(!1),O=U.useCallback($=>{C(Y=>{var W;return(W=Y.find(fe=>fe.id===$.id))!=null&&W.delete||Lt.dismiss($.id),Y.filter(({id:fe})=>fe!==$.id)})},[]);return U.useEffect(()=>Lt.subscribe($=>{if($.dismiss){C(Y=>Y.map(W=>W.id===$.id?{...W,delete:!0}:W));return}setTimeout(()=>{J1.flushSync(()=>{C(Y=>{let W=Y.findIndex(fe=>fe.id===$.id);return W!==-1?[...Y.slice(0,W),{...Y[W],...$},...Y.slice(W+1)]:[$,...Y]})})})}),[]),U.useEffect(()=>{if(d!=="system"){L(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?L("dark"):L("light")),typeof window>"u")return;let $=window.matchMedia("(prefers-color-scheme: dark)");try{$.addEventListener("change",({matches:Y})=>{L(Y?"dark":"light")})}catch{$.addListener(({matches:W})=>{try{L(W?"dark":"light")}catch(fe){console.error(fe)}})}},[d]),U.useEffect(()=>{E.length<=1&&M(!1)},[E]),U.useEffect(()=>{let $=Y=>{var W,fe;s.every(ke=>Y[ke]||Y.code===ke)&&(M(!0),(W=Z.current)==null||W.focus()),Y.code==="Escape"&&(document.activeElement===Z.current||(fe=Z.current)!=null&&fe.contains(document.activeElement))&&M(!1)};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[s]),U.useEffect(()=>{if(Z.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,F.current=!1)}},[Z.current]),U.createElement("section",{ref:t,"aria-label":`${S} ${N}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},_.map(($,Y)=>{var W;let[fe,ke]=$.split("-");return E.length?U.createElement("ol",{key:$,dir:b==="auto"?Hv():b,tabIndex:-1,ref:Z,className:a,"data-sonner-toaster":!0,"data-theme":G,"data-y-position":fe,"data-lifted":I&&E.length>1&&!i,"data-x-position":ke,style:{"--front-toast-height":`${((W=j[0])==null?void 0:W.height)||0}px`,"--width":`${GR}px`,"--gap":`${w}px`,...p,...eA(l,c)},onBlur:ae=>{F.current&&!ae.currentTarget.contains(ae.relatedTarget)&&(F.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||F.current||(F.current=!0,P.current=ae.relatedTarget)},onMouseEnter:()=>M(!0),onMouseMove:()=>M(!0),onMouseLeave:()=>{H||M(!1)},onDragEnd:()=>M(!1),onPointerDown:ae=>{ae.target instanceof HTMLElement&&ae.target.dataset.dismissible==="false"||D(!0)},onPointerUp:()=>D(!1)},E.filter(ae=>!ae.position&&Y===0||ae.position===$).map((ae,Pe)=>{var Ae,Qe;return U.createElement(ZR,{key:ae.id,icons:x,index:Pe,toast:ae,defaultRichColors:f,duration:(Ae=g==null?void 0:g.duration)!=null?Ae:h,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:n,visibleToasts:v,closeButton:(Qe=g==null?void 0:g.closeButton)!=null?Qe:o,interacting:H,position:$,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:O,toasts:E.filter(me=>me.position==ae.position),heights:j.filter(me=>me.position==ae.position),setHeights:T,expandByDefault:i,gap:w,loadingIcon:y,expanded:I,pauseWhenPageIsHidden:k,swipeDirections:e.swipeDirections})})):null}))});const nA=({...e})=>{const{theme:t="system"}=PR();return u.jsx(tA,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};var rA=Hu[" useId ".trim().toString()]||(()=>{}),sA=0;function ps(e){const[t,n]=m.useState(rA());return ar(()=>{n(r=>r??String(sA++))},[e]),t?`radix-${t}`:""}const iA=["top","right","bottom","left"],vs=Math.min,Gt=Math.max,wu=Math.round,ec=Math.floor,ir=e=>({x:e,y:e}
vendor: 11,912 bytes, line 251
251),oA={left:"right",right:"left",bottom:"top",top:"bottom"},aA={start:"end",end:"start"};function sp(e,t,n){return Gt(e,vs(t,n))}function jr(e,t){return typeof e=="function"?e(t):e}function Nr(e){return e.split("-")[0]}function Oo(e){return e.split("-")[1]}function ag(e){return e==="x"?"y":"x"}function lg(e){return e==="y"?"height":"width"}const lA=new Set(["top","bottom"]);function nr(e){return lA.has(Nr(e))?"y":"x"}function cg(e){return ag(nr(e))}function cA(e,t,n){n===void 0&&(n=!1);const r=Oo(e),s=cg(e),i=lg(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=xu(o)),[o,xu(o)]}function uA(e){const t=xu(e);return[ip(e),t,ip(t)]}function ip(e){return e.replace(/start|end/g,t=>aA[t])}const qv=["left","right"],Kv=["right","left"],dA=["top","bottom"],fA=["bottom","top"];function hA(e,t,n){switch(e){case"top":case"bottom":return n?t?Kv:qv:t?qv:Kv;case"left":case"right":return t?dA:fA;default:return[]}}function pA(e,t,n,r){const s=Oo(e);let i=hA(Nr(e),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),t&&(i=i.concat(i.map(ip)))),i}function xu(e){return e.replace(/left|right|bottom|top/g,t=>oA[t])}function mA(e){return{top:0,right:0,bottom:0,left:0,...e}}function DS(e){return typeof e!="number"?mA(e):{top:e,right:e,bottom:e,left:e}}function bu(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function Gv(e,t,n){let{reference:r,floating:s}=e;const i=nr(t),o=cg(t),a=lg(o),l=Nr(t),c=i==="y",d=r.x+r.width/2-s.width/2,f=r.y+r.height/2-s.height/2,h=r[a]/2-s[a]/2;let p;switch(l){case"top":p={x:d,y:r.y-s.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-s.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Oo(t)){case"start":p[o]-=h*(n&&c?-1:1);break;case"end":p[o]+=h*(n&&c?-1:1);break}return p}async function gA(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:i,rects:o,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=jr(t,e),v=DS(p),b=a[h?f==="floating"?"reference":"floating":f],w=bu(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:l})),y=f==="floating"?{x:r,y:s,width:o.floating.width,height:o.floating.height}:o.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),S=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},k=bu(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:x,strategy:l}):y);return{top:(w.top-k.top+v.top)/S.y,bottom:(k.bottom-w.bottom+v.bottom)/S.y,left:(w.left-k.left+v.left)/S.x,right:(k.right-w.right+v.right)/S.x}}const yA=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,a=i.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:f}=Gv(c,r,l),h=r,p={},v=0;for(let b=0;b<a.length;b++){var g;const{name:w,fn:y}=a[b],{x,y:S,data:k,reset:E}=await y({x:d,y:f,initialPlacement:r,placement:h,strategy:s,middlewareData:p,rects:c,platform:{...o,detectOverflow:(g=o.detectOverflow)!=null?g:gA},elements:{reference:e,floating:t}});d=x??d,f=S??f,p={...p,[w]:{...p[w],...k}},E&&v<=50&&(v++,typeof E=="object"&&(E.placement&&(h=E.placement),E.rects&&(c=E.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:s}):E.rects),{x:d,y:f}=Gv(c,h,l)),b=-1)}return{x:d,y:f,placement:h,strategy:s,middlewareData:p}},vA=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:i,platform:o,elements:a,middlewareData:l}=t,{element:c,padding:d=0}=jr(e,t)||{};if(c==null)return{};const f=DS(d),h={x:n,y:r},p=cg(s),v=lg(p),g=await o.getDimensions(c),b=p==="y",w=b?"top":"left",y=b?"bottom":"right",x=b?"clientHeight":"clientWidth",S=i.reference[v]+i.reference[p]-h[p]-i.floating[v],k=h[p]-i.reference[p],E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let C=E?E[x]:0;(!C||!await(o.isElement==null?void 0:o.isElement(E)))&&(C=a.floating[x]||i.floating[v]);const _=S/2-k/2,j=C/2-g[v]/2-1,T=vs(f[w],j),I=vs(f[y],j),M=T,H=C-g[v]-I,D=C/2-g[v]/2+_,G=sp(M,D,H),L=!l.arrow&&Oo(s)!=null&&D!==G&&i.reference[v]/2-(D<M?T:I)-g[v]/2<0,Z=L?D<M?D-M:D-H:0;return{[p]:h[p]+Z,data:{[p]:G,centerOffset:D-G-Z,...L&&{alignmentOffset:Z}},reset:L}}}),wA=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:i,rects:o,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:g=!0,...b}=jr(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=Nr(s),y=nr(a),x=Nr(a)===a,S=await(l.isRTL==null?void 0:l.isRTL(c.floating)),k=h||(x||!g?[xu(a)]:uA(a)),E=v!=="none";!h&&E&&k.push(...pA(a,g,v,S));const C=[a,...k],_=await l.detectOverflow(t,b),j=[];let T=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&j.push(_[w]),f){const D=cA(s,o,S);j.push(_[D[0]],_[D[1]])}if(T=[...T,{placement:s,overflows:j}],!j.every(D=>D<=0)){var I,M;const D=(((I=i.flip)==null?void 0:I.index)||0)+1,G=C[D];if(G&&(!(f==="alignment"?y!==nr(G):!1)||T.every(N=>nr(N.placement)===y?N.overflows[0]>0:!0)))return{data:{index:D,overflows:T},reset:{placement:G}};let L=(M=T.filter(Z=>Z.overflows[0]<=0).sort((Z,N)=>Z.overflows[1]-N.overflows[1])[0])==null?void 0:M.placement;if(!L)switch(p){case"bestFit":{var H;const Z=(H=T.filter(N=>{if(E){const P=nr(N.placement);return P===y||P==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(P=>P>0).reduce((P,F)=>P+F,0)]).sort((N,P)=>N[1]-P[1])[0])==null?void 0:H[0];Z&&(L=Z);break}case"initialPlacement":L=a;break}if(s!==L)return{reset:{placement:L}}}return{}}}};function Yv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Jv(e){return iA.some(t=>e[t]>=0)}const xA=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:s="referenceHidden",...i}=jr(e,t);switch(s){case"referenceHidden":{const o=await r.detectOverflow(t,{...i,elementContext:"reference"}),a=Yv(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Jv(a)}}}case"escaped":{const o=await r.detectOverflow(t,{...i,altBoundary:!0}),a=Yv(o,n.floating);return{data:{escapedOffsets:a,escaped:Jv(a)}}}default:return{}}}}},LS=new Set(["left","top"]);async function bA(e,t){const{placement:n,platform:r,elements:s}=e,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=Nr(n),a=Oo(n),l=nr(n)==="y",c=LS.has(o)?-1:1,d=i&&l?-1:1,f=jr(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:v}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof v=="number"&&(p=a==="end"?v*-1:v),l?{x:p*d,y:h*c}:{x:h*c,y:p*d}}const SA=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:i,placement:o,middlewareData:a}=t,l=await bA(t,e);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:s+l.x,y:i+l.y,data:{...l,placement:o}}}}},kA=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s,platform:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:l={fn:w=>{let{x:y,y:x}=w;return{x:y,y:x}}},...c}=jr(e,t),d={x:n,y:r},f=await i.detectOverflow(t,c),h=nr(Nr(s)),p=ag(h);let v=d[p],g=d[h];if(o){const w=p==="y"?"top":"left",y=p==="y"?"bottom":"right",x=v+f[w],S=v-f[y];v=sp(x,v,S)}if(a){const w=h==="y"?"top":"left",y=h==="y"?"bottom":"right",x=g+f[w],S=g-f[y];g=sp(x,g,S)}const b=l.fn({...t,[p]:v,[h]:g});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[p]:o,[h]:a}}}}}},_A=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:i,middlewareData:o}=t,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=jr(e,t),d={x:n,y:r},f=nr(s),h=ag(f);let p=d[h],v=d[f];const g=jr(a,t),b=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const x=h==="y"?"height":"width",S=i.reference[h]-i.floating[x]+b.mainAxis,k=i.reference[h]+i.reference[x]-b.mainAxis;p<S?p=S:p>k&&(p=k)}if(c){var w,y;const x=h==="y"?"width":"height",S=LS.has(Nr(s)),k=i.reference[f]-i.floating[x]+(S&&((w=o.offset)==null?void 0:w[f])||0)+(S?0:b.crossAxis),E=i.reference[f]+i.reference[x]+(S?0:((y=o.offset)==null?void 0:y[f])||0)-(S?b.crossAxis:0);v<k?v=k:v>E&&(v=E)}return{[h]:p,[f]:v}}}},EA=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:i,platform:o,elements:a}=t,{apply:l=()=>{},...c}=jr(e,t),d=await o.detectOverflow(t,c),f=Nr(s),h=Oo(s),p=nr(s)==="y",{width:v,height:g}=i.floating;let b,w;f==="top"||f==="bottom"?(b=f,w=h===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(w=f,b=h==="end"?"top":"bottom");const y=g-d.top-d.bottom,x=v-d.left-d.right,S=vs(g-d[b],y),k=vs(v-d[w],x),E=!t.middlewareData.shift;let C=S,_=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=y),E&&!h){const T=Gt(d.left,0),I=Gt(d.right,0),M=Gt(d.top,0),H=Gt(d.bottom,0);p?_=v-2*(T!==0||I!==0?T+I:Gt(d.left,d.right)):C=g-2*(M!==0||H!==0?M+H:Gt(d.top,d.bottom))}await l({...t,availableWidth:_,availableHeight:C});const j=await o.getDimensions(a.floating);return v!==j.width||g!==j.height?{reset:{rects:!0}}:{}}}};function hd(){return typeof window<"u"}function Mo(e){return $S(e)?(e.nodeName||"").toLowerCase():"#document"}function Xt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function dr(e){var t;return(t=($S(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function $S(e){return hd()?e instanceof Node||e instanceof Xt(e).Node:!1}function $n(e){return hd()?e instanceof Element||e instanceof Xt(e).Element:!1}function lr(e){return hd()?e instanceof HTMLElement||e instanceof Xt(e).HTMLElement:!1}function Qv(e){return!hd()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Xt(e).ShadowRoot}const CA=new Set(["inline","contents"]);function kl(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Fn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!CA.has(s)}const TA=new Set(["table","td","th"]);function PA(e){return TA.has(Mo(e))}const jA=[":popover-open",":modal"];function pd(e){return jA.some(t=>{try{return e.matches(t)}catch{return!1}})}const NA=["transform","translate","scale","rotate","perspective"],RA=["transform","translate","scale","rotate","perspective","filter"],AA=["paint","layout","strict","content"];function ug(e){const t=dg(),n=$n(e)?Fn(e):e;return NA.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||RA.some(r=>(n.willChange||"").includes(r))||AA.some(r=>(n.contain||"").includes(r))}function OA(e){let t=ws(e);for(;lr(t)&&!_o(t);){if(ug(t))return t;if(pd(t))return null;t=ws(t)}return null}function dg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const MA=new Set(["html","body","#document"]);function _o(e){return MA.has(Mo(e))}function Fn(e){return Xt(e).getComputedStyle(e)}function md(e){return $n(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ws(e){if(Mo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Qv(e)&&e.host||dr(e);return Qv(t)?t.host:t}function FS(e){const t=ws(e);return _o(t)?e.ownerDocument?e.ownerDocument.body:e.body:lr(t)&&kl(t)?t:FS(t)}
vendor: 14,356 bytes, line 251
251function Ha(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=FS(e),i=s===((r=e.ownerDocument)==null?void 0:r.body),o=Xt(s);if(i){const a=op(o);return t.concat(o,o.visualViewport||[],kl(s)?s:[],a&&n?Ha(a):[])}return t.concat(s,Ha(s,[],n))}function op(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function US(e){const t=Fn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=lr(e),i=s?e.offsetWidth:n,o=s?e.offsetHeight:r,a=wu(n)!==i||wu(r)!==o;return a&&(n=i,r=o),{width:n,height:r,$:a}}function fg(e){return $n(e)?e:e.contextElement}function so(e){const t=fg(e);if(!lr(t))return ir(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:i}=US(t);let o=(i?wu(n.width):n.width)/r,a=(i?wu(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const IA=ir(0);function VS(e){const t=Xt(e);return!dg()||!t.visualViewport?IA:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function DA(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Xt(e)?!1:t}function ui(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=fg(e);let o=ir(1);t&&(r?$n(r)&&(o=so(r)):o=so(e));const a=DA(i,n,r)?VS(i):ir(0);let l=(s.left+a.x)/o.x,c=(s.top+a.y)/o.y,d=s.width/o.x,f=s.height/o.y;if(i){const h=Xt(i),p=r&&$n(r)?Xt(r):r;let v=h,g=op(v);for(;g&&r&&p!==v;){const b=so(g),w=g.getBoundingClientRect(),y=Fn(g),x=w.left+(g.clientLeft+parseFloat(y.paddingLeft))*b.x,S=w.top+(g.clientTop+parseFloat(y.paddingTop))*b.y;l*=b.x,c*=b.y,d*=b.x,f*=b.y,l+=x,c+=S,v=Xt(g),g=op(v)}}return bu({width:d,height:f,x:l,y:c})}function gd(e,t){const n=md(e).scrollLeft;return t?t.left+n:ui(dr(e)).left+n}function BS(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-gd(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function LA(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const i=s==="fixed",o=dr(r),a=t?pd(t.floating):!1;if(r===o||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=ir(1);const d=ir(0),f=lr(r);if((f||!f&&!i)&&((Mo(r)!=="body"||kl(o))&&(l=md(r)),lr(r))){const p=ui(r);c=so(r),d.x=p.x+r.clientLeft,d.y=p.y+r.clientTop}const h=o&&!f&&!i?BS(o,l):ir(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+d.x+h.x,y:n.y*c.y-l.scrollTop*c.y+d.y+h.y}}function $A(e){return Array.from(e.getClientRects())}function FA(e){const t=dr(e),n=md(e),r=e.ownerDocument.body,s=Gt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Gt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+gd(e);const a=-n.scrollTop;return Fn(r).direction==="rtl"&&(o+=Gt(t.clientWidth,r.clientWidth)-s),{width:s,height:i,x:o,y:a}}const Xv=25;function UA(e,t){const n=Xt(e),r=dr(e),s=n.visualViewport;let i=r.clientWidth,o=r.clientHeight,a=0,l=0;if(s){i=s.width,o=s.height;const d=dg();(!d||d&&t==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}const c=gd(r);if(c<=0){const d=r.ownerDocument,f=d.body,h=getComputedStyle(f),p=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,v=Math.abs(r.clientWidth-f.clientWidth-p);v<=Xv&&(i-=v)}else c<=Xv&&(i+=c);return{width:i,height:o,x:a,y:l}}const VA=new Set(["absolute","fixed"]);function BA(e,t){const n=ui(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,i=lr(e)?so(e):ir(1),o=e.clientWidth*i.x,a=e.clientHeight*i.y,l=s*i.x,c=r*i.y;return{width:o,height:a,x:l,y:c}}function Zv(e,t,n){let r;if(t==="viewport")r=UA(e,n);else if(t==="document")r=FA(dr(e));else if($n(t))r=BA(t,n);else{const s=VS(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return bu(r)}function zS(e,t){const n=ws(e);return n===t||!$n(n)||_o(n)?!1:Fn(n).position==="fixed"||zS(n,t)}function zA(e,t){const n=t.get(e);if(n)return n;let r=Ha(e,[],!1).filter(a=>$n(a)&&Mo(a)!=="body"),s=null;const i=Fn(e).position==="fixed";let o=i?ws(e):e;for(;$n(o)&&!_o(o);){const a=Fn(o),l=ug(o);!l&&a.position==="fixed"&&(s=null),(i?!l&&!s:!l&&a.position==="static"&&!!s&&VA.has(s.position)||kl(o)&&!l&&zS(e,o))?r=r.filter(d=>d!==o):s=a,o=ws(o)}return t.set(e,r),r}function WA(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const o=[...n==="clippingAncestors"?pd(t)?[]:zA(t,this._c):[].concat(n),r],a=o[0],l=o.reduce((c,d)=>{const f=Zv(t,d,s);return c.top=Gt(f.top,c.top),c.right=vs(f.right,c.right),c.bottom=vs(f.bottom,c.bottom),c.left=Gt(f.left,c.left),c},Zv(t,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function HA(e){const{width:t,height:n}=US(e);return{width:t,height:n}}function qA(e,t,n){const r=lr(t),s=dr(t),i=n==="fixed",o=ui(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=ir(0);function c(){l.x=gd(s)}if(r||!r&&!i)if((Mo(t)!=="body"||kl(s))&&(a=md(t)),r){const p=ui(t,!0,i,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else s&&c();i&&!r&&s&&c();const d=s&&!r&&!i?BS(s,a):ir(0),f=o.left+a.scrollLeft-l.x-d.x,h=o.top+a.scrollTop-l.y-d.y;return{x:f,y:h,width:o.width,height:o.height}}function bf(e){return Fn(e).position==="static"}function e0(e,t){if(!lr(e)||Fn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return dr(e)===n&&(n=n.ownerDocument.body),n}function WS(e,t){const n=Xt(e);if(pd(e))return n;if(!lr(e)){let s=ws(e);for(;s&&!_o(s);){if($n(s)&&!bf(s))return s;s=ws(s)}return n}let r=e0(e,t);for(;r&&PA(r)&&bf(r);)r=e0(r,t);return r&&_o(r)&&bf(r)&&!ug(r)?n:r||OA(e)||n}const KA=async function(e){const t=this.getOffsetParent||WS,n=this.getDimensions,r=await n(e.floating);return{reference:qA(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function GA(e){return Fn(e).direction==="rtl"}const YA={convertOffsetParentRelativeRectToViewportRelativeRect:LA,getDocumentElement:dr,getClippingRect:WA,getOffsetParent:WS,getElementRects:KA,getClientRects:$A,getDimensions:HA,getScale:so,isElement:$n,isRTL:GA};function HS(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function JA(e,t){let n=null,r;const s=dr(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:d,top:f,width:h,height:p}=c;if(a||t(),!h||!p)return;const v=ec(f),g=ec(s.clientWidth-(d+h)),b=ec(s.clientHeight-(f+p)),w=ec(d),x={rootMargin:-v+"px "+-g+"px "+-b+"px "+-w+"px",threshold:Gt(0,vs(1,l))||1};let S=!0;function k(E){const C=E[0].intersectionRatio;if(C!==l){if(!S)return o();C?o(!1,C):r=setTimeout(()=>{o(!1,1e-7)},1e3)}C===1&&!HS(c,e.getBoundingClientRect())&&o(),S=!1}try{n=new IntersectionObserver(k,{...x,root:s.ownerDocument})}catch{n=new IntersectionObserver(k,x)}n.observe(e)}return o(!0),i}function QA(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=fg(e),d=s||i?[...c?Ha(c):[],...Ha(t)]:[];d.forEach(w=>{s&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const f=c&&a?JA(c,n):null;let h=-1,p=null;o&&(p=new ResizeObserver(w=>{let[y]=w;y&&y.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(t)})),n()}),c&&!l&&p.observe(c),p.observe(t));let v,g=l?ui(e):null;l&&b();function b(){const w=ui(e);g&&!HS(g,w)&&n(),g=w,v=requestAnimationFrame(b)}return n(),()=>{var w;d.forEach(y=>{s&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),f==null||f(),(w=p)==null||w.disconnect(),p=null,l&&cancelAnimationFrame(v)}}const XA=SA,ZA=kA,eO=wA,tO=EA,nO=xA,t0=vA,rO=_A,sO=(e,t,n)=>{const r=new Map,s={platform:YA,...n},i={...s.platform,_c:r};return yA(e,t,{...s,platform:i})};var iO=typeof document<"u",oO=function(){},Ic=iO?m.useLayoutEffect:oO;function Su(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Su(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&e.$$typeof)&&!Su(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function qS(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function n0(e,t){const n=qS(e);return Math.round(t*n)/n}function Sf(e){const t=m.useRef(e);return Ic(()=>{t.current=e}),t}function aO(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:o}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[d,f]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=m.useState(r);Su(h,r)||p(r);const[v,g]=m.useState(null),[b,w]=m.useState(null),y=m.useCallback(N=>{N!==E.current&&(E.current=N,g(N))},[]),x=m.useCallback(N=>{N!==C.current&&(C.current=N,w(N))},[]),S=i||v,k=o||b,E=m.useRef(null),C=m.useRef(null),_=m.useRef(d),j=l!=null,T=Sf(l),I=Sf(s),M=Sf(c),H=m.useCallback(()=>{if(!E.current||!C.current)return;const N={placement:t,strategy:n,middleware:h};I.current&&(N.platform=I.current),sO(E.current,C.current,N).then(P=>{const F={...P,isPositioned:M.current!==!1};D.current&&!Su(_.current,F)&&(_.current=F,xl.flushSync(()=>{f(F)}))})},[h,t,n,I,M]);Ic(()=>{c===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,f(N=>({...N,isPositioned:!1})))},[c]);const D=m.useRef(!1);Ic(()=>(D.current=!0,()=>{D.current=!1}),[]),Ic(()=>{if(S&&(E.current=S),k&&(C.current=k),S&&k){if(T.current)return T.current(S,k,H);H()}},[S,k,H,T,j]);const G=m.useMemo(()=>({reference:E,floating:C,setReference:y,setFloating:x}),[y,x]),L=m.useMemo(()=>({reference:S,floating:k}),[S,k]),Z=m.useMemo(()=>{const N={position:n,left:0,top:0};if(!L.floating)return N;const P=n0(L.floating,d.x),F=n0(L.floating,d.y);return a?{...N,transform:"translate("+P+"px, "+F+"px)",...qS(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:P,top:F}},[n,a,L.floating,d.x,d.y]);return m.useMemo(()=>({...d,update:H,refs:G,elements:L,floatingStyles:Z}),[d,H,G,L,Z])}const lO=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:s}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?t0({element:r.current,padding:s}).fn(n):{}:r?t0({element:r,padding:s}).fn(n):{}}}},cO=(e,t)=>({...XA(e),options:[e,t]}),uO=(e,t)=>({...ZA(e),options:[e,t]}),dO=(e,t)=>({...rO(e),options:[e,t]}),fO=(e,t)=>({...eO(e),options:[e,t]}),hO=(e,t)=>({...tO(e),options:[e,t]}),pO=(e,t)=>({...nO(e),options:[e,t]}),mO=(e,t)=>({...lO(e),options:[e,t]});var gO="Arrow",KS=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...i}=e;return u.jsx(Ee.svg,{...i,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});KS.displayName=gO;var yO=KS;function vO(e){const[t,n]=m.useState(void 0);return ar(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let o,a;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;o=c.inlineSize,a=c.blockSize}else o=e.offsetWidth,a=e.offsetHeight;n({width:o,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var hg="Popper",[GS,yd]=ur(hg),[wO,YS]=GS(hg),JS=e=>{const{__scopePopper:t,children:n}=e,[r,s]=m.useState(null);return u.jsx(wO,{scope:t,anchor:r,onAnchorChange:s,children:n})};JS.displayName=hg;var QS="PopperAnchor",XS=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,i=YS(QS,n),o=m.useRef(null),a=qe(t,o),l=m.useRef(null);return m.useEffect(()=>{const c=l.current;l.current=(r==null?void 0:r.current)||o.current,c!==l.current&&i.onAnchorChange(l.current)}),r?null:u.jsx(Ee.div,{...s,ref:a})});XS.displayName=QS;var pg="PopperContent",[xO,bO]=GS(pg),ZS=m.forwardRef((e,t)=>{var ae,Pe,Ae,Qe,me,Et;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:p="optimized",onPlaced:v,...g}=e,b=YS(pg,n),[w,y]=m.useState(null),x=qe(t,zt=>y(zt)),[S,k]=m.useState(null),E=vO(S),C=(E==null?void 0:E.width)??0,_=(E==null?void 0:E.height)??0,j=r+(i!=="center"?"-"+i:""),T=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},I=Array.isArray(c)?c:[c],M=I.length>0,H={padding:T,boundary:I.filter(kO),altBoundary:M},{refs:D,floatingStyles:G,placement:L,isPositioned:Z,middlewareData:N}=aO({strategy:"fixed",placement:j,whileElementsMounted:(...zt)=>QA(...zt,{animationFrame:p==="always"}),elements:{reference:b.anchor},middleware:[cO({mainAxis:s+_,alignmentAxis:o}),l&&uO({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?dO():void 0,...H}),l&&fO({...H}),hO({...H,apply:({elements:zt,rects:Wn,availableWidth:sn,availableHeight:on})=>{const{width:Ce,height:pr}=Wn.reference,Dt=zt.floating.style;Dt.setProperty("--radix-popper-available-width",`${sn}px`),Dt.setProperty("--radix-popper-available-height",`${on}px`),Dt.setProperty("--radix-popper-anchor-width",`${Ce}px`),Dt.setProperty("--radix-popper-anchor-height",`${pr}px`)}}),S&&mO({element:S,padding:a}),_O({arrowWidth:C,arrowHeight:_}),h&&pO({strategy:"referenceHidden",...H})]}),[P,F]=nk(L),O=tn(v);ar(()=>{Z&&(O==null||O())},[Z,O]);const $=(ae=N.arrow)==null?void 0:ae.x,Y=(Pe=N.arrow)==null?void 0:Pe.y,W=((Ae=N.arrow)==null?void 0:Ae.centerOffset)!==0,[fe,ke]=m.useState();return ar(()=>{w&&ke(window.getComputedStyle(w).zIndex)},[w]),u.jsx("div",{ref:D.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:Z?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[(Qe=N.transformOrigin)==null?void 0:Qe.x,(me=N.transformOrigin)==null?void 0:me.y].join(" "),...((Et=N.hide)==null?void 0:Et.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(xO,{scope:n,placedSide:P,onArrowChange:k,arrowX:$,arrowY:Y,shouldHideArrow:W,children:u.jsx(Ee.div,{"data-side":P,"data-align":F,...g,ref:x,style:{...g.style,animation:Z?void 0:"none"}})})})});ZS.displayName=pg;var ek="PopperArrow",SO={top:"bottom",right:"left",bottom:"top",left:"r
251ight"},tk=m.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,i=bO(ek,r),o=SO[i.placedSide];return u.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:u.jsx(yO,{...s,ref:n,style:{...s.style,display:"block"}})})});tk.displayName=ek;function kO(e){return e!==null}var _O=e=>({name:"transformOrigin",options:e,fn(t){var b,w,y;const{placement:n,rects:r,middlewareData:s}=t,o=((b=s.arrow)==null?void 0:b.centerOffset)!==0,a=o?0:e.arrowWidth,l=o?0:e.arrowHeight,[c,d]=nk(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((w=s.arrow)==null?void 0:w.x)??0)+a/2,p=(((y=s.arrow)==null?void 0:y.y)??0)+l/2;let v="",g="";return c==="bottom"?(v=o?f:`${h}px`,g=`${-l}px`):c==="top"?(v=o?f:`${h}px`,g=`${r.floating.height+l}px`):c==="right"?(v=`${-l}px`,g=o?f:`${p}px`):c==="left"&&(v=`${r.floating.width+l}px`,g=o?f:`${p}px`),{data:{x:v,y:g}}}});function nk(e){const[t,n="center"]=e.split("-");return[t,n]}var EO=JS,rk=XS,sk=ZS,ik=tk,CO=Symbol("radix.slottable");function TO(e){const t=({children:n})=>u.jsx(u.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=CO,t}var[vd]=ur("Tooltip",[yd]),mg=yd(),ok="TooltipProvider",PO=700,r0="tooltip.open",[jO,ak]=vd(ok),lk=e=>{const{__scopeTooltip:t,delayDuration:n=PO,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=e,o=m.useRef(!0),a=m.useRef(!1),l=m.useRef(0);return m.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),u.jsx(jO,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(l.current),o.current=!1},[]),onClose:m.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:a,onPointerInTransitChange:m.useCallback(c=>{a.current=c},[]),disableHoverableContent:s,children:i})};lk.displayName=ok;var ck="Tooltip",[kz,wd]=vd(ck),ap="TooltipTrigger",NO=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=wd(ap,n),i=ak(ap,n),o=mg(n),a=m.useRef(null),l=qe(t,a,s.onTriggerChange),c=m.useRef(!1),d=m.useRef(!1),f=m.useCallback(()=>c.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),u.jsx(rk,{asChild:!0,...o,children:u.jsx(Ee.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:l,onPointerMove:ne(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),d.current=!0)}),onPointerLeave:ne(e.onPointerLeave,()=>{s.onTriggerLeave(),d.current=!1}),onPointerDown:ne(e.onPointerDown,()=>{s.open&&s.onClose(),c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:ne(e.onFocus,()=>{c.current||s.onOpen()}),onBlur:ne(e.onBlur,s.onClose),onClick:ne(e.onClick,s.onClose)})})});NO.displayName=ap;var RO="TooltipPortal",[_z,AO]=vd(RO,{forceMount:void 0}),Eo="TooltipContent",uk=m.forwardRef((e,t)=>{const n=AO(Eo,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=e,o=wd(Eo,e.__scopeTooltip);return u.jsx(Un,{present:r||o.open,children:o.disableHoverableContent?u.jsx(dk,{side:s,...i,ref:t}):u.jsx(OO,{side:s,...i,ref:t})})}),OO=m.forwardRef((e,t)=>{const n=wd(Eo,e.__scopeTooltip),r=ak(Eo,e.__scopeTooltip),s=m.useRef(null),i=qe(t,s),[o,a]=m.useState(null),{trigger:l,onClose:c}=n,d=s.current,{onPointerInTransitChange:f}=r,h=m.useCallback(()=>{a(null),f(!1)},[f]),p=m.useCallback((v,g)=>{const b=v.currentTarget,w={x:v.clientX,y:v.clientY},y=$O(w,b.getBoundingClientRect()),x=FO(w,y),S=UO(g.getBoundingClientRect()),k=BO([...x,...S]);a(k),f(!0)},[f]);return m.useEffect(()=>()=>h(),[h]),m.useEffect(()=>{if(l&&d){const v=b=>p(b,d),g=b=>p(b,l);return l.addEventListener("pointerleave",v),d.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",v),d.removeEventListener("pointerleave",g)}}},[l,d,p,h]),m.useEffect(()=>{if(o){const v=g=>{const b=g.target,w={x:g.clientX,y:g.clientY},y=(l==null?void 0:l.contains(b))||(d==null?void 0:d.contains(b)),x=!VO(w,o);y?h():x&&(h(),c())};return document.addEventListener("pointermove",v),()=>document.removeEventListener("pointermove",v)}},[l,d,o,c,h]),u.jsx(dk,{...e,ref:i})}),[MO,IO]=vd(ck,{isInside:!1}),DO=TO("TooltipContent"),dk=m.forwardRef((e,t)=>
vendor: 5,551 bytes, line 251
251{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...a}=e,l=wd(Eo,n),c=mg(n),{onClose:d}=l;return m.useEffect(()=>(document.addEventListener(r0,d),()=>document.removeEventListener(r0,d)),[d]),m.useEffect(()=>{if(l.trigger){const f=h=>{const p=h.target;p!=null&&p.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),u.jsx(bl,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:u.jsxs(sk,{"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(DO,{children:r}),u.jsx(MO,{scope:n,isInside:!0,children:u.jsx(Q2,{id:l.contentId,role:"tooltip",children:s||r})})]})})});uk.displayName=Eo;var fk="TooltipArrow",LO=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=mg(n);return IO(fk,n).isInside?null:u.jsx(ik,{...s,...r,ref:t})});LO.displayName=fk;function $O(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function FO(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function UO(e){const{top:t,right:n,bottom:r,left:s}=e;return[{x:s,y:t},{x:n,y:t},{x:n,y:r},{x:s,y:r}]}function VO(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const a=t[i],l=t[o],c=a.x,d=a.y,f=l.x,h=l.y;d>r!=h>r&&n<(f-c)*(r-d)/(h-d)+c&&(s=!s)}return s}function BO(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),zO(t)}function zO(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var WO=lk,hk=uk;const HO=WO,qO=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>u.jsx(hk,{ref:r,sideOffset:t,className:Re("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));qO.displayName=hk.displayName;var xd=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(){}},KO={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Jr,im,Px,GO=(Px=class{constructor(){be(this,Jr,KO);be(this,im,!1)}setTimeoutProvider(e){de(this,Jr,e)}setTimeout(e,t){return A(this,Jr).setTimeout(e,t)}clearTimeout(e){A(this,Jr).clearTimeout(e)}setInterval(e,t){return A(this,Jr).setInterval(e,t)}clearInterval(e){A(this,Jr).clearInterval(e)}},Jr=new WeakMap,im=new WeakMap,Px),lp=new GO;function YO(e){setTimeout(e,0)}var bd=typeof window>"u"||"Deno"in globalThis;function Tn(){}function JO(e,t){return typeof e=="function"?e(t):e}function QO(e){return typeof e=="number"&&e>=0&&e!==1/0}function XO(e,t){return Math.max(e+(t||0)-Date.now(),0)}function cp(e,t){return typeof e=="function"?e(t):e}function ZO(e,t){return typeof e=="function"?e(t):e}function s0(e,t){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==gg(o,t.options))return!1}else if(!Ka(t.queryKey,o))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||s&&s!==t.state.fetchStatus||i&&!i(t))}function i0(e,t){const{exact:n,status:r,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(qa(t.options.mutationKey)!==qa(i))return!1}else if(!Ka(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||s&&!s(t))}function gg(e,t){return((t==null?void 0:t.queryKeyHashFn)||qa)(e)}function qa(e){return JSON.stringify(e,(t,n)=>up(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Ka(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Ka(e[n],t[n])):!1}var eM=Object.prototype.hasOwnProperty;function pk(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=o0(e)&&o0(t);
251if(!r&&!(up(e)&&up(t)))return t;const i=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),a=o.length,l=r?new Array(a):{};let c=0;for(let d=0;d<a;d++){const f=r?d:o[d],h=e[f],p=t[f];if(h===p){l[f]=h,(r?d<i:eM.call(e,f))&&c++;continue}if(h===null||p===null||typeof h!="object"||typeof p!="object"){l[f]=p;continue}const v=pk(h,p,n+1);l[f]=v,v===h&&c++}return i===a&&c===i?e:l}function o0(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function up(e){if(!a0(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!a0(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function a0(e){return Object.prototype.toString.call(e)==="[object Object]"}function tM(e){return new Promise(t=>{lp.setTimeout(t,e)})}function nM(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?pk(e,t):t}function rM(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function sM(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var yg=Symbol();function mk(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===yg?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function iM(e,t,n){let r=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var Ys,Qr,lo,jx,oM=(jx=class extends xd{constructor(){super();be(this,Ys);be(this,Qr);be(this,lo);de(this,lo,t=>{if(!bd&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){A(this,Qr)||this.setEventListener(A(this,lo))}onUnsubscribe(){var t;this.hasListeners()||((t=A(this,Qr))==null||t.call(this),de(this,Qr,void 0))}setEventListener(t){var n;de(this,lo,t),(n=A(this,Qr))==null||n.call(this),de(this,Qr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){A(this,Ys)!==t&&(de(this,Ys,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof A(this,Ys)=="boolean"?A(this,Ys):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ys=new WeakMap,Qr=new WeakMap,lo=new WeakMap,jx),gk=new oM;function aM(){let e,t;const n=new Promise((s,i)=>{e=s,t=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),e(s)},n.reject=s=>{r({status:"rejected",reason:s}),t(s)},n}var lM=YO;function cM(){let e=[],t=0,n=a=>{a()},r=a=>{a()},s=lM;const i=a=>{t?e.push(a):s(()=>{n(a)})},o=()=>{const a=e;e=[],a.length&&s(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||o()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{s=a}}}var jt=cM(),co,Xr,uo,Nx,uM=(Nx=class extends xd{constructor(){super();be(this,co,!0);be(this,Xr);be(this,uo);de(this,uo,t=>{if(!bd&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){A(this,Xr)||this.setEventListener(A(this,uo))}onUnsubscribe(){var t;this.hasListeners()||((t=A(this,Xr))==null||t.call(this),de(this,Xr,void 0))}setEventListener(t){var n;de(this,uo,t),(n=A(this,Xr))==null||n.call(this),de(this,Xr,t(this.setOnline.bind(this)))}setOnline(t){A(this,co)!==t&&(de(this,co,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return A(this,co)}},co=new WeakMap,Xr=new WeakMap,uo=new WeakMap,Nx),ku=new uM;function dM(e){return Math.min(1e3*2**e,3e4)}function yk(e){return(e??"online")==="online"?ku.isOnline():!0}var dp=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function vk(e){let t=!1,n=0,r;const s=aM(),i=()=>s.status!=="pending",o=g=>{var b;if(!i()){const w=new dp(g);h(w),(b=e.onCancel)==null||b.call(e,w)}},a=()=>{t=!0},l=()=>{t=!1},c=()=>gk.isFocused()&&(e.networkMode==="always"||ku.isOnline())&&e.canRun(),d=()=>yk(e.networkMode)&&e.canRun(),f=g=>{i()||(r==null||r(),s.resolve(g))},h=g=>{i()||(r==null||r(),s.reject(g))},p=()=>new Promise(g=>{var b;r=w=>{(i()||c())&&g(w)},(b=e.onPause)==null||b.call(e)}).then(()=>{var g;r=void 0,i()||(g=e.onContinue)==null||g.call(e)}),v=()=>{if(i())return;let g;const b=n===0?e.initialPromise:void 0;try{g=b??e.fn()}catch(w){g=Promise.reject(w)}Promise.resolve(g).then(f).catch(w=>{var E;if(i())return;const y=e.retry??(bd?0:3),x=e.retryDelay??dM,S=typeof x=="function"?x(n,w):x,k=y===!0||typeof y=="number"&&n<y||typeof y=="function"&&y(n,w);if(t||!k){h(w);return}n++,(E=e.onFail)==null||E.call(e,n,w),tM(S).then(()=>c()?void 0:p()).then(()=>{t?h(w):v()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(r==null||r(),s),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?v():p().then(v),s)}}var Js,Rx,wk=(Rx=class{constructor(){be(this,Js)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),QO(this.gcTime)&&de(this,Js,lp.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(bd?1/0:5*60*1e3))}clearGcTimeout(){A(this,Js)&&(lp.clearTimeout(A(this,Js)),de(this,Js,void 0))}},Js=new WeakMap,Rx),Qs,fo,cn,Xs,lt,fl,Zs,jn,gr,Ax,fM=(Ax=class extends wk{constructor(t){super();be(this,jn);be(this,Qs);be(this,fo);be(this,cn);be(this,Xs);be(this,lt);be(this,fl);be(this,Zs);de(this,Zs,!1),de(this,fl,t.defaultOptions),this.setOptions(t.options),this.observers=[],de(this,Xs,t.client),de(this,cn,A(this,Xs).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,de(this,Qs,c0(this.options)),this.state=t.state??A(this,Qs),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=A(this,lt))==null?void 0:t.promise}setOptions(t){if(this.options={...A(this,fl),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=c0(this.options);n.data!==void 0&&(this.setState(l0(n.data,n.dataUpdatedAt)),de(this,Qs,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&A(this,cn).remove(this)}setData(t,n){const r=nM(this.state.data,t,this.options);return wt(this,jn,gr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){wt(this,jn,gr).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,s;const n=(r=A(this,lt))==null?void 0:r.promise;return(s=A(this,lt))==null||s.cancel(t),n?n.then(Tn).catch(Tn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(A(this,Qs))}isActive(){return this.observers.some(t=>ZO(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===yg||this.state.dataUpdateCount+this.state.errorUpdate
251Count===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>cp(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!XO(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=A(this,lt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=A(this,lt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),A(this,cn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(A(this,lt)&&(A(this,Zs)?A(this,lt).cancel({revert:!0}):A(this,lt).cancelRetry()),this.scheduleGc()),A(this,cn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||wt(this,jn,gr).call(this,{type:"invalidate"})}async fetch(t,n){var l,c,d,f,h,p,v,g,b,w,y,x;if(this.state.fetchStatus!=="idle"&&((l=A(this,lt))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(A(this,lt))return A(this,lt).continueRetry(),A(this,lt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(k=>k.options.queryFn);S&&this.setOptions(S.options)}const r=new AbortController,s=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(de(this,Zs,!0),r.signal)})},i=()=>{const S=mk(this.options,n),E=(()=>{const C={client:A(this,Xs),queryKey:this.queryKey,meta:this.meta};return s(C),C})();return de(this,Zs,!1),this.options.persister?this.options.persister(S,E,this):S(E)},a=(()=>{const S={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:A(this,Xs),state:this.state,fetchFn:i};return s(S),S})();(c=this.options.behavior)==null||c.onFetch(a,this),de(this,fo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=a.fetchOptions)==null?void 0:d.meta))&&wt(this,jn,gr).call(this,{type:"fetch",meta:(f=a.fetchOptions)==null?void 0:f.meta}),de(this,lt,vk({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,onCancel:S=>{S instanceof dp&&S.revert&&this.setState({...A(this,fo),fetchStatus:"idle"}),r.abort()},onFail:(S,k)=>{wt(this,jn,gr).call(this,{type:"failed",failureCount:S,error:k})},onPause:()=>{wt(this,jn,gr).call(this,{type:"pause"})},onContinue:()=>{wt(this,jn,gr).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0}));try{const S=await A(this,lt).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(p=(h=A(this,cn).config).onSuccess)==null||p.call(h,S,this),(g=(v=A(this,cn).config).onSettled)==null||g.call(v,S,this.state.error,this),S}catch(S){if(S instanceof dp){if(S.silent)return A(this,lt).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw wt(this,jn,gr).call(this,{type:"error",error:S}),(w=(b=A(this,cn).config).onError)==null||w.call(b,S,this),(x=(y=A(this,cn).config).onSettled)==null||x.call(y,this.state.data,S,this),S}finally{this.scheduleGc()}}},Qs=new WeakMap,fo=new WeakMap,cn=new WeakMap,Xs=new WeakMap,lt=new WeakMap,fl=new WeakMap,Zs=new WeakMap,jn=new WeakSet,gr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...hM(r.data,this.options),fetchMeta:t.meta??null};case"success":const s={...r,...l0(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return de(this,fo,t.manual?s:void 0),s;case"error":const i=t.error;
251return{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),jt.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),A(this,cn).notify({query:this,type:"updated",action:t})})},Ax);function hM(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:yk(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function l0(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function c0(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}function u0(e){return{onFetch:(t,n)=>{var d,f,h,p,v;const r=t.options,s=(h=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:h.direction,i=((p=t.state.data)==null?void 0:p.pages)||[],o=((v=t.state.data)==null?void 0:v.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const c=async()=>{let g=!1;const b=x=>{iM(x,()=>t.signal,()=>g=!0)},w=mk(t.options,t.fetchOptions),y=async(x,S,k)=>{if(g)return Promise.reject();if(S==null&&x.pages.length)return Promise.resolve(x);const C=(()=>{const I={client:t.client,queryKey:t.queryKey,pageParam:S,direction:k?"backward":"forward",meta:t.options.meta};return b(I),I})(),_=await w(C),{maxPages:j}=t.options,T=k?sM:rM;return{pages:T(x.pages,_,j),pageParams:T(x.pageParams,S,j)}};if(s&&i.length){const x=s==="backward",S=x?pM:d0,k={pages:i,pageParams:o},E=S(r,k);a=await y(k,E,x)}else{const x=e??i.length;do{const S=l===0?o[0]??r.initialPageParam:d0(r,a);if(l>0&&S==null)break;a=await y(a,S),l++}while(l<x)}return a};t.options.persister?t.fetchFn=()=>{var g,b;return(b=(g=t.options).persister)==null?void 0:b.call(g,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function d0(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function pM(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var hl,Jn,St,ei,Qn,Ur,Ox,mM=(Ox=class extends wk{constructor(t){super();be(this,Qn);be(this,hl);be(this,Jn);be(this,St);be(this,ei);de(this,hl,t.client),this.mutationId=t.mutationId,de(this,St,t.mutationCache),de(this,Jn,[]),this.state=t.state||gM(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){A(this,Jn).includes(t)||(A(this,Jn).push(t),this.clearGcTimeout(),A(this,St).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){de(this,Jn,A(this,Jn).filter(n=>n!==t)),this.scheduleGc(),A(this,St).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){A(this,Jn).length||(this.state.status==="pending"?this.scheduleGc():A(this,St).remove(this))}continue(){var t;return((t=A(this,ei))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,a,l,c,d,f,h,p,v,g,b,w,y,x,S,k,E,C;const n=()=>{wt(this,Qn,Ur).call(this,{type:"continue"})},r={client:A(this,hl),meta:this.options.meta,mutationKey:this.options.mutationKey};de(this,ei,vk({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(_,j)=>{wt(this,Qn,Ur).call(this,{type:"failed",failureCount:_,error:j})},onPause:()=>{wt(this,Qn,Ur).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>A(this,St).canRun(this)}));const s=this.state.status==="pending",i=!A(this,ei).canStart();try{if(s)n();else{wt(this,Qn,Ur).call(this,{type:"pending",variables:t,isPaused:i}),A(this,St).config.onMutate&&await A(this,St).config.onMutate(t,this,r);const j=await((a=(o=this.options).onMutate)==null?void 0:a.call(o,t,r));j!==this.state.context&&wt(this,Qn,Ur).call(this,{type:"pending",context:j,variables:t,isPaused:i})}const _=await A(this,ei).start();return await((c=(l=A(this,St).config).onSuccess)==null?void 0:c.call(l,_,t,this.state.context,this,r)),await((f=(d=this.options).onSuccess)==null?void 0:f.call(d,_,t,this.state.context,r)),await((p=(h=A(this,St).config).onSettled)==null?void 0:p.call(h,_,null,this.state.variables,this.state.context,this,r)),await((g=(v=this.options).onSettled)==null?void 0:g.call(v,_,null,t,this.state.context,r)),wt(this,Qn,Ur).call(this,{type:"success",data:_}),_}catch(_){try{await((w=(b=A(this,St).config).onError)==null?void 0:w.call(b,_,t,this.state.context,this,r))}catch(j){Promise.reject(j)}try{await((x=(y=this.options).onError)==null?void 0:x.call(y,_,t,this.state.context,r))}catch(j){Promise.reject(j)}try{await((k=(S=A(this,St).config).onSettled)==null?void 0:k.call(S,void 0,_,this.state.variables,this.state.context,this,r))}catch(j){Promise.reject(j)}try{await((C=(E=this.options).onSettled)==null?void 0:C.call(E,void 0,_,t,this.state.context,r))}catch(j){Promise.reject(j)}throw wt(this,Qn,Ur).call(this,{type:"error",error:_}),_}finally{A(this,St).runNext(this)}}},hl=new WeakMap,Jn=new WeakMap,St=new WeakMap,ei=new WeakMap,Qn=new WeakSet,Ur=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};
251case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),jt.batch(()=>{A(this,Jn).forEach(r=>{r.onMutationUpdate(t)}),A(this,St).notify({mutation:this,type:"updated",action:t})})},Ox);function gM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var br,Nn,pl,Mx,yM=(Mx=class extends xd{constructor(t={}){super();be(this,br);be(this,Nn);be(this,pl);this.config=t,de(this,br,new Set),de(this,Nn,new Map),de(this,pl,0)}build(t,n,r){const s=new mM({client:t,mutationCache:this,mutationId:++Ol(this,pl)._,options:t.defaultMutationOptions(n),state:r});return this.add(s),s}add(t){A(this,br).add(t);const n=tc(t);if(typeof n=="string"){const r=A(this,Nn).get(n);r?r.push(t):A(this,Nn).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(A(this,br).delete(t)){const n=tc(t);if(typeof n=="string"){const r=A(this,Nn).get(n);if(r)if(r.length>1){const s=r.indexOf(t);s!==-1&&r.splice(s,1)}else r[0]===t&&A(this,Nn).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=tc(t);if(typeof n=="string"){const r=A(this,Nn).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){var r;const n=tc(t);if(typeof n=="string"){const s=(r=A(this,Nn).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){jt.batch(()=>{A(this,br).forEach(t=>{this.notify({type:"removed",mutation:t})}),A(this,br).clear(),A(this,Nn).clear()})}getAll(){return Array.from(A(this,br))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>i0(n,r))}findAll(t={}){return this.getAll().filter(n=>i0(t,n))}notify(t){jt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return jt.batch(()=>Promise.all(t.map(n=>n.continue().catch(Tn))))}},br=new WeakMap,Nn=new WeakMap,pl=new WeakMap,Mx);function tc(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Xn,Ix,vM=(Ix=class extends xd{constructor(t={}){super();be(this,Xn);this.config=t,de(this,Xn,new Map)}build(t,n,r){const s=n.queryKey,i=n.queryHash??gg(s,n);let o=this.get(i);return o||(o=new fM({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(s)}),this.add(o)),o}add(t){A(this,Xn).has(t.queryHash)||(A(this,Xn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=A(this,Xn).get(t.queryHash);n&&(t.destroy(),n===t&&A(this,Xn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){jt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return A(this,Xn).get(t)}getAll(){return[...A(this,Xn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>s0(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>s0(t,r)):n}notify(t){jt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){jt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){jt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Xn=new WeakMap,Ix),Ke,Zr,es,ho,po,ts,mo,go,Dx,wM=(Dx=class{constructor(e={}){be(this,Ke);be(this,Zr);be(this,es);be(this,ho);be(this,po);be(this,ts);be(this,mo);be(this,go);de(this,Ke,e.queryCache||new vM),de(this,Zr,e.mutationCache||new yM),de(this,es,e.defaultOptions||{}),de(this,ho,new Map),de(this,po,new Map),de(this,ts,0)}mount(){Ol(this,ts)._++,A(this,ts)===1&&(de(this,mo,gk.subscribe(async e=>{e&&(await this.resumePausedMutations(),A(this,Ke).onFocus())})),de(this,go,ku.subscribe(async e=>{e&&(await this.resumePausedMutations(),A(this,Ke).onOnline())})))}unmount(){var e,t;Ol(this,ts)._--,A(this,ts)===0&&((e=A(this,mo))==null||e.call(this),de(this,mo,void 0),(t=A(this,go))==null||t.call(this),de(this,go,void 0))}isFetching(e){return A(this,Ke).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return A(this,Zr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=A(this,Ke).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=A(this,Ke).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(cp(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return A(this,Ke).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=A(this,Ke).get(r.queryHash),i=s==null?void 0:s.state.data,o=JO(t,i);if(o!==void 0)return A(this,Ke).build(this,r).setData(o,{...n,manual:!0})}
251setQueriesData(e,t,n){return jt.batch(()=>A(this,Ke).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=A(this,Ke).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=A(this,Ke);jt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=A(this,Ke);return jt.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=jt.batch(()=>A(this,Ke).findAll(e).map(s=>s.cancel(n)));return Promise.all(r).then(Tn).catch(Tn)}invalidateQueries(e,t={}){return jt.batch(()=>(A(this,Ke).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=jt.batch(()=>A(this,Ke).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(Tn)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Tn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=A(this,Ke).build(this,t);return n.isStaleByTime(cp(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Tn).catch(Tn)}fetchInfiniteQuery(e){return e.behavior=u0(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Tn).catch(Tn)}ensureInfiniteQueryData(e){return e.behavior=u0(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ku.isOnline()?A(this,Zr).resumePausedMutations():Promise.resolve()}getQueryCache(){return A(this,Ke)}getMutationCache(){return A(this,Zr)}getDefaultOptions(){return A(this,es)}setDefaultOptions(e){de(this,es,e)}setQueryDefaults(e,t){A(this,ho).set(qa(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...A(this,ho).values()],n={};return t.forEach(r=>{Ka(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){A(this,po).set(qa(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...A(this,po).values()],n={};return t.forEach(r=>{Ka(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...A(this,es).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=gg(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===yg&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...A(this,es).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){A(this,Ke).clear(),A(this,Zr).clear()}},Ke=new WeakMap,Zr=new WeakMap,es=new WeakMap,ho=new WeakMap,po=new WeakMap,ts=new WeakMap,mo=new WeakMap,go=new WeakMap,Dx),xM=m.createContext(void 0),bM=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(xM.Provider,{value:e,children:t}));/** 252 * @remix-run/router v1.23.2 253 * 254 * Copyright (c) Remix Software Inc. 255 * 256 * This source code is licensed under the MIT license found in the 257 * LICENSE.md file in the root directory of this source tree. 258 * 259 * @license MIT 260 */function Ga(){return Ga=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ga.apply(this,arguments)}var ss;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(ss||(ss={}));const f0="popstate";function SM(e){e===void 0&&(e={});function t(r,s){let{pathname:i,search:o,hash:a}=r.location;return fp("",{pathname:i,search:o,hash:a},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:_u(s)}return _M(t,n,null,e)}function Ze(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function vg(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function kM(){return Math.random().toString(36).substr(2,8)}function h0(e,t){return{usr:e.state,key:e.key,idx:t}}function fp(e,t,n,r){return n===void 0&&(n=null),Ga({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Io(t):t,{state:n,key:t&&t.key||r||kM()})}function _u(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Io(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function _M(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,o=s.history,a=ss.Pop,l=null,c=d();c==null&&(c=0,o.replaceState(Ga({},o.state,{idx:c}),""));function d(){return(o.state||{idx:null}).idx}function f(){a=ss.Pop;let b=d(),w=b==null?null:b-c;c=b,l&&l({action:a,location:g.location,delta:w})}function h(b,w){a=ss.Push;let y=fp(g.location,b,w);c=d()+1;let x=h0(y,c),S=g.createHref(y);try{o.pushState(x,"",S)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;s.location.assign(S)}i&&l&&l({action:a,location:g.location,delta:1})}function p(b,w){a=ss.Replace;let y=fp(g.location,b,w);c=d();let x=h0(y,c),S=g.createHref(y);o.replaceState(x,"",S),i&&l&&l({action:a,location:g.location,delta:0})}function v(b){let w=s.location.origin!=="null"?s.location.origin:s.location.href,y=typeof b=="string"?b:_u(b);return y=y.replace(/ $/,"%20"),Ze(w,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,w)}let g={get action(){return a},get location(){return e(s,o)},listen(b){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(f0,f),l=b,()=>{s.removeEventListener(f0,f),l=null}},createHref(b){return t(s,b)},createURL:v,encodeLocation(b){let w=v(b);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:h,replace:p,go(b){return o.go(b)}};return g}var p0;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(p0||(p0={}));function EM(e,t,n){return n===void 0&&(n="/"),CM(e,t,n)}function CM(e,t,n,r){let s=typeof t=="string"?Io(t):t,i=wg(s.pathname||"/",n);if(i==null)return null;let o=xk(e);TM(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let c=FM(i);a=DM(o[l],c)}return a}function xk(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(i,o,a)=>{let l={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};l.relativePath.startsWith("/")&&(Ze(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not val
260id. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=ms([r,l.relativePath]),d=n.concat(l);i.children&&i.children.length>0&&(Ze(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),xk(i.children,t,d,c)),!(i.path==null&&!i.index)&&t.push({path:c,score:MM(c,i.index),routesMeta:d})};return e.forEach((i,o)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))s(i,o);else for(let l of bk(i.path))s(i,o,l)}),t}function bk(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let o=bk(r.join("/")),a=[];return a.push(...o.map(l=>l===""?i:[i,l].join("/"))),s&&a.push(...o),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function TM(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:IM(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const PM=/^:[\w-]+$/,jM=3,NM=2,RM=1,AM=10,OM=-2,m0=e=>e==="*";function MM(e,t){let n=e.split("/"),r=n.length;return n.some(m0)&&(r+=OM),t&&(r+=NM),n.filter(s=>!m0(s)).reduce((s,i)=>s+(PM.test(i)?jM:i===""?RM:AM),r)}function IM(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function DM(e,t,n){let{routesMeta:r}=e,s={},i="/",o=[];for(let a=0;a<r.length;++a){let l=r[a],c=a===r.length-1,d=i==="/"?t:t.slice(i.length)||"/",f=LM({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},d),h=l.route;if(!f)return null;
vendor: 5,132 bytes, lines 260-269
260Object.assign(s,f.params),o.push({params:s,pathname:ms([i,f.pathname]),pathnameBase:WM(ms([i,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(i=ms([i,f.pathnameBase]))}return o}function LM(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=$M(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let i=s[0],o=i.replace(/(.)\/+$/,"$1"),a=s.slice(1);return{params:r.reduce((c,d,f)=>{let{paramName:h,isOptional:p}=d;if(h==="*"){let g=a[f]||"";o=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const v=a[f];return p&&!v?c[h]=void 0:c[h]=(v||"").replace(/%2F/g,"/"),c},{}),pathname:i,pathnameBase:o,pattern:e}}function $M(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),vg(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function FM(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return vg(!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 wg(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const UM=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,VM=e=>UM.test(e);function BM(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Io(e):e,i;if(n)if(VM(n))i=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),vg(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?i=g0(n.substring(1),"/"):i=g0(n,t)}else i=t;return{pathname:i,search:HM(r),hash:qM(s)}}function g0(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function kf(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function zM(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function xg(e,t){let n=zM(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function bg(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=Io(e):(s=Ga({},e),Ze(!s.pathname||!s.pathname.includes("?"),kf("?","pathname","search",s)),Ze(!s.pathname||!s.pathname.includes("#"),kf("#","pathname","hash",s)),Ze(!s.search||!s.search.includes("#"),kf("#","search","hash",s)));let i=e===""||s.pathname==="",o=i?"/":s.pathname,a;if(o==null)a=n;else{let f=t.length-1;if(!r&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),f-=1;s.pathname=h.join("/")}a=f>=0?t[f]:"/"}let l=BM(s,a),c=o&&o!=="/"&&o.endsWith("/"),d=(i||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||d)&&(l.pathname+="/"),l}const ms=e=>e.join("/").replace(/\/\/+/g,"/"),WM=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),HM=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,qM=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function KM(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Sk=["post","put","patch","delete"];new Set(Sk);const GM=["get",...Sk];new Set(GM);/** 261 * React Router v6.30.3 262 * 263 * Copyright (c) Remix Software Inc. 264 * 265 * This source code is licensed under the MIT license found in the 266 * LICENSE.md file in the root directory of this source tree. 267 * 268 * @license MIT 269 */function Ya(){return Ya=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ya.apply(this,arguments)}const Sg=m.createContext(null),YM=m.createContext(null),Cs=m.createContext(null),Sd=m.createContext(null),Ar=m.createContext({outlet:null,matches:[],isDataRoute:!1}),kk=m.createContext(null);function JM(e,t){let{relative:n}=t===void 0?{}:t;Do()||Ze(!1);let{basename:r,navigator:s}=m.useContext(Cs),{hash:i,pathname:o,search:a}=Ek(e,{relative:n}),l=o;return r!=="/"&&(l=o==="/"?r:ms([r,o])),s.createHref({pathname:l,search:a,hash:i})}function Do(){return m.useContext(Sd)!=null}function fr(){return Do()||Ze(!1),m.useContext(Sd).location}function _k(e){m.useContext(Cs).static||m.useLayoutEffect(e)}function hr(){let{isDataRoute:e}=m.useContext(Ar);return e?uI():QM()}function QM(){Do()||Ze(!1);
vendor: 4,637 bytes, line 269
269let e=m.useContext(Sg),{basename:t,future:n,navigator:r}=m.useContext(Cs),{matches:s}=m.useContext(Ar),{pathname:i}=fr(),o=JSON.stringify(xg(s,n.v7_relativeSplatPath)),a=m.useRef(!1);return _k(()=>{a.current=!0}),m.useCallback(function(c,d){if(d===void 0&&(d={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let f=bg(c,JSON.parse(o),i,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:ms([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,o,i,e])}function XM(){let{matches:e}=m.useContext(Ar),t=e[e.length-1];return t?t.params:{}}function Ek(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=m.useContext(Cs),{matches:s}=m.useContext(Ar),{pathname:i}=fr(),o=JSON.stringify(xg(s,r.v7_relativeSplatPath));return m.useMemo(()=>bg(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function ZM(e,t){return eI(e,t)}function eI(e,t,n,r){Do()||Ze(!1);let{navigator:s}=m.useContext(Cs),{matches:i}=m.useContext(Ar),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let c=fr(),d;if(t){var f;let b=typeof t=="string"?Io(t):t;l==="/"||(f=b.pathname)!=null&&f.startsWith(l)||Ze(!1),d=b}else d=c;let h=d.pathname||"/",p=h;if(l!=="/"){let b=l.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(b.length).join("/")}let v=EM(e,{pathname:p}),g=iI(v&&v.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])})),i,n,r);return t&&g?m.createElement(Sd.Provider,{value:{location:Ya({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:ss.Pop}},g):g}function tI(){let e=cI(),t=KM(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:s},n):null,null)}const nI=m.createElement(tI,null);class rI extends m.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?m.createElement(Ar.Provider,{value:this.props.routeContext},m.createElement(kk.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function sI(e){let{routeContext:t,match:n,children:r}=e,s=m.useContext(Sg);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(Ar.Provider,{value:t},r)}function iI(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,a=(s=n)==null?void 0:s.errors;if(a!=null){let d=o.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);d>=0||Ze(!1),o=o.slice(0,Math.min(o.length,d+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<o.length;d++){let f=o[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(c=d),f.route.id){let{loaderData:h,errors:p}=n,v=f.route.loader&&h[f.route.id]===void 0&&(!p||p[f.route.id]===void 0);if(f.route.lazy||v){l=!0,c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((d,f,h)=>{let p,v=!1,g=null,b=null;n&&(p=a&&f.route.id?a[f.route.id]:void 0,g=f.route.errorElement||nI,l&&(c<0&&h===0?(dI("route-fallback"),v=!0,b=null):c===h&&(v=!0,b=f.route.hydrateFallbackElement||null)));let w=t.concat(o.slice(0,h+1)),y=()=>{let x;return p?x=g:v?x=b:f.route.Component?x=m.createElement(f.route.Component,null):f.route.element?x=f.route.element:x=d,m.createElement(sI,{match:f,routeContext:{outlet:d,matches:w,isDataRoute:n!=null},children:x})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?m.createElement(rI,{location:n.location,revalidation:n.revalidation,component:g,error:p,children:y(),routeC
269ontext:{outlet:null,matches:w,isDataRoute:!0}}):y()},null)}var Ck=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Ck||{}),Tk=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}(Tk||{});function oI(e){let t=m.useContext(Sg);return t||Ze(!1),t}function aI(e){let t=m.useContext(YM);return t||Ze(!1),t}function lI(e){let t=m.useContext(Ar);return t||Ze(!1),t}function Pk(e){let t=lI(),n=t.matches[t.matches.length-1];return n.route.id||Ze(!1),n.route.id}function cI(){var e;let t=m.useContext(kk),n=aI(),r=Pk();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function uI(){let{router:e}=oI(Ck.UseNavigateStable),t=Pk(Tk.UseNavigateStable),n=m.useRef(!1);return _k(()=>{n.current=!0}),m.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,Ya({fromRouteId:t},i)))},[e,t])}const y0={};function dI(e,t,n){y0[e]||(y0[e]=!0)}function fI(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function hI(e){let{to:t,replace:n,state:r,relative:s}=e;Do()||Ze(!1);let{future:i,static:o}=m.useContext(Cs),{matches:a}=m.useContext(Ar),{pathname:l}=fr(),c=hr(),d=bg(t,xg(a,i.v7_relativeSplatPath),l,s==="path"),f=JSON.stringify(d);return m.useEffect(()=>c(JSON.parse(f),{replace:n,state:r,relative:s}),[c,f,s,n,r]),null}function yr(e){Ze(!1)}function pI(e){let{basename:t="/",children:n=null,location:r,navigationType:s=ss.Pop,navigator:i,static:o=!1,future:a}=e;Do()&&Ze(!1);let l=t.replace(/^\/*/,"/"),c=m.useMemo(()=>({basename:l,navigator:i,static:o,future:Ya({v7_relativeSplatPath:!1},a)}),[l,a,i,o]);typeof r=="string"&&(r=Io(r));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:v="default"}=r,g=m.useMemo(()=>{let b=wg(d,l);return b==null?null:{location:{pathname:b,search:f,hash:h,state:p,key:v},navigationType:s}},[l,d,f,h,p,v,s]);return g==null?null:m.createElement(Cs.Provider,{value:c},m.createElement(Sd.Provider,{children:n,value:g}))}function mI(e){let{children:t,location:n}=e;return ZM(hp(t),n)}new Promise(()=>{});function hp(e,t){t===void 0&&(t=[]);let n=[];return m.Children.forEach(e,(r,s)=>{if(!m.isValidElement(r))return;let i=[...t,s];if(r.type===m.Fragment){n.push.apply(n,hp(r.props.children,i));return}r.type!==yr&&Ze(!1),!r.props.index||!r.props.children||Ze(!1);let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=hp(r.props.children,i)),n.push(o)}),n}/** 270 * React Router DOM v6.30.3 271 * 272 * Copyright (c) Remix Software Inc. 273 * 274 * This source code is licensed under the MIT license found in the 275 * LICENSE.md file in the root directory of this source tree. 276 * 277 * @license MIT 278 */function pp(){return pp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pp.apply(this,arguments)}function gI(e,t){if(e==null)return{};var n={},r=Object.keys(e),s,i;for(i=0;i<r.length;i++)s=r[i],!(t.indexOf(s)>=0)&&(n[s]=e[s]);return n}function yI(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function vI(e,t){return e.button===0&&(!t||t==="_self")&&!yI(e)}function mp(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function wI(e,t){let n=mp(e);return t&&t.forEach((r,s)=>
278{n.has(s)||t.getAll(s).forEach(i=>{n.append(s,i)})}),n}const xI=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],bI="6";try{window.__reactRouterVersion=bI}catch{}const SI="startTransition",v0=Hu[SI];function kI(e){let{basename:t,children:n,future:r,window:s}=e,i=m.useRef();i.current==null&&(i.current=SM({window:s,v5Compat:!0}));let o=i.current,[a,l]=m.useState({action:o.action,location:o.location}),{v7_startTransition:c}=r||{},d=m.useCallback(f=>{c&&v0?v0(()=>l(f)):l(f)},[l,c]);return m.useLayoutEffect(()=>o.listen(d),[o,d]),m.useEffect(()=>fI(r),[r]),m.createElement(pI,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}const _I=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",EI=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,yt=m.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:i,replace:o,state:a,target:l,to:c,preventScrollReset:d,viewTransition:f}=t,h=gI(t,xI),{basename:p}=m.useContext(Cs),v,g=!1;if(typeof c=="string"&&EI.test(c)&&(v=c,_I))try{let x=new URL(window.location.href),S=c.startsWith("//")?new URL(x.protocol+c):new URL(c),k=wg(S.pathname,p);S.origin===x.origin&&k!=null?c=k+S.search+S.hash:g=!0}catch{}let b=JM(c,{relative:s}),w=CI(c,{replace:o,state:a,target:l,preventScrollReset:d,relative:s,viewTransition:f});function y(x){r&&r(x),x.defaultPrevented||w(x)}return m.createElement("a",pp({},h,{href:v||b,onClick:g||i?r:y,ref:n,target:l}))});var w0;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(w0||(w0={}));var x0;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(x0||(x0={}));function CI(e,t){let{target:n,replace:r,state:s,preventScrollReset:i,relative:o,viewTransition:a}=t===void 0?{}:t,l=hr(),c=fr(),d=Ek(e,{relative:o});return m.useCallback(f=>{if(vI(f,n)){f.preventDefault();let h=r!==void 0?r:_u(c)===_u(d);l(e,{replace:h,state:s,preventScrollReset:i,relative:o,viewTransition:a})}},[c,l,d,r,s,n,e,i,o,a])}function kg(e){let t=m.useRef(mp(e)),n=m.useRef(!1),r=fr(),s=m.useMemo(()=>wI(r.search,n.current?null:t.current),[r.search]),i=hr(),o=m.useCallback((a,l)=>{const c=mp(typeof a=="function"?a(s):a);n.current=!0,i("?"+c,l)},[i,s]);return[s,o]}var tr=function(){return tr=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},tr.apply(this,arguments)};function Lo(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function TI(e,t,n,r){function s(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function a(d){try{c(r.next(d))}catch(f){o(f)}}function l(d){try{c(r.throw(d))}catch(f){o(f)}}function c(d){d.done?i(d.value):s(d.value).then(a,l)}c((r=r.apply(e,t||[])).next())})}function PI(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,i;r<s;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}const jI=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class _g extends Error{constructor(t,n="FunctionsError",r){super(t),this.name=n,this.context=r}}class NI extends _g{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class b0 extends _g{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class S0 extends _g{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var gp;(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"})(gp||(gp={}));class RI{constructor(t,{headers:n={},customFetch:r,region:s=gp.Any}={}){this.url=t,this.headers=n,this.region=s,this.fetch=jI(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return TI(this,arguments,void 0,function*(n,r={}){var s;let i,o;try{const{headers:a,method:l,body:c,signal:d,timeout:f}=r;let h={},{region:p}=r;p||(p=this.region);const v=new URL(`${this.url}/${n}`);p&&p!=="any"&&(h["x-region"]=p,v.searchParams.set("forceFunctionRegion",p));let g;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",g=c):typeof c=="string"?(h["Content-Type"]="text/plain",g=c):typeof FormData<"u"&&c instanceof FormData?g=c:(h["Content-Type"]="application/json",g=JSON.stringify(c)):c&&typeof c!="string"&&!(typeof Blob<"u"&&c instanceof Blob)&&!(c instanceof ArrayBuffer)&&!(typeof FormData<"u"&&c instanceof FormData)?g=JSON.stringify(c):g=c;let b=d;f&&(o=new AbortController,i=setTimeout(()=>
278o.abort(),f),d?(b=o.signal,d.addEventListener("abort",()=>o.abort())):b=o.signal);const w=yield this.fetch(v.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},h),this.headers),a),body:g,signal:b}).catch(k=>{throw new NI(k)}),y=w.headers.get("x-relay-error");if(y&&y==="true")throw new b0(w);if(!w.ok)throw new S0(w);let x=((s=w.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),S;return x==="application/json"?S=yield w.json():x==="application/octet-stream"||x==="application/pdf"?S=yield w.blob():x==="text/event-stream"?S=w:x==="multipart/form-data"?S=yield w.formData():S=yield w.text(),{data:S,error:null,response:w}}catch(a){return{data:null,error:a,response:a instanceof S0||a instanceof b0?a.context:void 0}}finally{i&&clearTimeout(i)}})}}var AI=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}},OI=class{constructor(e){var t,n,r;this.shouldThrowOnError=!1,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=(n=e.isMaybeSingle)!==null&&n!==void 0?n:!1,this.urlLengthLimit=(r=e.urlLengthLimit)!==null&&r!==void 0?r:8e3,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}then(e,t){var n=this;this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const r=this.fetch;let s=r(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async i=>{let o=null,a=null,l=null,c=i.status,d=i.statusText;if(i.ok){var f,h;if(n.method!=="HEAD"){var p;const w=await i.text();w===""||(n.headers.get("Accept")==="text/csv"||n.headers.get("Accept")&&(!((p=n.headers.get("Accept"))===null||p===void 0)&&p.includes("application/vnd.pgrst.plan+text"))?a=w:a=JSON.parse(w))}const g=(f=n.headers.get("Prefer"))===null||f===void 0?void 0:f.match(/count=(exact|planned|estimated)/),b=(h=i.headers.get("content-range"))===null||h===void 0?void 0:h.split("/");g&&b&&b.length>1&&(l=parseInt(b[1])),n.isMaybeSingle&&n.method==="GET"&&Array.isArray(a)&&(a.length>1?(o={code:"PGRST116",details:`Results contain ${a.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},a=null,l=null,c=406,d="Not Acceptable"):a.length===1?a=a[0]:a=null)}else{var v;const g=await i.text();try{o=JSON.parse(g),Array.isArray(o)&&i.status===404&&(a=[],o=null,c=200,d="OK")}catch{i.status===404&&g===""?(c=204,d="No Content"):o={message:g}}if(o&&n.isMaybeSingle&&(!(o==null||(v=o.details)===null||v===void 0)&&v.includes("0 rows"))&&(o=null,c=200,d="OK"),o&&n.shouldThrowOnError)throw new AI(o)}return{error:o,data:a,count:l,status:c,statusText:d}});return this.shouldThrowOnError||(s=s.catch(i=>{var o;let a="",l="",c="";const d=i==null?void 0:i.cause;if(d){var f,h,p,v;const w=(f=d==null?void 0:d.message)!==null&&f!==void 0?f:"",y=(h=d==null?void 0:d.code)!==null&&h!==void 0?h:"";a=`${(p=i==null?void 0:i.name)!==null&&p!==void 0?p:"FetchError"}: ${i==null?void 0:i.message}`,a+=` 279 280Caused by: ${(v=d==null?void 0:d.name)!==null&&v!==void 0?v:"Error"}: ${w}`,y&&(a+=` (${y})`),d!=null&&d.stack&&(a+=` 281${d.stack}`)}else{var g;a=(g=i==null?void 0:i.stack)!==null&&g!==void 0?g:""}const b=this.url.toString().length;return(i==null?void 0:i.name)==="AbortError"||(i==null?void 0:i.code)==="ABORT_ERR"?(c="",l="Request was aborted (timeout or manual cancellation)",b>this.urlLengthLimit&&(l+=`. Note: Your request URL is ${b} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((d==null?void 0:d.name)==="HeadersOverflowError"||(d==null?void 0:d.code)==="UND_ERR_HEADERS_OVERFLOW")&&(c="",l="HTTP headers exceeded server limits (typically 16KB)",b>this.urlLengthLimit&&(l+=`. Your request URL is ${b} 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.`)),{error:{message:`${(o=i==null?void 0:i.name)!==null&&o!==void 0?o:"FetchError"}: ${i==null?void 0:i.message}`,details:a,hint:l,code:c},data:null,count:null,status:0,statusText:""}}
281)),s.then(e,t)}returns(){return this}overrideTypes(){return this}},MI=class extends OI{select(e){let t=!1;const n=(e??"*").split("").map(r=>/\s/.test(r)&&!t?"":(r==='"'&&(t=!t),r)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:n,foreignTable:r,referencedTable:s=r}={}){const i=s?`${s}.order`:"order",o=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${o?`${o},`:""}${e}.${t?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:n=t}={}){const r=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(r,`${e}`),this}range(e,t,{foreignTable:n,referencedTable:r=n}={}){const s=typeof r>"u"?"offset":`${r}.offset`,i=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(s,`${e}`),this.url.searchParams.set(i,`${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.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:t=!1,settings:n=!1,buffers:r=!1,wal:s=!1,format:i="text"}={}){var o;const a=[e?"analyze":null,t?"verbose":null,n?"settings":null,r?"buffers":null,s?"wal":null].filter(Boolean).join("|"),l=(o=this.headers.get("Accept"))!==null&&o!==void 0?o:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${i}; for="${l}"; options=${a};`),i==="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 k0=new RegExp("[,()]");var Ni=class extends MI{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 n=Array.from(new Set(t)).map(r=>typeof r=="string"&&k0.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}notIn(e,t){const n=Array.from(new Set(t)).map(r=>typeof r=="string"&&k0.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(e,`not.in.(${n})`),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:n,type:r}={}){let s="";r==="plain"?s="pl":r==="phrase"?s="ph":r==="websearch"&&(s="w");const i=n===void 0?"":`(${n})`;return this.url.searchParams.append(e,`${s}fts${i}.${t}`),this}match(e){return Object.entries(e).forEach(([t,n])=>{this.url.searchParams.append(t,`eq.${n}`)}),this}not(e,t,n){return this.url.searchParams.append(e,`not.${t}.${n}`),this}or(e,{foreignTable:t,referencedTable:n=t}={}){const r=n?`${n}.or`:"or";return this.url.searchParams.append(r,`(${e})`),this}filter(e,t,n){return this.url.searchParams.append(e,`${t}.${n}`),this}},II=class{constructor(e,{headers:t={},schema:n,fetch:r,urlLengthLimit:s=8e3}){this.url=e,this.headers=new Headers(t),this.schema=n,this.fetch=r,this.urlLengthLimit=s}
281cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:n=!1,count:r}=t??{},s=n?"HEAD":"GET";let i=!1;const o=(e??"*").split("").map(c=>/\s/.test(c)&&!i?"":(c==='"'&&(i=!i),c)).join(""),{url:a,headers:l}=this.cloneRequestState();return a.searchParams.set("select",o),r&&l.append("Prefer",`count=${r}`),new Ni({method:s,url:a,headers:l,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}insert(e,{count:t,defaultToNull:n=!0}={}){var r;const s="POST",{url:i,headers:o}=this.cloneRequestState();if(t&&o.append("Prefer",`count=${t}`),n||o.append("Prefer","missing=default"),Array.isArray(e)){const a=e.reduce((l,c)=>l.concat(Object.keys(c)),[]);if(a.length>0){const l=[...new Set(a)].map(c=>`"${c}"`);i.searchParams.set("columns",l.join(","))}}return new Ni({method:s,url:i,headers:o,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit})}upsert(e,{onConflict:t,ignoreDuplicates:n=!1,count:r,defaultToNull:s=!0}={}){var i;const o="POST",{url:a,headers:l}=this.cloneRequestState();if(l.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),t!==void 0&&a.searchParams.set("on_conflict",t),r&&l.append("Prefer",`count=${r}`),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 Ni({method:o,url:a,headers:l,schema:this.schema,body:e,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch,urlLengthLimit:this.urlLengthLimit})}update(e,{count:t}={}){var n;const r="PATCH",{url:s,headers:i}=this.cloneRequestState();return t&&i.append("Prefer",`count=${t}`),new Ni({method:r,url:s,headers:i,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit})}delete({count:e}={}){var t;const n="DELETE",{url:r,headers:s}=this.cloneRequestState();return e&&s.append("Prefer",`count=${e}`),new Ni({method:n,url:r,headers:s,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch,urlLengthLimit:this.urlLengthLimit})}};function Ja(e){"@babel/helpers - typeof";return Ja=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},Ja(e)}function DI(e,t){if(Ja(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Ja(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function LI(e){var t=DI(e,"string");return Ja(t)=="symbol"?t:t+""}function $I(e,t,n){return(t=LI(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function nc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_0(Object(n),!0).forEach(function(r){$I(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var FI=class jk{constructor(t,{headers:n={},schema:r,fetch:s,timeout:i,urlLengthLimit:o=8e3}={}){this.url=t,this.headers=new Headers(n),this.schemaName=r,this.urlLengthLimit=o;const a=s??globalThis.fetch;i!==void 0&&i>0?this.fetch=(l,c)=>{const d=new AbortController,f=setTimeout(()=>d.abort(),i),h=c==null?void 0:c.signal;if(h){if(h.aborted)return clearTimeout(f),a(l,c);const p=()=>{clearTimeout(f),d.abort()};return h.addEventListener("abort",p,{once:!0}),a(l,nc(nc({},c),{},{signal:d.signal})).finally(()=>{clearTimeout(f),h.removeEventListener("abort",p)})}return a(l,nc(nc({},c),{},{signal:d.signal})).finally(()=>clearTimeout(f))}:this.fetch=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 II(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}schema(t){return new jk(this.url,{headers:this.headers,schema:t,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit})}rpc(t,n={},{head:r=!1,get:s=!1,count:i}={}){var o;let a;const l=new URL(`${this.url}/rpc/${t}`);let c;const d=p=>p!==null&&typeof p=="object"&&(!Array.isArray(p)||p.some(d)),f=r&&Object.values(n).some(d);f?(a="POST",c=n):r||s?(a=r?"HEAD":"GET",Object.entries(n).filter(([p,v])=>v!==void 0).map(([p,v])=>[p,Array.isArray(v)?`{${v.join(",")}}`:`${v}
281`]).forEach(([p,v])=>{l.searchParams.append(p,v)})):(a="POST",c=n);const h=new Headers(this.headers);return f?h.set("Prefer",i?`count=${i},return=minimal`:"return=minimal"):i&&h.set("Prefer",`count=${i}`),new Ni({method:a,url:l,headers:h,schema:this.schemaName,body:c,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch,urlLengthLimit:this.urlLengthLimit})}};class UI{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 n=globalThis.process;if(n){const r=n.versions;if(r&&r.node){const s=r.node,i=parseInt(s.replace(/^v/,"").split(".")[0]);return i>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${i} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${i} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option: 282import ws from "ws" 283new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.constructor)return t.constructor;let n=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(n+=` 284 285Suggested solution: ${t.workaround}`),new Error(n)}static createWebSocket(t,n){const r=this.getWebSocketConstructor();return new r(t,n)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const VI="2.97.0",BI=`realtime-js/${VI}`,zI="1.0.0",Nk="2.0.0",E0=Nk,yp=1e4,WI=1e3,HI=100;var qr;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(qr||(qr={}));var st;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(st||(st={}));var An;(function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"})(An||(An={}));var vp;(function(e){e.websocket="websocket"})(vp||(vp={}));var Vs;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(Vs||(Vs={}));class qI{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,n){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return n(this._binaryEncodeUserBroadcastPush(t));let r=[t.join_ref,t.ref,t.topic,t.event,t.payload];return n(JSON.stringify(r))}_binaryEncodeUserBroadcastPush(t){var n;return this._isArrayBuffer((n=t.payload)===null||n===void 0?void 0:n.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var n,r;const s=(r=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,s)}_encodeJsonUserBroadcastPush(t){var n,r;const s=(r=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:{},o=new TextEncoder().encode(JSON.stringify(s)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,o)}_encodeUserBroadcastPush(t,n,r){var s,i;const o=t.topic,a=(s=t.ref)!==null&&s!==void 0?s:"",l=(i=t.join_ref)!==null&&i!==void 0?i:"",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(o.length>255)throw new Error(`topic length ${o.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+o.length+c.length+f.length,p=new ArrayBuffer(this.HEADER_LENGTH+h);let v=new DataView(p),g=0;v.setUint8(g++,this.KINDS.userBroadcastPush),v.setUint8(g++,l.length),v.setUint8(g++,a.length),v.setUint8(g++,o.length),v.setUint8(g++,c.length),v.setUint8(g++,f.length),v.setUint8(g++,n),Array.from(l,w=>
285v.setUint8(g++,w.charCodeAt(0))),Array.from(a,w=>v.setUint8(g++,w.charCodeAt(0))),Array.from(o,w=>v.setUint8(g++,w.charCodeAt(0))),Array.from(c,w=>v.setUint8(g++,w.charCodeAt(0))),Array.from(f,w=>v.setUint8(g++,w.charCodeAt(0)));var b=new Uint8Array(p.byteLength+r.byteLength);return b.set(new Uint8Array(p),0),b.set(new Uint8Array(r),p.byteLength),b.buffer}decode(t,n){if(this._isArrayBuffer(t)){let r=this._binaryDecode(t);return n(r)}if(typeof t=="string"){const r=JSON.parse(t),[s,i,o,a,l]=r;return n({join_ref:s,ref:i,topic:o,event:a,payload:l})}return n({})}_binaryDecode(t){const n=new DataView(t),r=n.getUint8(0),s=new TextDecoder;switch(r){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(t,n,s)}}_decodeUserBroadcast(t,n,r){const s=n.getUint8(1),i=n.getUint8(2),o=n.getUint8(3),a=n.getUint8(4);let l=this.HEADER_LENGTH+4;const c=r.decode(t.slice(l,l+s));l=l+s;const d=r.decode(t.slice(l,l+i));l=l+i;const f=r.decode(t.slice(l,l+o));l=l+o;const h=t.slice(l,t.byteLength),p=a===this.JSON_ENCODING?JSON.parse(r.decode(h)):h,v={type:this.BROADCAST_EVENT,event:d,payload:p};return o>0&&(v.meta=JSON.parse(f)),{join_ref:null,ref:null,topic:c,event:this.BROADCAST_EVENT,payload:v}}_isArrayBuffer(t){var n;return t instanceof ArrayBuffer||((n=t==null?void 0:t.constructor)===null||n===void 0?void 0:n.name)==="ArrayBuffer"}_pick(t,n){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([r])=>n.includes(r)))}}class Rk{constructor(t,n){this.callback=t,this.timerCalc=n,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=n}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var Me;(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"})(Me||(Me={}));const C0=(e,t,n={})=>{var r;const s=(r=n.skipTypes)!==null&&r!==void 0?r:[];return t?Object.keys(t).reduce((i,o)=>(i[o]=KI(o,e,t,s),i),{}):{}},KI=(e,t,n,r)=>{const s=t.find(a=>a.name===e),i=s==null?void 0:s.type,o=n[e];return i&&!r.includes(i)?Ak(i,o):wp(o)},Ak=(e,t)=>{if(e.charAt(0)==="_"){const n=e.slice(1,e.length);return QI(t,n)}switch(e){case Me.bool:return GI(t);case Me.float4:case Me.float8:case Me.int2:case Me.int4:case Me.int8:case Me.numeric:case Me.oid:return YI(t);case Me.json:case Me.jsonb:return JI(t);case Me.timestamp:return XI(t);case Me.abstime:case Me.date:case Me.daterange:case Me.int4range:case Me.int8range:case Me.money:case Me.reltime:case Me.text:case Me.time:case Me.timestamptz:case Me.timetz:case Me.tsrange:case Me.tstzrange:return wp(t);default:return wp(t)}},wp=e=>e,GI=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},YI=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},JI=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},QI=(e,t)=>{if(typeof e!="string")return e;const n=e.length-1,r=e[n];if(e[0]==="{"&&r==="}"){let i;const o=e.slice(1,n);try{i=JSON.parse("["+o+"]")}catch{i=o?o.split(","):[]}return i.map(a=>Ak(t,a))}return e},XI=e=>typeof e=="string"?e.replace(" ","T"):e,Ok=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};class _f{constructor(t,n,r={},s=yp){this.channel=t,this.event=n,this.payload=r,this.timeout=s,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(t){this.timeout=t,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,j
285oin_ref:this.channel._joinRef()}))}updatePayload(t){this.payload=Object.assign(Object.assign({},this.payload),t)}receive(t,n){var r;return this._hasReceived(t)&&n((r=this.receivedResp)===null||r===void 0?void 0:r.response),this.recHooks.push({status:t,callback:n}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const t=n=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=n,this._matchReceive(n)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,n){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:n})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:t,response:n}){this.recHooks.filter(r=>r.status===t).forEach(r=>r.callback(n))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}}var T0;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(T0||(T0={}));class Sa{constructor(t,n){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const r=(n==null?void 0:n.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},s=>{const{onJoin:i,onLeave:o,onSync:a}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Sa.syncState(this.state,s,i,o),this.pendingDiffs.forEach(l=>{this.state=Sa.syncDiff(this.state,l,i,o)}),this.pendingDiffs=[],a()}),this.channel._on(r.diff,{},s=>{const{onJoin:i,onLeave:o,onSync:a}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=Sa.syncDiff(this.state,s,i,o),a())}),this.onJoin((s,i,o)=>{this.channel._trigger("presence",{event:"join",key:s,currentPresences:i,newPresences:o})}),this.onLeave((s,i,o)=>{this.channel._trigger("presence",{event:"leave",key:s,currentPresences:i,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,n,r,s){const i=this.cloneDeep(t),o=this.transformState(n),a={},l={};return this.map(i,(c,d)=>{o[c]||(l[c]=d)}),this.map(o,(c,d)=>{const f=i[c];if(f){const h=d.map(b=>b.presence_ref),p=f.map(b=>b.presence_ref),v=d.filter(b=>p.indexOf(b.presence_ref)<0),g=f.filter(b=>h.indexOf(b.presence_ref)<0);v.length>0&&(a[c]=v),g.length>0&&(l[c]=g)}else a[c]=d}),this.syncDiff(i,{joins:a,leaves:l},r,s)}static syncDiff(t,n,r,s){const{joins:i,leaves:o}={joins:this.transformState(n.joins),leaves:this.transformState(n.leaves)};return r||(r=()=>{}),s||(s=()=>{}),this.map(i,(a,l)=>{var c;const d=(c=t[a])!==null&&c!==void 0?c:[];if(t[a]=this.cloneDeep(l),d.length>0){const f=t[a].map(p=>p.presence_ref),h=d.filter(p=>f.indexOf(p.presence_ref)<0);t[a].unshift(...h)}r(a,d,l)}),this.map(o,(a,l)=>{let c=t[a];if(!c)return;const d=l.map(f=>f.presence_ref);c=c.filter(f=>d.indexOf(f.presence_ref)<0),t[a]=c,s(a,c,l),c.length===0&&delete t[a]}),t}static map(t,n){return Object.getOwnPropertyNames(t).map(r=>n(r,t[r]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((n,r)=>{const s=t[r];return"metas"in s?n[r]=s.metas.map(i=>(i.presence_ref=i.phx_ref,delete i.phx_ref,delete i.phx_ref_prev,i)):n[r]=s,n},{})}static cloneDeep(t){return JSON.parse(JSON.stringify(t))}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var P0;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(P0||(P0={}));var ka;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(ka||(ka={}));var wr;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(wr||(wr={}));class qi{constructor(t,n={config:{}},r){var s,i;if(this.topic=t,this.params=n,this.socket=r,this.bindings={},this.state=st.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},n.config),this.timeout=this.socket.timeout,this.joinPush=new _f(this,An.join,this.params,this.timeout),this.rejoinTimer=new Rk(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=st.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(o=>o.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=st.closed,this.socket._remove(this)}),this._onError(o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=st.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=st.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=st.errored,this.rejoinTimer.scheduleTimeout())}),this._on(An.reply,{},(o,a)=>{this._trigger(this._replyEventName(a),o)}),this.presence=new Sa(this),this.broadcastEndpointURL=Ok(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((i=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||i===void 0)&&i.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(t,n=this.timeout){var r,s,i;if(this.socket.isConnected()||this.socket.connect(),this.state==st.closed){const{config:{broadcast:o,presence:a,private:l}}=this.params,c=(s=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(p=>p.filter))!==null&&s!==void 0?s:[],d=!!this.bindings[ka.PRESENCE]&&this.bindings[ka.PRESENCE].length>0||((i=this.params.config.presence)===null||i===void 0?void 0:i.enabled)===!0,f={},h={broadcast:o,presence:Object.assign(Object.assign({},a),{enabled:d}),postgres_changes:c,private:l};this.socket.accessTokenValue&&(f.access_token=this.socket.accessTokenValue),this._onError(p=>t==null?void 0:t(wr.CHANNEL_ERROR,p)),this._onClose(()=>t==null?void 0:t(wr.CLOSED)),this.updateJoinPayload(Object.assign({config:h},f)),this.joinedOnce=!0,this._rejoin(n),this.joinPush.receive("ok",async({postgres_changes:p})=>{var v;if(this.socket._isManualToken()||this.socket.setAuth(),p===void 0){t==null||t(wr.SUBSCRIBED);return}else{const g=this.bindings.postgres_changes,b=(v=g==null?void 0:g.length)!==null&&v!==void 0?v:0,w=[];for(let y=0;y<b;y++){const x=g[y],{filter:{event:S,schema:k,table:E,filter:C}}=x,_=p&&p[y];if(_&&_.event===S&&qi.isFilterValueEqual(_.schema,k)&&qi.isFilterValueEqual(_.table,E)&&qi.isFilterValueEqual(_.filter,C))w.push(Object.assign(Object.assign({},x),{id:_.id}));else{this.unsubscribe(),this.state=st.errored,t==null||t(wr.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=w,t&&t(wr.SUBSCRIBED);return}}).receive("error",p=>{this.state=st.errored,t==null||t(wr.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(p).join(", ")||"error")))}).receive("timeout",()=>{t==null||t(wr.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,n={}){return await this.send({type:"presence",event:"track",payload:t},n.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,n,r){return this.state===st.joined&&t===ka.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(async()=>await this.subscribe())),this._on(t,n,r)}async httpSend(t,n,r={}){var s;if(n==null)return Promise.reject("Payload is required for httpSend()");const i={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(i.Authorization=`Bearer ${this.socket.accessTokenValue}`);const o={method:"POST",headers:i,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:n,private:this.private}]})},a=await this._fetchWithTimeout(this.broadcastEndpointURL,o,(s=r.timeout)!==null&&s!==void 0?s:this.timeout);if(a.status===202)return{success:!0};let l=a.statusText;
285try{const c=await a.json();l=c.error||c.message||l}catch{}return Promise.reject(new Error(l))}async send(t,n={}){var r,s;if(!this._canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:i,payload:o}=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:i,payload:o,private:this.private}]})};try{const c=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((s=c.body)===null||s===void 0?void 0:s.cancel()),c.ok?"ok":"error"}catch(c){return c.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var o,a,l;const c=this._push(t.type,t,n.timeout||this.timeout);t.type==="broadcast"&&!(!((l=(a=(o=this.params)===null||o===void 0?void 0:o.config)===null||a===void 0?void 0:a.broadcast)===null||l===void 0)&&l.ack)&&i("ok"),c.receive("ok",()=>i("ok")),c.receive("error",()=>i("error")),c.receive("timeout",()=>i("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=st.leaving;const n=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(An.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(s=>{r=new _f(this,An.leave,{},t),r.receive("ok",()=>{n(),s("ok")}).receive("timeout",()=>{n(),s("timed out")}).receive("error",()=>{s("error")}),r.send(),this._canPush()||r.trigger("ok",{})}).finally(()=>{r==null||r.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=st.closed,this.bindings={}}async _fetchWithTimeout(t,n,r){const s=new AbortController,i=setTimeout(()=>s.abort(),r),o=await this.socket.fetch(t,Object.assign(Object.assign({},n),{signal:s.signal}));return clearTimeout(i),o}_push(t,n,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let s=new _f(this,t,n,r);return this._canPush()?s.send():this._addToPushBuffer(s),s}_addToPushBuffer(t){if(t.startTimeout(),this.pushBuffer.push(t),this.pushBuffer.length>HI){const n=this.pushBuffer.shift();n&&(n.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${n.event}`,n.payload))}}_onMessage(t,n,r){return n}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,n,r){var s,i;const o=t.toLocaleLowerCase(),{close:a,error:l,leave:c,join:d}=An;if(r&&[a,l,c,d].indexOf(o)>=0&&r!==this._joinRef())return;let h=this._onMessage(o,n,r);if(n&&!h)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(s=this.bindings.postgres_changes)===null||s===void 0||s.filter(p=>{var v,g,b;return((v=p.filter)===null||v===void 0?void 0:v.event)==="*"||((b=(g=p.filter)===null||g===void 0?void 0:g.event)===null||b===void 0?void 0:b.toLocaleLowerCase())===o}).map(p=>p.callback(h,r)):(i=this.bindings[o])===null||i===void 0||i.filter(p=>{var v,g,b,w,y,x;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in p){const S=p.id,k=(v=p.filter)===null||v===void 0?void 0:v.event;return S&&((g=n.ids)===null||g===void 0?void 0:g.includes(S))&&(k==="*"||(k==null?void 0:k.toLocaleLowerCase())===((b=n.data)===null||b===void 0?void 0:b.type.toLocaleLowerCase()))}else{const S=(y=(w=p==null?void 0:p.filter)===null||w===void 0?void 0:w.event)===null||y===void 0?void 0:y.toLocaleLowerCase();return S==="*"||S===((x=n==null?void 0:n.event)===null||x===void 0?void 0:x.toLocaleLowerCase())}else return p.type.toLocaleLowerCase()===o}).map(p=>{if(typeof h=="object"&&"ids"in h){const v=h.data,{schema:g,table:b,commit_timestamp:w,type:y,errors:x}=v;h=Object.assign(Object.assign({},{schema:g,table:b,commit_timestamp:w,eventType:y,new:{},old:{},errors:x}),this._getPayloadRecords(v))}p.callback(h,r)})}_isClosed(){return this.state===st.closed}_isJoined(){return this.state===st.joined}_isJoining(){return this.state===st.joining}_isLeaving(){return this.state===st.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,n,r){const s=t.toLocaleLowerCase(),i={type:s,filter:n,callback:r};return this.bindings[s]?this.bindings[s].push(i):this.bindings[s]=[i],this}_off(t,n){const r=t.toLocaleLowerCase();return this.bindings[r]&&(this.bindings[r]=this.bindings[r].filter(s=>{var i;return!(((i=s.type)===null||i===void 0?void 0:i.toLocaleLowerCase())===r&&qi.isEqual(s.filter,n))})),this}static isEqual(t,n){if(Object.keys(t).length!==Object.keys(n).length)return!1;for(const r in t)if(t[r]!==n[r])return!1;return!0}static isFilterValueEqual(t,n){return(t??void 0)===(n??void 0)}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(An.close,{},t)}_onError(t){this._on(An.error,{},n=>t(n))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=st.joining,this.joinPush.resend(t))}_getPayloadRecords(t){const n={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(n.new=C0(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(n.old=C0(t.columns,t.old_record)),n}}const Ef=()=>{},rc={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},ZI=[1e3,2e3,5e3,1e4],eD=1e4,tD=` 286 addEventListener("message", (e) => { 287 if (e.data.event === "start") { 288 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 289 } 290 });`;class nD{constructor(t,n){var r;if(this.accessTokenValue=null,this.apiKey=null,this._manuallySetToken=!1,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=yp,this.transport=null,this.heartbeatIntervalMs=rc.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=Ef,this.ref=0,this.reconnectTimer=null,this.vsn=E0,this.logger=Ef,this.conn=null,this.sendBuffer=[],this.serializer
290=new qI,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._heartbeatSentAt=null,this._resolveFetch=s=>s?(...i)=>s(...i):(...i)=>fetch(...i),!(!((r=n==null?void 0:n.params)===null||r===void 0)&&r.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=n.params.apikey,this.endPoint=`${t}/${vp.websocket}`,this.httpEndpoint=Ok(t),this._initializeOptions(n),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(n==null?void 0:n.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=UI.createWebSocket(this.endpointURL())}catch(t){this._setConnectionState("disconnected");const n=t.message;throw n.includes("Node.js")?new Error(`${n} 291 292To use Realtime in Node.js, you need to provide a WebSocket implementation: 293 294Option 1: Use Node.js 22+ which has native WebSocket support 295Option 2: Install and provide the "ws" package: 296 297 npm install ws 298 299 import ws from "ws" 300 const client = new RealtimeClient(url, { 301 ...options, 302 transport: ws 303 })`):new Error(`WebSocket not available: ${n}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(t,n){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const r=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(r),this._setConnectionState("disconnected")},typeof this.conn.close=="function"&&(t?this.conn.close(t,n??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(t){const n=await t.unsubscribe();return this.channels.length===0&&this.disconnect(),n}async removeAllChannels(){const t=await Promise.all(this.channels.map(n=>n.unsubscribe()));return this.channels=[],this.disconnect(),t}log(t,n,r){this.logger(t,n,r)}connectionState(){switch(this.conn&&this.conn.readyState){case qr.connecting:return Vs.Connecting;case qr.open:return Vs.Open;case qr.closing:return Vs.Closing;default:return Vs.Closed}}isConnected(){return this.connectionState()===Vs.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(t,n={config:{}}){const r=`realtime:${t}`,s=this.getChannels().find(i=>i.topic===r);if(s)return s;{const i=new qi(`realtime:${t}`,n,this);return this.channels.push(i),i}}push(t){const{topic:n,event:r,payload:s,ref:i}=t,o=()=>{this.encode(t,a=>{var l;(l=this.conn)===null||l===void 0||l.send(a)})};this.log("push",`${n} ${r} (${i})`,s),this.isConnected()?o():this.sendBuffer.push(o)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){var t;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(n){this.log("error","error in heartbeat callback",n)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this._heartbeatSentAt=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(n){this.log("error","error in heartbeat callback",n)}this._wasManualDisconnect=!1,(t=this.conn)===null||t===void 0||t.close(WI,"heartbeat timeout"),setTimeout(()=>{var n;this.isConnected()||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout()},rc.HEARTBEAT_TIMEOUT_FALLBACK);return}this._heartbeatSentAt=Date.now(),this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(n){this.log("error","error in heartbeat callback",n)}this._setAuthSafely("heartbeat")}onHeartbeat(t){this.heartbeatCallback=t}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}_makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}_leaveOpenTopic(t){let n=this.channels.find(r=>r.topic===t&&(r._isJoined()||r._isJoining()));n&&(this.log("transport",`leaving duplicate topic "${t}"`),n.unsubscribe())}_remove(t){this.channels=this.channels.filter(n=>n.topic!==t.topic)}_onConnMessage(t){this.decode(t.data,n=>
303{if(n.topic==="phoenix"&&n.event==="phx_reply"&&n.ref&&n.ref===this.pendingHeartbeatRef){const c=this._heartbeatSentAt?Date.now()-this._heartbeatSentAt:void 0;try{this.heartbeatCallback(n.payload.status==="ok"?"ok":"error",c)}catch(d){this.log("error","error in heartbeat callback",d)}this._heartbeatSentAt=null,this.pendingHeartbeatRef=null}const{topic:r,event:s,payload:i,ref:o}=n,a=o?`(${o})`:"",l=i.status||"";this.log("receive",`${l} ${r} ${s} ${a}`.trim(),i),this.channels.filter(c=>c._isMember(r)).forEach(c=>c._trigger(s,i,o)),this._triggerStateCallbacks("message",n)})}_clearTimer(t){var n;t==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):t==="reconnect"&&((n=this.reconnectTimer)===null||n===void 0||n.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=t=>this._onConnError(t),this.conn.onmessage=t=>this._onConnMessage(t),this.conn.onclose=t=>this._onConnClose(t),this.conn.readyState===qr.open&&this._onConnOpen())}_teardownConnection(){if(this.conn){if(this.conn.readyState===qr.open||this.conn.readyState===qr.connecting)try{this.conn.close()}catch(t){this.log("error","Error closing connection",t)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this._terminateWorker(),this.channels.forEach(t=>t.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.flushSendBuffer()}).catch(n=>{this.log("error","error waiting for auth on connect",n),this.flushSendBuffer()}),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=n=>{this.log("worker","worker error",n.message),this._terminateWorker()},this.workerRef.onmessage=n=>{n.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)}_onConnClose(t){var n;this._setConnectionState("disconnected"),this.log("transport","close",t),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout(),this._triggerStateCallbacks("close",t)}_onConnError(t){this._setConnectionState("disconnected"),this.log("transport",`${t}`),this._triggerChanError(),this._triggerStateCallbacks("error",t);try{this.heartbeatCallback("error")}catch(n){this.log("error","error in heartbeat callback",n)}}_triggerChanError(){this.channels.forEach(t=>t._trigger(An.error))}_appendParams(t,n){if(Object.keys(n).length===0)return t;const r=t.match(/\?/)?"&":"?",s=new URLSearchParams(n);return`${t}${r}${s}`}_workerObjectUrl(t){let n;if(t)n=t;else{const r=new Blob([tD],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}_setConnectionState(t,n=!1){this._connectionState=t,t==="connecting"?this._wasManualDisconnect=!1:t==="disconnecting"&&(this._wasManualDisconnect=n)}async _performAuth(t=null){let n,r=!1;if(t)n=t,r=!0;else if(this.accessToken)try{n=await this.accessToken()}catch(s){this.log("error","Error fetching access token from callback",s),n=this.accessTokenValue}else n=this.accessTokenValue;r?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEac
303h(s=>{const i={access_token:n,version:BI};n&&s.updateJoinPayload(i),s.joinedOnce&&s._isJoined()&&s._push(An.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(n=>{this.log("error",`Error setting auth in ${t}`,n)})}_triggerStateCallbacks(t,n){try{this.stateChangeCallbacks[t].forEach(r=>{try{r(n)}catch(s){this.log("error",`error in ${t} callback`,s)}})}catch(r){this.log("error",`error triggering ${t} callbacks`,r)}}_setupReconnectionTimer(){this.reconnectTimer=new Rk(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},rc.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(t){var n,r,s,i,o,a,l,c,d,f,h,p;switch(this.transport=(n=t==null?void 0:t.transport)!==null&&n!==void 0?n:null,this.timeout=(r=t==null?void 0:t.timeout)!==null&&r!==void 0?r:yp,this.heartbeatIntervalMs=(s=t==null?void 0:t.heartbeatIntervalMs)!==null&&s!==void 0?s:rc.HEARTBEAT_INTERVAL,this.worker=(i=t==null?void 0:t.worker)!==null&&i!==void 0?i:!1,this.accessToken=(o=t==null?void 0:t.accessToken)!==null&&o!==void 0?o:null,this.heartbeatCallback=(a=t==null?void 0:t.heartbeatCallback)!==null&&a!==void 0?a:Ef,this.vsn=(l=t==null?void 0:t.vsn)!==null&&l!==void 0?l:E0,t!=null&&t.params&&(this.params=t.params),t!=null&&t.logger&&(this.logger=t.logger),(t!=null&&t.logLevel||t!=null&&t.log_level)&&(this.logLevel=t.logLevel||t.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(c=t==null?void 0:t.reconnectAfterMs)!==null&&c!==void 0?c:v=>ZI[v-1]||eD,this.vsn){case zI:this.encode=(d=t==null?void 0:t.encode)!==null&&d!==void 0?d:(v,g)=>g(JSON.stringify(v)),this.decode=(f=t==null?void 0:t.decode)!==null&&f!==void 0?f:(v,g)=>g(JSON.parse(v));break;case Nk:this.encode=(h=t==null?void 0:t.encode)!==null&&h!==void 0?h:this.serializer.encode.bind(this.serializer),this.decode=(p=t==null?void 0:t.decode)!==null&&p!==void 0?p:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t==null?void 0:t.workerUrl}}}var Qa=class extends Error{constructor(e,t){var n;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)&&((n=t.icebergType)==null?void 0:n.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function rD(e,t,n){const r=new URL(t,e);if(n)for(const[s,i]of Object.entries(n))i!==void 0&&r.searchParams.set(s,i);return r.toString()}async function sD(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 iD(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:s,body:i,headers:o}){const a=rD(e.baseUrl,r,s),l=await sD(e.auth),c=await t(a,{method:n,headers:{...i?{"Content-Type":"application/json"}:{},...l,...o},body:i?JSON.stringify(i):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 p=f?h:void 0,v=p==null?void 0:p.error;throw new Qa((v==null?void 0:v.message)??`Request failed with status ${c.status}`,{status:c.status,icebergType:v==null?void 0:v.type,icebergCode:v==null?void 0:v.code,details:p})}return{status:c.status,headers:c.headers,data:h}}}}function sc(e){return e.join("�")}var oD=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:sc(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(r=>({namespace:r}))}async createNamespace(e,t){const n={namespace:e.namespace,properties:t==null?void 0:t.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${sc(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${sc(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${sc(e.namespace)}`}),!0}catch(t){if(t instanceof Qa&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(n){if(n instanceof Qa&&n.status===409)return;throw n}}};function xi(e){return e.join("�")}var aD=class{constructor(e,t="",n){this.client=e,this.prefix=t,this.accessDelegation=n}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${xi(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${xi(e.namespace)}/tables`,body:t,headers:n})).data.metadata}async updateTable(e,t){const n=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${xi(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":n.data["metadata-location"],metadata:n.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${xi(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/${xi(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/${xi(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(n){if(n instanceof Qa&&n.status===404)return!1;throw n}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof Qa&&n.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},lD=class{constructor(e){var r;let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const n=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=iD({baseUrl:n,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=(r=e.accessDelegation)==null?void 0:r.join(","),this.namespaceOps=new oD(this.client,t),this.tableOps=new aD(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)}
303async 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)}},kd=class extends Error{constructor(e,t="storage",n,r){super(e),this.__isStorageError=!0,this.namespace=t,this.name=t==="vectors"?"StorageVectorsError":"StorageError",this.status=n,this.statusCode=r}};function _d(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var ic=class extends kd{constructor(e,t,n,r="storage"){super(e,r,t,n),this.name=r==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=t,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},Mk=class extends kd{constructor(e,t,n="storage"){super(e,n),this.name=n==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=t}};const cD=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),uD=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)},xp=e=>{if(Array.isArray(e))return e.map(n=>xp(n));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([n,r])=>{const s=n.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));t[s]=xp(r)}),t},dD=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e);function Xa(e){"@babel/helpers - typeof";return Xa=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},Xa(e)}function fD(e,t){if(Xa(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(Xa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hD(e){var t=fD(e,"string");return Xa(t)=="symbol"?t:t+""}function pD(e,t,n){return(t=hD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function j0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function se(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?j0(Object(n),!0).forEach(function(r){pD(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const N0=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)},mD=async(e,t,n,r)=>{if(e&&typeof e=="object"&&"status"in e&&"ok"in e&&typeof e.status=="number"&&!(n!=null&&n.noResolveJson)){const s=e,i=s.status||500;if(typeof s.json=="function")s.json().then(o=>{const a=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||i+"";t(new ic(N0(o),i,a,r))}).catch(()=>{if(r==="vectors"){const o=i+"";t(new ic(s.statusText||`HTTP ${i} error`,i,o,r))}else{const o=i+"";t(new ic(s.statusText||`HTTP ${i} error`,i,o,r))}});else{const o=i+"";t(new ic(s.statusText||`HTTP ${i} error`,i,o,r))}}else t(new Mk(N0(e),e,r))},gD=(e,t,n,r)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"||e==="HEAD"||!r?se(se({},s),n):(uD(r)?(s.headers=se({"Content-Type":"application/json"},t==null?void 0:t.headers),s.body=JSON.stringify(r)):s.body=r,t!=null&&t.duplex&&(s.duplex=t.duplex),se(se({},s),n))};async function ta(e,t,n,r,s,i,o){return new Promise((a,l)=>{e(n,gD(t,r,s,i)).then(c=>{if(!c.ok)throw c;if(r!=null&&r.noResolveJson)return c;if(o==="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=>mD(c,l,r,o))})}function Ik(e="storage"){return{get:async(t,n,r,s)=>ta(t,"GET",n,r,s,void 0,e),post:async(t,n,r,s,i)=>ta(t,"POST",n,s,i,r,e),put:async(t,n,r,s,i)=>ta(t,"PUT",n,s,i,r,e),head:async(t,n,r,s)=>ta(t,"HEAD",n,se(se({},r),{},{noResolveJson:!0}),s,void 0,e),remove:async(t,n,r,s,i)=>ta(t,"DELETE",n,s,i,r,e)}}const yD=Ik("storage"),{get:Za,post:Pn,put:bp,head:vD,remove:Eg}=yD,Yt=Ik("vectors");var $o=class{constructor(e,t={},n,r="storage"){this.shouldThrowOnError=!1,this.url=e,this.headers=t,this.fetch=cD(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=se(se({},this.headers),{},{[e]:t}),this}async handleOperation(e){var t=this;try{return{data:await e(),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(_d(n))return{data:null,error:n};throw n}}},wD=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(_d(t))return{data:null,error:t};throw t}}};let Dk;Dk=Symbol.toStringTag;var xD=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[Dk]="BlobDownloadBuilder",this.promise=null}asStream(){return new wD(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(_d(t))return{data:null,error:t};throw t}}};const bD={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},R0={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var SD=class extends $o{constructor(e,t={},n,r){super(e,t,r,"storage"),this.bucketId=n}async uploadOrUpdate(e,t,n,r){var s=this;return s.handleOperation(async()=>{let i;const o=se(se({},R0),r);let a=se(se({},s.headers),e==="POST"&&{"x-upsert":String(o.upsert)});const l=o.metadata;typeof Blob<"u"&&n instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),l&&i.append("metadata",s.encodeMetadata(l)),i.append("",n)):typeof FormData<"u"&&n instanceof FormData?(i=n,i.has("cacheControl")||i.append("cacheControl",o.cacheControl),l&&!i.has("metadata")&&i.append("metadata",s.encodeMetadata(l))):(i=n,a["cache-control"]=`max-age=${o.cacheControl}`,a["content-type"]=o.contentType,l&&(a["x-metadata"]=s.toBase64(s.encodeMetadata(l))),(typeof ReadableStream<"u"&&i instanceof ReadableStream||i&&typeof i=="object"&&"pipe"in i&&typeof i.pipe=="function")&&!o.duplex&&(o.duplex="half")),r!=null&&r.headers&&(a=se(se({},a),r.headers));const c=s._removeEmptyFolders(t),d=s._getFinalPath(c),f=await(e=="PUT"?bp:Pn)(s.fetch,`${s.url}/object/${d}`,i,se({headers:a},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{path:c,id:f.Id,fullPath:f.Key}})}async upload(e,t,n){return this.uploadOrUpdate("POST",e,t,n)}async uploadToSignedUrl(e,t,n,r){var s=this;const i=s._removeEmptyFolders(e),o=s._getFinalPath(i),a=new URL(s.url+`/object/upload/sign/${o}`);return a.searchParams.set("token",t),s.handleOperation(async()=>{let l;const c=se({upsert:R0.upsert},r),d=se(se({},s.headers),{"x-upsert":String(c.upsert)});return typeof Blob<"u"&&n instanceof Blob?(l=new FormData,l.append("cacheControl",c.cacheControl),l.append("",n)):typeof FormData<"u"&&n instanceof FormData?(l=n,l.append("cacheControl",c.cacheControl)):(l=n,d["cache-control"]=`max-age=${c.cacheControl}`,d["content-type"]=c.contentType),{path:i,fullPath:(await bp(s.fetch,a.toString(),l,{headers:d})).Key}})}async createSignedUploadUrl(e,t){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(e);const s=se({},n.headers);t!=null&&t.upsert&&(s["x-upsert"]="true");const i=await Pn(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:s}),o=new URL(n.url+i.url),a=o.searchParams.get("token");if(!a)throw new kd("No token returned by API");return{signedUrl:o.toString(),path:e,token:a}})}async update(e,t,n){return this.uploadOrUpdate("PUT",e,t,n)}async move(e,t,n){var r=this;return r.handleOperation(async()=>await Pn(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,de
303stinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers}))}async copy(e,t,n){var r=this;return r.handleOperation(async()=>({path:(await Pn(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(e,t,n){var r=this;return r.handleOperation(async()=>{let s=r._getFinalPath(e),i=await Pn(r.fetch,`${r.url}/object/sign/${s}`,se({expiresIn:t},n!=null&&n.transform?{transform:n.transform}:{}),{headers:r.headers});const o=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return{signedUrl:encodeURI(`${r.url}${i.signedURL}${o}`)}})}async createSignedUrls(e,t,n){var r=this;return r.handleOperation(async()=>{const s=await Pn(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:t,paths:e},{headers:r.headers}),i=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return s.map(o=>se(se({},o),{},{signedUrl:o.signedURL?encodeURI(`${r.url}${o.signedURL}${i}`):null}))})}download(e,t,n){const r=typeof(t==null?void 0:t.transform)<"u"?"render/image/authenticated":"object",s=this.transformOptsToQueryString((t==null?void 0:t.transform)||{}),i=s?`?${s}`:"",o=this._getFinalPath(e),a=()=>Za(this.fetch,`${this.url}/${r}/${o}${i}`,{headers:this.headers,noResolveJson:!0},n);return new xD(a,this.shouldThrowOnError)}async info(e){var t=this;const n=t._getFinalPath(e);return t.handleOperation(async()=>xp(await Za(t.fetch,`${t.url}/object/info/${n}`,{headers:t.headers})))}async exists(e){var t=this;const n=t._getFinalPath(e);try{return await vD(t.fetch,`${t.url}/object/${n}`,{headers:t.headers}),{data:!0,error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(_d(r)&&r instanceof Mk){const s=r.originalError;if([400,404].includes(s==null?void 0:s.status))return{data:!1,error:r}}throw r}}getPublicUrl(e,t){const n=this._getFinalPath(e),r=[],s=t!=null&&t.download?`download=${t.download===!0?"":t.download}`:"";s!==""&&r.push(s);const i=typeof(t==null?void 0:t.transform)<"u"?"render/image":"object",o=this.transformOptsToQueryString((t==null?void 0:t.transform)||{});o!==""&&r.push(o);let a=r.join("&");return a!==""&&(a=`?${a}`),{data:{publicUrl:encodeURI(`${this.url}/${i}/public/${n}${a}`)}}}async remove(e){var t=this;return t.handleOperation(async()=>await Eg(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}))}async list(e,t,n){var r=this;return r.handleOperation(async()=>{const s=se(se(se({},bD),t),{},{prefix:e||""});return await Pn(r.fetch,`${r.url}/object/list/${r.bucketId}`,s,{headers:r.headers},n)})}async listV2(e,t){var n=this;return n.handleOperation(async()=>{const r=se({},e);return await Pn(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{headers:n.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,"/")}transformOptsToQueryString(e){const t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}};const kD="2.97.0",_l={"X-Client-Info":`storage-js/${kD}`};var _D=class extends $o{constructor(e,t={},n,r){const s=new URL(e);r!=null&&r.useNewHostname&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase."));const i=s.href.replace(/\/$/,""),o=se(se({},_l),t);super(i,o,n,"storage")}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=t.listBucketOptionsToQueryString(e);return await Za(t.fetch,`${t.url}/bucket${n}`,{headers:t.headers})})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Za(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}))}async createBucket(e,t={public:!1}){var n=this;return n.handleOperation(async()=>await Pn(n.fetch,`${n.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async updateBucket(e,t){var n=this;return n.handleOperation(async()=>await bp(n.fetch,`${n.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(e){var t=this;return t.handleOperation(async()=>await Pn(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Eg(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():""}},ED=class extends $o{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=se(se({},_l),t);super(r,s,n,"storage")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Pn(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}))}async listBuckets(e){var t=this;return t.handleOperation(async()=>{const n=new URLSearchParams;(e==null?void 0:e.limit)!==void 0&&n.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&n.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&n.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&n.set("sortOrder",e.sortOrder),e!=null&&e.search&&n.set("search",e.search);const r=n.toString(),s=r?`${t.url}/bucket?${r}`:`${t.url}/bucket`;return await Za(t.fetch,s,{headers:t.headers})})}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Eg(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}))}from(e){var t=this;if(!dD(e))throw new kd("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 n=new lD({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}
303),r=this.shouldThrowOnError;return new Proxy(n,{get(s,i){const o=s[i];return typeof o!="function"?o:async(...a)=>{try{return{data:await o.apply(s,a),error:null}}catch(l){if(r)throw l;return{data:null,error:l}}}}})}},CD=class extends $o{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=se(se({},_l),{},{"Content-Type":"application/json"},t);super(r,s,n,"vectors")}async createIndex(e){var t=this;return t.handleOperation(async()=>await Yt.post(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{})}async getIndex(e,t){var n=this;return n.handleOperation(async()=>await Yt.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers}))}async listIndexes(e){var t=this;return t.handleOperation(async()=>await Yt.post(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}))}async deleteIndex(e,t){var n=this;return n.handleOperation(async()=>await Yt.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers})||{})}},TD=class extends $o{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=se(se({},_l),{},{"Content-Type":"application/json"},t);super(r,s,n,"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 Yt.post(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{})}async getVectors(e){var t=this;return t.handleOperation(async()=>await Yt.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 Yt.post(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}))}async queryVectors(e){var t=this;return t.handleOperation(async()=>await Yt.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 Yt.post(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{})}},PD=class extends $o{constructor(e,t={},n){const r=e.replace(/\/$/,""),s=se(se({},_l),{},{"Content-Type":"application/json"},t);super(r,s,n,"vectors")}async createBucket(e){var t=this;return t.handleOperation(async()=>await Yt.post(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}async getBucket(e){var t=this;return t.handleOperation(async()=>await Yt.post(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}))}async listBuckets(e={}){var t=this;return t.handleOperation(async()=>await Yt.post(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}))}async deleteBucket(e){var t=this;return t.handleOperation(async()=>await Yt.post(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{})}},jD=class extends PD{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new ND(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,n=this;return t().call(n,e)}async getBucket(e){var t=()=>super.getBucket,n=this;return t().call(n,e)}async listBuckets(e={}){var t=()=>super.listBuckets,n=this;return t().call(n,e)}async deleteBucket(e){var t=()=>super.deleteBucket,n=this;return t().call(n,e)}},ND=class extends CD{constructor(e,t,n,r){super(e,t,r),this.vectorBucketName=n}async createIndex(e){var t=()=>super.createIndex,n=this;return t().call(n,se(se({},e),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,n=this;return t().call(n,se(se({},e),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,n=this;return t().call(n,n.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,n=this;return t().call(n,n.vectorBucketName,e)}index(e){return new RD(this.url,this.headers,this.vectorBucketName,e,this.fetch)}}
303,RD=class extends TD{constructor(e,t,n,r,s){super(e,t,s),this.vectorBucketName=n,this.indexName=r}async putVectors(e){var t=()=>super.putVectors,n=this;return t().call(n,se(se({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(e){var t=()=>super.getVectors,n=this;return t().call(n,se(se({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,n=this;return t().call(n,se(se({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,n=this;return t().call(n,se(se({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,n=this;return t().call(n,se(se({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},AD=class extends _D{constructor(e,t={},n,r){super(e,t,n,r)}from(e){return new SD(this.url,this.headers,e,this.fetch)}get vectors(){return new jD(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new ED(this.url+"/iceberg",this.headers,this.fetch)}};const Lk="2.97.0",Ri=30*1e3,Sp=3,Cf=Sp*Ri,OD="http://localhost:9999",MD="supabase.auth.token",ID={"X-Client-Info":`gotrue-js/${Lk}`},kp="X-Supabase-Api-Version",$k={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},DD=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,LD=10*60*1e3;class el extends Error{constructor(t,n,r){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}}function ee(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class $D extends el{constructor(t,n,r){super(t,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function FD(e){return ee(e)&&e.name==="AuthApiError"}class Bs extends el{constructor(t,n){super(t),this.name="AuthUnknownError",this.originalError=n}}class Or extends el{constructor(t,n,r,s){super(t,r,s),this.name=n,this.status=r}}class qt extends Or{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function Tf(e){return ee(e)&&e.name==="AuthSessionMissingError"}class bi extends Or{constructor(){super("Auth session or user missing","AuthInvalidToken
303ResponseError",500,void 0)}}class oc extends Or{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class ac extends Or{constructor(t,n=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function UD(e){return ee(e)&&e.name==="AuthImplicitGrantRedirectError"}class A0 extends Or{constructor(t,n=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class VD extends Or{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 _p extends Or{constructor(t,n){super(t,"AuthRetryableFetchError",n,void 0)}}function Pf(e){return ee(e)&&e.name==="AuthRetryableFetchError"}class O0 extends Or{constructor(t,n,r){super(t,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}}class Ep extends Or{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const Eu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),M0=` 304\r=`.split(""),BD=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<M0.length;t+=1)e[M0[t].charCodeAt(0)]=-2;for(let t=0;t<Eu.length;t+=1)e[Eu[t].charCodeAt(0)]=t;return e})();function I0(e,t,n){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;n(Eu[r]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;n(Eu[r]),t.queuedBits-=6}}function Fk(e,t,n){const r=BD[e];if(r>-1)for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function D0(e){const t=[],n=o=>{t.push(String.fromCodePoint(o))},r={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},i=o=>{HD(o,r,n)};for(let o=0;o<e.length;o+=1)Fk(e.charCodeAt(o),s,i);return t.join("")}function zD(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 WD(e,t){for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r>55295&&r<=56319){const s=(r-55296)*1024&65535;r=(e.charCodeAt(n+1)-56320&65535|s)+65536,n+=1}zD(r,t)}}function HD(e,t,n){if(t.utf8seq===0){if(e<=127){n(e);return}for(let r=1;r<6;r+=1)if(!(e>>7-r&1)){t.utf8seq=r;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&n(t.codepoint)}}function io(e){const t=[],n={queue:0,queuedBits:0},r=s=>{t.push(s)};for(let s=0;s<e.length;s+=1)Fk(e.charCodeAt(s),n,r);return new Uint8Array(t)}function qD(e){const t=[];return WD(e,n=>t.push(n)),new Uint8Array(t)}function qs(e){const t=[],n={queue:0,queuedBits:0},r=s=>{t.push(s)};return e.forEach(s=>I0(s,n,r)),I0(null,n,r),t.join("")}function KD(e){return Math.round(Date.now()/1e3)+e}function GD(){return Symbol("auth-callback")}const ft=()=>typeof window<"u"&&typeof document<"u",Os={tested:!1,writable:!1},Uk=()=>{if(!ft())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Os.tested)return Os.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),Os.tested=!0,Os.writable=!0}catch{Os.tested=!0,Os.writable=!1}return Os.writable};function YD(e){const t={},n=new URL(e);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEac
304h((s,i)=>{t[i]=s})}catch{}return n.searchParams.forEach((r,s)=>{t[s]=r}),t}const Vk=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),JD=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Ai=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},Ms=async(e,t)=>{const n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return n}},dt=async(e,t)=>{await e.removeItem(t)};class Ed{constructor(){this.promise=new Ed.promiseConstructor((t,n)=>{this.resolve=t,this.reject=n})}}Ed.promiseConstructor=Promise;function lc(e){const t=e.split(".");if(t.length!==3)throw new Ep("Invalid JWT structure");for(let r=0;r<t.length;r++)if(!DD.test(t[r]))throw new Ep("JWT not in base64url format");return{header:JSON.parse(D0(t[0])),payload:JSON.parse(D0(t[1])),signature:io(t[2]),raw:{header:t[0],payload:t[1]}}}async function QD(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function XD(e,t){return new Promise((r,s)=>{(async()=>{for(let i=0;i<1/0;i++)try{const o=await e(i);if(!t(i,null,o)){r(o);return}}catch(o){if(!t(i,o)){s(o);return}}})()})}function ZD(e){return("0"+e.toString(16)).substr(-2)}function e5(){const t=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let s="";for(let i=0;i<56;i++)s+=n.charAt(Math.floor(Math.random()*r));return s}return crypto.getRandomValues(t),Array.from(t,ZD).join("")}async function t5(e){const n=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",n),s=new Uint8Array(r);return Array.from(s).map(i=>String.fromCharCode(i)).join("")}async function n5(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const n=await t5(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function Si(e,t,n=!1){const r=e5();let s=r;n&&(s+="/PASSWORD_RECOVERY"),await Ai(e,`${t}-code-verifier`,s);const i=await n5(r);return[i,r===i?"plain":"s256"]}const r5=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function s5(e){const t=e.headers.get(kp);if(!t||!t.match(r5))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function i5(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 o5(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 a5=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function ki(e){if(!a5.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function jf(){const e={};return new Proxy(e,{get:(t,n)=>{if(n==="__isUserNotAvailableProxy")return!0;if(typeof n=="symbol"){const r=n.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${n}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function l5(e,t){return new Proxy(e,{get:(n,r,s)=>{if(r==="__isInsecureUserWarningProxy")return!0;if(typeof r=="symbol"){const i=r.toString();if(i==="Symbol(Symbol.toPrimitive)"||i==="Symbol(Symbol.toStringTag)"||i==="Symbol(util.inspect.custom)"||i==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(n,r,s)}return!t.value&&typeof r=="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(n,r,s)}})}function L0(e){return JSON.parse(JSON.stringify(e))}const $s=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),c5=[502,503,504];async function $0(e){var t;if(!JD(e))throw new _p($s(e),0);if(c5.includes(e.status))throw new _p($s(e),e.status);let n;try{n=await e.json()}catch(i){throw new Bs($s(i),i)}let r;const s=s5(e);if(s&&s.getTime()>=$k["2024-01-01"].timestamp&&typeof n=="object"&&n&&typeof n.code=="string"?r=n.code:typeof n=="object"&&n&&typeof n.error_code=="string"&&(r=n.error_code),r){if(r==="weak_password")throw new O0($s(n),e.status,((t=n.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(r==="session_not_found")throw new qt}else if(typeof n=="object"&&n&&typeof n.weak_password=="object"&&n.weak_password&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.reasons.reduce((i,o)=>
304i&&typeof o=="string",!0))throw new O0($s(n),e.status,n.weak_password.reasons);throw new $D($s(n),e.status||500,r)}const u5=(e,t,n,r)=>{const s={method:e,headers:(t==null?void 0:t.headers)||{}};return e==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t==null?void 0:t.headers),s.body=JSON.stringify(r),Object.assign(Object.assign({},s),n))};async function ie(e,t,n,r){var s;const i=Object.assign({},r==null?void 0:r.headers);i[kp]||(i[kp]=$k["2024-01-01"].name),r!=null&&r.jwt&&(i.Authorization=`Bearer ${r.jwt}`);const o=(s=r==null?void 0:r.query)!==null&&s!==void 0?s:{};r!=null&&r.redirectTo&&(o.redirect_to=r.redirectTo);const a=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",l=await d5(e,t,n+a,{headers:i,noResolveJson:r==null?void 0:r.noResolveJson},{},r==null?void 0:r.body);return r!=null&&r.xform?r==null?void 0:r.xform(l):{data:Object.assign({},l),error:null}}async function d5(e,t,n,r,s,i){const o=u5(t,r,s,i);let a;try{a=await e(n,Object.assign({},o))}catch(l){throw console.error(l),new _p($s(l),0)}if(a.ok||await $0(a),r!=null&&r.noResolveJson)return a;try{return await a.json()}catch(l){await $0(l)}}function _n(e){var t;let n=null;p5(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=KD(e.expires_in)));const r=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:n,user:r},error:null}}function F0(e){const t=_n(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((n,r)=>n&&typeof r=="string",!0)&&(t.data.weak_password=e.weak_password),t}function Yr(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function f5(e){return{data:e,error:null}}function h5(e){const{action_link:t,email_otp:n,hashed_token:r,redirect_to:s,verification_type:i}=e,o=Lo(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:t,email_otp:n,hashed_token:r,redirect_to:s,verification_type:i},l=Object.assign({},o);return{data:{properties:a,user:l},error:null}}function U0(e){return e}function p5(e){return e.access_token&&e.refresh_token&&e.expires_in}const Nf=["global","local","others"];class m5{constructor({url:t="",headers:n={},fetch:r}){this.url=t,this.headers=n,this.fetch=Vk(r),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)}}async signOut(t,n=Nf[0]){if(Nf.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Nf.join(", ")}`);try{return await ie(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(r){if(ee(r))return{data:null,error:r};throw r}}async inviteUserByEmail(t,n={}){try{return await ie(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:Yr})}catch(r){if(ee(r))return{data:{user:null},error:r};throw r}}async generateLink(t){try{const{options:n}=t,r=Lo(t,["options"]),s=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(s.new_email=r==null?void 0:r.newEmail,delete s.newEmail),await ie(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:h5,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(ee(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(t){try{return await ie(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:Yr})}catch(n){if(ee(n))return{data:{user:null},error:n};throw n}}async listUsers(t){var n,r,s,i,o,a,l;try{const c={nextPage:null,lastPage:0,total:0},d=await ie(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(i=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:U0});if(d.error)throw d.error;const f=await d.json(),h=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,p=(l=(a=d.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&l!==void 0?l:[];return p.length>
3040&&(p.forEach(v=>{const g=parseInt(v.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(v.split(";")[1].split("=")[1]);c[`${b}Page`]=g}),c.total=parseInt(h)),{data:Object.assign(Object.assign({},f),c),error:null}}catch(c){if(ee(c))return{data:{users:[]},error:c};throw c}}async getUserById(t){ki(t);try{return await ie(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:Yr})}catch(n){if(ee(n))return{data:{user:null},error:n};throw n}}async updateUserById(t,n){ki(t);try{return await ie(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:n,headers:this.headers,xform:Yr})}catch(r){if(ee(r))return{data:{user:null},error:r};throw r}}async deleteUser(t,n=!1){ki(t);try{return await ie(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:n},xform:Yr})}catch(r){if(ee(r))return{data:{user:null},error:r};throw r}}async _listFactors(t){ki(t.userId);try{const{data:n,error:r}=await ie(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:n,error:r}}catch(n){if(ee(n))return{data:null,error:n};throw n}}async _deleteFactor(t){ki(t.userId),ki(t.id);try{return{data:await ie(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(n){if(ee(n))return{data:null,error:n};throw n}}async _listOAuthClients(t){var n,r,s,i,o,a,l;try{const c={nextPage:null,lastPage:0,total:0},d=await ie(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=t==null?void 0:t.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(i=(s=t==null?void 0:t.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:U0});if(d.error)throw d.error;const f=await d.json(),h=(o=d.headers.get("x-total-count"))!==null&&o!==void 0?o:0,p=(l=(a=d.headers.get("link"))===null||a===void 0?void 0:a.split(","))!==null&&l!==void 0?l:[];return p.length>0&&(p.forEach(v=>{const g=parseInt(v.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(v.split(";")[1].split("=")[1]);c[`${b}Page`]=g}),c.total=parseInt(h)),{data:Object.assign(Object.assign({},f),c),error:null}}catch(c){if(ee(c))return{data:{clients:[]},error:c};throw c}}async _createOAuthClient(t){try{return await ie(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ee(n))return{data:null,error:n};throw n}}async _getOAuthClient(t){try{return await ie(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ee(n))return{data:null,error:n};throw n}}async _updateOAuthClient(t,n){try{return await ie(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(ee(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(t){try{return await ie(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(ee(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(t){try{return await ie(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(ee(n))return{data:null,error:n};throw n}}}function V0(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}const _i={debug:!!(globalThis&&Uk()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};
304class Bk extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class B0 extends Bk{}async function g5(e,t,n){_i.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const r=new globalThis.AbortController;t>0&&setTimeout(()=>{r.abort(),_i.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:r.signal},async s=>{if(s){_i.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,s.name);try{return await n()}finally{_i.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,s.name)}}else{if(t===0)throw _i.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new B0(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(_i.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"),await n()}})}catch(s){throw(s==null?void 0:s.name)==="AbortError"?new B0(`Acquiring an exclusive Navigator LockManager lock "${e}" timed out waiting ${t}ms`):s}}function y5(){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 zk(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function v5(e){return parseInt(e,16)}function w5(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,r=>r.toString(16).padStart(2,"0")).join("")}function x5(e){var t;const{chainId:n,domain:r,expirationTime:s,issuedAt:i=new Date,nonce:o,notBefore:a,requestId:l,resources:c,scheme:d,uri:f,version:h}=e;{if(!Number.isInteger(n))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${n}`);if(!r)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(o&&o.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${o}`);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}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(` 305`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const p=zk(e.address),v=d?`${d}://${r}
305`:r,g=e.statement?`${e.statement} 306`:"",b=`${v} wants you to sign in with your Ethereum account: 307${p} 308 309${g}`;let w=`URI: ${f} 310Version: ${h} 311Chain ID: ${n}${o?` 312Nonce: ${o}`:""} 313Issued At: ${i.toISOString()}`;if(s&&(w+=` 314Expiration Time: ${s.toISOString()}`),a&&(w+=` 315Not Before: ${a.toISOString()}`),l&&(w+=` 316Request ID: ${l}`),c){let y=` 317Resources:`;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+=` 318- ${x}`}w+=y}return`${b} 319${w}`}class et extends Error{constructor({message:t,code:n,cause:r,name:s}){var i;super(t,{cause:r}),this.__isWebAuthnError=!0,this.name=(i=s??(r instanceof Error?r.name:void 0))!==null&&i!==void 0?i:"Unknown Error",this.code=n}}class Cu extends et{constructor(t,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:t}),this.name="WebAuthnUnknownError",this.originalError=n}}function b5({error:e,options:t}){var n,r,s;const{publicKey:i}=t;if(!i)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new et({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((n=i.authenticatorSelection)===null||n===void 0?void 0:n.requireResidentKey)===!0)return new et({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((r=i.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)==="required")return new et({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=i.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new et({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 et({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new et({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return i.pubKeyCredParams.filter(a=>a.type==="public-key").length===0?new et({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new et({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 o=window.location.hostname;if(Wk(o)){if(i.rp.id!==o)return new et({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new et({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new et({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 et({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 et({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function S5({error:e,options:t}){const{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new et({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new et({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const r=window.location.hostname;if(Wk(r)){if(n.rpId!==r)return new et({message:`The RP ID "${n.rpId}
319" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new et({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new et({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 et({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class k5{createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}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 _5=new k5;function E5(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:n,excludeCredentials:r}=e,s=Lo(e,["challenge","user","excludeCredentials"]),i=io(t).buffer,o=Object.assign(Object.assign({},n),{id:io(n.id).buffer}),a=Object.assign(Object.assign({},s),{challenge:i,user:o});if(r&&r.length>0){a.excludeCredentials=new Array(r.length);for(let l=0;l<r.length;l++){const c=r[l];a.excludeCredentials[l]=Object.assign(Object.assign({},c),{id:io(c.id).buffer,type:c.type||"public-key",transports:c.transports})}}return a}function C5(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:n}=e,r=Lo(e,["challenge","allowCredentials"]),s=io(t).buffer,i=Object.assign(Object.assign({},r),{challenge:s});if(n&&n.length>0){i.allowCredentials=new Array(n.length);for(let o=0;o<n.length;o++){const a=n[o];i.allowCredentials[o]=Object.assign(Object.assign({},a),{id:io(a.id).buffer,type:a.type||"public-key",transports:a.transports})}}return i}function T5(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e;return{id:e.id,rawId:e.id,response:{attestationObject:qs(new Uint8Array(e.response.attestationObject)),clientDataJSON:qs(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function P5(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e,r=e.getClientExtensionResults(),s=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:qs(new Uint8Array(s.authenticatorData)),clientDataJSON:qs(new Uint8Array(s.clientDataJSON)),signature:qs(new Uint8Array(s.signature)),userHandle:s.userHandle?qs(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function Wk(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function z0(){var e,t;return!!(ft()&&"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 j5(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Cu("Browser returned unexpected credential type",t)}:{data:null,error:new Cu("Empty credential response",t)}}catch(t){return{data:null,error:b5({error:t,options:e})}}}async function N5(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new Cu("Browser returned unexpected credential type",t)}:{data:null,error:new Cu("Empty credential response",t)}}
319catch(t){return{data:null,error:S5({error:t,options:e})}}}const R5={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},A5={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Tu(...e){const t=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),n=s=>s instanceof ArrayBuffer||ArrayBuffer.isView(s),r={};for(const s of e)if(s)for(const i in s){const o=s[i];if(o!==void 0)if(Array.isArray(o))r[i]=o;else if(n(o))r[i]=o;else if(t(o)){const a=r[i];t(a)?r[i]=Tu(a,o):r[i]=Tu(o)}else r[i]=o}return r}function O5(e,t){return Tu(R5,e,t||{})}function M5(e,t){return Tu(A5,e,t||{})}class I5{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:n,friendlyName:r,signal:s},i){var o;try{const{data:a,error:l}=await this.client.mfa.challenge({factorId:t,webauthn:n});if(!a)return{data:null,error:l};const c=s??_5.createNewAbortSignal();if(a.webauthn.type==="create"){const{user:d}=a.webauthn.credential_options.publicKey;if(!d.name){const f=r;if(f)d.name=`${d.id}:${f}`;else{const p=(await this.client.getUser()).data.user,v=((o=p==null?void 0:p.user_metadata)===null||o===void 0?void 0:o.name)||(p==null?void 0:p.email)||(p==null?void 0:p.id)||"User";d.name=`${d.id}:${v}`}}d.displayName||(d.displayName=d.name)}switch(a.webauthn.type){case"create":{const d=O5(a.webauthn.credential_options.publicKey,i==null?void 0:i.create),{data:f,error:h}=await j5({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=M5(a.webauthn.credential_options.publicKey,i==null?void 0:i.request),{data:f,error:h}=await N5(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 ee(a)?{data:null,error:a}:{data:null,error:new Bs("Unexpected error in challenge",a)}}}async _verify({challengeId:t,factorId:n,webauthn:r}){return this.client.mfa.verify({factorId:n,challengeId:t,webauthn:r})}async _authenticate({factorId:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},i){if(!n)return{data:null,error:new el("rpId is required for WebAuthn authentication")};try{if(!z0())return{data:null,error:new Bs("Browser does not support WebAuthn",null)};const{data:o,error:a}=await this.challenge({factorId:t,webauthn:{rpId:n,rpOrigins:r},signal:s},{request:i});if(!o)return{data:null,error:a};const{webauthn:l}=o;return this._verify({factorId:t,challengeId:o.challengeId,webauthn:{type:l.type,rpId:n,rpOrigins:r,credential_response:l.credential_response}})}catch(o){return ee(o)?{data:null,error:o}:{data:null,error:new Bs("Unexpected error in authenticate",o)}}}async _register({friendlyName:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},i){if(!n)return{data:null,error:new el("rpId is required for WebAuthn registration")};try{if(!z0())return{data:null,error:new Bs("Browser does not support WebAuthn",null)};const{data:o,error:a}=await this._enroll({friendlyName:t});if(!o)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:o.id,friendlyName:o.friendly_name,webauthn:{rpId:n,rpOrigins:r},signal:s},{create:i});return l?this._verify({factorId:o.id,challengeId:l.challengeId,webauthn:{rpId:n,rpOrigins:r,type:l.webauthn.type,credential_response:l.webauthn.credential_response}}):{data:null,error:c}}catch(o){return ee(o)?{data:null,error:o}:{data:null,error:new Bs("Unexpected error in register",o)}}}}y5();const D5={url:OD,storageKey:MD,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:ID,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:1e4,skipAutoInitialize:!1};
319async function W0(e,t,n){return await n()}const Ei={};class tl{get jwks(){var t,n;return(n=(t=Ei[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(t){Ei[this.storageKey]=Object.assign(Object.assign({},Ei[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,n;return(n=(t=Ei[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){Ei[this.storageKey]=Object.assign(Object.assign({},Ei[this.storageKey]),{cachedAt:t})}constructor(t){var n,r,s;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({},D5),t);if(this.storageKey=i.storageKey,this.instanceID=(n=tl.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,tl.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.instanceID>0&&ft()){const o=`${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(o),this.logDebugMessages&&console.trace(o)}if(this.persistSession=i.persistSession,this.autoRefreshToken=i.autoRefreshToken,this.admin=new m5({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=Vk(i.fetch),this.lock=i.lock||W0,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&&ft()&&(!((r=globalThis==null?void 0:globalThis.navigator)===null||r===void 0)&&r.locks)?this.lock=g5:this.lock=W0,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 I5(this)},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.persistSession?(i.storage?this.storage=i.storage:Uk()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=V0(this.memoryStorage)),i.userStorage&&(this.userStorage=i.userStorage)):(this.memoryStorage={},this.storage=V0(this.memoryStorage)),ft()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o);try{await this._notifyAllSubscribers(o.data.event,o.data.session,!1)}catch(a){this._debug("#broadcastChannel","error",a)}})}i.skipAutoInitialize||this.initialize().catch(o=>{this._debug("#initialize()","error",o)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${Lk}) ${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 n={},r="none";if(ft()&&(n=YD(window.location.href),this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce")),ft()&&this.detectSessionInUrl&&r!=="none"){const{data:s,error:i}=await this._getSessionFromURL(n,r);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),UD(i)){const l=(t=i.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:i}}return{error:i}}const{session:o,redirectType:a}=s;return this._debug("#_initialize()","detected session in URL",o,"redirect type",a),await this._saveSession(o),setTimeout(async()=>{a==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return ee(n)?this._returnResult({error:n}):this._returnResult({error:new Bs("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var n,r,s;try{const i=await ie(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=t==null?void 0:t.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(s=t==null?void 0:t.options)===null||s===void 0?void 0:s.captchaToken}},xform:_n}),{data:o,error:a}=i;if(a||!o)return this._returnResult({data:{user:null,session:null},error:a});const l=o.session,c=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:c,session:l},error:null})}catch(i){if(ee(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signUp(t){var n,r,s;try{let i;if("email"in t){const{email:d,password:f,options:h}=t;let p=null,v=null;this.flowType==="pkce"&&([p,v]=await Si(this.storage,this.storageKey)),i=await ie(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:h==null?void 0:h.emailRedirectTo,body:{email:d,password:f,data:(n=h==null?void 0:h.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:h==null?void 0:h.captchaToken},code_challenge:p,code_challenge_method:v},xform:_n})}else if("phone"in t){const{phone:d,password:f,options:h}=t;i=await ie(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:f,data:(r=h==null?void 0:h.data)!==null&&r!==void 0?r:{},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:_n})}else throw new oc("You must provide either an email or phone number and a password");const{data:o,error:a}=i;if(a||!o)return await dt(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:a});const l=o.session,c=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:c,session:l},error:null})}catch(i){if(await dt(this.storage,`${this.storageKey}-code-verifier`),ee(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithPassword(t){try{let n;if("email"in t){const{email:i,password:o,options:a}=t;n=await ie(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:F0})}else if("phone"in t){const{phone:i,password:o,options:a}=t;n=await ie(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:F0})}else throw new oc("You must provide either an email or phone number and a password");const{data:r,error:s}=n;if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!r||!r.session||!r.user){const i=new bi;return this._returnResult({data:{user:null,session:null},error:i})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:s})}catch(n){if(ee(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOAuth(t){var n,r,s,i;return await this._handleProviderSignIn(t.provider,{redirectTo:(n=t.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=t.options)===null||r===void 0?void 0:r.scopes,queryParams:(s=t.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(i=t.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:n}=t;switch(n){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}}async signInWithEthereum(t){var n,r,s,i,o,a,l,c,d,f,h;let p,v;if("message"in t)p=t.message,v=t.signature;else{const{chain:g,wallet:b,statement:w,options:y}=t;let x;if(ft())if(typeof b=="object")x=b;else{const j=window;if("ethereum"in j&&typeof j.ethereum=="object"&&"request"in j.ethereum&&typeof j.ethereum.request=="function")x=j.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((n=y==null?void 0:y.url)!==null&&n!==void 0?n:window.location.href),k=await x.request({method:"eth_requestAccounts"}).then(j=>j).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!k||k.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const E=zk(k[0]);let C=(r=y==null?void 0:y.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!C){const j=await x.request({method:"eth_chainId"});C=v5(j)}const _={domain:S.host,address:E,statement:w,uri:S.href,version:"1",chainId:C,nonce:(s=y==null?void 0:y.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(o=(i=y==null?void 0:y.signInWithEthereum)===null||i===void 0?void 0:i.issuedAt)!==null&&o!==void 0?o: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};p=x5(_),v=await x.request({method:"personal_sign",params:[w5(p),E]})}try{const{data:g,error:b}=await ie(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:p,signature:v},!((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:_n});if(b)throw b;if(!g||!g.session||!g.user){const w=new bi;return this._returnResult({data:{user:null,session:null},error:w})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:Object.assign({},g),error:b})}catch(g){if(ee(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async signInWithSolana(t){var n,r,s,i,o,a,l,c,d,f,h,p;let v,g;if("message"in t)v=t.message,g=t.signature;else{const{chain:b,wallet:w,statement:y,options:x}=t;let S;if(ft())if(typeof w=="object")S=w;else{const E=window;if("solana"in E&&typeof E.solana=="object"&&("signIn"in E.solana&&typeof E.solana.signIn=="function"||"signMessage"in E.solana&&typeof E.solana.signMessage=="function"))S=E.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 w!="object"||!(x!=null&&x.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");S=w}const k=new URL((n=x==null?void 0:x.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in S&&S.signIn){const E=await S.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},x==null?void 0:x.signInWithSolana),{version:"1",domain:k.host,uri:k.href}),y?{statement:y}:null));let C;if(Array.isArray(E)&&E[0]&&typeof E[0]=="object")C=E[0];else if(E&&typeof E=="object"&&"signedMessage"in E&&"signature"in E)C=E;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in C&&"signature"in C&&(typeof C.signedMessage=="string"||C.signedMessage instanceof Uint8Array)&&C.signature instanceof Uint8Array)v=typeof C.signedMessage=="string"?C.signedMessage:new TextDecoder().decode(C.signedMessage),g=C.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");v=[`${k.host} wants you to sign in with your Solana account:`,S.publicKey.toBase58(),...y?["",y,""]:[""],"Version: 1",`URI: ${k.href}`,`Issued At: ${(s=(r=x==null?void 0:x.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((i=x==null?void 0:x.signInWithSolana)===null||i===void 0)&&i.notBefore?[`Not Before: ${x.signInWithSolana.notBefore}`]:[],...!((o=x==null?void 0:x.signInWithSolana)===null||o===void 0)&&o.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(C=>
319`- ${C}`)]:[]].join(` 320`);const E=await S.signMessage(new TextEncoder().encode(v),"utf8");if(!E||!(E instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");g=E}}try{const{data:b,error:w}=await ie(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:v,signature:qs(g)},!((h=t.options)===null||h===void 0)&&h.captchaToken?{gotrue_meta_security:{captcha_token:(p=t.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:_n});if(w)throw w;if(!b||!b.session||!b.user){const y=new bi;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:w})}catch(b){if(ee(b))return this._returnResult({data:{user:null,session:null},error:b});throw b}}async _exchangeCodeForSession(t){const n=await Ms(this.storage,`${this.storageKey}-code-verifier`),[r,s]=(n??"").split("/");try{if(!r&&this.flowType==="pkce")throw new VD;const{data:i,error:o}=await ie(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:_n});if(await dt(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!i||!i.session||!i.user){const a=new bi;return this._returnResult({data:{user:null,session:null,redirectType:null},error:a})}return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),this._returnResult({data:Object.assign(Object.assign({},i),{redirectType:s??null}),error:o})}catch(i){if(await dt(this.storage,`${this.storageKey}-code-verifier`),ee(i))return this._returnResult({data:{user:null,session:null,redirectType:null},error:i});throw i}}async signInWithIdToken(t){try{const{options:n,provider:r,token:s,access_token:i,nonce:o}=t,a=await ie(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:s,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:_n}),{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 bi;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(n){if(ee(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOtp(t){var n,r,s,i,o;try{if("email"in t){const{email:a,options:l}=t;let c=null,d=null;this.flowType==="pkce"&&([c,d]=await Si(this.storage,this.storageKey));const{error:f}=await ie(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(n=l==null?void 0:l.data)!==null&&n!==void 0?n:{},create_user:(r=l==null?void 0:l.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},code_challenge:c,code_challenge_method:d},redirectTo:l==null?void 0:l.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:f})}if("phone"in t){const{phone:a,options:l}=t,{data:c,error:d}=await ie(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:(i=l==null?void 0:l.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},channel:(o=l==null?void 0:l.channel)!==null&&o!==void 0?o:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:c==null?void 0:c.message_id},error:d})}throw new oc("You must provide either an email or phone number.")}catch(a){if(await dt(this.storage,`${this.storageKey}-code-verifier`),ee(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async verifyOtp(t){var n,r;try{let s,i;"options"in t&&(s=(n=t.options)===null||n===void 0?void 0:n.redirectTo,i=(r=t.options)===null||r===void 0?void 0:r.captchaToken);const{data:o,error:a}=await ie(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:i}}),redirectTo:s,xform:_n});if(a)throw a;if(!o)throw new Error("An error occurred on token verification.");const l=o.session,c=o.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(ee(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithSSO(t){var n,r,s,i,o;try{let a=null,l=null;this.flowType==="pkce"&&([a,l]=await Si(this.storage,this.storageKey));const c=await ie(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(r=(n=t.options)===null||n===void 0?void 0:n.redirectTo)!==null&&r!==void 0?r:void 0}),!((s=t==null?void 0:t.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:a,code_challenge_method:l}),headers:this.headers,xform:f5});return!((i=c.data)===null||i===void 0)&&i.url&&ft()&&!(!((o=t.options)===null||o===void 0)&&o.skipBrowserRedirect)&&window.location.assign(c.data.url),this._returnResult(c)}catch(a){if(await dt(this.storage,`${this.storageKey}-code-verifier`),ee(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:n},error:r}=t;if(r)throw r;if(!n)throw new qt;const{error:s}=await ie(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return this._returnResult({data:{user:null,session:null},error:s})})}catch(t){if(ee(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const n=`${this.url}/resend`;if("email"in t){const{email:r,type:s,options:i}=t,{error:o}=await ie(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:s,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},redirectTo:i==null?void 0:i.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:o})}else if("phone"in t){const{phone:r,type:s,options:i}=t,{data:o,error:a}=await ie(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:s,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:a})}throw new oc("You must provide either an email or phone number and a type")}catch(n){if(ee(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async n=>n))}async _acquireLock(t,n){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const r=n();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await r}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const n=await this.__loadSession();return await t(n)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const n=await Ms(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?t=n:(this._debug("#getSession()","session from storage is not val
320id"),await this._removeSession())),!t)return{data:{session:null},error:null};const r=t.expires_at?t.expires_at*1e3-Date.now()<Cf:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",t.expires_at),!r){if(this.userStorage){const o=await Ms(this.userStorage,this.storageKey+"-user");o!=null&&o.user?t.user=o.user:t.user=jf()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};t.user=l5(t.user,o),o.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:s,error:i}=await this._callRefreshToken(t.refresh_token);return i?this._returnResult({data:{session:null},error:i}):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 n=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return n.data.user&&(this.suppressGetSessionWarning=!0),n}async _getUser(t){try{return t?await ie(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:Yr}):await this._useSession(async n=>{var r,s,i;const{data:o,error:a}=n;if(a)throw a;return!(!((r=o.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new qt}:await ie(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(s=o.session)===null||s===void 0?void 0:s.access_token)!==null&&i!==void 0?i:void 0,xform:Yr})})}catch(n){if(ee(n))return Tf(n)&&(await this._removeSession(),await dt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:n});throw n}}async updateUser(t,n={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,n))}async _updateUser(t,n={}){try{return await this._useSession(async r=>{const{data:s,error:i}=r;if(i)throw i;if(!s.session)throw new qt;const o=s.session;let a=null,l=null;this.flowType==="pkce"&&t.email!=null&&([a,l]=await Si(this.storage,this.storageKey));const{data:c,error:d}=await ie(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n==null?void 0:n.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:a,code_challenge_method:l}),jwt:o.access_token,xform:Yr});if(d)throw d;return o.user=c.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),this._returnResult({data:{user:o.user},error:null})})}catch(r){if(await dt(this.storage,`${this.storageKey}-code-verifier`),ee(r))return this._returnResult({data:{user:null},error:r});throw r}}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 qt;const n=Date.now()/1e3;let r=n,s=!0,i=null;const{payload:o}=lc(t.access_token);if(o.exp&&(r=o.exp,s=r<=n),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};i=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});i={access_token:t.access_token,refresh_token:t.refresh_token,user:a.user,token_type:"bearer",expires_in:r-n,expires_at:r},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return this._returnResult({data:{user:i.user,session:i},error:null})}catch(n){if(ee(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}}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 n=>{var r;if(!t){const{data:o,error:a}=n;if(a)throw a;t=(r=o.session)!==null&&r!==void 0?r:void 0}if(!(t!=null&&t.refresh_token))throw new qt;const{data:s,error:i}=await this._callRefreshToken(t.refresh_token);return i?this._returnResult({data:{user:null,session:null},error:i}):s?this._returnResult({data:{user:s.user,session:s},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(n){if(ee(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(t,n){try{if(!ft())throw new ac("No browser detected.");
320if(t.error||t.error_description||t.error_code)throw new ac(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new A0("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new ac("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new A0("No code detected.");const{data:y,error:x}=await this._exchangeCodeForSession(t.code);if(x)throw x;const S=new URL(window.location.href);return S.searchParams.delete("code"),window.history.replaceState(window.history.state,"",S.toString()),{data:{session:y.session,redirectType:null},error:null}}const{provider_token:r,provider_refresh_token:s,access_token:i,refresh_token:o,expires_in:a,expires_at:l,token_type:c}=t;if(!i||!a||!o||!c)throw new ac("No session defined in URL");const d=Math.round(Date.now()/1e3),f=parseInt(a);let h=d+f;l&&(h=parseInt(l));const p=h-d;p*1e3<=Ri&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${p}s, should have been closer to ${f}s`);const v=h-f;d-v>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",v,h,d):d-v<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",v,h,d);const{data:g,error:b}=await this._getUser(i);if(b)throw b;const w={provider_token:r,provider_refresh_token:s,access_token:i,expires_in:f,expires_at:h,refresh_token:o,token_type:c,user:g.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:w,redirectType:t.type},error:null})}catch(r){if(ee(r))return this._returnResult({data:{session:null,redirectType:null},error:r});throw r}}_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 n=await Ms(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&n)}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 n=>{var r;const{data:s,error:i}=n;if(i&&!Tf(i))return this._returnResult({error:i});const o=(r=s.session)===null||r===void 0?void 0:r.access_token;if(o){const{error:a}=await this.admin.signOut(o,t);if(a&&!(FD(a)&&(a.status===404||a.status===401||a.status===403)||Tf(a)))return this._returnResult({error:a})}return t!=="others"&&(await this._removeSession(),await dt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const n=GD(),r={id:n,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",n),this.stateChangeEmitters.delete(n)}};return this._debug("#onAuthStateChange()","registered callback with id",n),this.stateChangeEmitters.set(n,r),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:r}}}async _emitInitialSession(t){return await this._useSession(async n=>{var r,s;try{const{data:{session:i},error:o}=n;if(o)throw o;await((r=this.stateChangeEmitters.get(t))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",t,"session",i)}catch(i){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",i),console.error(i)}})}async resetPasswordForEmail(t,n={}){let r=null,s=null;this.flowType==="pkce"&&([r,s]=await Si(this.storage,this.storageKey,!0));try{return await ie(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:r,code_challenge_method:s,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(i){if(await dt(this.storage,`${this.storageKey}-code-verifier`),ee(i))return this._returnResult({data:null,error:i});throw i}}async getUserIdentities(){var t;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:(t=n.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(n){if(ee(n))return this._returnResult({data:null,error:n});throw n}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var n;try{const{data:r,error:s}=await this._useSession(async i=>{var o,a,l,c,d;const{data:f,error:h}=i;if(h)throw h;const p=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(o=t.options)===null||o===void 0?void 0:o.redirectTo,scopes:(a=t.options)===null||a===void 0?void 0:a.scopes,queryParams:(l=t.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await ie(this.fetch,"GET",p,{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 ft()&&!(!((n=t.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),this._returnResult({data:{provider:t.provider,url:r==null?void 0:r.url},error:null})}catch(r){if(ee(r))return this._returnResult({data:{provider:t.provider,url:null},error:r});throw r}}async linkIdentityIdToken(t){return await this._useSession(async n=>{var r;try{const{error:s,data:{session:i}}=n;
320if(s)throw s;const{options:o,provider:a,token:l,access_token:c,nonce:d}=t,f=await ie(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(r=i==null?void 0:i.access_token)!==null&&r!==void 0?r:void 0,body:{provider:a,id_token:l,access_token:c,nonce:d,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:_n}),{data:h,error:p}=f;return p?this._returnResult({data:{user:null,session:null},error:p}):!h||!h.session||!h.user?this._returnResult({data:{user:null,session:null},error:new bi}):(h.session&&(await this._saveSession(h.session),await this._notifyAllSubscribers("USER_UPDATED",h.session)),this._returnResult({data:h,error:p}))}catch(s){if(await dt(this.storage,`${this.storageKey}-code-verifier`),ee(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}})}async unlinkIdentity(t){try{return await this._useSession(async n=>{var r,s;const{data:i,error:o}=n;if(o)throw o;return await ie(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(s=(r=i.session)===null||r===void 0?void 0:r.access_token)!==null&&s!==void 0?s:void 0})})}catch(n){if(ee(n))return this._returnResult({data:null,error:n});throw n}}async _refreshAccessToken(t){const n=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(n,"begin");try{const r=Date.now();return await XD(async s=>(s>
3200&&await QD(200*Math.pow(2,s-1)),this._debug(n,"refreshing attempt",s),await ie(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:_n})),(s,i)=>{const o=200*Math.pow(2,s);return i&&Pf(i)&&Date.now()+o-r<Ri})}catch(r){if(this._debug(n,"error",r),ee(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}finally{this._debug(n,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,n){const r=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",n,"url",r),ft()&&!n.skipBrowserRedirect&&window.location.assign(r),{data:{provider:t,url:r},error:null}}async _recoverAndRefresh(){var t,n;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const s=await Ms(this.storage,this.storageKey);if(s&&this.userStorage){let o=await Ms(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:s.user},await Ai(this.userStorage,this.storageKey+"-user",o)),s.user=(t=o==null?void 0:o.user)!==null&&t!==void 0?t:jf()}else if(s&&!s.user&&!s.user){const o=await Ms(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(s.user=o.user,await dt(this.storage,this.storageKey+"-user"),await Ai(this.storage,this.storageKey,s)):s.user=jf()}if(this._debug(r,"session from storage",s),!this._isValidSession(s)){this._debug(r,"session is not valid"),s!==null&&await this._removeSession();return}const i=((n=s.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<Cf;if(this._debug(r,`session has${i?"":" not"} expired with margin of ${Cf}s`),i){if(this.autoRefreshToken&&s.refresh_token){const{error:o}=await this._callRefreshToken(s.refresh_token);o&&(console.error(o),Pf(o)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(s.user&&s.user.__isUserNotAvailableProxy===!0)try{const{data:o,error:a}=await this._getUser(s.access_token);!a&&(o!=null&&o.user)?(s.user=o.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(r,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){this._debug(r,"error",s),console.error(s);return}finally{this._debug(r,"end")}}async _callRefreshToken(t){var n,r;if(!t)throw new qt;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const s=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new Ed;const{data:i,error:o}=await this._refreshAccessToken(t);if(o)throw o;if(!i.session)throw new qt;await this._saveSession(i.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const a={data:i.session,error:null};return this.refreshingDeferred.resolve(a),a}catch(i){if(this._debug(s,"error",i),ee(i)){const o={data:null,error:i};return Pf(i)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(o),o}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(i),i}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(t,n,r=!0){const s=`#_notifyAllSubscribers(${t})`;this._debug(s,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:t,session:n});const i=[],o=Array.from(this.stateChangeEmitters.values()).map(async a=>{try{await a.callback(t,n)}catch(l){i.push(l)}});if(await Promise.all(o),i.length>0){for(let a=0;a<i.length;a+=1)console.error(i[a]);throw i[0]}}finally{this._debug(s,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await dt(this.storage,`${this.storageKey}-code-verifier`);const n=Object.assign({},t),r=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&n.user&&await Ai(this.userStorage,this.storageKey+"-user",{user:n.user});const s=Object.assign({},n);delete s.user;const i=L0(s);await Ai(this.storage,this.storageKey,i)}else{const s=L0(n);await Ai(this.storage,this.storageKey,s)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await dt(this.storage,this.storageKey),await dt(this.storage,this.storageKey+"-code-verifier"),await dt(this.storage,this.storageKey+"-user"),this.userStorage&&await dt(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&ft()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",t)}
320catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),Ri);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);const n=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=n,n&&typeof n=="object"&&typeof n.unref=="function"?n.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(n)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);const n=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,n&&clearTimeout(n)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async n=>{const{data:{session:r}}=n;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((r.expires_at*1e3-t)/Ri);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${Ri}ms, refresh threshold is ${Sp} ticks`),s<=Sp&&await this._callRefreshToken(r.refresh_token)})}catch(n){console.error("Auto refresh tick failed with error. This is likely a transient error.",n)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof Bk)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!ft()||!(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 n=`#_onVisibilityChanged(${t})`;this._debug(n,"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(n,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,n,r){const s=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&s.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&s.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[i,o]=await Si(this.storage,this.storageKey),a=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(o)}`});s.push(a.toString())}if(r!=null&&r.queryParams){const i=new URLSearchParams(r.queryParams);s.push(i.toString())}return r!=null&&r.skipBrowserRedirect&&s.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${t}?${s.join("&")}`}async _unenroll(t){try{return await this._useSession(async n=>{var r;const{data:s,error:i}=n;return i?this._returnResult({data:null,error:i}):await ie(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(ee(n))return this._returnResult({data:null,error:n});throw n}}async _enroll(t){try{return await this._useSession(async n=>{var r,s;const{data:i,error:o}=n;
320if(o)return this._returnResult({data:null,error:o});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 ie(this.fetch,"POST",`${this.url}/factors`,{body:a,headers:this.headers,jwt:(r=i==null?void 0:i.session)===null||r===void 0?void 0:r.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(n){if(ee(n))return this._returnResult({data:null,error:n});throw n}}async _verify(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:s,error:i}=n;if(i)return this._returnResult({data:null,error:i});const o=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?T5(t.webauthn.credential_response):P5(t.webauthn.credential_response)})}:{code:t.code}),{data:a,error:l}=await ie(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:o,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.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(n){if(ee(n))return this._returnResult({data:null,error:n});throw n}})}async _challenge(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:s,error:i}=n;if(i)return this._returnResult({data:null,error:i});const o=await ie(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});if(o.error)return o;const{data:a}=o;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:E5(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:C5(a.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(ee(n))return this._returnResult({data:null,error:n});throw n}})}async _challengeAndVerify(t){const{data:n,error:r}=await this._challenge({factorId:t.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:t.factorId,challengeId:n.id,code:t.code})}async _listFactors(){var t;const{data:{user:n},error:r}=await this.getUser();if(r)return{data:null,error:r};const s={all:[],phone:[],totp:[],webauthn:[]};for(const i of(t=n==null?void 0:n.factors)!==null&&t!==void 0?t:[])s.all.push(i),i.status==="verified"&&s[i.factor_type].push(i);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(t){var n,r,s,i;if(t)try{const{payload:p}=lc(t);let v=null;p.aal&&(v=p.aal);let g=v;const{data:{user:b},error:w}=await this.getUser(t);if(w)return this._returnResult({data:null,error:w});((r=(n=b==null?void 0:b.factors)===null||n===void 0?void 0:n.filter(S=>S.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(g="aal2");const x=p.amr||[];return{data:{currentLevel:v,nextLevel:g,currentAuthenticationMethods:x},error:null}}catch(p){if(ee(p))return this._returnResult({data:null,error:p});throw p}const{data:{session:o},error:a}
320=await this.getSession();if(a)return this._returnResult({data:null,error:a});if(!o)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:l}=lc(o.access_token);let c=null;l.aal&&(c=l.aal);let d=c;((i=(s=o.user.factors)===null||s===void 0?void 0:s.filter(p=>p.status==="verified"))!==null&&i!==void 0?i:[]).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 n=>{const{data:{session:r},error:s}=n;return s?this._returnResult({data:null,error:s}):r?await ie(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:r.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new qt})})}catch(n){if(ee(n))return this._returnResult({data:null,error:n});throw n}}async _approveAuthorization(t,n){try{return await this._useSession(async r=>{const{data:{session:s},error:i}=r;if(i)return this._returnResult({data:null,error:i});if(!s)return this._returnResult({data:null,error:new qt});const o=await ie(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 o.data&&o.data.redirect_url&&ft()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(r){if(ee(r))return this._returnResult({data:null,error:r});throw r}}async _denyAuthorization(t,n){try{return await this._useSession(async r=>{const{data:{session:s},error:i}=r;if(i)return this._returnResult({data:null,error:i});if(!s)return this._returnResult({data:null,error:new qt});const o=await ie(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 o.data&&o.data.redirect_url&&ft()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(r){if(ee(r))return this._returnResult({data:null,error:r});throw r}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?await ie(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new qt})})}catch(t){if(ee(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;return s?this._returnResult({data:null,error:s}):r?(await ie(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new qt})})}catch(n){if(ee(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(t,n={keys:[]}){let r=n.keys.find(a=>a.kid===t);if(r)return r;const s=Date.now();if(r=this.jwks.keys.find(a=>a.kid===t),r&&this.jwks_cached_at+LD>s)return r;const{data:i,error:o}=await ie(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=s,r=i.keys.find(a=>a.kid===t),!r)?null:r}async getClaims(t,n={}){try{let r=t;if(!r){const{data:p,error:v}
320=await this.getSession();if(v||!p.session)return this._returnResult({data:null,error:v});r=p.session.access_token}const{header:s,payload:i,signature:o,raw:{header:a,payload:l}}=lc(r);n!=null&&n.allowExpired||i5(i.exp);const c=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!c){const{error:p}=await this.getUser(r);if(p)throw p;return{data:{claims:i,header:s,signature:o},error:null}}const d=o5(s.alg),f=await crypto.subtle.importKey("jwk",c,d,!0,["verify"]);if(!await crypto.subtle.verify(d,f,o,qD(`${a}.${l}`)))throw new Ep("Invalid JWT signature");return{data:{claims:i,header:s,signature:o},error:null}}catch(r){if(ee(r))return this._returnResult({data:null,error:r});throw r}}}tl.nextInstanceID={};const L5=tl,$5="2.97.0";let ca="";typeof Deno<"u"?ca="deno":typeof document<"u"?ca="web":typeof navigator<"u"&&navigator.product==="ReactNative"?ca="react-native":ca="node";const F5={"X-Client-Info":`supabase-js-${ca}/${$5}`},U5={headers:F5},V5={schema:"public"},B5={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},z5={};function nl(e){"@babel/helpers - typeof";return nl=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},nl(e)}function W5(e,t){if(nl(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(nl(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function H5(e){var t=W5(e,"string");return nl(t)=="symbol"?t:t+""}function q5(e,t,n){return(t=H5(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function Ge(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?H0(Object(n),!0).forEach(function(r){q5(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const K5=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),G5=()=>Headers,Y5=(e,t,n)=>{const r=K5(n),s=G5();return async(i,o)=>{var a;const l=(a=await t())!==null&&a!==void 0?a:e;let c=new s(o==null?void 0:o.headers);return c.has("apikey")||c.set("apikey",e),c.has("Authorization")||c.set("Authorization",`Bearer ${l}`),r(i,Ge(Ge({},o),{},{headers:c}))}};function J5(e){return e.endsWith("/")?e:e+"/"}function Q5(e,t){var n,r;const{db:s,auth:i,realtime:o,global:a}=e,{db:l,auth:c,realtime:d,global:f}=t,h={db:Ge(Ge({},l),s),auth:Ge(Ge({},c),i),realtime:Ge(Ge({},d),o),storage:{},global:Ge(Ge(Ge({},f),a),{},{headers:Ge(Ge({},(n=f==null?void 0:f.headers)!==null&&n!==void 0?n:{}),(r=a==null?void 0:a.headers)!==null&&r!==void 0?r:{})}),accessToken:async()=>""};return e.accessToken?h.accessToken=e.accessToken:delete h.accessToken,h}function X5(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(J5(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var Z5=class extends L5{constructor(e){super(e)}},eL=class{constructor(e,t,n){var r,s;this.supabaseUrl=e,this.supabaseKey=t;const i=X5(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",i),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",i),this.storageUrl=new URL("storage/v1",i),this.functionsUrl=new URL("functions/v1",i);const o=`sb-${i.hostname.split(".")[0]}-auth-token`,a={db:V5,realtime:z5,auth:Ge(Ge({},B5),{},{storageKey:o}),global:U5},l=Q5(n??{},a);if(this.storageKey=(r=l.auth.storageKey)!==null&&r!==void 0?r:"",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=Y5(t,this._getAccessToken.bind(this),l.global.fetch),this.realtime=this._initRealtimeClient(Ge({headers:this.headers,accessToken:this._getAccessToken.bind(this)},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 FI(new URL("rest/v1",i).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch,timeout:l.db.timeout,urlLengthLimit:l.db.urlLengthLimit}),this.storage=new AD(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new RI(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={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,n)}
320channel(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,n;if(e.accessToken)return await e.accessToken();const{data:r}=await e.auth.getSession();return(t=(n=r.session)===null||n===void 0?void 0:n.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:s,storageKey:i,flowType:o,lock:a,debug:l,throwOnError:c},d,f){const h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new Z5({url:this.authUrl.href,headers:Ge(Ge({},h),d),storageKey:i,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:s,flowType:o,lock:a,debug:l,throwOnError:c,fetch:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(p=>p.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new nD(this.realtimeUrl.href,Ge(Ge({},e),{},{params:Ge(Ge({},{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,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const tL=(e,t,n)=>new eL(e,t,n);function nL(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const n=t.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=18:!1}nL()&&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 rL="https://ootiyjeyujflhihrmcyq.supabase.co",sL="sb_publishable_p5D3qoKijfeQOblSRP-ERA_cPfZtU7Z",Ve=tL(rL,sL,{auth:{storage:localStorage,persistSession:!0,autoRefreshToken:!0}});function Ts(){const[e,t]=m.useState(null),[n,r]=m.useState(!0);return m.useEffect(()=>{Ve.auth.getUser().then(({data:i})=>{t(i.user),r(!1)});const{data:s}=Ve.auth.onAuthStateChange((i,o)=>{t((o==null?void 0:o.user)??null)});return()=>{s.subscription.unsubscribe()}},[]),{user:e,loading:n}}function cc({children:e}){const{user:t,loading:n}=Ts();return n?null:t?u.jsx(u.Fragment,{children:e}):u.jsx(hI,{to:"/login",replace:!0})}function iL(){const e=m.useRef(null),t=m.useRef(null);return m.useEffect(()=>{const n=e.current,r=t.current;if(!n||!r)return;let s=0,i=0,o=0,a=0;const l=p=>{s=p.clientX,i=p.clientY,r.style.left=`${s}px`,r.style.top=`${i}px`},c=p=>{p.target.closest("a, button, [role='button'], input, textarea, select, label")&&n.classList.add("hovering")},d=()=>{n.classList.remove("hovering")},f=()=>{o+=(s-o)*.15,a+=(i-a)*.15,n.style.left=`${o}px`,n.style.top=`${a}px`,requestAnimationFrame(f)};return window.addEventListener("mousemove",l),document.addEventListener("mouseover",c),document.addEventListener("mouseout",d),f(),window.matchMedia("(pointer: coarse)").matches&&(n.style.display="none",r.style.display="none",document.body.style.cursor="auto"),()=>{window.removeEventListener("mousemove",l),document.removeEventListener("mouseover",c),document.removeEventListener("mouseout",d)}},[]),u.jsxs(u.Fragment,{children:[u.jsx("div",{ref:e,className:"custom-cursor"}),u.jsx("div",{ref:t,className:"cursor-dot"})]})}const Cg=m.createContext({});function Tg(e){const t=m.useRef(null);return t.current===null&&(t.current=e()),t.current}const oL=typeof window<"u",Hk=oL?m.useLayoutEffect:m.useEffect,Cd=m.createContext(null);function Pg(e,t){e.indexOf(t)===-1&&e.push(t)}function Pu(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const cr=(e,t,n)=>n>t?t:n<e?e:n;let jg=()=>{};const xs={},qk=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function Kk(e){return typeof e=="object"&&e!==null}const Gk=e=>/^0[^.\s]+$/u.test(e);function Yk(e){let t;return()=>(t===void 0&&(t=e()),t)}const mn=e=>e,aL=(e,t)=>n=>t(e(n)),El=(...e)=>
vendor: 28,471 bytes, line 320
320e.reduce(aL),rl=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Ng{constructor(){this.subscriptions=[]}add(t){return Pg(this.subscriptions,t),()=>Pu(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;i<s;i++){const o=this.subscriptions[i];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Zt=e=>e*1e3,hn=e=>e/1e3;function Jk(e,t){return t?e*(1e3/t):0}const Qk=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,lL=1e-7,cL=12;function uL(e,t,n,r,s){let i,o,a=0;do o=t+(n-t)/2,i=Qk(o,r,s)-e,i>0?n=o:t=o;while(Math.abs(i)>lL&&++a<cL);return o}function Cl(e,t,n,r){if(e===t&&n===r)return mn;const s=i=>uL(i,0,1,e,n);return i=>i===0||i===1?i:Qk(s(i),t,r)}const Xk=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Zk=e=>t=>1-e(1-t),e_=Cl(.33,1.53,.69,.99),Rg=Zk(e_),t_=Xk(Rg),n_=e=>e>=1?1:(e*=2)<1?.5*Rg(e):.5*(2-Math.pow(2,-10*(e-1))),Ag=e=>1-Math.sin(Math.acos(e)),r_=Zk(Ag),s_=Xk(Ag),dL=Cl(.42,0,1,1),fL=Cl(0,0,.58,1),i_=Cl(.42,0,.58,1),hL=e=>Array.isArray(e)&&typeof e[0]!="number",o_=e=>Array.isArray(e)&&typeof e[0]=="number",pL={linear:mn,easeIn:dL,easeInOut:i_,easeOut:fL,circIn:Ag,circInOut:s_,circOut:r_,backIn:Rg,backInOut:t_,backOut:e_,anticipate:n_},mL=e=>typeof e=="string",q0=e=>{if(o_(e)){jg(e.length===4);const[t,n,r,s]=e;return Cl(t,n,r,s)}else if(mL(e))return pL[e];return e},uc=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function gL(e,t){let n=new Set,r=new Set,s=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(d){o.has(d)&&(c.schedule(d),e()),d(a)}const c={schedule:(d,f=!1,h=!1)=>{const v=h&&s?n:r;return f&&o.add(d),v.add(d),d},cancel:d=>{r.delete(d),o.delete(d)},process:d=>{if(a=d,s){i=!0;return}s=!0;const f=n;n=r,r=f,n.forEach(l),n.clear(),s=!1,i&&(i=!1,c.process(d))}};return c}const yL=40;function a_(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=uc.reduce((x,S)=>(x[S]=gL(i),x),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:d,update:f,preRender:h,render:p,postRender:v}=o,g=()=>{const x=xs.useManualTiming,S=x?s.timestamp:performance.now();n=!1,x||(s.delta=r?1e3/60:Math.max(Math.min(S-s.timestamp,yL),1)),s.timestamp=S,s.isProcessing=!0,a.process(s),l.process(s),c.process(s),d.process(s),f.process(s),h.process(s),p.process(s),v.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(g))},b=()=>{n=!0,r=!0,s.isProcessing||e(g)};return{schedule:uc.reduce((x,S)=>{const k=o[S];return x[S]=(E,C=!1,_=!1)=>(n||b(),k.schedule(E,C,_)),x},{}),cancel:x=>{for(let S=0;S<uc.length;S++)o[uc[S]].cancel(x)},state:s,steps:o}}const{schedule:Oe,cancel:bs,state:pt,steps:Rf}=a_(typeof requestAnimationFrame<"u"?requestAnimationFrame:mn,!0);let Dc;function vL(){Dc=void 0}const Nt={now:()=>(Dc===void 0&&Nt.set(pt.isProcessing||xs.useManualTiming?pt.timestamp:performance.now()),Dc),set:e=>{Dc=e,queueMicrotask(vL)}},l_=e=>t=>typeof t=="string"&&t.startsWith(e),c_=l_("--"),wL=l_("var(--"),Og=e=>wL(e)?xL.test(e.split("/*")[0].trim()):!1,xL=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function K0(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Fo={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},sl={...Fo,transform:e=>cr(0,1,e)},dc={...Fo,default:1},_a=e=>Math.round(e*1e5)/1e5,Mg=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function bL(e){return e==null}const SL=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ig=(e,t)=>n=>!!(typeof n=="string"&&SL.test(n)&&n.startsWith(e)||t&&!bL(n)&&Object.prototype.hasOwnProperty.call(n,t)),u_=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(Mg);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},kL=e=>cr(0,255,e),Af={...Fo,transform:e=>Math.round(kL(e))},Ks={test:Ig("rgb","red"),parse:u_("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Af.transform(e)+", "+Af.transform(t)+", "+Af.transform(n)+", "+_a(sl.transform(r))+")"};function _L(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Cp={test:Ig("#"),parse:_L,transform:Ks.transform},Tl=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Vr=Tl("deg"),or=Tl("%"),X=Tl("px"),EL=Tl("vh"),CL=Tl("vw"),G0={...or,parse:e=>or.parse(e)/100,transform:e=>or.transform(e*100)},Ki={test:Ig("hsl","hue"),parse:u_("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+or.transform(_a(t))+", "+or.transform(_a(n))+", "+_a(sl.transform(r))+")"},nt={test:e=>Ks.test(e)||Cp.test(e)||Ki.test(e),parse:e=>Ks.test(e)?Ks.parse(e):Ki.test(e)?Ki.parse(e):Cp.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ks.transform(e):Ki.transform(e),getAnimatableNone:e=>{const t=nt.parse(e);return t.alpha=0,nt.transform(t)}},TL=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function PL(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Mg))==null?void 0:t.length)||0)+(((n=e.match(TL))==null?void 0:n.length)||0)>0}const d_="number",f_="color",jL="var",NL="var(",Y0="${}",RL=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Co(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=t.replace(RL,l=>(nt.test(l)?(r.color.push(i),s.push(f_),n.push(nt.parse(l))):l.startsWith(NL)?(r.var.push(i),s.push(jL),n.push(l)):(r.number.push(i),s.push(d_),n.push(parseFloat(l))),++i,Y0)).split(Y0);return{values:n,split:a,indexes:r,types:s}}function AL(e){return Co(e).values}function h_({split:e,types:t}){const n=e.length;return r=>{let s="";for(let i=0;i<n;i++)if(s+=e[i],r[i]!==void 0){const o=t[i];o===d_?s+=_a(r[i]):o===f_?s+=nt.transform(r[i]):s+=r[i]}return s}}function OL(e){return h_(Co(e))}const ML=e=>typeof e=="number"?0:nt.test(e)?nt.getAnimatableNone(e):e,IL=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:ML(e);function DL(e){const t=Co(e);return h_(t)(t.values.map((r,s)=>IL(r,t.split[s])))}const Dn={test:PL,parse:AL,createTransformer:OL,getAnimatableNone:DL};function Of(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function LL({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,o=0;if(!t)s=i=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;s=Of(l,a,e+1/3),i=Of(l,a,e),o=Of(l,a,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function ju(e,t){return n=>n>0?t:e}const $e=(e,t,n)=>e+(t-e)*n,Mf=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},$L=[Cp,Ks,Ki],FL=e=>$L.find(t=>t.test(e));function J0(e){const t=FL(e);if(!t)return!1;let n=t.parse(e);return t===Ki&&(n=LL(n)),n}const Q0=(e,t)=>{const n=J0(e),r=J0(t);if(!n||!r)return ju(e,t);const s={...n};return i=>(s.red=Mf(n.red,r.red,i),s.green=Mf(n.green,r.green,i),s.blue=Mf(n.blue,r.blue,i),s.alpha=$e(n.alpha,r.alpha,i),Ks.transform(s))},Tp=new Set(["none","hidden"]);function UL(e,t){return Tp.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function VL(e,t){return n=>$e(e,t,n)}function Dg(e){return typeof e=="number"?VL:typeof e=="string"?Og(e)?ju:nt.test(e)?Q0:WL:Array.isArray(e)?p_:typeof e=="object"?nt.test(e)?Q0:BL:ju}function p_(e,t){const n=[...e],r=n.length,s=e.map((i,o)=>Dg(i)(i,t[o]));return i=>{for(let o=0;o<r;o++)n[o]=s[o](i);return n}}function BL(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=Dg(e[s])(e[s],t[s]));return s=>{for(const i in r)n[i]=r[i](s);return n}}function zL(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const i=t.types[s],o=e.indexes[i][r[i]],a=e.values[o]??0;n[s]=a,r[i]++}return n}const WL=(e,t)=>{const n=Dn.createTransformer(t),r=Co(e),s=Co(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Tp.has(e)&&!s.values.length||Tp.has(t)&&!r.values.length?UL(e,t):El(p_(zL(r,s),s.values),n):ju(e,t)};function m_(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?$e(e,t,n):Dg(e)(e,t)}const HL=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Oe.update(t,n),stop:()=>bs(t),now:()=>pt.isProcessing?pt.timestamp:Nt.now()}},g_=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i<s;i++)r+=Math.round(e(i/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Nu=2e4;function Lg(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Nu;)t+=n,r=e.next(t);return t>=Nu?1/0:t}function qL(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(Lg(r),Nu);return{type:"keyframes",ease:i=>r.next(s*i).value/t,duration:hn(s)}}const Ye={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Pp(e,t){return e*Math.sqrt(1-t*t)}const KL=12;function GL(e,t,n){let r=n;for(let s=1;s<KL;s++)r=r-e(r)/t(r);return r}const If=.001;function YL({duration:e=Ye.duration,bounce:t=Ye.bounce,velocity:n=Ye.velocity,mass:r=Ye.mass}){let s,i,o=1-t;o=cr(Ye.minDamping,Ye.maxDamping,o),e=cr(Ye.minDuration,Ye.maxDuration,hn(e)),o<1?(s=c=>{const d=c*o,f=d*e,h=d-n,p=Pp(c,o),v=Math.exp(-f);return If-h/p*v},i=c=>{const f=c*o*e,h=f*n+n,p=Math.pow(o,2)*Math.pow(c,2)*e,v=Math.exp(-f),g=Pp(Math.pow(c,2),o);return(-s(c)+If>0?-1:1)*((h-p)*v)/g}):(s=c=>{const d=Math.exp(-c*e),f=(c-n)*e+1;return-If+d*f},i=c=>{const d=Math.exp(-c*e),f=(n-c)*(e*e);return d*f});const a=5/e,l=GL(s,i,a);if(e=Zt(e),isNaN(l))return{stiffness:Ye.stiffness,damping:Ye.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const JL=["duration","bounce"],QL=["stiffness","damping","mass"];function X0(e,t){return t.some(n=>e[n]!==void 0)}function XL(e){let t={velocity:Ye.velocity,stiffness:Ye.stiffness,damping:Ye.damping,mass:Ye.mass,isResolvedFromDuration:!1,...e};if(!X0(e,QL)&&X0(e,JL))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*cr(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:Ye.mass,stiffness:s,damping:i}}else{const n=YL({...e,velocity:0});t={...t,...n,mass:Ye.mass},t.isResolvedFromDuration=!0}return t}function Ru(e=Ye.visualDuration,t=Ye.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:c,mass:d,duration:f,velocity:h,isResolvedFromDuration:p}=XL({...n,velocity:-hn(n.velocity||0)}),v=h||0,g=c/(2*Math.sqrt(l*d)),b=o-i,w=hn(Math.sqrt(l/d)),y=Math.abs(b)<5;r||(r=y?Ye.restSpeed.granular:Ye.restSpeed.default),s||(s=y?Ye.restDelta.granular:Ye.restDelta.default);let x,S,k,E,C,_;if(g<1)k=Pp(w,g),E=(v+g*w*b)/k,x=T=>{const I=Math.exp(-g*w*T);return o-I*(E*Math.sin(k*T)+b*Math.cos(k*T))},C=g*w*E+b*k,_=g*w*b-E*k,S=T=>Math.exp(-g*w*T)*(C*Math.sin(k*T)+_*Math.cos(k*T));else if(g===1){x=I=>o-Math.exp(-w*I)*(b+(v+w*b)*I);const T=v+w*b;S=I=>Math.exp(-w*I)*(w*T*I-v)}else{const T=w*Math.sqrt(g*g-1);x=D=>{const G=Math.exp(-g*w*D),L=Math.min(T*D,300);return o-G*((v+g*w*b)*Math.sinh(L)+T*b*Math.cosh(L))/T};const I=(v+g*w*b)/T,M=g*w*I-b*T,H=g*w*b-I*T;S=D=>{const G=Math.exp(-g*w*D),L=Math.min(T*D,300);return G*(M*Math.sinh(L)+H*Math.cosh(L))}}const j={calculatedDuration:p&&f||null,velocity:T=>Zt(S(T)),next:T=>{if(!p&&g<1){const M=Math.exp(-g*w*T),H=Math.sin(k*T),D=Math.cos(k*T),G=o-M*(E*H+b*D),L=Zt(M*(C*H+_*D));return a.done=Math.abs(L)<=r&&Math.abs(o-G)<=s,a.value=a.done?o:G,a}const I=x(T);if(p)a.done=T>=f;else{const M=Zt(S(T));a.done=Math.abs(M)<=r&&Math.abs(o-I)<=s}return a.value=a.done?o:I,a},toString:()=>{const T=Math.min(Lg(j),Nu),I=g_(M=>j.next(T*M).value,T,30);return T+"ms "+I},toTransition:()=>{}};return j}Ru.applyToOptions=e=>{const t=qL(e,100,Ru);return e.ease=t.ease,e.duration=Zt(t.duration),e.type="keyframes",e};const ZL=5;function y_(e,t,n){const r=Math.max(t-ZL,0);return Jk(n-e(r),t-r)}function jp({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:d}){const f=e[0],h={done:!1,value:f},p=_=>a!==void 0&&_<a||l!==void 0&&_>l,v=_=>a===void 0?l:l===void 0||Math.abs(a-_)<Math.abs(l-_)?a:l;let g=n*t;const b=f+g,w=o===void 0?b:o(b);w!==b&&(g=w-f);const y=_=>-g*Math.exp(-_/r),x=_=>w+y(_),S=_=>{const j=y(_),T=x(_);h.done=Math.abs(j)<=c,h.value=h.done?w:T};let k,E;const C=_=>{p(h.value)&&(k=_,E=Ru({keyframes:[h.value,v(h.value)],velocity:y_(x,_,h.value),damping:s,stiffness:i,restDelta:c,restSpeed:d}))};return C(0),{calculatedDuration:null,next:_=>{let j=!1;return!E&&k===void 0&&(j=!0,S(_),C(_)),k!==void 0&&_>=k?E.next(_-k):(!j&&S(_),h)}}}function e3(e,t,n){const r=[],s=n||xs.mix||m_,i=e.length-1;for(let o=0;o<i;o++){let a=s(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||mn:t;a=El(l,a)}r.push(a)}return r}function t3(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const i=e.length;if(jg(i===t.length),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=e3(t,r,s),l=a.length,c=d=>{if(o&&d<e[0])return t[0];let f=0;if(l>1)for(;f<e.length-2&&!(d<e[f+1]);f++);const h=rl(e[f],e[f+1],d);return a[f](h)};return n?d=>c(cr(e[0],e[i-1],d)):c}function n3(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=rl(0,t,r);e.push($e(n,1,s))}}function r3(e){const t=[0];return n3(t,e.length-1),t}function s3(e,t){return e.map(n=>n*t)}function i3(e,t){return e.map(()=>t||i_).splice(0,e.length-1)}function Ea({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=hL(r)?r.map(q0):q0(r),i={done:!1,value:t[0]},o=s3(n&&n.length===t.length?n:r3(t),e),a=t3(o,t,{ease:Array.isArray(s)?s:i3(t,s)});return{calculatedDuration:e,next:l=>(i.value=a(l),i.done=l>=e,i)}}const o3=e=>e!==null;function Td(e,{repeat:t,repeatType:n="loop"},r,s=1){const i=e.filter(o3),a=s<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const a3={decay:jp,inertia:jp,tween:Ea,keyframes:Ea,spring:Ru};function v_(e){typeof e.type=="string"&&(e.type=a3[e.type])}class $g{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const l3=e=>e/100;class Au extends $g{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==Nt.now()&&this.tick(Nt.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;v_(t);const{type:n=Ea,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=t;let{keyframes:a}=t;const l=n||Ea;l!==Ea&&typeof a[0]!="number"&&(this.mixKeyframes=El(l3,m_(a[0],a[1])),a=[0,100]);const c=l({...t,keyframes:a});i==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...a].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=Lg(c));const{calculatedDuration:d}=c;this.calculatedDuration=d,this.resolvedDuration=d+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:d,repeat:f,repeatType:h,repeatDelay:p,type:v,onUpdate:g,finalKeyframe:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const w=this.currentTime-c*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?w<0:w>s;this.currentTime=Math.max(w,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let x=this.currentTime,S=r;if(f){const _=Math.min(this.currentTime,s)/a;let j=Math.floor(_),T=_%1;!T&&_>=1&&(T=1),T===1&&j--,j=Math.min(j,f+1),!!(j%2)&&(h==="reverse"?(T=1-T,p&&(T-=p/a)):h==="mirror"&&(S=o)),x=cr(0,1,T)*a}let k;y?(this.delayState.value=d[0],k=this.delayState):k=S.next(x),i&&!y&&(k.value=i(k.value));let{done:E}=k;!y&&l!==null&&(E=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return C&&v!==jp&&(k.value=Td(d,this.options,b,this.speed)),g&&g(k.value),C&&this.finish(),k}then(t,n){return this.finished.then(t,n)}get duration(){return hn(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+hn(t)}get time(){return hn(this.currentTime)}set time(t){t=Zt(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return y_(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(Nt.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=hn(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:t=HL,startTime:n}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(i=(s=this.options).onPlay)==null||i.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Nt.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function c3(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Gs=e=>e*180/Math.PI,Np=e=>{const t=Gs(Math.atan2(e[1],e[0]));return Rp(t)},u3={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Np,rotateZ:Np,skewX:e=>Gs(Math.atan(e[1])),skewY:e=>Gs(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Rp=e=>(e=e%360,e<0&&(e+=360),e),Z0=Np,ew=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),tw=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),d3={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ew,scaleY:tw,scale:e=>(ew(e)+tw(e))/2,rotateX:e=>Rp(Gs(Math.atan2(e[6],e[5]))),rotateY:e=>Rp(Gs(Math.atan2(-e[2],e[0]))),rotateZ:Z0,rotate:Z0,skewX:e=>Gs(Math.atan(e[4])),skewY:e=>Gs(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Ap(e){return e.includes("scale")?1:0}function Op(e,t){if(!e||e==="none")return Ap(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=d3,s=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=u3,s=a}if(!s)return Ap(t);const i=r[t],o=s[1].split(",").map(h3);return typeof i=="function"?i(o):o[i]}const f3=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Op(n,t)};function h3(e){return parseFloat(e.trim())}const Uo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Vo=new Set(Uo),nw=e=>e===Fo||e===X,p3=new Set(["x","y","z"]),m3=Uo.filter(e=>!p3.has(e));function g3(e){const t=[];return m3.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const is={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Op(t,"x"),y:(e,{transform:t})=>Op(t,"y")};is.translateX=is.x;is.translateY=is.y;const ri=new Set;let Mp=!1,Ip=!1,Dp=!1;function w_(){if(Ip){const e=Array.from(ri).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=g3(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var a;(a=r.getValue(i))==null||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Ip=!1,Mp=!1,ri.forEach(e=>e.complete(Dp)),ri.clear()}function x_(){ri.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Ip=!0)})}function y3(){Dp=!0,x_(),w_(),Dp=!1}class Fg{constructor(t,n,r,s,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(ri.add(this),Mp||(Mp=!0,Oe.read(x_),Oe.resolveKeyframes(w_))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const i=s==null?void 0:s.get(),o=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const a=r.readValue(n,o);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=o),s&&i===void 0&&s.set(t[0])}c3(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),ri.delete(this)}cancel(){this.state==="scheduled"&&(ri.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const v3=e=>e.startsWith("--");function b_(e,t,n){v3(t)?e.style.setProperty(t,n):e.style[t]=n}const w3={};function S_(e,t){const n=Yk(e);return()=>w3[t]??n()}const x3=S_(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),k_=S_(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),ua=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,rw={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ua([0,.65,.55,1]),circOut:ua([.55,0,1,.45]),backIn:ua([.31,.01,.66,-.59]),backOut:ua([.33,1.53,.69,.99])};function __(e,t){if(e)return typeof e=="function"?k_()?g_(e,t):"ease-out":o_(e)?ua(e):Array.isArray(e)?e.map(n=>__(n,t)||rw.easeOut):rw[e]}function b3(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:a="easeOut",times:l}={},c=void 0){const d={[t]:n};l&&(d.offset=l);const f=__(a,s);Array.isArray(f)&&(d.easing=f);const h={delay:r,duration:s,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return c&&(h.pseudoElement=c),e.animate(d,h)}function E_(e){return typeof e=="function"&&"applyToOptions"in e}function S3({type:e,...t}){return E_(e)&&k_()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class C_ extends $g{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=t;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=t,jg(typeof t.type!="string");const c=S3(t);this.animation=b3(n,r,s,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const d=Td(s,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(d),b_(n,r,d),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return hn(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+hn(t)}get time(){return hn(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Zt(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:s}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&x3()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),mn):s(this)}}const T_={anticipate:n_,backInOut:t_,circInOut:s_};function k3(e){return e in T_}function _3(e){typeof e.ease=="string"&&k3(e.ease)&&(e.ease=T_[e.ease])}const Df=10;class E3 extends C_{constructor(t){_3(t),v_(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new Au({...o,autoplay:!1}),l=Math.max(Df,Nt.now()-this.startTime),c=cr(0,Df,l-Df),d=a.sample(l).value,{name:f}=this.options;i&&f&&b_(i,f,d),n.setWithVelocity(a.sample(Math.max(0,l-c)).value,d,c),a.stop()}}const sw=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Dn.test(e)||e==="0")&&!e.startsWith("url("));function C3(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function T3(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],o=sw(s,t),a=sw(i,t);return!o||!a?!1:C3(e)||(n==="spring"||E_(n))&&r}function Lp(e){e.duration=0,e.type="keyframes"}const P_=new Set(["opacity","clipPath","filter","transform"]),P3=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function j3(e){for(let t=0;t<e.length;
320t++)if(typeof e[t]=="string"&&P3.test(e[t]))return!0;return!1}const N3=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),R3=Yk(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function A3(e){var f;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:i,type:o,keyframes:a}=e;if(!(((f=t==null?void 0:t.owner)==null?void 0:f.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:d}=t.owner.getProps();return R3()&&n&&(P_.has(n)||N3.has(n)&&j3(a))&&(n!=="transform"||!d)&&!c&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const O3=40;class M3 extends $g{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",keyframes:a,name:l,motionValue:c,element:d,...f}){var v;super(),this.stop=()=>{var g,b;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(b=this.keyframeResolver)==null||b.cancel()},this.createdAt=Nt.now();const h={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:l,motionValue:c,element:d,...f},p=(d==null?void 0:d.KeyframeResolver)||Fg;this.keyframeResolver=new p(a,(g,b,w)=>this.onKeyframesResolved(g,b,h,!w),l,c,d),(v=this.keyframeResolver)==null||v.scheduleResolve()}onKeyframesResolved(t,n,r,s){var w,y;this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:l,isHandoff:c,onUpdate:d}=r;this.resolvedAt=Nt.now();let f=!0;T3(t,i,o,a)||(f=!1,(xs.instantAnimations||!l)&&(d==null||d(Td(t,r,n))),t[0]=t[t.length-1],Lp(r),r.repeat=0);const p={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>O3?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},v=f&&!c&&A3(p),g=(y=(w=p.motionValue)==null?void 0:w.owner)==null?void 0:y.current;let b;if(v)try{b=new E3({...p,element:g})}catch{b=new Au(p)}else b=new Au(p);b.finished.then(()=>{this.notifyFinished()}).catch(mn),this.pendingTimeline&&(this.stopTimeline=b.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=b}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),y3()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function j_(e,t,n,r=0,s=1){const i=Array.from(e).sort((c,d)=>c.sortNodePosition(d)).indexOf(t),o=e.size,a=(o-1)*r;return typeof n=="function"?n(i,o):s===1?i*r:a-i*r}const I3=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function D3(e){const t=I3.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function N_(e,t,n=1){const[r,s]=D3(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const o=i.trim();return qk(o)?parseFloat(o):o}return Og(s)?N_(s,t,n+1):s}const L3={type:"spring",stiffness:500,damping:25,restSpeed:10},$3=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),F3={type:"keyframes",duration:.8},U3={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},V3=(e,{keyframes:t})=>t.length>2?F3:Vo.has(e)?e.startsWith("scale")?$3(t[1]):L3:U3;function R_(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function Ug(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?R_(n,e):n}const B3=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function z3(e){for(const t in e)if(!B3.has(t))return!0;return!1}const Vg=(e,t,n,r={},s,i)=>o=>{const a=Ug(r,e)||{},l=a.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Zt(l);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:h=>{t.set(h),a.onUpdate&&a.onUpdate(h)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:i?void 0:s};z3(a)||Object.assign(d,V3(e,d)),d.duration&&(d.duration=Zt(d.duration)),d.repeatDelay&&(d.repeatDelay=Zt(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(Lp(d),d.delay===0&&(f=!0)),(xs.instantAnimations||xs.skipAnimations||s!=null&&s.shouldSkipAnimations)&&(f=!0,Lp(d),d.delay=0),d.allowFlatten=!a.type&&!a.ease,f&&!i&&t.get()!==void 0){const h=Td(d.keyframes,a);if(h!==void 0){Oe.update(()=>{d.onUpdate(h),d.onComplete()});return}}return a.isSync?new Au(d):new M3(d)};function iw(e){const t=[{},{}];
vendor: 50,574 bytes, line 320
320return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Bg(e,t,n,r){if(typeof t=="function"){const[s,i]=iw(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=iw(r);t=t(n!==void 0?n:e.custom,s,i)}return t}function si(e,t,n){const r=e.getProps();return Bg(r,t,n!==void 0?n:r.custom,e)}const A_=new Set(["width","height","top","left","right","bottom",...Uo]),ow=30,W3=e=>!isNaN(parseFloat(e));class H3{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=Nt.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Nt.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=W3(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Ng);const r=this.events[t].add(n);return t==="change"?()=>{r(),Oe.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Nt.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>ow)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,ow);return Jk(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function To(e,t){return new H3(e,t)}const $p=e=>Array.isArray(e);function q3(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,To(n))}function K3(e){return $p(e)?e[e.length-1]||0:e}function G3(e,t){const n=si(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=K3(i[o]);q3(e,o,a)}}const mt=e=>!!(e&&e.getVelocity);function Y3(e){return!!(mt(e)&&e.add)}function Fp(e,t){const n=e.getValue("willChange");if(Y3(n))return n.add(t);if(!n&&xs.WillChange){const r=new xs.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function zg(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const J3="framerAppearId",O_="data-"+zg(J3);function M_(e){return e.props[O_]}function Q3({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function I_(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:o,...a}=t;const l=e.getDefaultTransition();i=i?R_(i,l):l;const c=i==null?void 0:i.reduceMotion;r&&(i=r);const d=[],f=s&&e.animationState&&e.animationState.getState()[s];for(const h in a){const p=e.getValue(h,e.latestValues[h]??null),v=a[h];if(v===void 0||f&&Q3(f,h))continue;const g={delay:n,...Ug(i||{},h)},b=p.get();if(b!==void 0&&!p.isAnimating()&&!Array.isArray(v)&&v===b&&!g.velocity){Oe.update(()=>p.set(v));continue}let w=!1;if(window.MotionHandoffAnimation){const S=M_(e);if(S){const k=window.MotionHandoffAnimation(S,h,Oe);k!==null&&(g.startTime=k,w=!0)}}Fp(e,h);const y=c??e.shouldReduceMotion;p.start(Vg(h,p,v,y&&A_.has(h)?{type:!1}:g,e,w));const x=p.animation;x&&d.push(x)}if(o){const h=()=>Oe.update(()=>{o&&G3(e,o)});d.length?Promise.all(d).then(h):h()}return d}function Up(e,t,n={}){var l;const r=si(e,t,n.type==="exit"?(l=e.presenceContext)==null?void 0:l.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(I_(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:h}=s;return X3(e,t,c,d,f,h,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[c,d]=a==="beforeChildren"?[i,o]:[o,i];return c().then(()=>d())}else return Promise.all([i(),o(n.delay)])}function X3(e,t,n=0,r=0,s=0,i=1,o){const a=[];for(const l of e.variantChildren)l.notify("AnimationStart",t),a.push(Up(l,t,{...o,delay:n+(typeof r=="function"?0:r)+j_(e.variantChildren,l,r,s,i)}).then(()=>l.notify("AnimationComplete",t)));return Promise.all(a)}function Z3(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>Up(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=Up(e,t,n);else{const s=typeof t=="function"?si(e,t,n.custom):t;r=Promise.all(I_(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const e4={test:e=>e==="auto",parse:e=>e},D_=e=>t=>t.test(e),L_=[Fo,X,or,Vr,CL,EL,e4],aw=e=>L_.find(D_(e));function t4(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Gk(e):!0}const n4=new Set(["brightness","contrast","saturate","opacity"]);function r4(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(Mg)||[];if(!r)return e;const s=n.replace(r,"");let i=n4.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const s4=/\b([a-z-]*)\(.*?\)/gu,Vp={...Dn,getAnimatableNone:e=>{const t=e.match(s4);return t?t.map(r4).join(" "):e}},Bp={...Dn,getAnimatableNone:e=>{const t=Dn.parse(e);return Dn.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},lw={...Fo,transform:Math.round},i4={rotate:Vr,rotateX:Vr,rotateY:Vr,rotateZ:Vr,scale:dc,scaleX:dc,scaleY:dc,scaleZ:dc,skew:Vr,skewX:Vr,skewY:Vr,distance:X,translateX:X,translateY:X,translateZ:X,x:X,y:X,z:X,perspective:X,transformPerspective:X,opacity:sl,originX:G0,originY:G0,originZ:X},Wg={borderWidth:X,borderTopWidth:X,borderRightWidth:X,borderBottomWidth:X,borderLeftWidth:X,borderRadius:X,borderTopLeftRadius:X,borderTopRightRadius:X,borderBottomRightRadius:X,borderBottomLeftRadius:X,width:X,maxWidth:X,height:X,maxHeight:X,top:X,right:X,bottom:X,left:X,inset:X,insetBlock:X,insetBlockStart:X,insetBlockEnd:X,insetInline:X,insetInlineStart:X,insetInlineEnd:X,padding:X,paddingTop:X,paddingRight:X,paddingBottom:X,paddingLeft:X,paddingBlock:X,paddingBlockStart:X,paddingBlockEnd:X,paddingInline:X,paddingInlineStart:X,paddingInlineEnd:X,margin:X,marginTop:X,marginRight:X,marginBottom:X,marginLeft:X,marginBlock:X,marginBlockStart:X,marginBlockEnd:X,marginInline:X,marginInlineStart:X,marginInlineEnd:X,fontSize:X,backgroundPositionX:X,backgroundPositionY:X,...i4,zIndex:lw,fillOpacity:sl,strokeOpacity:sl,numOctaves:lw},o4={...Wg,color:nt,backgroundColor:nt,outlineColor:nt,fill:nt,stroke:nt,borderColor:nt,borderTopColor:nt,borderRightColor:nt,borderBottomColor:nt,borderLeftColor:nt,filter:Vp,WebkitFilter:Vp,mask:Bp,WebkitMask:Bp},$_=e=>o4[e],a4=new Set([Vp,Bp]);function F_(e,t){let n=$_(e);return a4.has(n)||(n=Dn),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const l4=new Set(["auto","none","0"]);function c4(e,t,n){let r=0,s;for(;r<e.length&&!s;){const i=e[r];typeof i=="string"&&!l4.has(i)&&Co(i).values.length&&(s=e[r]),r++}if(s&&n)for(const i of t)e[i]=F_(n,s)}class u4 extends Fg{constructor(t,n,r,s,i){super(t,n,r,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<t.length;d++){let f=t[d];if(typeof f=="string"&&(f=f.trim(),Og(f))){const h=N_(f,n.current);h!==void 0&&(t[d]=h),d===t.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!A_.has(r)||t.length!==2)return;const[s,i]=t,o=aw(s),a=aw(i),l=K0(s),c=K0(i);if(l!==c&&is[r]){this.needsMeasurement=!0;return}if(o!==a)if(nw(o)&&nw(a))for(let d=0;d<t.length;d++){const f=t[d];typeof f=="string"&&(t[d]=parseFloat(f))}else is[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)(t[s]===null||t4(t[s]))&&r.push(s);r.length&&c4(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=is[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var a;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const s=t.getValue(n);s&&s.jump(this.measuredOrigin,!1);const i=r.length-1,o=r[i];r[i]=is[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([l,c])=>{t.getValue(l).set(c)}),this.resolveNoneKeyframes()}}function U_(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const s=(n==null?void 0:n[e])??r.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(r=>r!=null)}const V_=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function Lc(e){return Kk(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Hg}=a_(queueMicrotask,!1),En={x:!1,y:!1};function B_(){return En.x||En.y}function d4(e){return e==="x"||e==="y"?En[e]?null:(En[e]=!0,()=>{En[e]=!1}):En.x||En.y?null:(En.x=En.y=!0,()=>{En.x=En.y=!1})}function z_(e,t){const n=U_(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function f4(e){return!(e.pointerType==="touch"||B_())}function h4(e,t,n={}){const[r,s,i]=z_(e,n);return r.forEach(o=>{let a=!1,l=!1,c;const d=()=>{o.removeEventListener("pointerleave",v)},f=b=>{c&&(c(b),c=void 0),d()},h=b=>{a=!1,window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",h),l&&(l=!1,f(b))},p=()=>{a=!0,window.addEventListener("pointerup",h,s),window.addEventListener("pointercancel",h,s)},v=b=>{if(b.pointerType!=="touch"){if(a){l=!0;return}f(b)}},g=b=>{if(!f4(b))return;l=!1;const w=t(o,b);typeof w=="function"&&(c=w,o.addEventListener("pointerleave",v,s))};o.addEventListener("pointerenter",g,s),o.addEventListener("pointerdown",p,s)}),i}const W_=(e,t)=>t?e===t?!0:W_(e,t.parentElement):!1,qg=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,p4=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function m4(e){return p4.has(e.tagName)||e.isContentEditable===!0}const g4=new Set(["INPUT","SELECT","TEXTAREA"]);function y4(e){return g4.has(e.tagName)||e.isContentEditable===!0}const $c=new WeakSet;function cw(e){return t=>{t.key==="Enter"&&e(t)}}function Lf(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const v4=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=cw(()=>{if($c.has(n))return;Lf(n,"down");const s=cw(()=>{Lf(n,"up")}),i=()=>Lf(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function uw(e){return qg(e)&&!B_()}const dw=new WeakSet;function w4(e,t,n={}){const[r,s,i]=z_(e,n),o=a=>{const l=a.currentTarget;if(!uw(a)||dw.has(a))return;$c.add(l),n.stopPropagation&&dw.add(a);const c=t(l,a),d=(p,v)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",h),$c.has(l)&&$c.delete(l),uw(p)&&typeof c=="function"&&c(p,{success:v})},f=p=>{d(p,l===window||l===document||n.useGlobalTarget||W_(l,p.target))},h=p=>{d(p,!1)};window.addEventListener("pointerup",f,s),window.addEventListener("pointercancel",h,s)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,s),Lc(a)&&(a.addEventListener("focus",c=>v4(c,s)),!m4(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}function Kg(e){return Kk(e)&&"ownerSVGElement"in e}const Fc=new WeakMap;let Br;const H_=(e,t,n)=>(r,s)=>s&&s[0]?s[0][e+"Size"]:Kg(r)&&"getBBox"in r?r.getBBox()[t]:r[n],x4=H_("inline","width","offsetWidth"),b4=H_("block","height","offsetHeight");function S4({target:e,borderBoxSize:t}){var n;(n=Fc.get(e))==null||n.forEach(r=>{r(e,{get width(){return x4(e,t)},get height(){return b4(e,t)}})})}function k4(e){e.forEach(S4)}function _4(){typeof ResizeObserver>"u"||(Br=new ResizeObserver(k4))}function E4(e,t){Br||_4();const n=U_(e);return n.forEach(r=>{let s=Fc.get(r);s||(s=new Set,Fc.set(r,s)),s.add(t),Br==null||Br.observe(r)}),()=>{n.forEach(r=>{const s=Fc.get(r);s==null||s.delete(t),s!=null&&s.size||Br==null||Br.unobserve(r)})}}const Uc=new Set;let Gi;function C4(){Gi=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Uc.forEach(t=>t(e))},window.addEventListener("resize",Gi)}function T4(e){return Uc.add(e),Gi||C4(),()=>{Uc.delete(e),!Uc.size&&typeof Gi=="function"&&(window.removeEventListener("resize",Gi),Gi=void 0)}}function fw(e,t){return typeof e=="function"?T4(e):E4(e,t)}function P4(e){return Kg(e)&&e.tagName==="svg"}const j4=[...L_,nt,Dn],N4=e=>j4.find(D_(e)),hw=()=>({translate:0,scale:1,origin:0,originPoint:0}),Yi=()=>({x:hw(),y:hw()}),pw=()=>({min:0,max:0}),it=()=>({x:pw(),y:pw()}),R4=new WeakMap;function Pd(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function il(e){return typeof e=="string"||Array.isArray(e)}const Gg=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Yg=["initial",...Gg];function jd(e){return Pd(e.animate)||Yg.some(t=>il(e[t]))}function q_(e){return!!(jd(e)||e.variants)}function A4(e,t,n){for(const r in t){const s=t[r],i=n[r];if(mt(s))e.addValue(r,s);else if(mt(i))e.addValue(r,To(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=e.getStaticValue(r);e.addValue(r,To(o!==void 0?o:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const zp={current:null},K_={current:!1},O4=typeof window<"u";function M4(){if(K_.current=!0,!!O4)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>zp.current=e.matches;e.addEventListener("change",t),t()}else zp.current=!1}const mw=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Ou={};function G_(e){Ou=e}function I4(){return Ou}class D4{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:o,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=Fg,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=Nt.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,Oe.render(this.render,!1,!0))};const{latestValues:c,renderState:d}=a;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=d,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=i,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=jd(n),this.isVariantNode=q_(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...h}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in h){const v=h[p];c[p]!==void 0&&mt(v)&&v.set(c[p])}}mount(t){var n,r;if(this.hasBeenMounted)for(const s in this.initialValues)(n=this.values.get(s))==null||n.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=t,R4.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,i)=>this.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(K_.current||M4(),this.shouldReduceMotion=zp.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),bs(this.notifyUpdate),bs(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&P_.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:a,times:l,ease:c,duration:d}=n.accelerate,f=new C_({element:this.current,name:t,keyframes:a,times:l,ease:c,duration:Zt(d)}),h=o(f);this.valueSubscriptions.set(t,()=>{h(),f.cancel()});return}const r=Vo.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&Oe.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i&&i(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Ou){const n=Ou[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):it()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<mw.length;r++){const s=mw[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const i="on"+s,o=t[i];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=A4(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=To(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(qk(r)||Gk(r))?r=parseFloat(r):!N4(r)&&Dn.test(n)&&(r=F_(t,n)),this.setBaseTarget(t,mt(r)?r.get():r)),mt(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Bg(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);o&&(r=o[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!mt(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Ng),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Hg.render(this.render)}}class Y_ extends D4{constructor(){super(...arguments),this.KeyframeResolver=u4}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;mt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Ps{constructor(t){this.isMounted=!1,this.node=t}update(){}}function J_({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function L4({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function $4(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function $f(e){return e===void 0||e===1}function Wp({scale:e,scaleX:t,scaleY:n}){return!$f(e)||!$f(t)||!$f(n)}function Fs(e){return Wp(e)||Q_(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Q_(e){return gw(e.x)||gw(e.y)}function gw(e){return e&&e!=="0%"}function Mu(e,t,n){const r=e-n,s=t*r;return n+s}function yw(e,t,n,r,s){return s!==void 0&&(e=Mu(e,s,r)),Mu(e,n,r)+t}function Hp(e,t=0,n=1,r,s){e.min=yw(e.min,t,n,r,s),e.max=yw(e.max,t,n,r,s)}function X_(e,{x:t,y:n}){Hp(e.x,t.translate,t.scale,t.originPoint),Hp(e.y,n.translate,n.scale,n.originPoint)}const vw=.999999999999,ww=1.0000000000001;function F4(e,t,n,r=!1){var a;const s=n.length;if(!s)return;t.x=t.y=1;let i,o;for(let l=0;l<s;l++){i=n[l],o=i.projectionDelta;const{visualElement:c}=i.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&(Zn(e.x,-i.scroll.offset.x),Zn(e.y,-i.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,X_(e,o)),r&&Fs(i.latestValues)&&Vc(e,i.latestValues,(a=i.layout)==null?void 0:a.layoutBox))}t.x<ww&&t.x>vw&&(t.x=1),t.y<ww&&t.y>vw&&(t.y=1)}function Zn(e,t){e.min+=t,e.max+=t}function xw(e,t,n,r,s=.5){const i=$e(e.min,e.max,s);Hp(e,t,n,i,r)}function bw(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Vc(e,t,n){const r=n??e;xw(e.x,bw(t.x,r.x),t.scaleX,t.scale,t.originX),xw(e.y,bw(t.y,r.y),t.scaleY,t.scale,t.originY)}function Z_(e,t){return J_($4(e.getBoundingClientRect(),t))}function U4(e,t,n){const r=Z_(e,n),{scroll:s}=t;return s&&(Zn(r.x,s.offset.x),Zn(r.y,s.offset.y)),r}const V4={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},B4=Uo.length;function z4(e,t,n){let r="",s=!0;for(let i=0;i<B4;i++){const o=Uo[i],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number")l=a===(o.startsWith("scale")?1:0);else{const c=parseFloat(a);l=o.startsWith("scale")?c===1:c===0}if(!l||n){const c=V_(a,Wg[o]);if(!l){s=!1;const d=V4[o]||o;r+=`${d}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function Jg(e,t,n){const{style:r,vars:s,transformOrigin:i}=e;let o=!1,a=!1;for(const l in t){const c=t[l];if(Vo.has(l)){o=!0;continue}else if(c_(l)){s[l]=c;continue}else{const d=V_(c,Wg[l]);l.startsWith("origin")?(a=!0,i[l]=d):r[l]=d}}if(t.transform||(o||n?r.transform=z4(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:d=0}=i;r.transformOrigin=`${l} ${c} ${d}`}}function eE(e,{style:t,vars:n},r,s){const i=e.style;let o;for(o in t)i[o]=t[o];s==null||s.applyProjectionStyles(i,r);for(o in n)i.setProperty(o,n[o])}function Sw(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const na={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(X.test(e))e=parseFloat(e);else return e;const n=Sw(e,t.target.x),r=Sw(e,t.target.y);return`${n}% ${r}%`}},W4={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=Dn.parse(e);if(s.length>5)return r;const i=Dn.createTransformer(e),o=typeof s[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;s[0+o]/=a,s[1+o]/=l;const c=$e(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=c),typeof s[3+o]=="number"&&(s[3+o]/=c),i(s)}},qp={borderRadius:{...na,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:na,borderTopRightRadius:na,borderBottomLeftRadius:na,borderBottomRightRadius:na,boxShadow:W4};function tE(e,{layout:t,layoutId:n}){return Vo.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!qp[e]||e==="opacity")}function Qg(e,t,n){var o;const r=e.style,s=t==null?void 0:t.style,i={};if(!r)return i;for(const a in r)(mt(r[a])||s&&mt(s[a])||tE(a,e)||((o=n==null?void 0:n.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(i[a]=r[a]);return i}function H4(e){return window.getComputedStyle(e)}class q4 extends Y_{constructor(){super(...arguments),this.type="html",this.renderInstance=eE}readValueFromInstance(t,n){var r;if(Vo.has(n))return(r=this.projection)!=null&&r.isProjecting?Ap(n):f3(t,n);{const s=H4(t),i=(c_(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Z_(t,n)}build(t,n,r){Jg(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Qg(t,n,r)}}const K4={offset:"stroke-dashoffset",array:"stroke-dasharray"},G4={offset:"strokeDashoffset",array:"strokeDasharray"};function Y4(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?K4:G4;e[i.offset]=`${-r}`,e[i.array]=`${t} ${n}`}const J4=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function nE(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...a},l,c,d){if(Jg(e,a,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:f,style:h}=e;f.transform&&(h.transform=f.transform,delete f.transform),(h.transform||f.transformOrigin)&&(h.transformOrigin=f.transformOrigin??"50% 50%",delete f.transformOrigin),h.transform&&(h.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete f.transformBox);for(const p of J4)f[p]!==void 0&&(h[p]=f[p],delete f[p]);t!==void 0&&(f.x=t),n!==void 0&&(f.y=n),r!==void 0&&(f.scale=r),s!==void 0&&Y4(f,s,i,o,!1)}const rE=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),sE=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Q4(e,t,n,r){eE(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(rE.has(s)?s:zg(s),t.attrs[s])}function iE(e,t,n){const r=Qg(e,t,n);for(const s in e)if(mt(e[s])||mt(t[s])){const i=Uo.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}class X4 extends Y_{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=it}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Vo.has(n)){const r=$_(n);return r&&r.default||0}return n=rE.has(n)?n:zg(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return iE(t,n,r)}build(t,n,r){nE(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){Q4(t,n,r,s)}mount(t){this.isSVGTag=sE(t.tagName),super.mount(t)}}const Z4=Yg.length;function oE(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?oE(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Z4;n++){const r=Yg[n],s=e.props[r];(il(s)||s===!1)&&(t[r]=s)}return t}function aE(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const e$=[...Gg].reverse(),t$=Gg.length;function n$(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Z3(e,n,r)))}function r$(e){let t=n$(e),n=kw(),r=!0,s=!1;const i=c=>(d,f)=>{var p;const h=si(e,f,c==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(h){const{transition:v,transitionEnd:g,...b}=h;d={...d,...b,...g}}return d};function o(c){t=c(e)}function a(c){const{props:d}=e,f=oE(e.parent)||{},h=[],p=new Set;let v={},g=1/0;for(let w=0;w<t$;w++){const y=e$[w],x=n[y],S=d[y]!==void 0?d[y]:f[y],k=il(S),E=y===c?x.isActive:null;E===!1&&(g=w);let C=S===f[y]&&S!==d[y]&&k;if(C&&(r||s)&&e.manuallyAnimateOnMount&&(C=!1),x.protectedKeys={...v},!x.isActive&&E===null||!S&&!x.prevProp||Pd(S)||typeof S=="boolean")continue;if(y==="exit"&&x.isActive&&E!==!0){x.prevResolvedValues&&(v={...v,...x.prevResolvedValues});continue}const _=s$(x.prevProp,S);let j=_||y===c&&x.isActive&&!C&&k||w>g&&k,T=!1;const I=Array.isArray(S)?S:[S];let M=I.reduce(i(y),{});E===!1&&(M={});const{prevResolvedValues:H={}}=x,D={...H,...M},G=N=>{j=!0,p.has(N)&&(T=!0,p.delete(N)),x.needsAnimating[N]=!0;const P=e.getValue(N);P&&(P.liveStyle=!1)};for(const N in D){const P=M[N],F=H[N];if(v.hasOwnProperty(N))continue;let O=!1;$p(P)&&$p(F)?O=!aE(P,F):O=P!==F,O?P!=null?G(N):p.add(N):P!==void 0&&p.has(N)?G(N):x.protectedKeys[N]=!0}x.prevProp=S,x.prevResolvedValues=M,x.isActive&&(v={...v,...M}),(r||s)&&e.blockInitialAnimation&&(j=!1);const L=C&&_;j&&(!L||T)&&h.push(...I.map(N=>{const P={type:y};if(typeof N=="string"&&(r||s)&&!L&&e.manuallyAnimateOnMount&&e.parent){const{parent:F}=e,O=si(F,N);if(F.enteringChildren&&O){const{delayChildren:$}=O.transition||{};P.delay=j_(F.enteringChildren,e,$)}}return{animation:N,options:P}}))}if(p.size){const w={};if(typeof d.initial!="boolean"){const y=si(e,Array.isArray(d.initial)?d.initial[0]:d.initial);y&&y.transition&&(w.transition=y.transition)}p.forEach(y=>{const x=e.getBaseTarget(y),S=e.getValue(y);S&&(S.liveStyle=!0),w[y]=x??null}),h.push({animation:w})}let b=!!h.length;return r&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(b=!1),r=!1,s=!1,b?t(h):Promise.resolve()}function l(c,d){var h;if(n[c].isActive===d)return Promise.resolve();(h=e.variantChildren)==null||h.forEach(p=>{var v;return(v=p.animationState)==null?void 0:v.setActive(c,d)}),n[c].isActive=d;const f=a(c);for(const p in n)n[p].protectedKeys={};return f}return{animateChanges:a,setActive:l,setAnimateFunction:o,getState:()=>n,reset:()=>{n=kw(),s=!0}}}function s$(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!aE(t,e):!1}function Is(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function kw(){return{animate:Is(!0),whileInView:Is(),whileHover:Is(),whileTap:Is(),whileDrag:Is(),whileFocus:Is(),exit:Is()}}function Kp(e,t){e.min=t.min,e.max=t.max}function kn(e,t){Kp(e.x,t.x),Kp(e.y,t.y)}function _w(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const lE=1e-4,i$=1-lE,o$=1+lE,cE=.01,a$=0-cE,l$=0+cE;function Rt(e){return e.max-e.min}function c$(e,t,n){return Math.abs(e-t)<=n}function Ew(e,t,n,r=.5){e.origin=r,e.originPoint=$e(t.min,t.max,e.origin),e.scale=Rt(n)/Rt(t),e.translate=$e(n.min,n.max,e.origin)-e.originPoint,(e.scale>=i$&&e.scale<=o$||isNaN(e.scale))&&(e.scale=1),(e.translate>=a$&&e.translate<=l$||isNaN(e.translate))&&(e.translate=0)}function Ca(e,t,n,r){Ew(e.x,t.x,n.x,r?r.originX:void 0),Ew(e.y,t.y,n.y,r?r.originY:void 0)}function Cw(e,t,n,r=0){const s=r?$e(n.min,n.max,r):n.min;e.min=s+t.min,e.max=e.min+Rt(t)}function u$(e,t,n,r){Cw(e.x,t.x,n.x,r==null?void 0:r.x),Cw(e.y,t.y,n.y,r==null?void 0:r.y)}function Tw(e,t,n,r=0){const s=r?$e(n.min,n.max,r):n.min;e.min=t.min-s,e.max=e.min+Rt(t)}function Iu(e,t,n,r){Tw(e.x,t.x,n.x,r==null?void 0:r.x),Tw(e.y,t.y,n.y,r==null?void 0:r.y)}function Pw(e,t,n,r,s){return e-=t,e=Mu(e,1/n,r),s!==void 0&&(e=Mu(e,1/s,r)),e}function d$(e,t=0,n=1,r=.5,s,i=e,o=e){if(or.test(t)&&(t=parseFloat(t),t=$e(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=$e(i.min,i.max,r);e===i&&(a-=t),e.min=Pw(e.min,t,n,a,s),e.max=Pw(e.max,t,n,a,s)}function jw(e,t,[n,r,s],i,o){d$(e,t[n],t[r],t[s],t.scale,i,o)}const f$=["x","scaleX","originX"],h$=["y","scaleY","originY"];function Nw(e,t,n,r){jw(e.x,t,f$,n?n.x:void 0,r?r.x:void 0),jw(e.y,t,h$,n?n.y:void 0,r?r.y:void 0)}function Rw(e){return e.translate===0&&e.scale===1}function uE(e){return Rw(e.x)&&Rw(e.y)}function Aw(e,t){return e.min===t.min&&e.max===t.max}function p$(e,t){return Aw(e.x,t.x)&&Aw(e.y,t.y)}function Ow(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function dE(e,t){return Ow(e.x,t.x)&&Ow(e.y,t.y)}function Mw(e){return Rt(e.x)/Rt(e.y)}function Iw(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Yn(e){return[e("x"),e("y")]}function m$(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:d,rotateX:f,rotateY:h,skewX:p,skewY:v}=n;c&&(r=`perspective(${c}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),h&&(r+=`rotateY(${h}deg) `),p&&(r+=`skewX(${p}deg) `),v&&(r+=`skewY(${v}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const fE=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],g$=fE.length,Dw=e=>typeof e=="string"?parseFloat(e):e,Lw=e=>typeof e=="number"||X.test(e);function y$(e,t,n,r,s,i){s?(e.opacity=$e(0,n.opacity??1,v$(r)),e.opacityExit=$e(t.opacity??1,0,w$(r))):i&&(e.opacity=$e(t.opacity??1,n.opacity??1,r));for(let o=0;o<g$;o++){const a=fE[o];let l=$w(t,a),c=$w(n,a);if(l===void 0&&c===void 0)continue;l||(l=0),c||(c=0),l===0||c===0||Lw(l)===Lw(c)?(e[a]=Math.max($e(Dw(l),Dw(c),r),0),(or.test(c)||or.test(l))&&(e[a]+="%")):e[a]=c}(t.rotate||n.rotate)&&(e.rotate=$e(t.rotate||0,n.rotate||0,r))}function $w(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const v$=hE(0,.5,r_),w$=hE(.5,.95,mn);function hE(e,t,n){return r=>r<e?0:r>t?1:n(rl(e,t,r))}function x$(e,t,n){const r=mt(e)?e:To(e);return r.start(Vg("",r,t,n)),r.animation}function ol(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const b$=(e,t)=>e.depth-t.depth;class S${constructor(){this.children=[],this.isDirty=!1}add(t){Pg(this.children,t),this.isDirty=!0}remove(t){Pu(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(b$),this.isDirty=!1,this.children.forEach(t)}}function k$(e,t){const n=Nt.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(bs(r),e(i-t))};return Oe.setup(r,!0),()=>bs(r)}function Bc(e){return mt(e)?e.get():e}class _${constructor(){this.members=[]}add(t){Pg(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(Pu(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(Pu(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){var n;for(let r=this.members.indexOf(t)-1;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1&&((n=s.instance)==null?void 0:n.isConnected)!==!1)return this.promote(s),!0}return!1}promote(t,n){var s;const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=r.options,{layoutDependency:o}=t.options;(i===void 0||i!==o)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),(s=t.root)!=null&&s.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,s,i,o;(r=(n=t.options).onExitComplete)==null||r.call(n),(o=(s=t.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||o.call(i)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const zc={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Ff=["","X","Y","Z"],E$=1e3;let C$=0;function Uf(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function pE(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=M_(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Oe,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&pE(r)}function mE({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=t==null?void 0:t()){this.id=C$++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(j$),this.nodes.forEach(I$),this.nodes.forEach(D$),this.nodes.forEach(N$)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new S$)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Ng),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Kg(o)&&!P4(o),this.instance=o;const{layoutId:a,layout:l,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(l||a)&&(this.isLayoutDirty=!0),e){let d,f=0;const h=()=>this.root.updateBlockedByResize=!1;Oe.read(()=>{f=window.innerWidth}),e(o,()=>{const p=window.innerWidth;p!==f&&(f=p,this.root.updateBlockedByResize=!0,d&&d(),d=k$(h,250),zc.hasAnimatedSinceResize&&(zc.hasAnimatedSinceResize=!1,this.nodes.forEach(Vw)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||l)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:f,hasRelativeLayoutChanged:h,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const v=this.options.transition||c.getDefaultTransition()||V$,{onLayoutAnimationStart:g,onLayoutAnimationComplete:b}=c.getProps(),w=!this.targetLayout||!dE(this.targetLayout,p),y=!f&&h;if(this.options.layoutRoot||this.resumeFrom||y||f&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const x={...Ug(v,"layout"),onPlay:g,onComplete:b};(c.shouldReduceMotion||this.options.layoutRoot)&&(x.delay=0,x.type=!1),this.startAnimation(x),this.setAnimationOrigin(d,y)}else f||Vw(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),bs(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(L$),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&pE(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];f.shouldResetTransform=!0,(typeof f.latestValues.x=="string"||typeof f.latestValues.y=="string")&&(f.isLayoutDirty=!0),f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const l=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),l&&this.nodes.forEach(A$),this.nodes.forEach(Fw);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Uw);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(O$),this.nodes.forEach(M$),this.nodes.forEach(T$),this.nodes.forEach(P$)):this.nodes.forEach(Uw),this.clearAllSnapshots();const a=Nt.now();pt.delta=cr(0,1e3/60,a-pt.timestamp),pt.timestamp=a,pt.isProcessing=!0,Rf.update.process(pt),Rf.preRender.process(pt),Rf.render.process(pt),pt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Hg.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(R$),this.sharedNodes.forEach($$)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Oe.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Oe.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Rt(this.snapshot.measuredBox.x)&&!Rt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=it()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!uE(this.projectionDelta),l=this.getTransformTemplate(),c=l?l(this.latestValues,""):void 0,d=c!==this.prevTransformTemplateValue;o&&this.instance&&(a||Fs(this.latestValues)||d)&&(s(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),B$(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var c;const{visualElement:o}=this.options;if(!o)return it();const a=o.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(z$))){const{scroll:d}=this.root;d&&(Zn(a.x,d.offset.x),Zn(a.y,d.offset.y))}return a}removeElementScroll(o){var l;const a=it();if(kn(a,o),(l=this.scroll)!=null&&l.wasRoot)return a;for(let c=0;c<this.path.length;c++){const d=this.path[c],{scroll:f,options:h}=d;d!==this.root&&f&&h.layoutScroll&&(f.wasRoot&&kn(a,o),Zn(a.x,f.offset.x),Zn(a.y,f.offset.y))}return a}applyTransform(o,a=!1,l){var d,f;const c=l||it();kn(c,o);for(let h=0;h<this.path.length;h++){const p=this.path[h];!a&&p.options.layoutScroll&&p.scroll&&p!==p.root&&(Zn(c.x,-p.scroll.offset.x),Zn(c.y,-p.scroll.offset.y)),Fs(p.latestValues)&&Vc(c,p.latestValues,(d=p.layout)==null?void 0:d.layoutBox)}return Fs(this.latestValues)&&Vc(c,this.latestValues,(f=this.layout)==null?void 0:f.layoutBox),c}removeTransform(o){var l;const a=it();kn(a,o);for(let c=0;c<this.path.length;c++){const d=this.path[c];if(!Fs(d.latestValues))continue;let f;d.instance&&(Wp(d.latestValues)&&d.updateSnapshot(),f=it(),kn(f,d.measurePageBox())),Nw(a,d.latestValues,(l=d.snapshot)==null?void 0:l.layoutBox,f)}return Fs(this.latestValues)&&Nw(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==pt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var p;const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==a;if(!(o||l&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!this.layout||!(d||f))return;this.resolvedRelativeTargetAt=pt.timestamp;const h=this.getClosestProjectingParent();h&&this.linkedParentVersion!==h.layoutVersion&&!h.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&h&&h.layout?this.createRelativeTarget(h,this.layout.layoutBox,h.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=it(),this.targetWithTransforms=it()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),u$(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):kn(this.target,this.layout.layoutBox),X_(this.target,this.targetDelta)):kn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?this.createRelativeTarget(h,this.target,h.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||Wp(this.parent.latestValues)||Q_(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,l){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=it(),this.relativeTargetOrigin=it(),Iu(this.relativeTargetOrigin,a,l,this.options.layoutAnchor||void 0),kn(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var v;const o=this.getLead(),a=!!this.resumingFrom||this!==o;let l=!0;if((this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty)&&
vendor: 5,333 bytes, line 320
320(l=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===pt.timestamp&&(l=!1),l)return;const{layout:c,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||d))return;kn(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,h=this.treeScale.y;F4(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=it());const{target:p}=o;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(_w(this.prevProjectionDelta.x,this.projectionDelta.x),_w(this.prevProjectionDelta.y,this.projectionDelta.y)),Ca(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==h||!Iw(this.projectionDelta.x,this.prevProjectionDelta.x)||!Iw(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Yi(),this.projectionDelta=Yi(),this.projectionDeltaWithTransform=Yi()}setAnimationOrigin(o,a=!1){const l=this.snapshot,c=l?l.latestValues:{},d={...this.latestValues},f=Yi();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const h=it(),p=l?l.source:void 0,v=this.layout?this.layout.source:void 0,g=p!==v,b=this.getStack(),w=!b||b.members.length<=1,y=!!(g&&!w&&this.options.crossfade===!0&&!this.path.some(U$));this.animationProgress=0;let x;this.mixTargetDelta=S=>{const k=S/1e3;Bw(f.x,o.x,k),Bw(f.y,o.y,k),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Iu(h,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),F$(this.relativeTarget,this.relativeTargetOrigin,h,k),x&&p$(this.relativeTarget,x)&&(this.isProjectionDirty=!1),x||(x=it()),kn(x,this.relativeTarget)),g&&(this.animationValues=d,y$(d,c,this.latestValues,k,y,w)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,l,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(c=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||c.stop(),this.pendingAnimation&&(bs(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Oe.update(()=>{zc.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=To(0)),this.motionValue.jump(0,!1),this.currentAnimation=x$(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),o.onUpdate&&o.onUpdate(d)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(E$),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:c,latestValues:d}=o;if(!(!a||!l||!c)){if(this!==o&&this.layout&&c&&gE(this.options.animationType,this.layout.layoutBox,c.layoutBox)){l=this.target||it();const f=Rt(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+f;const h=Rt(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+h}kn(a,l),Vc(a,d),Ca(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new _$),this.sharedNodes.get(o).add(a);const c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const c=this.getStack();c&&c.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}
vendor: 4,506 bytes, line 320
320resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const c={};l.z&&Uf("z",o,c,this.animationValues);for(let d=0;d<Ff.length;d++)Uf(`rotate${Ff[d]}`,o,c,this.animationValues),Uf(`skew${Ff[d]}`,o,c,this.animationValues);o.render();for(const d in c)o.setStaticValue(d,c[d]),this.animationValues&&(this.animationValues[d]=c[d]);o.scheduleRender()}applyProjectionStyles(o,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const l=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=Bc(a==null?void 0:a.pointerEvents)||"",o.transform=l?l(this.latestValues,""):"none";return}const c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=Bc(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!Fs(this.latestValues)&&(o.transform=l?l({},""):"none",this.hasProjected=!1);return}o.visibility="";const d=c.animationValues||c.latestValues;this.applyTransformsToTarget();let f=m$(this.projectionDeltaWithTransform,this.treeScale,d);l&&(f=l(d,f)),o.transform=f;const{x:h,y:p}=this.projectionDelta;o.transformOrigin=`${h.origin*100}% ${p.origin*100}% 0`,c.animationValues?o.opacity=c===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:o.opacity=c===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const v in qp){if(d[v]===void 0)continue;const{correct:g,applyTo:b,isCSSVariable:w}=qp[v],y=f==="none"?d[v]:g(d[v],c);if(b){const x=b.length;for(let S=0;S<x;S++)o[b[S]]=y}else w?this.options.visualElement.renderState.vars[v]=y:o[v]=y}this.options.layoutId&&(o.pointerEvents=c===this?Bc(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(Fw),this.root.sharedNodes.clear()}}}function T$(e){e.updateLayout()}function P$(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:i}=e.options,o=t.source!==e.layout.source;if(i==="size")Yn(f=>{const h=o?t.measuredBox[f]:t.layoutBox[f],p=Rt(h);h.min=r[f].min,h.max=h.min+p});else if(i==="x"||i==="y"){const f=i==="x"?"y":"x";Kp(o?t.measuredBox[f]:t.layoutBox[f],r[f])}else gE(i,t.layoutBox,r)&&Yn(f=>{const h=o?t.measuredBox[f]:t.layoutBox[f],p=Rt(r[f]);h.max=h.min+p,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+p)});const a=Yi();Ca(a,r,t.layoutBox);const l=Yi();o?Ca(l,e.applyTransform(s,!0),t.measuredBox):Ca(l,r,t.layoutBox);const c=!uE(a);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:h,layout:p}=f;if(h&&p){const v=e.options.layoutAnchor||void 0,g=it();Iu(g,t.layoutBox,h.layoutBox,v);const b=it();Iu(b,r,p.layoutBox,v),dE(g,b)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=b,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function j$(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function N$(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function R$(e){e.clearSnapshot()}function Fw(e){e.clearMeasurements()}function A$(e){e.isLayoutDirty=!0,e.updateLayout()}function Uw(e){e.isLayoutDirty=!1}function O$(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function M$(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Vw(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function I$(e){e.resolveTargetDelta()}function D$(e){e.calcProjection()}
320function L$(e){e.resetSkewAndRotation()}function $$(e){e.removeLeadSnapshot()}function Bw(e,t,n){e.translate=$e(t.translate,0,n),e.scale=$e(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function zw(e,t,n,r){e.min=$e(t.min,n.min,r),e.max=$e(t.max,n.max,r)}function F$(e,t,n,r){zw(e.x,t.x,n.x,r),zw(e.y,t.y,n.y,r)}function U$(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const V$={duration:.45,ease:[.4,0,.1,1]},Ww=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Hw=Ww("applewebkit/")&&!Ww("chrome/")?Math.round:mn;function qw(e){e.min=Hw(e.min),e.max=Hw(e.max)}function B$(e){qw(e.x),qw(e.y)}function gE(e,t,n){return e==="position"||e==="preserve-aspect"&&!c$(Mw(t),Mw(n),.2)}function z$(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const W$=mE({attachResizeListener:(e,t)=>ol(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),Vf={current:void 0},yE=mE({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Vf.current){const e=new W$({});e.mount(window),e.setOptions({layoutScroll:!0}),Vf.current=e}return Vf.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),Xg=m.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Kw(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function H$(...e){return t=>{let n=!1;const r=e.map(s=>{const i=Kw(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s<r.length;s++){const i=r[s];typeof i=="function"?i():Kw(e[s],null)}}}}function q$(...e){return m.useCallback(H$(...e),e)}class K$ extends m.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(Lc(n)&&t.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=n.offsetParent,s=Lc(r)&&r.offsetWidth||0,i=Lc(r)&&r.offsetHeight||0,o=getComputedStyle(n),a=this.props.sizeRef.current;a.height=parseFloat(o.height),a.width=parseFloat(o.width),a.top=n.offsetTop,a.left=n.offsetLeft,a.right=s-a.width-a.left,a.bottom=i-a.height-a.top}return null}componentDidUpdate(){}render(){return this.props.children}}function G$({children:e,isPresent:t,anchorX:n,anchorY:r,root:s,pop:i}){var h;const o=m.useId(),a=m.useRef(null),l=m.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:c}=m.useContext(Xg),d=((h=e.props)==null?void 0:h.ref)??(e==null?void 0:e.ref),f=q$(a,d);return m.useInsertionEffect(()=>{const{width:p,height:v,top:g,left:b,right:w,bottom:y}=l.current;if(t||i===!1||!a.current||!p||!v)return;const x=n==="left"?`left: ${b}`:`right: ${w}`,S=r==="bottom"?`bottom: ${y}`:`top: ${g}`;a.current.dataset.motionPopId=o;const k=document.createElement("style");c&&(k.nonce=c);const E=s??document.head;return E.appendChild(k),k.sheet&&k.sheet.insertRule(` 321 [data-motion-pop-id="${o}"] { 322 position: absolute !important; 323 width: ${p}px !important; 324 height: ${v}px !important; 325 ${x}px !important; 326 ${S}px !important; 327 } 328 `),()=>{var C;(C=a.current)==null||C.removeAttribute("data-motion-pop-id"),E.contains(k)&&E.removeChild(k)}},[t]),u.jsx(K$,{isPresent:t,childRef:a,sizeRef:l,pop:i,children:i===!1?e:m.cloneElement(e,{ref:f})})}const Y$=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:a,anchorY:l,root:c})=>{const d=Tg(J$),f=m.useId();let h=!0,p=m.useMemo(()=>(h=!1,{id:f,initial:t,isPresent:n,custom:s,onExitComplete:v=>{d.set(v,!0);for(const g of d.values())if(!g)return;r&&r()},register:v=>(d.set(v,!1),()=>d.delete(v))}),[n,d,r]);return i&&h&&(p={...p}),m.useMemo(()=>{d.forEach((v,g)=>d.set(g,!1))},[n]),m.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),e=u.jsx(G$,{pop:o==="popLayout",isPresent:n,anchorX:a,anchorY:l,root:c,children:e}),u.jsx(Cd.Provider,{value:p,children:e})};function J$(){return new Map}function vE(e=!0){const t=m.useContext(Cd);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=m.useId();m.useEffect(()=>{if(e)return s(i)},[e]);const o=m.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,o]:[!0]}const fc=e=>e.key||"";function Gw(e){const t=[];
vendor: 1,065 bytes, line 328
328return m.Children.forEach(e,n=>{m.isValidElement(n)&&t.push(n)}),t}const Du=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:a="left",anchorY:l="top",root:c})=>{const[d,f]=vE(o),h=m.useMemo(()=>Gw(e),[e]),p=o&&!d?[]:h.map(fc),v=m.useRef(!0),g=m.useRef(h),b=Tg(()=>new Map),w=m.useRef(new Set),[y,x]=m.useState(h),[S,k]=m.useState(h);Hk(()=>{v.current=!1,g.current=h;for(let _=0;_<S.length;_++){const j=fc(S[_]);p.includes(j)?(b.delete(j),w.current.delete(j)):b.get(j)!==!0&&b.set(j,!1)}},[S,p.length,p.join("-")]);const E=[];if(h!==y){let _=[...h];for(let j=0;j<S.length;j++){const T=S[j],I=fc(T);p.includes(I)||(_.splice(j,0,T),E.push(T))}return i==="wait"&&E.length&&(_=E),k(Gw(_)),x(h),null}const{forceRender:C}=m.useContext(Cg);return u.jsx(u.Fragment,{children:S.map(_=>{const j=fc(_),T=o&&!d?!1:h===S||p.includes(j),I=()=>{if(w.current.has(j))return;if(b.has(j))w.current.add(j),b.set(j,!0);else return;let M=!0;b.forEach(H=>{H||(M=!1)}),M&&(C==null||C(),k(g.current),o&&(f==null||f()),r&&r()
vendor: 24,961 bytes, line 328
328)};return u.jsx(Y$,{isPresent:T,initial:!v.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,root:c,onExitComplete:T?void 0:I,anchorX:a,anchorY:l,children:_},j)})})},wE=m.createContext({strict:!1}),Yw={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let Jw=!1;function Q$(){if(Jw)return;const e={};for(const t in Yw)e[t]={isEnabled:n=>Yw[t].some(r=>!!n[r])};G_(e),Jw=!0}function xE(){return Q$(),I4()}function X$(e){const t=xE();for(const n in e)t[n]={...t[n],...e[n]};G_(t)}const Z$=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Lu(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Z$.has(e)}let bE=e=>!Lu(e);function eF(e){typeof e=="function"&&(bE=t=>t.startsWith("on")?!Lu(t):e(t))}try{eF(require("@emotion/is-prop-valid").default)}catch{}function tF(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||mt(e[s])||(bE(s)||n===!0&&Lu(s)||!t&&!Lu(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const Nd=m.createContext({});function nF(e,t){if(jd(e)){const{initial:n,animate:r}=e;return{initial:n===!1||il(n)?n:void 0,animate:il(r)?r:void 0}}return e.inherit!==!1?t:{}}function rF(e){const{initial:t,animate:n}=nF(e,m.useContext(Nd));return m.useMemo(()=>({initial:t,animate:n}),[Qw(t),Qw(n)])}function Qw(e){return Array.isArray(e)?e.join(" "):e}const Zg=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function SE(e,t,n){for(const r in t)!mt(t[r])&&!tE(r,n)&&(e[r]=t[r])}function sF({transformTemplate:e},t){return m.useMemo(()=>{const n=Zg();return Jg(n,t,e),Object.assign({},n.vars,n.style)},[t])}function iF(e,t){const n=e.style||{},r={};return SE(r,n,e),Object.assign(r,sF(e,t)),r}function oF(e,t){const n={},r=iF(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const kE=()=>({...Zg(),attrs:{}});function aF(e,t,n,r){const s=m.useMemo(()=>{const i=kE();return nE(i,t,sE(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};SE(i,e.style,e),s.style={...i,...s.style}}return s}const lF=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function ey(e){return typeof e!="string"||e.includes("-")?!1:!!(lF.indexOf(e)>-1||/[A-Z]/u.test(e))}function cF(e,t,n,{latestValues:r},s,i=!1,o){const l=(o??ey(e)?aF:oF)(t,r,s,e),c=tF(t,typeof e=="string",i),d=e!==m.Fragment?{...c,...l,ref:n}:{},{children:f}=t,h=m.useMemo(()=>mt(f)?f.get():f,[f]);return m.createElement(e,{...d,children:h})}function uF({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:dF(n,r,s,e),renderState:t()}}function dF(e,t,n,r){const s={},i=r(e,{});for(const h in i)s[h]=Bc(i[h]);let{initial:o,animate:a}=e;const l=jd(e),c=q_(e);t&&c&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const f=d?a:o;if(f&&typeof f!="boolean"&&!Pd(f)){const h=Array.isArray(f)?f:[f];for(let p=0;p<h.length;p++){const v=Bg(e,h[p]);if(v){const{transitionEnd:g,transition:b,...w}=v;for(const y in w){let x=w[y];if(Array.isArray(x)){const S=d?x.length-1:0;x=x[S]}x!==null&&(s[y]=x)}for(const y in g)s[y]=g[y]}}}return s}const _E=e=>(t,n)=>{const r=m.useContext(Nd),s=m.useContext(Cd),i=()=>uF(e,t,r,s);return n?i():Tg(i)},fF=_E({scrapeMotionValuesFromProps:Qg,createRenderState:Zg}),hF=_E({scrapeMotionValuesFromProps:iE,createRenderState:kE}),pF=Symbol.for("motionComponentSymbol");function mF(e,t,n){const r=m.useRef(n);m.useInsertionEffect(()=>{r.current=n});const s=m.useRef(null);return m.useCallback(i=>{var a;i&&((a=e.onMount)==null||a.call(e,i));const o=r.current;if(typeof o=="function")if(i){const l=o(i);typeof l=="function"&&(s.current=l)}else s.current?(s.current(),s.current=null):o(i);else o&&(o.current=i);t&&(i?t.mount(i):t.unmount())},[t])}const EE=m.createContext({});function Oi(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function gF(e,t,n,r,s,i){var x,S;const{visualElement:o}=m.useContext(Nd),a=m.useContext(wE),l=m.useContext(Cd),c=m.useContext(Xg),d=c.reducedMotion,f=c.skipAnimations,h=m.useRef(null),p=m.useRef(!1);r=r||a.renderer,!h.current&&r&&(h.current=r(e,{visualState:t,parent:o,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:d,skipAnimations:f,isSVG:i}),p.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));const v=h.current,g=m.useContext(EE);v&&!v.projection&&s&&(v.type==="html"||v.type==="svg")&&yF(h.current,n,s,g);const b=m.useRef(!1);m.useInsertionEffect(()=>{v&&b.current&&v.update(n,l)});const w=n[O_],y=m.useRef(!!w&&typeof window<"u"&&!((x=window.MotionHandoffIsComplete)!=null&&x.call(window,w))&&((S=window.MotionHasOptimisedAnimation)==null?void 0:S.call(window,w)));return Hk(()=>{p.current=!0,v&&(b.current=!0,window.MotionIsMounted=!0,v.updateFeatures(),v.scheduleRenderMicrotask(),y.current&&v.animationState&&v.animationState.animateChanges())}),m.useEffect(()=>{v&&(!y.current&&v.animationState&&v.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var k;(k=window.MotionHandoffMarkAsComplete)==null||k.call(window,w)}),y.current=!1),v.enteringChildren=void 0)}),v}function yF(e,t,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutAnchor:d,layoutCrossfade:f}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:CE(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||a&&Oi(a),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:f,layoutScroll:l,layoutRoot:c,layoutAnchor:d})}function CE(e){if(e)return e.options.allowProjection!==!1?e.projection:CE(e.parent)}function Bf(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&X$(r);const i=n?n==="svg":ey(e),o=i?hF:fF;function a(c,d){let f;const h={...m.useContext(Xg),...c,layoutId:vF(c)},{isStatic:p}=h,v=rF(c),g=o(c,p);if(!p&&typeof window<"u"){wF();const b=xF(h);f=b.MeasureLayout,v.visualElement=gF(e,g,h,s,b.ProjectionNode,i)}return u.jsxs(Nd.Provider,{value:v,children:[f&&v.visualElement?u.jsx(f,{visualElement:v.visualElement,...h}):null,cF(e,c,mF(g,v.visualElement,d),g,p,t,i)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const l=m.forwardRef(a);return l[pF]=e,l}function vF({layoutId:e}){const t=m.useContext(Cg).id;return t&&e!==void 0?t+"-"+e:e}function wF(e,t){m.useContext(wE).strict}function xF(e){const t=xE(),{drag:n,layout:r}=t;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function bF(e,t){if(typeof Proxy>"u")return Bf;const n=new Map,r=(i,o)=>Bf(i,o,e,t),s=(i,o)=>r(i,o);return new Proxy(s,{get:(i,o)=>o==="create"?r:(n.has(o)||n.set(o,Bf(o,void 0,e,t)),n.get(o))})}const SF=(e,t)=>t.isSVG??ey(e)?new X4(t):new q4(t,{allowProjection:e!==m.Fragment});class kF extends Ps{constructor(t){super(t),t.animationState||(t.animationState=r$(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Pd(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let _F=0;class EF extends Ps{constructor(){super(...arguments),this.id=_F++,this.isExitComplete=!1}update(){var i;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:o,custom:a}=this.node.getProps();if(typeof o=="string"){const l=si(this.node,o,a);if(l){const{transition:c,transitionEnd:d,...f}=l;for(const h in f)(i=this.node.getValue(h))==null||i.jump(f[h])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const CF={animation:{Feature:kF},exit:{Feature:EF}};function Pl(e){return{point:{x:e.pageX,y:e.pageY}}}const TF=e=>t=>qg(t)&&e(t,Pl(t));function Ta(e,t,n,r){return ol(e,t,TF(n),r)}const TE=({current:e})=>e?e.ownerDocument.defaultView:null,Xw=(e,t)=>Math.abs(e-t);function PF(e,t){const n=Xw(e.x,t.x),r=Xw(e.y,t.y);return Math.sqrt(n**2+r**2)}const Zw=new Set(["auto","scroll"]);class PE{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=hc(this.lastRawMoveEventInfo,this.transformPagePoint));const p=zf(this.lastMoveEventInfo,this.history),v=this.startEvent!==null,g=PF(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!v&&!g)return;const{point:b}=p,{timestamp:w}=pt;this.history.push({...b,timestamp:w});const{onStart:y,onMove:x}=this.handlers;v||(y&&y(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,p)},this.handlePointerMove=(p,v)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=v,this.lastMoveEventInfo=hc(v,this.transformPagePoint),Oe.update(this.updatePoint,!0)},this.handlePointerUp=(p,v)=>{this.end();const{onEnd:g,onSessionEnd:b,resumeAnimation:w}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&w&&w(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=zf(p.type==="pointercancel"?this.lastMoveEventInfo:hc(v,this.transformPagePoint),this.history);this.startEvent&&g&&g(p,y),b&&b(p,y)},!qg(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const l=Pl(t),c=hc(l,this.transformPagePoint),{point:d}=c,{timestamp:f}=pt;this.history=[{...d,timestamp:f}];const{onSessionStart:h}=n;h&&h(t,zf(c,this.history)),this.removeListeners=El(Ta(this.contextWindow,"pointermove",this.handlePointerMove),Ta(this.contextWindow,"pointerup",this.handlePointerUp),Ta(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(Zw.has(r.overflowX)||Zw.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},i={x:s.x-n.x,y:s.y-n.y};i.x===0&&i.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(t,s),Oe.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),bs(this.updatePoint)}}function hc(e,t){return t?{point:t(e.point)}:e}function ex(e,t){return{x:e.x-t.x,y:e.y-t.y}}function zf({point:e},t){return{point:e,delta:ex(e,jE(t)),offset:ex(e,jF(t)),velocity:NF(t,.1)}}function jF(e){return e[0]}function jE(e){return e[e.length-1]}function NF(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=jE(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Zt(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&s.timestamp-r.timestamp>Zt(t)*2&&(r=e[1]);const i=hn(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function RF(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?$e(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?$e(n,e,r.max):Math.min(e,n)),e}function tx(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function AF(e,{top:t,left:n,bottom:r,right:s}){return{x:tx(e.x,n,s),y:tx(e.y,t,r)}}function nx(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function OF(e,t){return{x:nx(e.x,t.x),y:nx(e.y,t.y)}}function MF(e,t){let n=.5;const r=Rt(e),s=Rt(t);return s>r?n=rl(t.min,t.max-r,e.min):r>s&&(n=rl(e.min,e.max-s,t.min)),cr(0,1,n)}function IF(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Gp=.35;function DF(e=Gp){return e===!1?e=0:e===!0&&(e=Gp),{x:rx(e,"left","right"),y:rx(e,"top","bottom")}}function rx(e,t,n){return{min:sx(e,t),max:sx(e,n)}}function sx(e,t){return typeof e=="number"?e:e[t]||0}const LF=new WeakMap;class $F{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=it(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=f=>{n&&this.snapToCursor(Pl(f).point),this.stopAnimation()},o=(f,h)=>{const{drag:p,dragPropagation:v,onDragStart:g}=this.getProps();if(p&&!v&&(this.openDragLock&&this.openDragLock(),this.openDragLock=d4(p),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=h,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Yn(w=>{let y=this.getAxisMotionValue(w).get()||0;if(or.test(y)){const{projection:x}=this.visualElement;if(x&&x.layout){const S=x.layout.layoutBox[w];S&&(y=Rt(S)*(parseFloat(y)/100))}}this.originPoint[w]=y}),g&&Oe.update(()=>g(f,h),!1,!0),Fp(this.visualElement,"transform");const{animationState:b}=this.visualElement;b&&b.setActive("whileDrag",!0)},a=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h;const{dragPropagation:p,dragDirectionLock:v,onDirectionLock:g,onDrag:b}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:w}=h;if(v&&this.currentDirection===null){this.currentDirection=UF(w),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",h.point,w),this.updateAxis("y",h.point,w),this.visualElement.render(),b&&Oe.update(()=>b(f,h),!1,!0)},l=(f,h)=>{this.latestPointerEvent=f,this.latestPanInfo=h,this.stop(f,h),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new PE(t,{onSessionStart:i,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:TE(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&Oe.postRender(()=>a(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!pc(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=RF(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){var i;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,s=this.constraints;t&&Oi(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=AF(r.layoutBox,t):this.constraints=!1,this.elastic=DF(n),s!==this.constraints&&!Oi(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&Yn(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=IF(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Oi(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=U4(r,s.root,this.visualElement.getTransformPagePoint());let o=OF(s.layout.layoutBox,i);if(n){const a=n(L4(o));this.hasMutatedConstraints=!!a,a&&(o=J_(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},c=Yn(d=>{if(!pc(d,n,this.currentDirection))return;let f=l&&l[d]||{};(o===!0||o===d)&&(f={min:0,max:0});const h=s?200:1e6,p=s?40:1e7,v={type:"inertia",velocity:r?t[d]:0,bounceStiffness:h,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(d,v)});return Promise.all(c).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Fp(this.visualElement,t),r.start(Vg(t,r,0,n,this.visualElement,!1))}stopAnimation(){Yn(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Yn(n=>{const{drag:r}=this.getProps();if(!pc(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n],l=i.get()||0;i.set(t[n]-$e(o,a,.5)+l)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Oi(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Yn(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=MF({min:l,max:l},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Yn(o=>{if(!pc(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:c}=this.constraints[o];a.set($e(l,c,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;LF.set(this.visualElement,this);const t=this.visualElement.current,n=Ta(t,"pointerdown",c=>{const{drag:d,dragListener:f=!0}=this.getProps(),h=c.target,p=h!==t&&y4(h);d&&f&&!p&&this.start(c)});let r;const s=()=>{const{dragConstraints:c}=this.getProps();Oi(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),r||(r=FF(t,c.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Oe.read(s);const a=ol(window,"resize",()=>this.scalePositionWithinConstraints()),l=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:d})=>{this.isDragging&&d&&(Yn(f=>{const h=this.getAxisMotionValue(f);h&&(this.originPoint[f]+=c[f].translate,h.set(h.get()+c[f].translate))}),this.visualElement.render())});return()=>{a(),n(),o(),l&&l(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=Gp,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function ix(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function FF(e,t,n){const r=fw(e,ix(n)),s=fw(t,ix(n));return()=>{r(),s()}}function pc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function UF(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class VF extends Ps{constructor(t){super(t),this.removeGroupControls=mn,this.removeListeners=mn,this.controls=new $F(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||mn}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Wf=e=>(t,n)=>{e&&Oe.update(()=>e(t,n),!1,!0)};class BF extends Ps{constructor(){super(...arguments),this.removePointerDownListener=mn}onPointerDown(t){this.session=new PE(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:TE(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Wf(t),onStart:Wf(n),onMove:Wf(r),onEnd:(i,o)=>{delete this.session,s&&Oe.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=Ta(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Hf=!1;class zF extends m.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),Hf&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),zc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:o}=r;return o&&(o.isPresent=i,t.layoutDependency!==n&&o.setOptions({...o.options,layoutDependency:n}),Hf=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==i?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||Oe.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),Hg.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;Hf=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function NE(e){const[t,n]=vE(),r=m.useContext(Cg);return u.jsx(zF,{...e,layoutGroup:r,switchLayoutGroup:m.useContext(EE),isPresent:t,safeToRemove:n})}const WF={pan:{Feature:BF},drag:{Feature:VF,ProjectionNode:yE,MeasureLayout:NE}};
328function ox(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&Oe.postRender(()=>i(t,Pl(t)))}class HF extends Ps{mount(){const{current:t}=this.node;t&&(this.unmount=h4(t,(n,r)=>(ox(this.node,r,"Start"),s=>ox(this.node,s,"End"))))}unmount(){}}class qF extends Ps{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=El(ol(this.node.current,"focus",()=>this.onFocus()),ol(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function ax(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&Oe.postRender(()=>i(t,Pl(t)))}class KF extends Ps{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=w4(t,(s,i)=>(ax(this.node,i,"Start"),(o,{success:a})=>ax(this.node,o,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Yp=new WeakMap,qf=new WeakMap,GF=e=>{const t=Yp.get(e.target);t&&t(e)},YF=e=>{e.forEach(GF)};function JF({root:e,...t}){const n=e||document;qf.has(n)||qf.set(n,{});const r=qf.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(YF,{root:e,...t})),r[s]}function QF(e,t,n){const r=JF(t);return Yp.set(e,n),r.observe(e),()=>{Yp.delete(e),r.unobserve(e)}}const XF={some:0,all:1};class ZF extends Ps{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var l;(l=this.stopObserver)==null||l.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:XF[s]},a=c=>{const{isIntersecting:d}=c;if(this.isInView===d||(this.isInView=d,i&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:f,onViewportLeave:h}=this.node.getProps(),p=d?f:h;p&&p(c)};this.stopObserver=QF(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(eU(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function eU({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const tU={inView:{Feature:ZF},tap:{Feature:KF},focus:{Feature:qF},hover:{Feature:HF}},nU={layout:{ProjectionNode:yE,MeasureLayout:NE}},rU={...CF,...tU,...WF,...nU},le=bF(rU,SF),Jp=Ve;function jl({open:e,onClose:t}){const[n,r]=m.useState(""),[s,i]=m.useState(""),[o,a]=m.useState(""),[l,c]=m.useState(""),[d,f]=m.useState(!1),[h,p]=m.useState(!1),[v,g]=m.useState(null),[b,w]=m.useState(0);m.useEffect(()=>{e&&(y(),p(!1),g(null),r(""),i(""),a(""),c(""))},[e]);const y=async()=>{const{count:S}=await Jp.from("waitlist").select("*",{count:"exact",head:!0});S!==null&&w(S)},x=async S=>{var E;if(S.preventDefault(),!n.trim()||!s.trim()||!o.trim()){g("Please fill in all required fields.");return}f(!0),g(null);const{error:k}=await Jp.from("waitlist").insert({name:n.trim(),email:s.trim(),profession_role:o.trim(),feedback:l.trim()||null});if(k){(E=k.message)!=null&&E.includes("duplicate")||k.code==="23505"?g("This email is already on the waitlist!"):g(k.message||"Something went wrong."),f(!1);return}p(!0),w(C=>C+1),f(!1)};return u.jsx(Du,{children:e&&u.jsxs(u.Fragment,{children:[u.jsx(le.div,{initial:{opacity:0}
328,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100]",onClick:t}),u.jsx(le.div,{initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},transition:{duration:.25,ease:[.22,1,.36,1]},className:"fixed inset-0 z-[101] flex items-center justify-center p-4",children:u.jsxs("div",{className:"surface-raised p-6 relative w-full max-w-[420px] max-h-[90vh] overflow-y-auto",children:[u.jsx("button",{onClick:t,className:"absolute top-4 right-4 text-muted-foreground hover:text-foreground transition-colors",children:u.jsx(fd,{className:"h-4 w-4"})}),h?u.jsxs("div",{className:"text-center py-6",children:[u.jsx(SN,{className:"h-10 w-10 text-accent mx-auto mb-4"}),u.jsx("h3",{className:"text-[18px] font-semibold tracking-tight mb-2",children:"You're on the list!"}),u.jsxs("p",{className:"text-[13px] text-muted-foreground mb-4",children:["We'll reach out when it's your turn. You're #",b," on the waitlist."]}),u.jsx("button",{onClick:t,className:"text-[13px] text-primary hover:underline font-medium",children:"Close"})]}):u.jsxs(u.Fragment,{children:[u.jsx("h3",{className:"text-[18px] font-semibold tracking-tight mb-1",children:"Join the Waitlist"}),u.jsx("p",{className:"text-[13px] text-muted-foreground mb-5",children:"Be the first to know when SpecMe launches."}),u.jsxs("div",{className:"flex items-center gap-2 mb-5 px-3 py-2 rounded-lg bg-primary/8 border border-primary/15",children:[u.jsx(ig,{className:"h-3.5 w-3.5 text-primary"}),u.jsxs("span",{className:"text-[13px] text-primary font-medium",children:[b," ",b===1?"person":"people"," on the waitlist"]})]}),u.jsxs("form",{onSubmit:x,className:"space-y-3",children:[u.jsxs("div",{children:[u.jsx("label",{className:"text-[12px] text-muted-foreground mb-1 block",children:"Name *"}),u.jsx("input",{value:n,onChange:S=>r(S.target.value),placeholder:"Your full name",required:!0,className:"premium-input"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"text-[12px] text-muted-foreground mb-1 block",children:"Email *"}),u.jsx("input",{type:"email",value:s,onChange:S=>i(S.target.value),placeholder:"[email protected]",required:!0,className:"premium-input"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"text-[12px] text-muted-foreground mb-1 block",children:"Profession and Role *"}),u.jsx("input",{value:o,onChange:S=>a(S.target.value),placeholder:"e.g. Product Manager at Acme",required:!0,className:"premium-input"})]}),u.jsxs("div",{children:[u.jsxs("label",{className:"text-[12px] text-muted-foreground mb-1 block",children:["One line feedback ",u.jsx("span",{className:"text-muted-foreground/50",children:"(optional)"})]}),u.jsx("input",{value:l,onChange:S=>c(S.target.value),placeholder:"What excites you about SpecMe?",className:"premium-input"})]}),v&&u.jsx("div",{className:"text-[13px] text-red-400 bg-red-500/8 p-2.5 rounded-lg border border-red-500/15",children:v}),u.jsxs("button",{type:"submit",disabled:d,className:"w-full h-10 rounded-lg bg-primary hover:bg-primary/90 text-primary-foreground text-[13px] font-medium transition-colors flex items-center justify-center gap-2",children:[d&&u.jsx(Pt,{className:"h-3.5 w-3.5 animate-spin"}),"Join Waitlist"]})]})]})]})})]})})}function sU(){const[e,t]=m.useState(0);return m.useEffect(()=>{Jp.from("waitlist").select("*",{count:"exact",head:!0}).then(({count:n})=>{n!==null&&t(n)})},[]),e}function iU(){const[e,t]=m.useState(!1),[n,r]=m.useState(!1);return m.useEffect(()=>{const s=()=>t(window.scrollY>8);return window.addEventListener("scroll",s,{passive:!0}),()=>window.removeEventListener("scroll",s)},[]),u.jsxs(u.Fragment,{children:[u.jsxs("header",{className:`fixed top-0 left-0 right-0 z-50 h-14 flex items-center px-6 transition-all duration-300 ${e?"bg-background/80 backdrop-blur-xl border-b border-border":"bg-transparent border-b border-transparent"}`,children:[u.jsx(yt,{to:"/",className:"text-[15px] font-semibold tracking-tight text-foreground",children:"SpecMe"}),u.jsx("div",{className:"flex-1"}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(yt,{to:"/login",className:"text-[13px] text-muted-foreground hover:text-foreground transition-colors px-3 py-1.5",children:"Log in"}),u.jsx("button",{onClick:()=>r(!0),className:"text-[13px] font-medium bg-primary hover:bg-primary/90 text-primary-foreground px-4 py-1.5 rounded-lg transition-colors",children:"Join Waitlist"})]})]}),u.jsx(jl,{open:n,onClose:()=>r(!1)})]})}function oU(){const[e,t]=m.useState(!1);return u.jsxs("section",{className:"pt-32 pb-24 px-6",children:[u.jsx("div",{className:"max-w-[1100px] mx-auto",children:u.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-16 items-center",children:[u.jsxs(le.div,{initial:{opacity:0,y:16}
328,animate:{opacity:1,y:0},transition:{duration:.6,ease:[.22,1,.36,1]},children:[u.jsxs("h1",{className:"text-[46px] lg:text-[56px] font-extrabold tracking-[-0.02em] leading-[1.06] text-foreground mb-6",children:["Turn messy feedback",u.jsx("br",{}),"into"," ",u.jsx("span",{className:"text-gradient",children:"living specs."})]}),u.jsx("p",{className:"text-[16px] text-muted-foreground/80 leading-[1.7] max-w-[440px] mb-8",children:"SpecMe takes scattered PM notes, customer calls, and Slack threads, then turns them into structured, engineering-ready implementation plans. In seconds."}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("button",{onClick:()=>t(!0),className:"inline-flex items-center gap-2 bg-primary hover:bg-primary/90 text-primary-foreground text-[13px] font-medium px-5 h-10 rounded-lg transition-colors",children:["Join Waitlist",u.jsx(Zh,{className:"h-3.5 w-3.5"})]}),u.jsx(yt,{to:"/login",className:"inline-flex items-center gap-2 text-[13px] text-muted-foreground hover:text-foreground border border-border px-5 h-10 rounded-lg transition-colors",children:"Log in"})]})]}),u.jsx(le.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.15,duration:.6,ease:[.22,1,.36,1]},children:u.jsx("div",{className:"surface-raised aspect-video relative overflow-hidden rounded-xl",style:{boxShadow:"0 0 60px rgba(56,142,246,0.08), 0 20px 60px rgba(0,0,0,0.3)"},children:u.jsx("video",{autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"w-full h-full object-cover",src:"/hero-video.mp4"})})})]})}),u.jsx(jl,{open:e,onClose:()=>t(!1)})]})}const aU=[{icon:ON,title:"Structured from chaos",description:"Takes messy inputs from PMs, customers, and stakeholders, then synthesizes them into clear, actionable specs."},{icon:BN,title:"Engineering-ready output",description:"Generates implementation plans with exact files to change, acceptance criteria, and technical rationale."},{icon:$N,title:"Reduces ambiguity",description:"Bridges the gap between product intent and engineering execution. Less back-and-forth, faster shipping."}];function lU(){return u.jsx("section",{className:"py-24 px-6 border-t border-border",children:u.jsxs("div",{className:"max-w-[1100px] mx-auto",children:[u.jsxs(le.div,{initial:{opacity:0,y:12},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-80px"},transition:{duration:.5},children:[u.jsx("div",{className:"section-label mb-4",children:"Why SpecMe"}),u.jsxs("h2",{className:"text-[36px] font-semibold tracking-tight leading-[1.1] text-foreground mb-4 max-w-[500px]",children:["From feedback to",u.jsx("br",{}),"execution, faster."]}),u.jsx("p",{className:"text-[15px] text-muted-foreground max-w-[480px] mb-14",children:"SpecMe helps product and engineering teams move from scattered context to confident delivery."})]}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:aU.map((e,t)=>u.jsxs(le.div,{initial:{opacity:0,y:12},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-60px"},transition:{delay:t*.08,duration:.4},className:"float-card p-6",children:[u.jsx(e.icon,{className:"h-5 w-5 text-muted-foreground mb-4"}),u.jsx("h3",{className:"text-[15px] font-semibold mb-2",children:e.title}),u.jsx("p",{className:"text-[13px] text-muted-foreground leading-relaxed",children:e.description})]},e.title))})]})})}const cU=[{num:"01",title:"Connect your sources",description:"Link your GitHub repo, local project, or paste feedback directly. SpecMe indexes your codebase for context-aware analysis."},{num:"02",title:"Feed the messy context",description:"Paste call transcripts, Slack threads, Jira tickets, PM notes, any raw input. SpecMe synthesizes it all."},{num:"03",title:"Get an engineering-ready spec",description:"Receive a structured implementation plan with files to change, acceptance criteria, risks, and next steps."}];function uU(){return u.jsx("section",{className:"py-24 px-6 border-t border-border",children:u.jsxs("div",{className:"max-w-[1100px] mx-auto",children:[u.jsxs(le.div,{initial:{opacity:0,y:12},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-80px"},transition:{duration:.5},className:"mb-14",children:[u.jsx("div",{className:"section-label mb-4",children:"Getting started"}),u.jsxs("h2",{className:"text-[36px] font-semibold tracking-tight leading-[1.1] text-foreground max-w-[480px]",children:["Three steps to",u.jsx("br",{}),"shipping."]})]}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:cU.map((e,t)=>u.jsxs(le.div,{initial:{opacity:0,y:12},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-60px"},transition:{delay:t*.08,duration:.4},className:"relative pl-5 border-l border-border",children:[u.jsx("div",{className:"text-[12px] text-muted-foreground
328/50 mb-2",children:e.num}),u.jsx("h3",{className:"text-[15px] font-semibold mb-2",children:e.title}),u.jsx("p",{className:"text-[13px] text-muted-foreground leading-relaxed",children:e.description})]},e.num))})]})})}const dU=[{name:"Notion",description:"Import docs & wikis",icon:u.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"h-7 w-7",children:u.jsx("path",{d:"M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L18.1 2.168c-.42-.326-.98-.7-2.055-.607L3.36 2.768c-.467.047-.56.28-.374.466l1.473.974zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.84-.047.933-.56.933-1.167V6.354c0-.606-.233-.933-.746-.886l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.746 0-.933-.234-1.495-.933l-4.577-7.186v6.952l1.448.327s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279V9.16l-1.215-.14c-.093-.513.28-.886.747-.933l3.222-.187z"})})},{name:"Jira",description:"Sync tasks & issues",icon:u.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"h-6 w-6",children:u.jsx("path",{d:"M11.571 11.513H0a5.218 5.218 0 0 0 5.232 5.215h2.13v2.057A5.215 5.215 0 0 0 12.575 24V12.518a1.005 1.005 0 0 0-1.005-1.005zm5.723-5.756H5.736a5.215 5.215 0 0 0 5.215 5.214h2.129v2.058a5.218 5.218 0 0 0 5.215 5.214V6.758a1.001 1.001 0 0 0-1.001-1.001zM23.013 0H11.455a5.215 5.215 0 0 0 5.215 5.215h2.129v2.057A5.215 5.215 0 0 0 24.013 12.487V1.005A1.005 1.005 0 0 0 23.013 0z"})})},{name:"Slack",description:"Capture conversations",icon:u.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"h-6 w-6",children:u.jsx("path",{d:"M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z"})})},{name:"GitHub",description:"Repos, PRs & code",icon:u.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"h-6 w-6",children:u.jsx("path",{d:"M12 0C5.374 0 0 5.373 0 12c0 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.23A11.509 11.509 0 0 1 12 5.803c1.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.576C20.566 21.797 24 17.3 24 12c0-6.627-5.373-12-12-12z"})})}];function fU(){return u.jsx("section",{className:"py-24 px-6 border-t border-border",children:u.jsxs("div",{className:"max-w-[1100px] mx-auto",children:[u.jsxs(le.div,{initial:{opacity:0,y:12},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-80px"},transition:{duration:.5},className:"mb-14",children:[u.jsx("div",{className:"section-label mb-4",children:"Integrations"}),u.jsxs("h2",{className:"text-[36px] font-semibold tracking-tight leading-[1.1] text-foreground max-w-[480px] mb-4",children:["Connect your",u.jsx("br",{}),"sources."]}),u.jsx("p",{className:"text-[15px] text-muted-foreground max-w-[440px]",children:"SpecMe pulls context from the tools your team already uses. More integrations coming soon."})]}),u.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4 max-w-[720px] mb-10",children:dU.map((e,t)=>u.jsxs(le.div,{initial:{opacity:0,y:12},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-60px"},transition:{delay:t*.06,duration:.4},className:"float-card p-5 flex flex-col items-center text-center",children:[u.jsx("div",{className:"text-muted-foreground mb-3",children:e.icon}),u.jsx("h3",{className:"text-[14px] font-semibold mb-1",children:e.name}),u.jsx("p",{className:"text-[12px] text-muted-foreground",children:e.description})]},e.name))}),u.jsx(le.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-80px"},transition:{duration:.5,delay:.15},className:"rounded-xl border border-border overflow-hidden shadow-2xl",children:u.jsx("video",{src:"/connect-project.mp4",autoPlay:!0,loop:!0,muted:!0,playsInl
328ine:!0,className:"w-full h-auto"})})]})})}function hU(){return u.jsx("section",{className:"py-24 px-6 border-t border-border",children:u.jsx("div",{className:"max-w-[1100px] mx-auto",children:u.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-16 items-center",children:[u.jsxs(le.div,{initial:{opacity:0,y:12},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-80px"},transition:{duration:.5},children:[u.jsx("div",{className:"section-label mb-4",children:"Implementation"}),u.jsxs("h2",{className:"text-[36px] font-semibold tracking-tight leading-[1.1] text-foreground mb-5 max-w-[420px]",children:["From spec to",u.jsx("br",{}),"shipped code."]}),u.jsx("p",{className:"text-[15px] text-muted-foreground leading-relaxed max-w-[400px] mb-8",children:"SpecMe doesn't stop at the plan. Connect your GitHub repo and apply changes directly. Review diffs, commit, and push, all from within the app."}),u.jsx("div",{className:"space-y-5",children:[{title:"Visual Diffs",desc:"See exactly what changed. Review additions and deletions before applying."},{title:"Direct Apply",desc:"Apply generated changes to your codebase with one click. Undo anytime."},{title:"Commit & Push",desc:"Commit and push to GitHub directly from the SpecMe interface."}].map(e=>u.jsxs("div",{className:"border-l-2 border-border pl-4",children:[u.jsx("h3",{className:"text-[14px] font-semibold mb-1",children:e.title}),u.jsx("p",{className:"text-[13px] text-muted-foreground",children:e.desc})]},e.title))})]}),u.jsx(le.div,{initial:{opacity:0,y:16},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-60px"},transition:{delay:.1,duration:.5},children:u.jsx("div",{className:"surface-raised aspect-video relative overflow-hidden rounded-xl",style:{boxShadow:"0 0 60px rgba(56,142,246,0.08), 0 20px 60px rgba(0,0,0,0.3)"},children:u.jsx("video",{autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"w-full h-full object-cover",src:"/github-video.mp4"})})})]})})})}const pU=[{icon:vu,title:"Living Specs",desc:"Specs that evolve. Iterate on your plan with follow-up messages. The output updates in context."},{icon:LN,title:"Acceptance Criteria",desc:"Auto-generated structured acceptance criteria ready for your tickets and stories."},{icon:xN,title:"Context Synthesis",desc:"Combines codebase knowledge, PM feedback, and project context into coherent output."},{icon:AN,title:"Change Tracking",desc:"Every file change tracked. Visual diffs, full code views, and version history across iterations."},{icon:_S,title:"Run History",desc:"Every spec generation is saved. Revisit, compare, and build on past work."},{icon:ig,title:"PM + Eng Handoff",desc:"One tool for both sides. PMs describe intent, engineers get actionable files and rationale."}];function mU(){return u.jsx("section",{className:"py-24 px-6 border-t border-border",children:u.jsxs("div",{className:"max-w-[1100px] mx-auto",children:[u.jsxs(le.div,{initial:{opacity:0,y:12},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-80px"},transition:{duration:.5},className:"mb-14",children:[u.jsx("div",{className:"section-label mb-4",children:"Core features"}),u.jsxs("h2",{className:"text-[36px] font-semibold tracking-tight leading-[1.1] text-foreground max-w-[480px]",children:["Everything you need",u.jsx("br",{}),"to ship with clarity."]})]}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5",children:pU.map((e,t)=>u.jsxs(le.div,{initial:{opacity:0,y:10},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-40px"},transition:{delay:t*.05,duration:.35},className:"float-card p-5",children:[u.jsx(e.icon,{className:"h-4 w-4 text-muted-foreground mb-3"}),u.jsx("h3",{className:"text-[14px] font-semibold mb-1.5",children:e.title}),u.jsx("p",{className:"text-[13px] text-muted-foreground leading-relaxed",children:e.desc})]},e.title))})]})})}const gU=[{name:"Demo",price:"Free",period:"",description:"See SpecMe in action",features:["Live product walkthrough","See how specs are generated","Q&A with the team"],cta:"Join Waitlist",ctaLink:"waitlist",featured:!1,isDemo:!1},{name:"Starter",price:"$20",period:"seat / month",description:"For individual builders",features:["Core spec generation","Diff viewer","10 generations / month included","$2 per extra generation"],cta:"Start",ctaLink:"/login?mode=signup",featured:!1,isDemo:!1},{name:"Team",price:"$49",period:"seat / month",description:"For growing teams",features:["Everything in Starter","Multi-repo context","Team memory","PR hooks / apply-to-branch","60 generations / seat / month included","$1.50 per extra generation"],cta:"Start",ctaLink:"/login?mode=signup",featured:!0,isDemo:!1},{name:"Enterprise",price:"Custom",period:"annual contract",description:"For organizations at scale",features:[],cta:"Contact us",ctaLink:"contact",featured:!1,isDemo:!1}],yU=["Additional Repos","Usage-based Runs","Compliance Add-ons","Integration Marketplace"];function vU({open:e,onClose:t}){const[n,r]=m.useState(""),[s,i]=m.useState(""),[o,a]=m.useState("");
328if(!e)return null;const l=()=>{const c=encodeURIComponent(`Enterprise inquiry from ${n||"a visitor"}`),d=encodeURIComponent(`Name: ${n} 329Email: ${s} 330 331${o}`);window.open(`mailto:[email protected]?subject=${c}&body=${d}`,"_blank"),t(),r(""),i(""),a("")};return u.jsx(Du,{children:u.jsx(le.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm px-4",onClick:t,children:u.jsxs(le.div,{initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},transition:{duration:.2},className:"surface w-full max-w-[440px] p-6 relative",onClick:c=>c.stopPropagation(),children:[u.jsx("button",{type:"button",onClick:t,className:"absolute top-4 right-4 text-muted-foreground hover:text-foreground transition-colors",children:u.jsx(fd,{className:"h-4 w-4"})}),u.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[u.jsx(ep,{className:"h-4 w-4 text-primary"}),u.jsx("h3",{className:"text-[16px] font-semibold",children:"Contact us"})]}),u.jsx("p",{className:"text-[13px] text-muted-foreground mb-5",children:"Tell us about your team and we'll get back to you."}),u.jsxs("div",{className:"space-y-3 mb-5",children:[u.jsx("input",{type:"text",placeholder:"Your name",value:n,onChange:c=>r(c.target.value),className:"w-full h-9 px-3 text-[13px] rounded-lg border border-border bg-transparent text-foreground placeholder:text-muted-foreground/50 focus:outline-none focus:border-primary/40"}),u.jsx("input",{type:"email",placeholder:"Your email",value:s,onChange:c=>i(c.target.value),className:"w-full h-9 px-3 text-[13px] rounded-lg border border-border bg-transparent text-foreground placeholder:text-muted-foreground/50 focus:outline-none focus:border-primary/40"}),u.jsx("textarea",{placeholder:"How can we help?",value:o,onChange:c=>a(c.target.value),rows:4,className:"w-full px-3 py-2 text-[13px] rounded-lg border border-border bg-transparent text-foreground placeholder:text-muted-foreground/50 focus:outline-none focus:border-primary/40 resize-none"})]}),u.jsxs("button",{type:"button",onClick:l,className:"w-full flex items-center justify-center gap-2 h-9 text-[13px] font-medium rounded-lg bg-primary hover:bg-primary/90 text-primary-foreground transition-colors",children:[u.jsx(ES,{className:"h-3.5 w-3.5"}),"Send Email"]})]})})})}function wU(){const[e,t]=m.useState(!1),[n,r]=m.useState(!1);return u.jsxs("section",{className:"py-24 px-6 border-t border-border",children:[u.jsx(jl,{open:e,onClose:()=>t(!1)}),u.jsx(vU,{open:n,onClose:()=>r(!1)}),u.jsxs("div",{className:"max-w-[1200px] mx-auto",children:[u.jsxs(le.div,{initial:{opacity:0,y:12},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-80px"},transition:{duration:.5},className:"text-center mb-14",children:[u.jsx("div",{className:"section-label mb-4",children:"Pricing"}),u.jsx("h2",{className:"text-[36px] font-semibold tracking-tight leading-[1.1] text-foreground mb-3",children:"Simple, transparent pricing."}),u.jsx("p",{className:"text-[15px] text-muted-foreground max-w-[400px] mx-auto",children:"Simple per-seat SaaS with strong expansion levers"})]}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-12",children:gU.map((s,i)=>{const o=s.ctaLink.startsWith("mailto:"),a=s.ctaLink==="contact",l=s.ctaLink==="waitlist";return u.jsxs(le.div,{initial:{opacity:0,y:12},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-60px"},transition:{delay:i*.08,duration:.4},className:`surface p-6 relative flex flex-col ${s.featured?"border-primary/30 ring-1 ring-primary/20":""}`,style:s.featured?{boxShadow:"0 0 40px rgba(56,142,246,0.1), 0 8px 32px rgba(0,0,0,0.3)"}:{},children:[s.featured&&u.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2 bg-primary text-primary-foreground text-[10px] font-semibold px-3 py-1 rounded-full uppercase tracking-wider z-10",children:"Most Popular"}),u.jsx("div",{className:"section-label mb-2",children:s.name}),u.jsxs("div",{className:"flex items-baseline gap-1 mb-1",children:[u.jsx("span",{className:"text-[28px] font-semibold tracking-tight",children:s.price}),s.period&&u.jsxs("span",{className:"text-[13px] text-muted-foreground",children:["/ ",s.period]})]}),u.jsx("p",{className:"text-[13px] text-muted-foreground mb-5",children:s.description}),s.features.length>0&&u.jsx("ul",{className:"space-y-2.5 mb-6 flex-1",children:s.features.map(c=>u.jsxs("li",{className:"flex items-start gap-2 text-[13px] text-muted-foreground",children:[u.jsx(yu,{className:"h-3.5 w-3.5 text-accent mt-0.5 shrink-0"}),c]},c))}),s.features.length===0&&u.jsx("div",{className:"flex-1"}),a?u.jsxs("button",{type:"button",onClick:()=>r(!0),className:"mt-auto flex items-center justify-center gap-2 text-[13px] font-medium h-9 w-full rounded-lg transition-colors border border-border hover:border-white/[0.12] text-foreground",children:[u.jsx(ep,{className:"h-3.5 w-3.5"}),s.cta]}):o?u.jsxs("a",{href:s.ctaLink,className:"mt-auto flex items-center justify-center gap-2 text-[13px] font-medium h-9 rounded-lg transition-colors border border-border hover:border-white/[0.12] text-foreground",children:[u.jsx(ep,{className:"h-3.5 w-3.5"}),s.cta]}):l?u.jsx("button",{type:"button",onClick:()=>t(!0),className:"mt-auto block w-full text-center text-[13px] font-medium h-9 leading-9 rounded-lg transition-colors bg-primary hover:bg-primary/90 text-primary-foreground",children:s.cta}):u.jsx("button",{type:"button",onClick:()=>t(!0),className:`mt-auto block w-full text-center text-[13px] font-medium h-9 leading-9 rounded-lg transition-colors ${s.featured?"bg-primary hover:bg-primary/90 text-primary-foreground":"border border-border hover:border-white/[0.12] text-foreground"}`,children:"Join Waitlist"})]},s.name)})}),u.jsxs(le.div,{initial:{opacity:0}
331,whileInView:{opacity:1},viewport:{once:!0},transition:{duration:.4},className:"text-center",children:[u.jsx("div",{className:"section-label mb-3",children:"Expansion Levers"}),u.jsx("div",{className:"flex flex-wrap items-center justify-center gap-2",children:yU.map(s=>u.jsx("span",{className:"chip",children:s},s))})]})]})]})}var Rd="Collapsible",[xU,RE]=ur(Rd),[bU,ty]=xU(Rd),AE=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:i,onOpenChange:o,...a}=e,[l,c]=mi({prop:r,defaultProp:s??!1,onChange:o,caller:Rd});return u.jsx(bU,{scope:n,disabled:i,contentId:ps(),open:l,onOpenToggle:m.useCallback(()=>c(d=>!d),[c]),children:u.jsx(Ee.div,{"data-state":ry(l),"data-disabled":i?"":void 0,...a,ref:t})})});AE.displayName=Rd;var OE="CollapsibleTrigger",ME=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=ty(OE,n);return u.jsx(Ee.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":ry(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:ne(e.onClick,s.onOpenToggle)})});ME.displayName=OE;var ny="CollapsibleContent",IE=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=ty(ny,e.__scopeCollapsible);return u.jsx(Un,{present:n||s.open,children:({present:i})=>u.jsx(SU,{...r,ref:t,present:i})})});IE.displayName=ny;var SU=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...i}=e,o=ty(ny,n),[a,l]=m.useState(r),c=m.useRef(null),d=qe(t,c),f=m.useRef(0),h=f.current,p=m.useRef(0),v=p.current,g=o.open||a,b=m.useRef(g),w=m.useRef(void 0);return m.useEffect(()=>{const y=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(y)},[]),ar(()=>{const y=c.current;if(y){w.current=w.current||{transitionDuration:y.style.transitionDuration,animationName:y.style.animationName},y.style.transitionDuration="0s",y.style.animationName="none";const x=y.getBoundingClientRect();f.current=x.height,p.current=x.width,b.current||(y.style.transitionDuration=w.current.transitionDuration,y.style.animationName=w.current.animationName),l(r)}},[o.open,r]),u.jsx(Ee.div,{"data-state":ry(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!g,...i,ref:d,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...e.style},children:g&&s})});function ry(e){return e?"open":"closed"}var kU=AE,_U=ME,EU=IE,CU=m.createContext(void 0);function sy(e){const t=m.useContext(CU);return e||t||"ltr"}var Vn="Accordion",TU=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[iy,PU,jU]=ad(Vn),[Ad]=ur(Vn,[jU,RE]),oy=RE(),DE=U.forwardRef((e,t)=>{const{type:n,...r}=e,s=r,i=r;return u.jsx(iy.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?u.jsx(OU,{...i,ref:t}):u.jsx(AU,{...s,ref:t})})});DE.displayName=Vn;var[LE,NU]=Ad(Vn),[$E,RU]=Ad(Vn,{collapsible:!1}),AU=U.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:i=!1,...o}=e,[a,l]=mi({prop:n,defaultProp:r??"",onChange:s,caller:Vn});return u.jsx(LE,{scope:e.__scopeAccordion,value:U.useMemo(()=>a?[a]:[],[a]),onItemOpen:l,onItemClose:U.useCallback(()=>i&&l(""),[i,l]),children:u.jsx($E,{scope:e.__scopeAccordion,collapsible:i,children:u.jsx(FE,{...o,ref:t})})})}),OU=U.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...i}=e,[o,a]=mi({prop:n,defaultProp:r??[],onChange:s,caller:Vn}),l=U.useCallback(d=>a((f=[])=>[...f,d]),[a]),c=U.useCallback(d=>a((f=[])=>f.filter(h=>h!==d)),[a]);return u.jsx(LE,{scope:e.__scopeAccordion,value:o,onItemOpen:l,onItemClose:c,children:u.jsx($E,{scope:e.__scopeAccordion,collapsible:!0,children:u.jsx(FE,{...i,ref:t})})})}),[MU,Od]=Ad(Vn),FE=U.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:i="vertical",...o}=e,a=U.useRef(null),l=qe(a,t),c=PU(n),f=sy(s)==="ltr",h=ne(e.onKeyDown,p=>{var _;if(!TU.includes(p.key))return;const v=p.target,g=c().filter(j=>{var T;return!((T=j.ref.current)!=null&&T.disabled)}),b=g.findIndex(j=>j.ref.current===v),w=g.length;if(b===-1)return;p.preventDefault();let y=b;const x=0,S=w-1,k=()=>{y=b+1,y>S&&(y=x)},E=()=>{y=b-1,y<x&&(y=S)};switch(p.key){case"Home":y=x;break;case"End":y=S;break;case"ArrowRight":i==="horizontal"&&(f?k():E());break;case"ArrowDown":i==="vertical"&&k();break;case"ArrowLeft":i==="horizontal"&&(f?E():k());break;case"ArrowUp":i==="vertical"&&E();break}const C=y%w;(_=g[C].ref.current)==null||_.focus()});return u.jsx(MU,{scope:n,disabled:r,direction:s,orientation:i,children:u.jsx(iy.Slot,{scope:n,children:u.jsx(Ee.div,{...o,"data-orientation":i,ref:l,onKeyDown:r?void 0:h})})})}),$u="AccordionItem",[IU,ay]=Ad($u),UE=U.forwardRef((e,t)=>
331{const{__scopeAccordion:n,value:r,...s}=e,i=Od($u,n),o=NU($u,n),a=oy(n),l=ps(),c=r&&o.value.includes(r)||!1,d=i.disabled||e.disabled;return u.jsx(IU,{scope:n,open:c,disabled:d,triggerId:l,children:u.jsx(kU,{"data-orientation":i.orientation,"data-state":qE(c),...a,...s,ref:t,disabled:d,open:c,onOpenChange:f=>{f?o.onItemOpen(r):o.onItemClose(r)}})})});UE.displayName=$u;var VE="AccordionHeader",BE=U.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=Od(Vn,n),i=ay(VE,n);return u.jsx(Ee.h3,{"data-orientation":s.orientation,"data-state":qE(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:t})});BE.displayName=VE;var Qp="AccordionTrigger",zE=U.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=Od(Vn,n),i=ay(Qp,n),o=RU(Qp,n),a=oy(n);return u.jsx(iy.ItemSlot,{scope:n,children:u.jsx(_U,{"aria-disabled":i.open&&!o.collapsible||void 0,"data-orientation":s.orientation,id:i.triggerId,...a,...r,ref:t})})});zE.displayName=Qp;var WE="AccordionContent",HE=U.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=Od(Vn,n),i=ay(WE,n),o=oy(n);return u.jsx(EU,{role:"region","aria-labelledby":i.triggerId,"data-orientation":s.orientation,...o,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});HE.displayName=WE;function qE(e){return e?"open":"closed"}var DU=DE,LU=UE,$U=BE,KE=zE,GE=HE;const FU=DU,YE=m.forwardRef(({className:e,...t},n)=>u.jsx(LU,{ref:n,className:Re("border-b",e),...t}));YE.displayName="AccordionItem";const JE=m.forwardRef(({className:e,children:t,...n},r)=>u.jsx($U,{className:"flex",children:u.jsxs(KE,{ref:r,className:Re("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,u.jsx(kS,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));JE.displayName=KE.displayName;const QE=m.forwardRef(({className:e,children:t,...n},r)=>u.jsx(GE,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:u.jsx("div",{className:Re("pb-4 pt-0",e),children:t})}));QE.displayName=GE.displayName;const UU=[{q:"What is SpecMe?",a:"SpecMe is an AI copilot that turns messy PM feedback, customer calls, and stakeholder notes into structured, engineering-ready implementation specs with exact files to change, acceptance criteria, and technical rationale."},{q:"How does SpecMe analyze my codebase?",a:"You connect a GitHub repository or local project folder. SpecMe indexes the codebase to understand your project structure, then uses that context when generating implementation plans."},{q:"What kind of inputs does SpecMe accept?",a:"Anything: call transcripts, Slack threads, Jira tickets, PM notes, customer emails, or free-form descriptions of what you want to change. SpecMe synthesizes all of it."},{q:"Can I apply changes directly to my codebase?",a:"Yes. SpecMe generates file-level changes that you can review, apply, undo, and push to GitHub, all from within the app."},{q:"Is my code sent to external servers?",a:"SpecMe uses AI services to generate specs. Your code
331context is sent to the configured AI provider for analysis. Self-hosting options give you full control over data flow."},{q:"Can I iterate on a generated spec?",a:"Yes. Every run supports a conversation thread. Send follow-up messages to refine, adjust, or expand the spec. The output updates in context."}];function VU(){const[e,t]=m.useState(!1),n=sU();return u.jsxs(u.Fragment,{children:[u.jsx("section",{className:"py-24 px-6 border-t border-border",children:u.jsxs("div",{className:"max-w-[720px] mx-auto",children:[u.jsx(le.div,{initial:{opacity:0,y:12},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-80px"},transition:{duration:.5},className:"mb-10",children:u.jsxs("h2",{className:"text-[36px] font-semibold tracking-tight leading-[1.1] text-foreground",children:["Frequently asked",u.jsx("br",{}),"questions."]})}),u.jsx(FU,{type:"single",collapsible:!0,className:"space-y-0",children:UU.map((r,s)=>u.jsx(le.div,{initial:{opacity:0},whileInView:{opacity:1},viewport:{once:!0},transition:{delay:s*.04,duration:.3},children:u.jsxs(YE,{value:`faq-${s}`,className:"border-b border-border py-1",children:[u.jsx(JE,{className:"text-[14px] font-medium text-foreground hover:no-underline py-4",children:r.q}),u.jsx(QE,{className:"text-[13px] text-muted-foreground leading-relaxed pb-4",children:r.a})]})},s))})]})}),u.jsx("section",{className:"py-24 px-6 border-t border-border",children:u.jsx("div",{className:"max-w-[720px] mx-auto text-center",children:u.jsxs(le.div,{initial:{opacity:0,y:12},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-80px"},transition:{duration:.5},children:[u.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-full bg-primary/8 border border-primary/15 mb-6",children:[u.jsx(ig,{className:"h-3.5 w-3.5 text-primary"}),u.jsxs("span",{className:"text-[13px] text-primary font-semibold",children:[n," ",n===1?"person":"people"," on the waitlist"]})]}),u.jsx("h2",{className:"text-[36px] font-semibold tracking-tight leading-[1.1] text-foreground mb-4",children:"Be the first to try SpecMe."}),u.jsx("p",{className:"text-[15px] text-muted-foreground mb-8 max-w-[400px] mx-auto",children:"We're launching soon. Join the waitlist to get early access when we open the doors."}),u.jsx("button",{onClick:()=>t(!0),className:"inline-flex items-center gap-2 bg-primary hover:bg-primary/90 text-primary-foreground text-[14px] font-medium px-8 h-11 rounded-lg transition-colors",children:"Join Waitlist"})]})})}),u.jsx("footer",{className:"py-8 px-6 border-t border-border",children:u.jsxs("div",{className:"max-w-[1100px] mx-auto flex items-center justify-between",children:[u.jsx("span",{className:"text-[13px] text-muted-foreground",children:"SpecMe"}),u.jsx("span",{className:"text-[11px] text-muted-foreground/50",children:"AI-native spec generation workspace"})]})}),u.jsx(jl,{open:e,onClose:()=>t(!1)})]})}function BU(){return u.jsxs("div",{className:"min-h-screen bg-background text-foreground noise-overlay relative",children:[u.jsxs("div",{className:"fixed inset-0 pointer-events-none",children:[u.jsx("div",{className:"absolute top-[-10%] left-[30%] w-[700px] h-[600px] bg-primary/[0.04] rounded-full blur-[160px]"}),u.jsx("div",{className:"absolute top-[40%] right-[10%] w-[500px] h-[400px] bg-accent/[0.025] rounded-full blur-[120px]"}),u.jsx("div",{className:"absolute bottom-[10%] left-[15%] w-[400px] h-[400px] bg-violet-600/[0.02] rounded-full blur-[130px]"}),u.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(ellipse_80%_80%_at_50%_50%,transparent_40%,hsl(225,25%,5%)_100%)]"})]}),u.jsxs("div",{className:"relative z-10",children:[u.jsx(iU,{}),u.jsx(oU,{}),u.jsx(lU,{}),u.jsx(uU,{}),u.jsx(fU,{}),u.jsx(hU,{}),u.jsx(mU,{}),u.jsx(wU,{}),u.jsx(VU,{})]})]})}function zU(){const{user:e,loading:t}=Ts(),n=hr();return m.useEffect(()=>{!t&&e&&n("/dashboard",{replace:!0})},[e,t,n]),t?u.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:u.jsxs("div",{className:"flex flex-col items-center gap-3",children:[u.jsx("span",{className:"text-[15px] font-semibold tracking-tight text-foreground",children:"SpecMe"}),u.jsx(Pt,{className:"h-4 w-4 animate-spin text-muted-foreground"})]})}):e?null:u.jsx(BU,{})}var WU=Symbol.for("react.lazy"),Fu=Hu[" use ".trim().toString()];function HU(e){return typeof e=="object"&&e!==null&&"then"in e}function XE(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===WU&&"_payload"in e&&HU(e._payload)}function ZE(e){const t=KU(e),n=m.forwardRef((r,s)=>{let{children:i,...o}=r;XE(i)&&typeof Fu=="function"&&(i=Fu(i._payload));const a=m.Children.toArray(i),l=a.find(YU);if(l){const c=l.props.children,d=a.map(f=>f===l?m.Children.count(c)>1?m.Children.only(null):m.isValidElement(c)?c.props.children:null:f);return u.jsx(t,{...o,ref:s,children:m.isValidElement(c)?m.cloneElement(c,void 0,d):null})}return u.jsx(t,{...o,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}var qU=ZE("Slot");function KU(e){const t=m.forwardRef((n,r)=>{let{children:s,...i}=n;
331if(XE(s)&&typeof Fu=="function"&&(s=Fu(s._payload)),m.isValidElement(s)){const o=QU(s),a=JU(i,s.props);return s.type!==m.Fragment&&(a.ref=r?Es(r,o):o),m.cloneElement(s,a)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var GU=Symbol("radix.slottable");function YU(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===GU}function JU(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...a)=>{const l=i(...a);return s(...a),l}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function QU(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const XU=sg("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"}}),oe=m.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...s},i)=>{const o=r?qU:"button";return u.jsx(o,{className:Re(XU({variant:t,size:n,className:e})),ref:i,...s})});oe.displayName="Button";const Tt=m.forwardRef(({className:e,type:t,...n},r)=>u.jsx("input",{type:t,className:Re("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:r,...n}));Tt.displayName="Input";var ZU=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],eV=ZU.reduce((e,t)=>{const n=ZE(`Primitive.${t}`),r=m.forwardRef((s,i)=>{const{asChild:o,...a}=s,l=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),tV="Label",eC=m.forwardRef((e,t)=>u.jsx(eV.label,{...e,ref:t,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=e.onMouseDown)==null||s.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));eC.displayName=tV;var tC=eC;const nV=sg("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),tt=m.forwardRef(({className:e,...t},n)=>u.jsx(tC,{ref:n,className:Re(nV(),e),...t}));tt.displayName=tC.displayName;function ly({size:e=64,className:t="",mood:n="idle"}){const r=n==="running"||n==="eating";return u.jsx(le.div,{animate:r?{y:[0,-8,0],rotate:[0,4,-4,0]}:{y:[0,-3,0]},transition:r?{duration:.5,repeat:1/0,ease:"easeInOut"}:{duration:3,repeat:1/0,ease:"easeInOut"},className:t,style:{filter:"drop-shadow(0 4px 12px rgba(56,142,246,0.15))"},children:u.jsxs("svg",{width:e,height:e,viewBox:"0 0 80 80",fill:"none",children:[u.jsx("rect",{x:"12",y:"18",width:"56",height:"46",rx:"16",fill:"url(#bodyGrad)",stroke:"hsl(213,94%,56%)",strokeWidth:"1",strokeOpacity:"0.3"}),u.jsx("rect",{x:"16",y:"22",width:"48",height:"38",rx:"12",fill:"hsl(225,22%,7%)"}),u.jsx(le.circle,{cx:"31",cy:"37",r:n==="eating"?3.5:4.5,fill:"hsl(213,94%,56%)",animate:n==="thinking"?{scaleY:[1,.15,1]}:n==="happy"?{scaleY:.4}:{scaleY:1},transition:{duration:n==="thinking"?1.2:.3,repeat:n==="thinking"?1/0:0}}),u.jsx(le.circle,{cx:"49",cy:"37",r:n==="eating"?3.5:4.5,fill:"hsl(213,94%,56%)",animate:n==="thinking"?{scaleY:[1,.15,1]}:n==="happy"?{scaleY:.4}:{scaleY:1},transition:{duration:n==="thinking"?1.2:.3,repeat:n==="thinking"?1/0:0,delay:.08}}),n==="eating"?u.jsx(le.ellipse,{cx:"40",cy:"50",rx:"8",fill:"hsl(225,22%,4%)",stroke:"hsl(213,94%,56%)",strokeWidth:"0.8",strokeOpacity:"0.3",animate:{ry:[3,7,3]},transition:{duration:.4,repeat:1/0}}):n==="happy"||n==="running"?u.jsx("path",{d:"M33 49 Q40 55 47 49",stroke:"hsl(172,66%,50%)",strokeWidth:"1.5",strokeLinecap:"round",fill:"none"}):u.jsx("line",{x1:"35",y1:"49",x2:"45",y2:"49",stroke:"hsl(218,14%,28%)",strokeWidth:"1.5",strokeLinecap:"round"}),u.jsx(le.line,{x1:"40",y1:"18",x2:"40",y2:"9",stroke:"hsl(213,94%,56%)",strokeWidth:"1.5",strokeLinecap:"round",strokeOpacity:"0.35",animate:{y2:[9,7,9]},transition:{duration:2,repeat:1/0}}),u.jsx(le.circle,{cx:"40",cy:"7",r:"3.5",fill:"hsl(172,66%,50%)",animate:{o
331pacity:[.4,1,.4],scale:[.9,1.2,.9]},transition:{duration:2,repeat:1/0}}),r&&u.jsxs(u.Fragment,{children:[u.jsx(le.line,{x1:"28",y1:"64",x2:"24",y2:"72",stroke:"hsl(213,94%,56%)",strokeWidth:"2",strokeLinecap:"round",strokeOpacity:"0.4",animate:{x2:[24,20,24],y2:[72,68,72]},transition:{duration:.3,repeat:1/0}}),u.jsx(le.line,{x1:"52",y1:"64",x2:"56",y2:"72",stroke:"hsl(213,94%,56%)",strokeWidth:"2",strokeLinecap:"round",strokeOpacity:"0.4",animate:{x2:[56,60,56],y2:[72,68,72]},transition:{duration:.3,repeat:1/0,delay:.15}})]}),u.jsx("defs",{children:u.jsxs("linearGradient",{id:"bodyGrad",x1:"12",y1:"18",x2:"68",y2:"64",gradientUnits:"userSpaceOnUse",children:[u.jsx("stop",{stopColor:"hsl(225,22%,12%)"}),u.jsx("stop",{offset:"1",stopColor:"hsl(225,22%,8%)"})]})})]})})}const mc=[{label:"Jira",text:"PROD-423: Fix onboarding",color:"hsl(213,94%,56%)"},{label:"Slack",text:"#eng: can we ship this?",color:"hsl(172,66%,50%)"},{label:"Notion",text:"Q3 roadmap feedback",color:"hsl(35,85%,55%)"},{label:"PM",text:"Users want bulk export",color:"hsl(280,55%,60%)"},{label:"Call",text:"API rate limits noted",color:"hsl(350,65%,55%)"},{label:"Email",text:"Client needs SSO",color:"hsl(45,80%,55%)"}],lx=["Acceptance Criteria","Files to Change","Technical Rationale","Risk Assessment"];function cy({className:e="",compact:t=!1,fullPage:n=!1}){const[r,s]=m.useState([]),[i,o]=m.useState([]),[a,l]=m.useState({x:50,y:50}),[c,d]=m.useState(0),[f,h]=m.useState(0),p=t?[{x:5,y:8},{x:35,y:5},{x:65,y:10},{x:8,y:55},{x:40,y:58},{x:68,y:52}]:[{x:3,y:5},{x:28,y:3},{x:55,y:8},{x:5,y:50},{x:30,y:55},{x:58,y:48}],v=m.useCallback(b=>{if(b<p.length){const w=p[b];l({x:w.x+5,y:w.y})}},[p]);m.useEffect(()=>{const b=setInterval(()=>{s(w=>{if(w.length>=mc.length)return setTimeout(()=>{s([]),o([]),d(0),l({x:50,y:50}),h(x=>x+1)},3500),w;const y=w.length;return v(y),d(y),y>=2&&i.length<lx.length&&setTimeout(()=>o(x=>[...x,x.length]),500),[...w,y]})},2e3);return()=>clearInterval(b)},[f,i.length,v]);const g=t?220:n?360:300;return u.jsxs("div",{className:`relative overflow-hidden ${e}`,style:{height:g},children:[u.jsx(Du,{children:mc.map((b,w)=>{const y=r.includes(w),x=p[w],S=c===w&&!y;return y?u.jsx(le.div,{initial:{opacity:1,scale:1},animate:{opacity:0,scale:2},transition:{duration:.5},className:"absolute",style:{left:`${x.x+3}%`,top:`${x.y+2}%`},children:u.jsx("div",{className:"w-3 h-3 rounded-full",style:{background:b.color,filter:"blur(4px)"}})},`${f}-particle-${w}`):u.jsx(le.div,{initial:{opacity:0,scale:.6},animate:{opacity:S?[1,.7,1]:.85,scale:S?[1,.95,1]:1,x:`${x.x}%`,y:`${x.y}%`},exit:{opacity:0,scale:0,transition:{duration:.3,ease:"easeIn"}},transition:{opacity:{duration:.4},scale:{duration:S?.5:.4,repeat:S?1/0:0},x:{duration:.3},y:{duration:.3}},className:"absolute",style:{animation:`drift ${6+w*.8}s ease-in-out infinite`,animationDelay:`${w*.4}s`},children:u.jsxs("div",{className:"bg-card/90 border border-border rounded-lg px-2.5 py-1.5 shadow-lg backdrop-blur-sm",style:{boxShadow:`0 0 12px ${b.color}15, 0 4px 12px rgba(0,0,0,0.3)`},children:[u.jsx("div",{className:"text-[9px] font-semibold mb-0.5",style:{color:b.color},children:b.label}),u.jsx("div",{className:"text-[10px] text-foreground/60 whitespace-nowrap",children:b.text})]})},`${f}-input-${w}`)})}),u.jsx(le.div,{className:"absolute z-10",animate:{left:`${a.x}%`,top:`${a.y}%`},transition:{duration:.8,ease:[.25,.46,.45,.94]},style:{transform:"translate(-50%, -50%)"},children:u.jsx(ly,{size:t?52:68,mood:r.length>0&&r.length<mc.length?"eating":r.length>=mc.length?"happy":"idle"})}),u.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 space-y-2 z-20",children:u.jsx(Du,{children:i.map(b=>u.jsx(le.div,{initial:{opacity:0,x:30,scale:.8},animate:{opacity:1,x:0,scale:1},transition:{duration:.5,ease:[.22,1,.36,1]},className:"bg-card border border-primary/25 rounded-lg px-3 py-2",style:{boxShadow:"0 0 20px rgba(56,142,246,0.08)"},children:u.jsx("div",{className:"text-[10px] font-semibold text-primary",children:lx[b]})},`${f}-output-${b}`))})})]})}function rV(){const e=hr(),[t]=kg(),n=t.get("mode")==="signup"?"signup":"signin",[r,s]=m.useState(n),[i,o]=m.useState(""),[a,l]=m.useState(""),[c,d]=m.useState(""),[f,h]=m.useState(""),[p,v]=m.useState(!1),[g,b]=m.useState(null),[w,y]=m.useState(!1),[x,S]=m.useState(!1);m.useEffect(()=>{S(!1),b(null)},[r]);const k=async()=>{v(!0),b(null);try{const{error:_}=await Ve.auth.signInWithOAuth({provider:"google",options:{redirectTo:`${window.location.origin}/dashboard`}});if(_)throw _}catch(_){b(_ instanceof Error?_.message:"Google sign-in failed"),v(!1)}},E=async _=>{var j,T,I,M;_.preventDefault(),v(!0),b(null);try{if(r==="signin"){const{error:H}=await Ve.auth.signInWithPassword({email:c,password:f});if(H)throw H;const{data:D}=await Ve.auth.getUser(),G=((j=D.user)==null?void 0:j.user_metadata)||{};if(!(!!((T=G.full_name)!=null&&T.trim())||!!((I=G.first_name)!=null&&I.trim())&&!!((M=G.last_name)!=null&&M.trim()))){S(!0);return}e("/dashboard")}else{v(!1),y(!0);return}}catch(H){b(H instanceof Error?H.message:"Authentication failed")}finally{v(!1)}},C=async()=>{const _=i.trim(),j=a.trim();if(!_||!j){b("Please enter your first and last name.");return}v(!0),b(null);try{const{error:T}=await Ve.auth.updateUser({data:{first_name:_,last_name:j,full_name:`${_} ${j}`}});if(T)throw T;e("/dashboard")}catch(T){b(T instanceof Error?T.message:"Failed to save profile")}finally{v(!1)}};return u.jsxs("div",{className:"min-h-screen bg-background flex relative overflow-hidden noise-overlay",children:[u.jsxs("div",{className:"fixed inset-0 pointer-events-none",children:[u.jsx("div",{className:"absolute top-[15%] left-[20%] w-[500px] h-[500px] bg-primary/[0.04] rounded-full blur-[150px]"}),u.jsx("div",{className:"absolute bottom-[20%] right-[15%] w-[400px] h-[400px] bg-accent/[0.03] rounded-full blur-[120px]"})]}),u.jsxs("div",{className:"hidden lg:flex lg:w-[55%] relative flex-col",children:[u.jsx("div",{className:"relative z-10 px-8 pt-6 flex items-center justify-between",children:u.jsx(yt,{to:"/",className:"text-[15px] font-semibold tracking-tight text-foreground",children:"SpecMe"})}),u.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center relative px-12",children:[u.jsx("div",{className:"absolute inset-0 opacity-[0.02]",style:{backgroundImage:"linear-gradient(rgba(255,255,255,0.2) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.2) 1px, transparent 1px)",backgroundSize:"48px 48px"}}),r==="signup"?u.jsxs(le.div,{initial:{opacity:0}
331,animate:{opacity:1},transition:{duration:.5},className:"relative z-10 w-full max-w-[500px]",children:[u.jsxs("div",{className:"mb-6 space-y-4",children:[u.jsxs("p",{className:"text-[15px] text-foreground/80 leading-[1.7]",children:["Product managers spend ",u.jsx("span",{className:"highlight-number",children:"20 hours a week"})," playing telephone, reading Slack threads, decoding stakeholder asks, rewriting the same context into Jira tickets that engineers still ping them about."]}),u.jsxs("p",{className:"text-[15px] text-foreground/80 leading-[1.7]",children:["That's ",u.jsx("span",{className:"highlight-number",children:"$39,000 per PM per year"})," burned on being a human router. We're guessing that's not the line item you pitched investors on."]}),u.jsxs("p",{className:"text-[15px] text-foreground/90 leading-[1.7] font-medium",children:["SpecMe collapses that entire mess into engineer-ready specs in ",u.jsx("span",{className:"text-gradient font-bold",children:"under a minute"})," and for a fraction of the cost."]})]}),u.jsx("div",{className:"surface-raised rounded-xl overflow-hidden",children:u.jsx(cy,{fullPage:!0})})]},"signup-scene"):u.jsxs(le.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.6},className:"relative z-10 max-w-[420px]",children:[u.jsxs("h1",{className:"text-[40px] font-bold tracking-tight leading-[1.08] mb-5",children:["Stop being the",u.jsx("br",{}),u.jsx("span",{className:"text-gradient",children:"human router."})]}),u.jsx("p",{className:"text-[15px] text-muted-foreground leading-relaxed",children:"Paste feedback, get a production-ready implementation plan with exact files to change. In seconds."})]},"signin-scene")]})]}),u.jsx("div",{className:"flex-1 flex items-center justify-center relative",children:u.jsxs(le.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.4,delay:.1},className:"relative w-full max-w-[380px] mx-6",children:[u.jsxs("div",{className:"flex flex-col items-center mb-10 lg:hidden",children:[u.jsx(yt,{to:"/",className:"text-lg font-semibold tracking-tight",children:"SpecMe"}),u.jsx("p",{className:"text-[13px] text-muted-foreground mt-1",children:"AI-native spec generation"})]}),u.jsxs("div",{className:"hidden lg:block mb-6",children:[u.jsx("h2",{className:"text-xl font-semibold tracking-tight mb-1.5",children:r==="signin"?"Welcome back":"Create an account"}),u.jsx("p",{className:"text-[13px] text-muted-foreground",children:r==="signin"?"Sign in to your workspace":"Get started with SpecMe"})]}),!x&&u.jsxs("div",{className:"mb-4",children:[u.jsxs("button",{type:"button",onClick:k,disabled:p,className:"w-full h-10 rounded-lg border border-border bg-card hover:bg-white/[0.04] transition-colors flex items-center justify-center gap-2.5 text-[13px] font-medium text-foreground",children:[u.jsxs("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",children:[u.jsx("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z"}),u.jsx("path",{fill:"#34A853",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:"#FBBC05",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:"#EA4335",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("div",{className:"relative my-4",children:[u.jsx("div",{className:"absolute inset-0 flex items-center",children:u.jsx("div",{className:"w-full border-t border-border"})}),u.jsx("div",{className:"relative flex justify-center text-[11px]",children:u.jsx("span",{className:"bg-background px-3 text-muted-foreground",children:"or continue with email"})})]})]}),u.jsxs(le.form,{initial:{opacity:0}
331,animate:{opacity:1},transition:{duration:.25},onSubmit:E,className:"space-y-4",children:[(r==="signup"||x)&&u.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(tt,{htmlFor:"first_name",className:"text-[12px] text-muted-foreground",children:"First name"}),u.jsx(Tt,{id:"first_name",type:"text",required:!0,value:i,onChange:_=>o(_.target.value),className:"premium-input",placeholder:"First"})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(tt,{htmlFor:"last_name",className:"text-[12px] text-muted-foreground",children:"Last name"}),u.jsx(Tt,{id:"last_name",type:"text",required:!0,value:a,onChange:_=>l(_.target.value),className:"premium-input",placeholder:"Last"})]})]}),!x&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(tt,{htmlFor:"email",className:"text-[12px] text-muted-foreground",children:"Email"}),u.jsx(Tt,{id:"email",type:"email",required:!0,value:c,onChange:_=>d(_.target.value),className:"premium-input",placeholder:"[email protected]"})]}),u.jsxs("div",{className:"space-y-1.5",children:[u.jsx(tt,{htmlFor:"password",className:"text-[12px] text-muted-foreground",children:"Password"}),u.jsx(Tt,{id:"password",type:"password",required:!0,value:f,onChange:_=>h(_.target.value),className:"premium-input",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢"})]})]}),x&&u.jsx("div",{className:"text-[13px] text-muted-foreground bg-card p-3 rounded-lg border border-border",children:"One-time setup: add your name so we can personalize your dashboard."}),g&&u.jsx("div",{className:"text-[13px] text-red-400 bg-red-500/8 p-3 rounded-lg border border-red-500/15",children:g}),x?u.jsxs(oe,{type:"button",onClick:C,disabled:p,className:"w-full h-10 rounded-lg bg-primary hover:bg-primary/90 border-0 text-[13px] font-medium",children:[p&&u.jsx(Pt,{className:"mr-2 h-3.5 w-3.5 animate-spin"}),"Continue"]}):u.jsxs(oe,{type:"submit",disabled:p,className:"w-full h-10 rounded-lg bg-primary hover:bg-primary/90 border-0 text-[13px] font-medium",children:[p&&u.jsx(Pt,{className:"mr-2 h-3.5 w-3.5 animate-spin"}),r==="signin"?"Sign in":"Create account"]})]},r),!x&&u.jsx("div",{className:"mt-6 text-center text-[13px] text-muted-foreground",children:r==="signin"?u.jsxs(u.Fragment,{children:["Don't have an account?"," ",u.jsx("button",{type:"button",onClick:()=>{s("signup"),b(null)},className:"text-foreground hover:underline font-medium",children:"Sign up"})]}):u.jsxs(u.Fragment,{children:["Already have an account?"," ",u.jsx("button",{type:"button",onClick:()=>{s("signin"),b(null)},className:"text-foreground hover:underline font-medium",children:"Sign in"})]})})]})}),u.jsx(jl,{open:w,onClose:()=>{y(!1),s("signin")}})]})}var Kf=0;function nC(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??cx()),document.body.insertAdjacentElement("beforeend",e[1]??cx()),Kf++,()=>{Kf===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Kf--}},[])}function cx(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Gf="focusScope.autoFocusOnMount",Yf="focusScope.autoFocusOnUnmount",ux={bubbles:!1,cancelable:!0},sV="FocusScope",uy=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...o}=e,[a,l]=m.useState(null),c=tn(s),d=tn(i),f=m.useRef(null),h=qe(t,g=>l(g)),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let g=function(x){if(p.paused||!a)return;const S=x.target;a.contains(S)?f.current=S:zr(f.current,{select:!0})},b=function(x){if(p.paused||!a)return;const S=x.relatedTarget;S!==null&&(a.contains(S)||zr(f.current,{select:!0}))},w=function(x){if(document.activeElement===document.body)for(const k of x)k.removedNodes.length>0&&zr(a)};document.addEventListener("focusin",g),document.addEventListener("focusout",b);const y=new MutationObserver(w);return a&&y.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",b),y.disconnect()}}},[r,a,p.paused]),m.useEffect(()=>{if(a){fx.add(p);const g=document.activeElement;if(!a.contains(g)){const w=new CustomEvent(Gf,ux);a.addEventListener(Gf,c),a.dispatchEvent(w),w.defaultPrevented||(iV(uV(rC(a)),{select:!0}),document.activeElement===g&&zr(a))}return()=>{a.removeEventListener(Gf,c),setTimeout(()=>{const w=new CustomEvent(Yf,ux);a.addEventListener(Yf,d),a.dispatchEvent(w),w.defaultPrevented||zr(g??document.body,{select:!0}),a.removeEventListener(Yf,d),fx.remove(p)}
vendor: 8,760 bytes, line 331
331,0)}}},[a,c,d,p]);const v=m.useCallback(g=>{if(!n&&!r||p.paused)return;const b=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,w=document.activeElement;if(b&&w){const y=g.currentTarget,[x,S]=oV(y);x&&S?!g.shiftKey&&w===S?(g.preventDefault(),n&&zr(x,{select:!0})):g.shiftKey&&w===x&&(g.preventDefault(),n&&zr(S,{select:!0})):w===y&&g.preventDefault()}},[n,r,p.paused]);return u.jsx(Ee.div,{tabIndex:-1,...o,ref:h,onKeyDown:v})});uy.displayName=sV;function iV(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(zr(r,{select:t}),document.activeElement!==n)return}function oV(e){const t=rC(e),n=dx(t,e),r=dx(t.reverse(),e);return[n,r]}function rC(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function dx(e,t){for(const n of e)if(!aV(n,{upTo:t}))return n}function aV(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 lV(e){return e instanceof HTMLInputElement&&"select"in e}function zr(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&lV(e)&&t&&e.select()}}var fx=cV();function cV(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=hx(e,t),e.unshift(t)},remove(t){var n;e=hx(e,t),(n=e[0])==null||n.resume()}}}function hx(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function uV(e){return e.filter(t=>t.tagName!=="A")}var Jf="rovingFocusGroup.onEntryFocus",dV={bubbles:!1,cancelable:!0},Nl="RovingFocusGroup",[Xp,sC,fV]=ad(Nl),[hV,iC]=ur(Nl,[fV]),[pV,mV]=hV(Nl),oC=m.forwardRef((e,t)=>u.jsx(Xp.Provider,{scope:e.__scopeRovingFocusGroup,children:u.jsx(Xp.Slot,{scope:e.__scopeRovingFocusGroup,children:u.jsx(gV,{...e,ref:t})})}));oC.displayName=Nl;var gV=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:d=!1,...f}=e,h=m.useRef(null),p=qe(t,h),v=sy(i),[g,b]=mi({prop:o,defaultProp:a??null,onChange:l,caller:Nl}),[w,y]=m.useState(!1),x=tn(c),S=sC(n),k=m.useRef(!1),[E,C]=m.useState(0);return m.useEffect(()=>{const _=h.current;if(_)return _.addEventListener(Jf,x),()=>_.removeEventListener(Jf,x)},[x]),u.jsx(pV,{scope:n,orientation:r,dir:v,loop:s,currentTabStopId:g,onItemFocus:m.useCallback(_=>b(_),[b]),onItemShiftTab:m.useCallback(()=>y(!0),[]),onFocusableItemAdd:m.useCallback(()=>C(_=>_+1),[]),onFocusableItemRemove:m.useCallback(()=>C(_=>_-1),[]),children:u.jsx(Ee.div,{tabIndex:w||E===0?-1:0,"data-orientation":r,...f,ref:p,style:{outline:"none",...e.style},onMouseDown:ne(e.onMouseDown,()=>{k.current=!0}),onFocus:ne(e.onFocus,_=>{const j=!k.current;if(_.target===_.currentTarget&&j&&!w){const T=new CustomEvent(Jf,dV);if(_.currentTarget.dispatchEvent(T),!T.defaultPrevented){const I=S().filter(L=>L.focusable),M=I.find(L=>L.active),H=I.find(L=>L.id===g),G=[M,H,...I].filter(Boolean).map(L=>L.ref.current);cC(G,d)}}k.current=!1}),onBlur:ne(e.onBlur,()=>y(!1))})})}),aC="RovingFocusGroupItem",lC=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:i,children:o,...a}=e,l=ps(),c=i||l,d=mV(aC,n),f=d.currentTabStopId===c,h=sC(n),{onFocusableItemAdd:p,onFocusableItemRemove:v,currentTabStopId:g}=d;return m.useEffect(()=>{if(r)return p(),()=>v()},[r,p,v]),u.jsx(Xp.ItemSlot,{scope:n,id:c,focusable:r,active:s,children:u.jsx(Ee.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...a,ref:t,onMouseDown:ne(e.onMouseDown,b=>{r?d.onItemFocus(c):b.preventDefault()}),onFocus:ne(e.onFocus,()=>d.onItemFocus(c)),onKeyDown:ne(e.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){d.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const w=wV(b,d.orientation,d.dir);if(w!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let x=h().filter(S=>S.focusable).map(S=>S.ref.current);if(w==="last")x.reverse();else if(w==="prev"||w==="next"){w==="prev"&&x.reverse();const S=x.indexOf(b.currentTarget);x=d.loop?xV(x,S+1):x.slice(S+1)}setTimeout(()=>cC(x))}}),children:typeof o=="function"?o({isCurrentTabStop:f,hasTabStop:g!=null}):o})})});lC.displayName=aC;var yV={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function vV(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function wV(e,t,n){const r=vV(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return yV[r]}function cC(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function xV(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var bV=oC,SV=lC;function kV(e){const t=_V(e),n=m.forwardRef((r,s)=>{const{children:i,...o}=r,a=m.Children.toArray(i),l=a.find(CV);if(l){const c=l.props.children,d=a.map(f=>f===l?m.Children.count(c)>1?m.Children.only(null):m.isValidElement(c)?c.props.children:null:f);return u.jsx(t,{...o,ref:s,children:m.isValidElement(c)?m.cloneElement(c,void 0,d):null})}return u.jsx(t,{...o,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function _V(e){const t=m.forwardRef((n,r)=>{const{children:s,...i}=n;if(m.isValidElement(s)){const o=PV(s),a=TV(i,s.props);return s.type!==m.Fragment&&(a.ref=r?Es(r,o):o),m.cloneElement(s,a)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var EV=Symbol("radix.slottable");function CV(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===EV}function TV(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...a)=>{const l=i(...a);return s(...a),l}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function PV(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var jV=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Ci=new WeakMap,gc=new WeakMap,yc={},Qf=0,uC=function(e){return e&&(e.host||uC(e.parentNode))},NV=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=uC(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},RV=function(e,t,n,r){var s=NV(t,Array.isArray(e)?e:[e]);yc[n]||(yc[n]=new WeakMap);var i=yc[n],o=[],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 p=h.getAttribute(r),v=p!==null&&p!=="false",g=(Ci.get(h)||0)+1,b=(i.get(h)||0)+1;Ci.set(h,g),i.set(h,b),o.push(h),g===1&&v&&gc.set(h,!0),b===1&&h.setAttribute(n,"true"),v||h.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",h,w)}})};return d(t),a.clear(),Qf++,function(){o.forEach(function(f){var h=Ci.get(f)-1,p=i.get(f)-1;Ci.set(f,h),i.set(f,p),h||(gc.has(f)||f.removeAttribute(r),gc.delete(f)),p||f.removeAttribute(n)}),Qf--,Qf||(Ci=new WeakMap,Ci=new WeakMap,gc=new WeakMap,yc={})}},dC=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=jV(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),RV(r,s,n,"aria-hidden")):function(){return null}},Wc="right-scroll-bar-position",Hc="width-before-scroll-bar",AV="with-scroll-bars-hidden",OV="--removed-body-scroll-bar-size";function Xf(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function MV(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var IV=typeof window<"u"?m.useLayoutEffect:m.useEffect,px=new WeakMap;function DV(e,t){var n=MV(null,function(r){return e.forEach(function(s){return Xf(s,r)})});return IV(function(){var r=px.get(n);if(r){var s=new Set(r),i=new Set(e),o=n.current;s.forEach(function(a){i.has(a)||Xf(a,null)}),i.forEach(function(a){s.has(a)||Xf(a,o)})}px.set(n,e)},[e]),n}function LV(e){return e}
vendor: 10,989 bytes, lines 331-371
331function $V(e,t){t===void 0&&(t=LV);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var o=t(i,r);return n.push(o),function(){n=n.filter(function(a){return a!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var a=n;n=[],a.forEach(i),o=n}var l=function(){var d=o;o=[],d.forEach(i)},c=function(){return Promise.resolve().then(l)};c(),n={push:function(d){o.push(d),c()},filter:function(d){return o=o.filter(d),n}}}};return s}function FV(e){e===void 0&&(e={});var t=$V(null);return t.options=tr({async:!0,ssr:!1},e),t}var fC=function(e){var t=e.sideCar,n=Lo(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return m.createElement(r,tr({},n))};fC.isSideCarExport=!0;function UV(e,t){return e.useMedium(t),fC}var hC=FV(),Zf=function(){},Md=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:Zf,onWheelCapture:Zf,onTouchMoveCapture:Zf}),s=r[0],i=r[1],o=e.forwardProps,a=e.children,l=e.className,c=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,p=e.noRelative,v=e.noIsolation,g=e.inert,b=e.allowPinchZoom,w=e.as,y=w===void 0?"div":w,x=e.gapMode,S=Lo(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=h,E=DV([n,t]),C=tr(tr({},S),s);return m.createElement(m.Fragment,null,d&&m.createElement(k,{sideCar:hC,removeScrollBar:c,shards:f,noRelative:p,noIsolation:v,inert:g,setCallbacks:i,allowPinchZoom:!!b,lockRef:n,gapMode:x}),o?m.cloneElement(m.Children.only(a),tr(tr({},C),{ref:E})):m.createElement(y,tr({},C,{className:l,ref:E}),a))});Md.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Md.classNames={fullWidth:Hc,zeroRight:Wc};var VV=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function BV(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=VV();return t&&e.setAttribute("nonce",t),e}function zV(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function WV(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var HV=function(){var e=0,t=null;return{add:function(n){e==0&&(t=BV())&&(zV(t,n),WV(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},qV=function(){var e=HV();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},pC=function(){var e=qV(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},KV={left:0,top:0,right:0,gap:0},eh=function(e){return parseInt(e||"",10)||0},GV=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[eh(n),eh(r),eh(s)]},YV=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return KV;var t=GV(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},JV=pC(),oo="data-scroll-locked",QV=function(e,t,n,r){var s=e.left,i=e.top,o=e.right,a=e.gap;return n===void 0&&(n="margin"),` 332 .`.concat(AV,` { 333 overflow: hidden `).concat(r,`; 334 padding-right: `).concat(a,"px ").concat(r,`; 335 } 336 body[`).concat(oo,`] { 337 overflow: hidden `).concat(r,`; 338 overscroll-behavior: contain; 339 `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` 340 padding-left: `.concat(s,`px; 341 padding-top: `).concat(i,`px; 342 padding-right: `).concat(o,`px; 343 margin-left:0; 344 margin-top:0; 345 margin-right: `).concat(a,"px ").concat(r,`; 346 `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),` 347 } 348 349 .`).concat(Wc,` { 350 right: `).concat(a,"px ").concat(r,`; 351 } 352 353 .`).concat(Hc,` { 354 margin-right: `).concat(a,"px ").concat(r,`; 355 } 356 357 .`).concat(Wc," .").concat(Wc,` { 358 right: 0 `).concat(r,`; 359 } 360 361 .`).concat(Hc," .").concat(Hc,` { 362 margin-right: 0 `).concat(r,`; 363 } 364 365 body[`).concat(oo,`] { 366 `).concat(OV,": ").concat(a,`px; 367 } 368`)},mx=function(){var e=parseInt(document.body.getAttribute(oo)||"0",10);return isFinite(e)?e:0},XV=function(){m.useEffect(function(){return document.body.setAttribute(oo,(mx()+1).toString()),function(){var e=mx()-1;e<=0?document.body.removeAttribute(oo):document.body.setAttribute(oo,e.toString())}},[])},ZV=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;XV();var i=m.useMemo(function(){return YV(s)},[s]);return m.createElement(JV,{styles:QV(i,!t,s,n?"":"!important")})},Zp=!1;if(typeof window<"u")try{var vc=Object.defineProperty({},"passive",{get:function(){return Zp=!0,!0}});window.addEventListener("test",vc,vc),window.removeEventListener("test",vc,vc)}catch{Zp=!1}var Ti=Zp?{passive:!1}:!1,e6=function(e){return e.tagName==="TEXTAREA"},mC=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!e6(e)&&n[t]==="visible")},t6=function(e){return mC(e,"overflowY")},n6=function(e){return mC(e,"overflowX")},gx=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=gC(e,r);if(s){var i=yC(e,r),o=i[1],a=i[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},r6=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},s6=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},gC=function(e,t){return e==="v"?t6(t):n6(t)},yC=function(e,t){return e==="v"?r6(t):s6(t)},i6=function(e,t){return e==="h"&&t==="rtl"?-1:1},o6=function(e,t,n,r,s){var i=i6(e,window.getComputedStyle(t).direction),o=i*r,a=n.target,l=t.contains(a),c=!1,d=o>0,f=0,h=0;do{if(!a)break;var p=yC(e,a),v=p[0],g=p[1],b=p[2],w=g-b-i*v;(v||w)&&gC(e,a)&&(f+=w,h+=v);var y=a.parentNode;a=y&&y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?y.host:y}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&Math.abs(f)<1||!d&&Math.abs(h)<1)&&(c=!0),c},wc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},yx=function(e){return[e.deltaX,e.deltaY]},vx=function(e){return e&&"current"in e?e.current:e},a6=function(e,t){return e[0]===t[0]&&e[1]===t[1]},l6=function(e){return` 369 .block-interactivity-`.concat(e,` {pointer-events: none;} 370 .allow-interactivity-`).concat(e,` {pointer-events: all;} 371`)},c6=0,Pi=[];function u6(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),s=m.useState(c6++)[0],i=m.useState(pC)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var g=PI([e.lockRef.current],(e.shards||[]).map(vx),!0).filter(Boolean);return g.forEach(function(b){return b.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),g.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var a=m.useCallback(function(g,b){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!o.current.allowPinchZoom;var w=wc(g),y=n.current,x="deltaX"in g?g.deltaX:y[0]-w[0],S="deltaY"in g?g.deltaY:y[1]-w[1],k,E=g.target,C=Math.abs(x)>Math.abs(S)?"h":"v";if("touches"in g&&C==="h"&&E.type==="range")return!1;var _=window.getSelection(),j=_&&_.anchorNode,T=j?j===E||j.contains(E):!1;if(T)return!1;var I=gx(C,E);if(!I)return!0;if(I?k=C:(k=C==="v"?"h":"v",I=gx(C,E)),!I)return!1;if(!r.current&&"changedTouches"in g&&(x||S)&&(r.current=k),!k)return!0;var M=r.current||k;return o6(M,b,g,M==="h"?x:S)},[]),l=m.useCallback(function(g){var b=g;if(!(!Pi.length||Pi[Pi.length-1]!==i)){var w="deltaY"in b?yx(b):wc(b),y=t.current.filter(function(k){return k.name===b.type&&(k.target===b.target||b.target===k.shadowParent)&&a6(k.delta,w)})[0];if(y&&y.should){b.cancelable&&b.preventDefault();return}if(!y){var x=(o.current.shards||[]).map(vx).filter(Boolean).filter(function(k){return k.contains(b.target)}),S=x.length>0?a(b,x[0]):!o.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),c=m.useCallback(function(g,b,w,y){var x={name:g,delta:b,target:w,should:y,shadowParent:d6(w)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(S){return S!==x})},1)},[]),d=m.useCallback(function(g){n.current=wc(g),r.current=void 0},[]),f=m.useCallback(function(g){c(g.type,yx(g),g.target,a(g,e.lockRef.current))},[]),h=m.useCallback(function(g){c(g.type,wc(g),g.target,a(g,e.lockRef.current))},[]);m.useEffect(function(){return Pi.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",l,Ti),document.addEventListener("touchmove",l,Ti),document.addEventListener("touchstart",d,Ti),function(){Pi=Pi.filter(function(g){return g!==i}),document.removeEventListener("wheel",l,Ti),document.removeEventListener("touchmove",l,Ti),document.removeEventListener("touchstart",d,Ti)}},[]);var p=e.removeScrollBar,v=e.inert;return m.createElement(m.Fragment,null,v?m.createElement(i,{styles:l6(s)}):null,p?m.createElement(ZV,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function d6(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const f6=UV(hC,u6);var dy=m.forwardRef(function(e,t){return m.createElement(Md,tr({},e,{ref:t,sideCar:f6}))});dy.classNames=Md.classNames;var em=["Enter"," "],h6=["ArrowDown","PageUp","Home"],vC=["ArrowUp","PageDown","End"],p6=[...h6,...vC],m6={ltr:[...em,"ArrowRight"],rtl:[...em,"ArrowLeft"]},g6={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Rl="Menu",[al,y6,v6]=ad(Rl),[gi,wC]=ur(Rl,[v6,yd,iC]),Id=yd(),xC=iC(),[w6,yi]=gi(Rl),[x6,Al]=gi(Rl),bC=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:i,modal:o=!0}=e,a=Id(t),[l,c]=m.useState(null),d=m.useRef(!1),f=tn(i),h=sy(s);return m.useEffect(()=>{const p=()=>{d.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>d.current=!1;return document.addEventListener("keydown",p,{capture:!0}),()=>{document.removeEventListener("keydown",p,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),u.jsx(EO,{...a,children:u.jsx(w6,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:c,children:u.jsx(x6,{scope:t,onClose:m.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:o,children:r})})})};bC.displayName=Rl;var b6="MenuAnchor",fy=m.forwardRef((e,t)=>
vendor: 12,896 bytes, line 371
371{const{__scopeMenu:n,...r}=e,s=Id(n);return u.jsx(rk,{...s,...r,ref:t})});fy.displayName=b6;var hy="MenuPortal",[S6,SC]=gi(hy,{forceMount:void 0}),kC=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,i=yi(hy,t);return u.jsx(S6,{scope:t,forceMount:n,children:u.jsx(Un,{present:n||i.open,children:u.jsx(ld,{asChild:!0,container:s,children:r})})})};kC.displayName=hy;var gn="MenuContent",[k6,py]=gi(gn),_C=m.forwardRef((e,t)=>{const n=SC(gn,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=yi(gn,e.__scopeMenu),o=Al(gn,e.__scopeMenu);return u.jsx(al.Provider,{scope:e.__scopeMenu,children:u.jsx(Un,{present:r||i.open,children:u.jsx(al.Slot,{scope:e.__scopeMenu,children:o.modal?u.jsx(_6,{...s,ref:t}):u.jsx(E6,{...s,ref:t})})})})}),_6=m.forwardRef((e,t)=>{const n=yi(gn,e.__scopeMenu),r=m.useRef(null),s=qe(t,r);return m.useEffect(()=>{const i=r.current;if(i)return dC(i)},[]),u.jsx(my,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ne(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),E6=m.forwardRef((e,t)=>{const n=yi(gn,e.__scopeMenu);return u.jsx(my,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),C6=kV("MenuContent.ScrollLock"),my=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,disableOutsideScroll:v,...g}=e,b=yi(gn,n),w=Al(gn,n),y=Id(n),x=xC(n),S=y6(n),[k,E]=m.useState(null),C=m.useRef(null),_=qe(t,C,b.onContentChange),j=m.useRef(0),T=m.useRef(""),I=m.useRef(0),M=m.useRef(null),H=m.useRef("right"),D=m.useRef(0),G=v?dy:m.Fragment,L=v?{as:C6,allowPinchZoom:!0}:void 0,Z=P=>{var ae,Pe;const F=T.current+P,O=S().filter(Ae=>!Ae.disabled),$=document.activeElement,Y=(ae=O.find(Ae=>Ae.ref.current===$))==null?void 0:ae.textValue,W=O.map(Ae=>Ae.textValue),fe=$6(W,F,Y),ke=(Pe=O.find(Ae=>Ae.textValue===fe))==null?void 0:Pe.ref.current;(function Ae(Qe){T.current=Qe,window.clearTimeout(j.current),Qe!==""&&(j.current=window.setTimeout(()=>Ae(""),1e3))})(F),ke&&setTimeout(()=>ke.focus())};m.useEffect(()=>()=>window.clearTimeout(j.current),[]),nC();const N=m.useCallback(P=>{var O,$;return H.current===((O=M.current)==null?void 0:O.side)&&U6(P,($=M.current)==null?void 0:$.area)},[]);return u.jsx(k6,{scope:n,searchRef:T,onItemEnter:m.useCallback(P=>{N(P)&&P.preventDefault()},[N]),onItemLeave:m.useCallback(P=>{var F;N(P)||((F=C.current)==null||F.focus(),E(null))},[N]),onTriggerLeave:m.useCallback(P=>{N(P)&&P.preventDefault()},[N]),pointerGraceTimerRef:I,onPointerGraceIntentChange:m.useCallback(P=>{M.current=P},[]),children:u.jsx(G,{...L,children:u.jsx(uy,{asChild:!0,trapped:s,onMountAutoFocus:ne(i,P=>{var F;P.preventDefault(),(F=C.current)==null||F.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:u.jsx(bl,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,children:u.jsx(bV,{asChild:!0,...x,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:k,onCurrentTabStopIdChange:E,onEntryFocus:ne(l,P=>{w.isUsingKeyboardRef.current||P.preventDefault()}),preventScrollOnEntryFocus:!0,children:u.jsx(sk,{role:"menu","aria-orientation":"vertical","data-state":UC(b.open),"data-radix-menu-content":"",dir:w.dir,...y,...g,ref:_,style:{outline:"none",...g.style},onKeyDown:ne(g.onKeyDown,P=>{const O=P.target.closest("[data-radix-menu-content]")===P.currentTarget,$=P.ctrlKey||P.altKey||P.metaKey,Y=P.key.length===1;O&&(P.key==="Tab"&&P.preventDefault(),!$&&Y&&Z(P.key));const W=C.current;if(P.target!==W||!p6.includes(P.key))return;P.preventDefault();const ke=S().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);vC.includes(P.key)&&ke.reverse(),D6(ke)}),onBlur:ne(e.onBlur,P=>{P.currentTarget.contains(P.target)||(window.clearTimeout(j.current),T.current="")}),onPointerMove:ne(e.onPointerMove,ll(P=>{const F=P.target,O=D.current!==P.clientX;if(P.currentTarget.contains(F)&&O){const $=P.clientX>D.current?"right":"left";H.current=$,D.current=P.clientX}}))})})})})})})});_C.displayName=gn;var T6="MenuGroup",gy=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(Ee.div,{role:"group",...r,ref:t})});gy.displayName=T6;var P6="MenuLabel",EC=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(Ee.div,{...r,ref:t})});EC.displayName=P6;var Uu="MenuItem",wx="menu.itemSelect",Dd=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,i=m.useRef(null),o=Al(Uu,e.__scopeMenu),a=py(Uu,e.__scopeMenu),l=qe(t,i),c=m.useRef(!1),d=()=>{const f=i.current;if(!n&&f){const h=new CustomEvent(wx,{bubbles:!0,cancelable:!0});f.addEventListener(wx,p=>r==null?void 0:r(p),{once:!0}),eg(f,h),h.defaultPrevented?c.current=!1:o.onClose()}};return u.jsx(CC,{...s,ref:l,disabled:n,onClick:ne(e.onClick,d),onPointerDown:f=>{var h;(h=e.onPointerDown)==null||h.call(e,f),c.current=!0},onPointerUp:ne(e.onPointerUp,f=>{var h;c.current||(h=f.currentTarget)==null||h.click()}),onKeyDown:ne(e.onKeyDown,f=>{const h=a.searchRef.current!=="";n||h&&f.key===" "||em.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});Dd.displayName=Uu;var CC=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...i}=e,o=py(Uu,n),a=xC(n),l=m.useRef(null),c=qe(t,l),[d,f]=m.useState(!1),[h,p]=m.useState("");return m.useEffect(()=>{const v=l.current;v&&p((v.textContent??"").trim())},[i.children]),u.jsx(al.ItemSlot,{scope:n,disabled:r,textValue:s??h,children:u.jsx(SV,{asChild:!0,...a,focusable:!r,children:u.jsx(Ee.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:c,onPointerMove:ne(e.onPointerMove,ll(v=>{r?o.onItemLeave(v):(o.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ne(e.onPointerLeave,ll(v=>o.onItemLeave(v))),onFocus:ne(e.onFocus,()=>f(!0)),onBlur:ne(e.onBlur,()=>f(!1))})})})}),j6="MenuCheckboxItem",TC=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return u.jsx(AC,{scope:e.__scopeMenu,checked:n,children:u.jsx(Dd,{role:"menuitemcheckbox","aria-checked":Vu(n)?"mixed":n,...s,ref:t,"data-state":vy(n),onSelect:ne(s.onSelect,()=>r==null?void 0:r(Vu(n)?!0:!n),{checkForDefaultPrevented:!1})})})});TC.displayName=j6;var PC="MenuRadioGroup",[N6,R6]=gi(PC,{value:void 0,onValueChange:()=>{}}),jC=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,i=tn(r);return u.jsx(N6,{scope:e.__scopeMenu,value:n,onValueChange:i,children:u.jsx(gy,{...s,ref:t})})});jC.displayName=PC;var NC="MenuRadioItem",RC=m.forwardRef((e,t)=>{const{value:n,...r}=e,s=R6(NC,e.__scopeMenu),i=n===s.value;return u.jsx(AC,{scope:e.__scopeMenu,checked:i,children:u.jsx(Dd,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":vy(i),onSelect:ne(r.onSelect,()=>{var o;return(o=s.onValueChange)==null?void 0:o.call(s,n)},{checkForDefaultPrevented:!1})})})});RC.displayName=NC;var yy="MenuItemIndicator",[AC,A6]=gi(yy,{checked:!1}),OC=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,i=A6(yy,n);return u.jsx(Un,{present:r||Vu(i.checked)||i.checked===!0,children:u.jsx(Ee.span,{...s,ref:t,"data-state":vy(i.checked)})})});OC.displayName=yy;var O6="MenuSeparator",MC=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(Ee.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});MC.displayName=O6;var M6="MenuArrow",IC=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Id(n);return u.jsx(ik,{...s,...r,ref:t})});IC.displayName=M6;var I6="MenuSub",[Cz,DC]=gi(I6),da="MenuSubTrigger",LC=m.forwardRef((e,t)=>{const n=yi(da,e.__scopeMenu),r=Al(da,e.__scopeMenu),s=DC(da,e.__scopeMenu),i=py(da,e.__scopeMenu),o=m.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,c={__scopeMenu:e.__scopeMenu},d=m.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return m.useEffect(()=>d,[d]),m.useEffect(()=>{const f=a.current;return()=>{window.clearTimeout(f),l(null)}},[a,l]),u.jsx(fy,{asChild:!0,...c,children:u.jsx(CC,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":UC(n.open),...e,ref:Es(t,s.onTriggerChange),onClick:f=>{var h;(h=e.onClick)==null||h.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ne(e.onPointerMove,ll(f=>{i.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:ne(e.onPointerLeave,ll(f=>{var p,v;d();const h=(p=n.content)==null?void 0:p.getBoundingClientRect();if(h){const g=(v=n.content)==null?void 0:v.dataset.side,b=g==="right",w=b?-5:5,y=h[b?"left":"right"],x=h[b?"right":"left"];i.onPointerGraceIntentChange({area:[{x:f.clientX+w,y:f.clientY},{x:y,y:h.top},{x,y:h.top},{x,y:h.bottom},{x:y,y:h.bottom}],side:g}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(f),f.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ne(e.onKeyDown,f=>{var p;const h=i.searchRef.current!=="";e.disabled||h&&f.key===" "||m6[r.dir].includes(f.key)&&(n.onOpenChange(!0),(p=n.content)==null||p.focus(),f.preventDefault())})})})});LC.displayName=da;var $C="MenuSubContent",FC=m.forwardRef((e,t)=>{const n=SC(gn,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,i=yi(gn,e.__scopeMenu),o=Al(gn,e.__scopeMenu),a=DC($C,e.__scopeMenu),l=m.useRef(null),c=qe(t,l);return u.jsx(al.Provider,{scope:e.__scopeMenu,children:u.jsx(Un,{present:r||i.open,children:u.jsx(al.Slot,{scope:e.__scopeMenu,children:u.jsx(my,{id:a.contentId,"aria-labelledby":a.triggerId,...s,ref:c,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;o.isUsingKeyboardRef.current&&((f=l.current)==null||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:ne(e.onFocusOutside,d=>{d.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:ne(e.onEscapeKeyDown,d=>{o.onClose(),d.preventDefault()}),onKeyDown:ne(e.onKeyDown,d=>{var p;const f=d.currentTarget.contains(d.target),h=g6[o.dir].includes(d.key);f&&h&&(i.onOpenChange(!1),(p=a.trigger)==null||p.focus(),d.preventDefault())})})})})})});FC.displayName=$C;function UC(e){return e?"open":"closed"}function Vu(e){return e==="indeterminate"}function vy(e){return Vu(e)?"indeterminate":e?"checked":"unchecked"}function D6(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function L6(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function $6(e,t,n){const s=t.length>1&&Array.from(t).every(c=>c===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=L6(e,Math.max(i,0));s.length===1&&(o=o.filter(c=>c!==n));const l=o.find(c=>c.toLowerCase().startsWith(s.toLowerCase()));return l!==n?l:void 0}function F6(e,t){const{x:n,y:r}=e;let s=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const a=t[i],l=t[o],c=a.x,d=a.y,f=l.x,h=l.y;d>r!=h>r&&n<(f-c)*(r-d)/(h-d)+c&&(s=!s)}return s}function U6(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return F6(n,t)}function ll(e){return t=>t.pointerType==="mouse"?e(t):void 0}var V6=bC,B6=fy,z6=kC,W6=_C,H6=gy,q6=EC,K6=Dd,G6=TC,Y6=jC,J6=RC,Q6=OC,X6=MC,Z6=IC,eB=LC,tB=FC,Ld="DropdownMenu",[nB]=ur(Ld,[wC]),It=wC(),[rB,VC]=nB(Ld),BC=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:i,onOpenChange:o,modal:a=!0}=e,l=It(t),c=m.useRef(null),[d,f]=mi({prop:s,defaultProp:i??!1,onChange:o,caller:Ld});return u.jsx(rB,{scope:t,triggerId:ps(),triggerRef:c,contentId:ps(),open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(h=>!h),[f]),modal:a,children:u.jsx(V6,{...l,open:d,onOpenChange:f,dir:r,modal:a,children:n})})};BC.displayName=Ld;var zC="DropdownMenuTrigger",WC=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,i=VC(zC,n),o=It(n);return u.jsx(B6,{asChild:!0,...o,children:u.jsx(Ee.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:Es(t,i.triggerRef),onPointerDown:ne(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:ne(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});WC.displayName=zC;var sB="DropdownMenuPortal",HC=e=>{const{__scopeDropdownMenu:t,...n}=e,r=It(t);return u.jsx(z6,{...r,...n})};HC.displayName=sB;var qC="DropdownMenuContent",KC=m.forwardRef((e,t)=>
371{const{__scopeDropdownMenu:n,...r}=e,s=VC(qC,n),i=It(n),o=m.useRef(!1);return u.jsx(W6,{id:s.contentId,"aria-labelledby":s.triggerId,...i,...r,ref:t,onCloseAutoFocus:ne(e.onCloseAutoFocus,a=>{var l;o.current||(l=s.triggerRef.current)==null||l.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:ne(e.onInteractOutside,a=>{const l=a.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,d=l.button===2||c;(!s.modal||d)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});KC.displayName=qC;var iB="DropdownMenuGroup",oB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=It(n);return u.jsx(H6,{...s,...r,ref:t})});oB.displayName=iB;var aB="DropdownMenuLabel",GC=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=It(n);return u.jsx(q6,{...s,...r,ref:t})});GC.displayName=aB;var lB="DropdownMenuItem",YC=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=It(n);return u.jsx(K6,{...s,...r,ref:t})});YC.displayName=lB;var cB="DropdownMenuCheckboxItem",JC=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=It(n);return u.jsx(G6,{...s,...r,ref:t})});JC.displayName=cB;var uB="DropdownMenuRadioGroup",dB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=It(n);return u.jsx(Y6,{...s,...r,ref:t})});dB.displayName=uB;var fB="DropdownMenuRadioItem",QC=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=It(n);return u.jsx(J6,{...s,...r,ref:t})});QC.displayName=fB;var hB="DropdownMenuItemIndicator",XC=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=It(n);return u.jsx(Q6,{...s,...r,ref:t})});XC.displayName=hB;var pB="DropdownMenuSeparator",ZC=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=It(n);return u.jsx(X6,{...s,...r,ref:t})});ZC.displayName=pB;var mB="DropdownMenuArrow",gB=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=It(n);return u.jsx(Z6,{...s,...r,ref:t})});gB.displayName=mB;var yB="DropdownMenuSubTrigger",eT=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=It(n);return u.jsx(eB,{...s,...r,ref:t})});eT.displayName=yB;var vB="DropdownMenuSubContent",tT=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=It(n);return u.jsx(tB,{...s,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});tT.displayName=vB;var wB=BC,xB=WC,bB=HC,nT=KC,rT=GC,sT=YC,iT=JC,oT=QC,aT=XC,lT=ZC,cT=eT,uT=tT;const SB=wB,kB=xB,_B=m.forwardRef(({className:e,inset:t,children:n,...r},s)=>u.jsxs(cT,{ref:s,className:Re("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",t&&"pl-8",e),...r,children:[n,u.jsx(bN,{className:"ml-auto h-4 w-4"})]}));_B.displayName=cT.displayName;const EB=m.forwardRef(({className:e,...t},n)=>u.jsx(uT,{ref:n,className:Re("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",e),...t}));EB.displayName=uT.displayName;const dT=m.forwardRef(({className:e,sideOffset:t=4,...n},r)=>u.jsx(bB,{children:u.jsx(nT,{ref:r,sideOffset:t,className:Re("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 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]:sli
371de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));dT.displayName=nT.displayName;const fT=m.forwardRef(({className:e,inset:t,...n},r)=>u.jsx(sT,{ref:r,className:Re("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t&&"pl-8",e),...n}));fT.displayName=sT.displayName;const CB=m.forwardRef(({className:e,children:t,checked:n,...r},s)=>u.jsxs(iT,{ref:s,className:Re("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),checked:n,...r,children:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(aT,{children:u.jsx(yu,{className:"h-4 w-4"})})}),t]}));CB.displayName=iT.displayName;const TB=m.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(oT,{ref:r,className:Re("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(aT,{children:u.jsx(EN,{className:"h-2 w-2 fill-current"})})}),t]}));TB.displayName=oT.displayName;const PB=m.forwardRef(({className:e,inset:t,...n},r)=>u.jsx(rT,{ref:r,className:Re("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));PB.displayName=rT.displayName;const jB=m.forwardRef(({className:e,...t},n)=>u.jsx(lT,{ref:n,className:Re("-mx-1 my-1 h-px bg-muted",e),...t}));jB.displayName=lT.displayName;function ao({children:e,repoUrl:t}){const{user:n}=Ts(),r=hr(),s=fr(),[i,o]=m.useState(""),[a,l]=m.useState(!1);m.useEffect(()=>{const h=()=>l(window.scrollY>4);return window.addEventListener("scroll",h,{passive:!0}),()=>window.removeEventListener("scroll",h)},[]);const c=async()=>{await Ve.auth.signOut(),r("/")},d=()=>{var v;const h=i.trim();if(!h)return;
371const p=(((v=document.body)==null?void 0:v.innerText)||"").slice(0,1200);r("/upload",{state:{prefill:h,originRoute:s.pathname,originTitle:document.title,originUiText:p}}),o("")},f=[{to:"/dashboard",label:"Dashboard"},{to:"/sync",label:"Projects"},{to:"/upload",label:"Generate"}];return u.jsxs("div",{className:"app-shell noise-overlay flex flex-col",children:[u.jsxs(le.header,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.3},className:`sticky top-0 z-50 h-14 flex items-center px-5 shrink-0 transition-all duration-300 ${a?"bg-background/80 backdrop-blur-xl border-b border-border":"bg-transparent border-b border-transparent"}`,children:[u.jsx(yt,{to:"/dashboard",className:"flex items-center gap-2 mr-8 shrink-0",children:u.jsx("span",{className:"text-[15px] font-semibold tracking-tight text-foreground",children:"SpecMe"})}),u.jsx("nav",{className:"hidden md:flex items-center gap-0.5",children:f.map(h=>{const p=s.pathname===h.to||h.to==="/dashboard"&&s.pathname.startsWith("/runs/");return u.jsx(yt,{to:h.to,className:`px-3 py-1.5 rounded-md text-[13px] font-medium transition-colors duration-150 ${p?"text-foreground bg-white/[0.06]":"text-muted-foreground hover:text-foreground"}`,children:h.label},h.to)})}),u.jsx("div",{className:"flex-1"}),u.jsxs("div",{className:"hidden sm:flex items-center gap-2 mr-3",children:[t&&u.jsx("span",{className:"font-mono text-[11px] text-muted-foreground truncate max-w-[180px] mr-1",children:t}),u.jsxs("div",{className:"relative",children:[u.jsx(DN,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground/50"}),u.jsx("input",{value:i,onChange:h=>o(h.target.value),onKeyDown:h=>{h.key==="Enter"&&d()},placeholder:"Describe a change...",className:"h-8 w-[220px] rounded-lg border border-border bg-card pl-8 pr-3 text-[13px] outline-none transition-all duration-200 placeholder:text-muted-foreground/40 focus:border-white/[0.12] focus:w-[280px]"})]}),u.jsx(oe,{size:"sm",onClick:d,disabled:!i.trim(),className:"h-8 px-3 rounded-lg text-[13px] bg-primary hover:bg-primary/90 border-0",children:"Run"})]}),u.jsxs(SB,{children:[u.jsx(kB,{asChild:!0,children:u.jsxs("button",{className:"flex items-center gap-1.5 text-[13px] text-muted-foreground hover:text-foreground transition-colors h-8 px-2 rounded-md",children:[u.jsx("span",{className:"truncate max-w-[140px]",children:n==null?void 0:n.email}),u.jsx(kS,{className:"h-3 w-3 opacity-50"})]})}),u.jsx(dT,{align:"end",className:"w-44 bg-card border-border",children:u.jsxs(fT,{onClick:c,className:"text-red-400 focus:text-red-400 text-[13px]",children:[u.jsx(MN,{className:"mr-2 h-3.5 w-3.5"}),"Sign out"]})})]})]}),u.jsx("main",{className:"flex-1 relative",children:e})]})}function qc({className:e,...t}){return u.jsx("div",{className:Re("animate-pulse rounded-md bg-muted",e),...t})}function Bn(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function di(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}const hT=6048e5,NB=864e5;let RB={};function $d(){return RB}function cl(e,t){var a,l,c,d;const n=$d(),r=(t==null?void 0:t.weekStartsOn)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.weekStartsOn)??n.weekStartsOn??((d=(c=n.locale)==null?void 0:c.options)==null?void 0:d.weekStartsOn)??0,s=Bn(e),i=s.getDay(),o=(i<r?7:0)+i-r;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function Bu(e){return cl(e,{weekStartsOn:1})}function pT(e){const t=Bn(e),n=t.getFullYear(),r=di(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const s=Bu(r),i=di(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const o=Bu(i);return t.getTime()>=s.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function xx(e){const t=Bn(e);return t.setHours(0,0,0,0),t}function bx(e){const t=Bn(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}
vendor: 9,533 bytes, line 371
371function AB(e,t){const n=xx(e),r=xx(t),s=+n-bx(n),i=+r-bx(r);return Math.round((s-i)/NB)}function OB(e){const t=pT(e),n=di(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Bu(n)}function MB(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function IB(e){if(!MB(e)&&typeof e!="number")return!1;const t=Bn(e);return!isNaN(Number(t))}function DB(e){const t=Bn(e),n=di(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}const LB={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},$B=(e,t,n)=>{let r;const s=LB[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function th(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const FB={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},UB={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},VB={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},BB={date:th({formats:FB,defaultWidth:"full"}),time:th({formats:UB,defaultWidth:"full"}),dateTime:th({formats:VB,defaultWidth:"full"})},zB={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},WB=(e,t,n,r)=>zB[e];function ra(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,a=n!=null&&n.width?String(n.width):o;s=e.formattingValues[a]||e.formattingValues[o]}else{const o=e.defaultWidth,a=n!=null&&n.width?String(n.width):e.defaultWidth;s=e.values[a]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return s[i]}}const HB={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},qB={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},KB={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},GB={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},YB={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},JB={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},QB=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},XB={ordinalNumber:QB,era:ra({values:HB,defaultWidth:"wide"}),quarter:ra({values:qB,defaultWidth:"wide",argumentCallback:e=>e-1}),month:ra({values:KB,defaultWidth:"wide"}),day:ra({values:GB,defaultWidth:"wide"}),dayPeriod:ra({values:YB,defaultWidth:"wide",formattingValues:JB,defaultFormattingWidth:"wide"})};function sa(e){return(t,n={})=>{const r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(s);if(!i)return null;const o=i[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?e8(a,f=>f.test(o)):ZB(a,f=>f.test(o));let c;c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c;const d=t.slice(o.length);return{value:c,rest:d}}}function ZB(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function e8(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function t8(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const s=r[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const a=t.slice(s.length);return{value:o,rest:a}}}const n8=/^(\d+)(th|st|nd|rd)?/i,r8=/\d+/i,s8={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},i8={any:[/^b/i,/^(a|c)/i]},o8={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},a8={any:[/1/i,/2/i,/3/i,/4/i]},l8={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},c8={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},u8={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},d8={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},f8={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},h8={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},p8={ordinalNumber:t8({matchPattern:n8,parsePattern:r8,valueCallback:e=>parseInt(e,10)}),era:sa({matchPatterns:s8,defaultMatchWidth:"wide",parsePatterns:i8,defaultParseWidth:"any"}),quarter:sa({matchPatterns:o8,defaultMatchWidth:"wide",parsePatterns:a8,defaultParseWidth:"any",valueCallback:e=>e+1}),month:sa({matchPatterns:l8,defaultMatchWidth:"wide",parsePatterns:c8,defaultParseWidth:"any"}),day:sa({matchPatterns:u8,defaultMatchWidth:"wide",parsePatterns:d8,defaultParseWidth:"any"}),dayPeriod:sa({matchPatterns:f8,defaultMatchWidth:"any",parsePatterns:h8,defaultParseWidth:"any"})},m8={code:"en-US",formatDistance:$B,formatLong:BB,formatRelative:WB,localize:XB,match:p8,options:{weekStartsOn:0,firstWeekContainsDate:1}};function g8(e){const t=Bn(e);return AB(t,DB(t))+1}function y8(e){const t=Bn(e),n=+Bu(t)-+OB(t);return Math.round(n/hT)+1}function mT(e,t){var d,f,h,p;const n=Bn(e),r=n.getFullYear(),s=$d(),i=(t==null?void 0:t.firstWeekContainsDate)??((f=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??s.firstWeekContainsDate??((p=(h=s.locale)==null?void 0:h.options)==null?void 0:p.firstWeekContainsDate)??1,o=di(e,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const a=cl(o,t),l=di(e,0);l.setFullYear(r,0,i),l.setHours(0,0,0,0);const c=cl(l,t);return n.getTime()>=a.getTime()?r+1:n.getTime()>=c.getTime()?r:r-1}function v8(e,t){var a,l,c,d;const n=$d(),r=(t==null?void 0:t.firstWeekContainsDate)??((l=(a=t==null?void 0:t.locale)==null?void 0:a.options)==null?void 0:l.firstWeekContainsDate)??n.firstWeekContainsDate??((d=(c=n.locale)==null?void 0:c.options)==null?void 0:d.firstWeekContainsDate)??1,s=mT(e,t),i=di(e,0);return i.setFullYear(s,0,r),i.setHours(0,0,0,0),cl(i,t)}function w8(e,t){const n=Bn(e),r=+cl(n,t)-+v8(n,t);return Math.round(r/hT)+1}function je(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Fr={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return je(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):je(n+1,2)},d(e,t){return je(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return je(e.getHours()%12||12,t.length)},H(e,t){return je(e.getHours(),t.length)},m(e,t){return je(e.getMinutes(),t.length)},s(e,t){return je(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),s=Math.trunc(r*Math.pow(10,n-3));return je(s,t.length)}},ji={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}
vendor: 4,661 bytes, line 371
371,Sx={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),s=r>0?r:1-r;return n.ordinalNumber(s,{unit:"year"})}return Fr.y(e,t)},Y:function(e,t,n,r){const s=mT(e,r),i=s>0?s:1-s;if(t==="YY"){const o=i%100;return je(o,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):je(i,t.length)},R:function(e,t){const n=pT(e);return je(n,t.length)},u:function(e,t){const n=e.getFullYear();return je(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return je(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return je(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Fr.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return je(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const s=w8(e,r);return t==="wo"?n.ordinalNumber(s,{unit:"week"}):je(s,t.length)},I:function(e,t,n){const r=y8(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):je(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Fr.d(e,t)},D:function(e,t,n){const r=g8(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):je(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const s=e.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return je(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(s,{width:"short",context:"formatting"});case"eeee":default:return n.day(s,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const s=e.getDay(),i=(s-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return je(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(s,{width:"narrow",context:"standalone"});case"cccccc":return n.day(s,{width:"short",context:"standalone"});case"cccc":default:return n.day(s,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),s=r===0?7:r;switch(t){case"i":return String(s);case"ii":return je(s,t.length);case"io":return n.ordinalNumber(s,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const s=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let s;switch(r===12?s=ji.noon:r===0?s=ji.midnight:s=r/12>
vendor: 4,402 bytes, line 371
371=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let s;switch(r>=17?s=ji.evening:r>=12?s=ji.afternoon:r>=4?s=ji.morning:s=ji.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Fr.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Fr.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):je(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):je(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Fr.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Fr.s(e,t)},S:function(e,t){return Fr.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return _x(r);case"XXXX":case"XX":return Us(r);case"XXXXX":case"XXX":default:return Us(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return _x(r);case"xxxx":case"xx":return Us(r);case"xxxxx":case"xxx":default:return Us(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+kx(r,":");case"OOOO":default:return"GMT"+Us(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+kx(r,":");case"zzzz":default:return"GMT"+Us(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return je(r,t.length)},T:function(e,t,n){const r=e.getTime();return je(r,t.length)}};function kx(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=Math.trunc(r/60),i=r%60;return i===0?n+String(s):n+String(s)+t+je(i,2)}function _x(e,t){return e%60===0?(e>0?"-":"+")+je(Math.abs(e)/60,2):Us(e,t)}function Us(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),s=je(Math.trunc(r/60),2),i=je(r%60,2);return n+s+t+i}const Ex=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},gT=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},x8=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],s=n[2];if(!s)return Ex(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",Ex(r,t)).replace("{{time}}",gT(s,t))},b8={p:gT,P:x8},S8=/^D+$/,k8=/^Y+$/,_8=["D","DD","YY","YYYY"];function E8(e){return S8.test(e)}function C8(e){return k8.test(e)}function T8(e,t,n){const r=P8(e,t,n);if(console.warn(r),_8.includes(e))throw new RangeError(r)}function P8(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const j8=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,N8=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,R8=/^'([^]*?)'?$/,A8=/''/g,O8=/[a-zA-Z]/;function Cx(e,t,n){var d,f,h,p;const r=$d(),s=r.locale??m8,i=r.firstWeekContainsDate??((f=(d=r.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??1,o=r.weekStartsOn??((p=(h=r.locale)==null?void 0:h.options)==null?void 0:p.weekStartsOn)??0,a=Bn(e);if(!IB(a))throw new RangeError("Invalid time value");let l=t.match(N8).map(v=>{const g=v[0];if(g==="p"||g==="P"){const b=b8[g];return b(v,s.formatLong)}return v}).join("").match(j8).map(v=>{if(v==="''")return{isToken:!1,value:"'"};const g=v[0];if(g==="'")return{isToken:!1,value:M8(v)};if(Sx[g])return{isToken:!0,value:v};
371if(g.match(O8))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:v}});s.localize.preprocessor&&(l=s.localize.preprocessor(a,l));const c={firstWeekContainsDate:i,weekStartsOn:o,locale:s};return l.map(v=>{if(!v.isToken)return v.value;const g=v.value;(C8(g)||E8(g))&&T8(g,t,String(e));const b=Sx[g[0]];return b(a,g,s.localize,c)}).join("")}function M8(e){const t=e.match(R8);return t?t[1].replace(A8,"'"):e}const I8=["http://127.0.0.1:4000","http://localhost:4000"];function tm(e){return e.replace(/\/+$/,"")}function D8(e){try{const t=new URL(e);if(t.hostname==="localhost"){const n=new URL(t.toString());return n.hostname="127.0.0.1",[e,tm(n.toString())]}if(t.hostname==="127.0.0.1"){const n=new URL(t.toString());return n.hostname="localhost",[e,tm(n.toString())]}}catch{return[e]}return[e]}function L8(){const e="http://localhost:4000".trim(),t=e?D8(tm(e)):[];for(const n of I8)t.includes(n)||t.push(n);return t}async function Te(e,t){const n=e.startsWith("/")?e:`/${e}`,r=[];for(const s of L8())try{return await fetch(`${s}${n}`,t)}catch(i){const o=i instanceof Error?i.message:String(i);r.push(`${s} (${o})`)}throw new Error(`Could not reach backend server. Tried: ${r.join(", ")}. Start the API server and ensure port 4000 is reachable.`)}function nh(e,t){var n;if(e.connectionStatus==="failed")return{kind:"none",repoUrl:"",repoBranch:"main",localPath:""};if(e.mode==="github"&&e.connectionStatus==="connected")return{kind:"github",repoUrl:e.repoUrl||t.repoUrl,repoBranch:e.branch||t.repoBranch||"main",localPath:""};if(e.mode==="local"&&e.connectionStatus==="connected"){const r=(n=e.source)!=null&&n.startsWith("local:")?e.source.slice(6):e.root||t.localPath;return{kind:"local",repoUrl:"",repoBranch:t.repoBranch||"main",localPath:r||""}}return(e.mode==="slack"||e.mode==="jira"||e.mode==="notion")&&e.connectionStatus==="connected"?{kind:e.mode,repoUrl:"",repoBranch:"",localPath:""}:{kind:"none",repoUrl:"",repoBranch:"main",localPath:""}}function $8(e,t){const n=(e??"").trim();return n?n.startsWith("local:")?{kind:"local",repoUrl:"",repoBranch:(t==null?void 0:t.trim())||"main",localPath:n.slice(6)}:{kind:"github",repoUrl:n,repoBranch:(t==null?void 0:t.trim())||"main",localPath:""}:{kind:"none",repoUrl:"",repoBranch:(t==null?void 0:t.trim())||"main",localPath:""}}function F8(){var N,P,F;const e=hr(),{toast:t}=Ro(),{user:n}=Ts(),[r,s]=m.useState(!0),[i,o]=m.useState({kind:"none",repoUrl:"",repoBranch:"main",localPath:""}),[a,l]=m.useState([]),[c,d]=m.useState(null),[f,h]=m.useState(!1),[p,v]=m.useState(null),[g,b]=m.useState([]),[w,y]=m.useState(null),[x,S]=m.useState(null);m.useEffect(()=>{n&&(async()=>{s(!0);const{data:O}=await Ve.from("user_settings").select("repo_url, repo_branch").eq("user_id",n.id).maybeSingle(),$=$8((O==null?void 0:O.repo_url)??null,(O==null?void 0:O.repo_branch)??null);o($);const Y=await Te("/api/project").catch(()=>null);if(Y!=null&&Y.ok){const me=await Y.json();me.success&&me.project&&(v(me.project),o(nh(me.project,$)))}else v({mode:"workspace",connectionStatus:"failed",lastConnectionError:"Could not verify backend project connection. Reconnect from Sync."}),o({kind:"none",repoUrl:"",repoBranch:"main",localPath:""});const W=await Te("/api/attempt/latest").catch(()=>null);if(W!=null&&W.ok){const me=await W.json();h(!!me.hasUndoableChanges)}const fe=await Te("/api/project/history").catch(()=>null);if(fe!=null&&fe.ok){const me=await fe.json();me.success&&Array.isArray(me.projects)&&b(me.projects)}const{data:ke,error:ae}=await Ve.from("runs").select("id, status, created_at, feedback_id").eq("user_id",n.id).order("created_at",{ascending:!1}).limit(10);if(ae){t({title:"Error",description:ae.message||"Failed to load runs",variant:"destructive"}),l([]),s(!1);return}const Pe=ke??[],Ae=Array.from(new Set(Pe.map(me=>me.feedback_id))).filter(Boolean),Qe={};if(Ae.length){const{data:me}=await Ve.from("feedback").select("id, title").in("id",Ae);me==null||me.forEach(Et=>{Qe[Et.id]=Et.title})}l(Pe.map(me=>({id:me.id,status:me.status||"queued",created_at:me.created_at,title:Qe[me.feedback_id]||"
371Untitled"}))),s(!1)})()},[n,t]);const k=n==null?void 0:n.user_metadata,C=((N=k==null?void 0:k.full_name)==null?void 0:N.trim())||[(P=k==null?void 0:k.first_name)==null?void 0:P.trim(),(F=k==null?void 0:k.last_name)==null?void 0:F.trim()].filter(Boolean).join(" ")||"there",_=O=>O==="done"?"status-done":O==="running"?"status-running":O==="error"?"status-error":"status-queued",j=m.useMemo(()=>i.kind==="github"?i.repoUrl:i.kind==="local"?i.localPath:null,[i]),T=m.useMemo(()=>i.kind!=="none",[i.kind]),I=m.useMemo(()=>p?p.connectionStatus==="failed"?"Connection failed":p.mode==="workspace"||p.connectionStatus==="disconnected"||p.connectionStatus!=="connected"||i.kind==="none"?"No project connected":{github:"GitHub connected",local:"Local connected",slack:"Slack connected",jira:"Jira connected",notion:"Notion connected"}[i.kind]||"Connected":"No project connected",[i.kind,p]),M=async()=>{const O=await Te("/api/attempt/latest").catch(()=>null);if(!(O!=null&&O.ok))return;const $=await O.json();h(!!$.hasUndoableChanges)},H=async O=>{if(n){if(i.kind!==O){t({title:"Nothing to disconnect",description:O==="github"?"No GitHub project connected.":"No local project connected."});return}if(!(f&&!window.confirm("You have unapplied/undoable changes. Disconnecting may make it harder to recover work. Continue?"))){d(O);try{const $=await Te("/api/project/disconnect",{method:"POST",headers:{"Content-Type":"application/json"}}),Y=await $.text();if(!$.ok)try{const fe=JSON.parse(Y);throw new Error([fe.error,fe.reconnectManualHint].filter(Boolean).join(" ")||"Failed to reset project state")}catch{throw new Error(Y||"Failed to reset project state")}const{error:W}=await Ve.from("user_settings").upsert({user_id:n.id,repo_url:null,repo_branch:null,updated_at:new Date().toISOString()},{onConflict:"user_id"});if(W)throw W;o({kind:"none",repoUrl:"",repoBranch:"main",localPath:""}),v({mode:"workspace",connectionStatus:"disconnected",lastConnectionError:null}),h(!1),t({title:"Disconnected",description:"Project disconnected."}),e("/dashboard")}catch($){t({title:"Disconnect failed",description:$ instanceof Error?$.message:"Something went wrong",variant:"destructive"})}finally{d(null),await M()}}}},D=async O=>{try{const $=await Te("/api/runs/activate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runId:O})}),Y=await $.text();if($.ok)try{const W=JSON.parse(Y);W.success===!1&&t({title:"Reconnect warning",description:[W.message,W.reconnectManualHint].filter(Boolean).join(" ")||"Could not auto-reconnect.",variant:"destructive"}),W.project&&(v(W.project),o(nh(W.project,i)))}catch{}else throw new Error(Y||"Failed to reconnect")}catch($){t({title:"Reconnect failed",description:$ instanceof Error?$.message:"Failed to reconnect.",variant:"destructive"})}finally{e(`/runs/${O}`)}},G=async O=>{if(window.confirm("Delete this project history entry permanently?")){y(O);try{const $=await Te(`/api/project/history/${O}`,{method:"DELETE"}),Y=await $.text();if(!$.ok)throw new Error(Y||"Failed to delete");b(W=>W.filter(fe=>fe.runId!==O)),t({title:"Deleted"})}catch($){t({title:"Delete failed",description:$ instanceof Error?$.message:"Failed to delete",variant:"destructive"})}finally{y(null)}}},L=async O=>{if(!(!n||x)){S(O);try{const $=await Te(`/api/${O}/pull`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:n.id})}),Y=await $.text();if(!$.ok)try{const fe=JSON.parse(Y);throw new Error(fe.error||Y||"Pull failed")}catch(fe){throw fe instanceof Error&&fe.message!==Y?fe:new Error(Y||"Pull failed")}const W=JSON.parse(Y);W.project&&(v(W.project),o(nh(W.project,i))),t({title:`${O.charAt(0).toUpperCase()+O.slice(1)} synced`,description:W.message||"Pull complete."})}catch($){t({title:"Pull failed",description:$ instanceof Error?$.message:"Something went wrong",variant:"destructive"})}finally{S(null)}}},Z=()=>{if(i.kind==="none"){t({title:"Connect a project first",description:"Use Connect GitHub or Connect Local.",variant:"destructive"});return}e("/upload")};return u.jsx(ao,{repoUrl:j,children:u.jsxs("div",{className:"max-w-[960px] mx-auto px-6 py-8",children:[u.jsx(le.div,{initial:{opacity:0,y:12}
371,animate:{opacity:1,y:0},transition:{duration:.4},className:"mb-8",children:u.jsxs("div",{className:"surface-raised p-6 md:p-8 relative overflow-hidden",children:[u.jsx("div",{className:"absolute top-[-20%] right-[-10%] w-[350px] h-[250px] bg-primary/[0.06] rounded-full blur-[80px] pointer-events-none"}),u.jsx("div",{className:"absolute bottom-[-15%] left-[-5%] w-[250px] h-[200px] bg-accent/[0.04] rounded-full blur-[70px] pointer-events-none"}),u.jsxs("div",{className:"relative z-10 flex items-start justify-between gap-6",children:[u.jsxs("div",{className:"flex-1",children:[u.jsxs("h1",{className:"text-[22px] font-semibold tracking-tight mb-2",children:["Hey ",C]}),u.jsx("p",{className:"text-[14px] text-muted-foreground leading-relaxed mb-5 max-w-[400px]",children:"Paste your feedback, review an implementation plan, and ship updates with confidence."}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs(oe,{onClick:Z,disabled:!T,className:"h-9 px-4 rounded-lg bg-primary hover:bg-primary/90 border-0 text-[13px] font-medium",children:[u.jsx(tp,{className:"mr-1.5 h-3.5 w-3.5"}),"Generate a Plan"]}),u.jsxs(yt,{to:"/sync",className:"text-[13px] text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1",children:["Connect project",u.jsx(wN,{className:"h-3 w-3"})]})]})]}),u.jsx("div",{className:"hidden md:block",children:u.jsx(ly,{size:72,mood:T?"happy":"thinking"})})]})]})}),u.jsx(le.section,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.05,duration:.4},className:"mb-8",children:u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[u.jsx(yt,{to:"/sync",className:"float-card p-4 group block",children:u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"h-9 w-9 rounded-lg bg-primary/10 border border-primary/15 flex items-center justify-center",children:u.jsx(NN,{className:"h-4 w-4 text-primary"})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-[13px] font-medium",children:"Manage Project Source"}),u.jsx("div",{className:"text-[12px] text-muted-foreground mt-0.5",children:"Connect or switch between GitHub and local projects"})]}),u.jsx(Zh,{className:"h-3.5 w-3.5 text-muted-foreground/30 group-hover:text-primary transition-all group-hover:translate-x-0.5"})]})}),u.jsx(yt,{to:"/upload",className:"float-card p-4 group block",children:u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"h-9 w-9 rounded-lg bg-accent/10 border border-accent/15 flex items-center justify-center",children:u.jsx(VN,{className:"h-4 w-4 text-accent"})}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-[13px] font-medium",children:"Upload Feedback"}),u.jsx("div",{className:"text-[12px] text-muted-foreground mt-0.5",children:"Paste your transcript and generate your plan"})]}),u.jsx(Zh,{className:"h-3.5 w-3.5 text-muted-foreground/30 group-hover:text-accent transition-all group-hover:translate-x-0.5"})]})})]})}),u.jsxs(le.section,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.1,duration:.4},className:"mb-8",children:[u.jsx("div",{className:"section-label mb-3",children:"Project"}),u.jsxs("div",{className:"surface p-4",children:[u.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap mb-4",children:[u.jsxs("div",{className:"flex items-center gap-2.5",children:[u.jsx("div",{className:`h-1.5 w-1.5 rounded-full ${i.kind!=="none"?"bg-accent":"bg-muted-foreground/30"}`}),u.jsx("span",{className:"text-[13px] font-medium",children:I}),i.kind==="github"&&i.repoUrl&&u.jsx("span",{className:"text-[12px] text-muted-foreground font-mono",children:i.repoUrl}),i.kind==="local"&&i.localPath&&u.jsx("span",{className:"text-[12px] text-muted-foreground font-mono",children:i.localPath})]}),u.jsxs("div",{className:"flex gap-2",children:[f&&u.jsx("span",{className:"text-[11px] text-amber-400 bg-amber-500/10 border border-amber-500/15 rounded px-2 py-0.5",children:"Undoable changes"}),(p==null?void 0:p.connectionStatus)==="failed"&&p.lastConnectionError&&u.jsx("span",{className:"text-[11px] text-red-400 bg-red-500/8 border border-red-500/15 rounded px-2 py-0.5",children:p.lastConnectionError})]})]}),u.jsx("div",{className:"section-label mb-2 mt-1",children:"Connect"}),u.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 ga
371p-2 mb-3",children:[u.jsx(oe,{variant:"outline",size:"sm",onClick:()=>e("/sync?mode=github"),className:"h-8 text-[12px] rounded-lg border-border bg-transparent hover:bg-white/[0.03]",children:"GitHub"}),u.jsx(oe,{variant:"outline",size:"sm",onClick:()=>e("/sync?mode=local"),className:"h-8 text-[12px] rounded-lg border-border bg-transparent hover:bg-white/[0.03]",children:"Local"}),u.jsx(oe,{variant:"outline",size:"sm",onClick:()=>e("/sync?mode=slack"),className:"h-8 text-[12px] rounded-lg border-border bg-transparent hover:bg-white/[0.03]",children:"Slack"}),u.jsx(oe,{variant:"outline",size:"sm",onClick:()=>e("/sync?mode=jira"),className:"h-8 text-[12px] rounded-lg border-border bg-transparent hover:bg-white/[0.03]",children:"Jira"}),u.jsx(oe,{variant:"outline",size:"sm",onClick:()=>e("/sync?mode=notion"),className:"h-8 text-[12px] rounded-lg border-border bg-transparent hover:bg-white/[0.03]",children:"Notion"})]}),u.jsx("div",{className:"section-label mb-2",children:"Pull latest"}),u.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-3 gap-2 mb-3",children:[u.jsxs(oe,{variant:"outline",size:"sm",onClick:()=>void L("slack"),disabled:x!==null||i.kind!=="slack",className:"h-8 text-[12px] rounded-lg border-border bg-transparent hover:bg-white/[0.03]",children:[u.jsx(wf,{className:`mr-1.5 h-3 w-3 ${x==="slack"?"animate-spin":""}`}),x==="slack"?"Pullingâ¦":"Pull Slack Data"]}),u.jsxs(oe,{variant:"outline",size:"sm",onClick:()=>void L("jira"),disabled:x!==null||i.kind!=="jira",className:"h-8 text-[12px] rounded-lg border-border bg-transparent hover:bg-white/[0.03]",children:[u.jsx(wf,{className:`mr-1.5 h-3 w-3 ${x==="jira"?"animate-spin":""}`}),x==="jira"?"Pullingâ¦":"Pull Jira Data"]}),u.jsxs(oe,{variant:"outline",size:"sm",onClick:()=>void L("notion"),disabled:x!==null||i.kind!=="notion",className:"h-8 text-[12px] rounded-lg border-border bg-transparent hover:bg-white/[0.03]",children:[u.jsx(wf,{className:`mr-1.5 h-3 w-3 ${x==="notion"?"animate-spin":""}`}),x==="notion"?"Pullingâ¦":"Pull Notion Data"]})]}),u.jsx("div",{className:"section-label mb-2",children:"Disconnect"}),u.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-2",children:[u.jsx(oe,{variant:"outline",size:"sm",onClick:()=>H("github"),disabled:c!==null||i.kind!=="github",className:"h-8 text-[12px] rounded-lg border-border bg-transparent hover:bg-red-500/10 hover:text-red-400 hover:border-red-500/20",children:c==="github"?"...":"GitHub"}),u.jsx(oe,{variant:"outline",size:"sm",onClick:()=>H("local"),disabled:c!==null||i.kind!=="local",className:"h-8 text-[12px] rounded-lg border-border bg-transparent hover:bg-red-500/10 hover:text-red-400 hover:border-red-500/20",children:c==="local"?"...":"Local"}),u.jsx(oe,{variant:"outline",size:"sm",onClick:()=>H("slack"),disabled:c!==null||i.kind!=="slack",className:"h-8 text-[12px] rounded-lg border-border bg-transparent hover:bg-red-500/10 hover:text-red-400 hover:border-red-500/20",children:"Slack"}),u.jsx(oe,{variant:"outline",size:"sm",onClick:()=>H("jira"),disabled:c!==null||i.kind!=="jira",className:"h-8 text-[12px] rounded-lg border-border bg-transparent hover:bg-red-500/10 hover:text-red-400 hover:border-red-500/20",children:"Jira"}),u.jsx(oe,{variant:"outline",size:"sm",onClick:()=>H("notion"),disabled:c!==null||i.kind!=="notion",className:"h-8 text-[12px] rounded-lg border-border bg-transparent hover:bg-red-500/10 hover:text-red-400 hover:border-red-500/20",children:"Notion"})]})]})]}),u.jsxs(le.section,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.15,duration:.4},className:"mb-8",children:[u.jsx("div",{className:"section-label mb-3",children:"Project history"}),u.jsx("div",{className:"surface overflow-hidden",children:g.length?u.jsx("div",{className:"divide-y divide-border",children:g.map(O=>{var Y;const $=O.projectType==="github"?O.repoUrl||"GitHub project":O.projectType==="local"?((Y=O.source)==null?void 0:Y.replace(/^local:/,""))||"Local project":"Workspace";return u.jsxs("div",{className:"flex items-center justify-between gap-4 px-4 py-3 hover:bg-white/[0.015] transition-colors",children:[u.jsxs("button",{type:"button",onClick:()=>void D(O.runId),className:"min-w-0 text-left",children:[u.jsx("div",{className:"text-[13px] font-medium truncate",children:$}),u.jsxs("div",{className:"text-[11px] text-muted-foreground mt-0.5",children:[O.branch||"No branch"," · ",O.lastOpenedAt?Cx(new Date(O.lastOpenedAt),"MMM d, h:mm a"):"No timestamp"]})]}),u.jsx(oe,{variant:"ghost",size:"sm",onClick:()=>void G(O.runId),disabled:w===O.runId,className:"h-7 px-2 text-[11px] text-muted-foreground hover:text-red-400 rounded-md",children:u.jsx(FN,{className:"h-3 w-3"})})]},O.runId)})}):u.jsx("div",{className:"px-4 py-4 text-[13px] text-muted-foreground",children:"No saved project history yet."})})]}),u.jsxs(le.section,{initial:{opacity:0,y:12}
371,animate:{opacity:1,y:0},transition:{delay:.2,duration:.4},children:[u.jsx("div",{className:"section-label mb-3",children:"Recent runs"}),r?u.jsx("div",{className:"space-y-2",children:[1,2,3].map(O=>u.jsx(qc,{className:"h-12 w-full rounded-lg bg-card"},O))}):a.length>0?u.jsx("div",{className:"surface overflow-hidden",children:u.jsx("div",{className:"divide-y divide-border",children:a.map(O=>u.jsxs("button",{type:"button",onClick:()=>void D(O.id),className:"w-full text-left flex items-center justify-between px-4 py-3 hover:bg-white/[0.02] transition-colors group",children:[u.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[u.jsx(IN,{className:"h-3 w-3 text-muted-foreground/40 shrink-0 group-hover:text-primary transition-colors"}),u.jsx("span",{className:"text-[13px] font-medium truncate",children:O.title})]}),u.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[u.jsx("span",{className:_(O.status),children:O.status}),u.jsx("span",{className:"text-[11px] text-muted-foreground",children:Cx(new Date(O.created_at),"MMM d, h:mm a")})]})]},O.id))})}):u.jsxs("div",{className:"surface p-8 text-center relative overflow-hidden",children:[u.jsx("div",{className:"mb-4",children:u.jsx(cy,{compact:!0})}),u.jsx("div",{className:"text-[15px] font-medium mb-1.5",children:"No runs yet"}),u.jsx("div",{className:"text-[13px] text-muted-foreground mb-5 max-w-sm mx-auto",children:"Your generated plans will appear here after you create your first run."}),u.jsxs(oe,{variant:"outline",onClick:Z,disabled:!T,className:"h-8 px-4 text-[12px] rounded-lg border-border bg-transparent hover:bg-white/[0.03]",children:[u.jsx(tp,{className:"mr-1.5 h-3 w-3"}),"Generate a Plan"]})]})]})]})})}const Ji=m.forwardRef(({className:e,...t},n)=>u.jsx("textarea",{className:Re("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
371ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Ji.displayName="Textarea";function U8(e){const t=V8(e),n=m.forwardRef((r,s)=>{const{children:i,...o}=r,a=m.Children.toArray(i),l=a.find(z8);if(l){const c=l.props.children,d=a.map(f=>f===l?m.Children.count(c)>1?m.Children.only(null):m.isValidElement(c)?c.props.children:null:f);return u.jsx(t,{...o,ref:s,children:m.isValidElement(c)?m.cloneElement(c,void 0,d):null})}return u.jsx(t,{...o,ref:s,children:i})});return n.displayName=`${e}.Slot`,n}function V8(e){const t=m.forwardRef((n,r)=>{const{children:s,...i}=n;if(m.isValidElement(s)){const o=H8(s),a=W8(i,s.props);return s.type!==m.Fragment&&(a.ref=r?Es(r,o):o),m.cloneElement(s,a)}return m.Children.count(s)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var B8=Symbol("radix.slottable");function z8(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===B8}function W8(e,t){const n={...t};for(const r in t){const s=e[r],i=t[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...a)=>{const l=i(...a);return s(...a),l}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...e,...n}}function H8(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Fd="Dialog",[yT]=ur(Fd),[q8,zn]=yT(Fd),vT=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:i,modal:o=!0}=e,a=m.useRef(null),l=m.useRef(null),[c,d]=mi({prop:r,defaultProp:s??!1,onChange:i,caller:Fd});return u.jsx(q8,{scope:t,triggerRef:a,contentRef:l,contentId:ps(),titleId:ps(),descriptionId:ps(),open:c,onOpenChange:d,onOpenToggle:m.useCallback(()=>d(f=>!f),[d]),modal:o,children:n})};vT.displayName=Fd;var wT="DialogTrigger",K8=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=zn(wT,n),i=qe(t,s.triggerRef);return u.jsx(Ee.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":by(s.open),...r,ref:i,onClick:ne(e.onClick,s.onOpenToggle)})});
vendor: 5,259 bytes, lines 371-375
371K8.displayName=wT;var wy="DialogPortal",[G8,xT]=yT(wy,{forceMount:void 0}),bT=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,i=zn(wy,t);return u.jsx(G8,{scope:t,forceMount:n,children:m.Children.map(r,o=>u.jsx(Un,{present:n||i.open,children:u.jsx(ld,{asChild:!0,container:s,children:o})}))})};bT.displayName=wy;var zu="DialogOverlay",ST=m.forwardRef((e,t)=>{const n=xT(zu,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=zn(zu,e.__scopeDialog);return i.modal?u.jsx(Un,{present:r||i.open,children:u.jsx(J8,{...s,ref:t})}):null});ST.displayName=zu;var Y8=U8("DialogOverlay.RemoveScroll"),J8=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=zn(zu,n);return u.jsx(dy,{as:Y8,allowPinchZoom:!0,shards:[s.contentRef],children:u.jsx(Ee.div,{"data-state":by(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),fi="DialogContent",kT=m.forwardRef((e,t)=>{const n=xT(fi,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,i=zn(fi,e.__scopeDialog);return u.jsx(Un,{present:r||i.open,children:i.modal?u.jsx(Q8,{...s,ref:t}):u.jsx(X8,{...s,ref:t})})});kT.displayName=fi;var Q8=m.forwardRef((e,t)=>{const n=zn(fi,e.__scopeDialog),r=m.useRef(null),s=qe(t,n.contentRef,r);return m.useEffect(()=>{const i=r.current;if(i)return dC(i)},[]),u.jsx(_T,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ne(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ne(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&i.preventDefault()}),onFocusOutside:ne(e.onFocusOutside,i=>i.preventDefault())})}),X8=m.forwardRef((e,t)=>{const n=zn(fi,e.__scopeDialog),r=m.useRef(!1),s=m.useRef(!1);return u.jsx(_T,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,a;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const o=i.target;((c=n.triggerRef.current)==null?void 0:c.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})}),_T=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:i,...o}=e,a=zn(fi,n),l=m.useRef(null),c=qe(t,l);return nC(),u.jsxs(u.Fragment,{children:[u.jsx(uy,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:i,children:u.jsx(bl,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":by(a.open),...o,ref:c,onDismiss:()=>a.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(Z8,{titleId:a.titleId}),u.jsx(tz,{contentRef:l,descriptionId:a.descriptionId})]})]})}),xy="DialogTitle",ET=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=zn(xy,n);return u.jsx(Ee.h2,{id:s.titleId,...r,ref:t})});ET.displayName=xy;var CT="DialogDescription",TT=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=zn(CT,n);return u.jsx(Ee.p,{id:s.descriptionId,...r,ref:t})});TT.displayName=CT;var PT="DialogClose",jT=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=zn(PT,n);return u.jsx(Ee.button,{type:"button",...r,ref:t,onClick:ne(e.onClick,()=>s.onOpenChange(!1))})});jT.displayName=PT;function by(e){return e?"open":"closed"}var NT="DialogTitleWarning",[Tz,RT]=w2(NT,{contentName:fi,titleName:xy,docsSlug:"dialog"}),Z8=({titleId:e})=>{const t=RT(NT),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. 372 373If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. 374 375For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},ez="DialogDescriptionWarning",tz=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${RT(ez).contentName}}.`;return m.useEffect(()=>{var i;const s=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},nz=vT,rz=bT,AT=ST,OT=kT,MT=ET,IT=TT,sz=jT;const iz=nz,oz=rz,DT=m.forwardRef(({className:e,...t},n)=>u.jsx(AT,{ref:n,className:Re("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}));DT.displayName=AT.displayName;const LT=m.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(oz,{children:[u.jsx(DT,{}),u.jsxs(OT,{ref:r,className:Re("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:rou
375nded-lg",e),...n,children:[t,u.jsxs(sz,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[u.jsx(fd,{className:"h-4 w-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));LT.displayName=OT.displayName;const $T=({className:e,...t})=>u.jsx("div",{className:Re("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});$T.displayName="DialogHeader";const FT=({className:e,...t})=>u.jsx("div",{className:Re("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});FT.displayName="DialogFooter";const UT=m.forwardRef(({className:e,...t},n)=>u.jsx(MT,{ref:n,className:Re("text-lg font-semibold leading-none tracking-tight",e),...t}));UT.displayName=MT.displayName;const VT=m.forwardRef(({className:e,...t},n)=>u.jsx(IT,{ref:n,className:Re("text-sm text-muted-foreground",e),...t}));VT.displayName=IT.displayName;function Sy({state:e,onOpenChange:t}){return u.jsx(iz,{open:e.open,onOpenChange:t,children:u.jsxs(LT,{className:"bg-card border-border rounded-xl",children:[u.jsxs($T,{children:[u.jsx(UT,{className:"text-[15px]",children:e.title||"Action failed"}),u.jsx(VT,{className:"text-[13px]",children:e.explanation})]}),u.jsxs("div",{className:"rounded-lg border border-red-500/15 bg-red-500/8 p-3 text-[13px] text-red-400",children:[u.jsx("div",{className:"font-medium text-[11px] uppercase tracking-wider text-red-400/70 mb-1",children:"Reason"}),u.jsx("div",{children:e.reason})]}),u.jsxs("div",{className:"rounded-lg border border-border bg-card p-3 text-[13px]",children:[u.jsx("div",{className:"font-medium text-[11px] uppercase tracking-wider text-muted-foreground mb-1",children:"What to do next"}),u.jsx("div",{className:"text-muted-foreground",children:e.nextSteps})]}),e.technicalDetails?u.jsxs("details",{className:"rounded-lg border border-border bg-card p-3 text-[12px]",children:[u.jsx("summary",{className:"cursor-pointer text-muted-foreground hover:text-foreground transition-colors text-[11px]",children:"Technical details"}),u.jsx("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap break-words text-muted-foreground",children:e.technicalDetails})]}):null,u.jsx(FT,{children:u.jsx(oe,{onClick:()=>t(!1),className:"h-8 rounded-lg bg-primary hover:bg-primary/90 border-0 text-[13px]",children:"Close"})})]})})}const az=new Set(["auth_failed","permission_denied","repo_not_found","remote_rejected","origin_not_allowed","network_error","gemini_rate_limited","gemini_model_not_found","slack_auth_failed","slack_missing_scope","slack_rate_limited","jira_auth_failed","jira_rate_limited","jira_jql_invalid","notion_auth_failed","notion_access_denied","notion_rate_limited"]);function nm(e,t){const n=(e||"").trim().toLowerCase();if(az.has(n))return!0;const r=(t||"").toLowerCase();return r.includes("permission")||r.includes("authentication")||r.includes("token")||r.includes("forbidden")||r.includes("403")}function ul(e){try{return JSON.parse(e)}catch{return{error:e}}}function dl(e,t,n){return{reason:e.exactReason||e.reasonMessage||e.error||e.message||t,nextSteps:e.nextSteps||n,technicalDetails:e.technicalDetails}}function lz(e,t){const n=(e??"").trim();return n.startsWith("local:")?{mode:"local",localPath:n.slice(6),githubUrl:"",slackWorkspace:"",jiraSite:"",notionLabel:"",branch:(t==null?void 0:t.trim())||""}:n.startsWith("slack:")?{mode:"slack",localPath:"",githubUrl:"",slackWorkspace:n.slice(6),jiraSite:"",notionLabel:"",branch:""}:n.startsWith("jira:")?{mode:"jira",localPath:"",githubUrl:"",slackWorkspace:"",jiraSite:n.slice(5),notionLabel:"",branch:""}:n.startsWith("notion:")?{mode:"notion",localPath:"",githubUrl:"",slackWorkspace:"",jiraSite:"",notionLabel:n.slice(7),branch:""}:{mode:"github",localPath:"",githubUrl:n,slackWorkspace:"",jiraSite:"",notionLabel:"",branch:(t==null?void 0:t.trim())||""}}function cz(){var js;const{user:e}=Ts(),t=hr(),{toast:n}=Ro(),[r]=kg(),[s,i]=m.useState("github"),[o,a]=m.useState(""),[l,c]=m.useState(""),[d,f]=m.useState(""),[h,p]=m.useState(""),[v,g]=m.useState(""),[b,w]=m.useState(""),[y,x]=m.useState(null),[S,k]=m.useState(""),[E,C]=m.useState(""),[_,j]=m.useState(""),[T,I]=m.useState(""),[M,H]=m.useState(""),[D,G]=m.useState(""),[L,Z]=m.useState(null),[N,P]=m.useState(""),[F,O]=m.useState(""),[$,Y]=m.useState(""),[W,fe]=m.useState(null),[ke,ae]=m.useState(!1),[Pe,Ae]=m.useState(null),[Qe,me]=m.useState(""),[Et,zt]=m.useState(""),[Wn,sn]=m.useState({open:!1,title:"",explanation:"",reason:"",nextSteps:"",technicalDetails:""});m.useEffect(()=>{e&&Ve.from("user_settings").select("repo_url, repo_branch").eq("user_id",e.id).maybeSingle().then(({data:z,error:ge})=>{if(ge){console.error(ge);return}const te=lz((z==null?void 0:z.repo_url)??null,(z==null?void 0:z.repo_branch)??null);i(te.mode),f(te.localPath),a(te.githubUrl),c(te.branch),w(te.slackWorkspace),G(te.jiraSite),Y(te.notionLabel);const he=r.get("mode");(he==="github"||he==="local"||he==="slack"||he==="jira"||he==="notion")&&i(he)})},[e,r]),m.useEffect(()=>{e&&(async()=>{const z=await Te(`/api/slack/connection?userId=${encodeURIComponent(e.id)}`).catch(()=>null);if(!(z!=null&&z.ok))return;const ge=await z.json();if(!ge.success)return;const te=ge.connection||null;x(te),te!=null&&te.channelInput&&g(he=>he||te.channelInput||""),te!=null&&te.teamName&&w(he=>he||te.teamName||"")})()},[e]),m.useEffect(()=>{e&&(async()=>{const z=await Te(`/api/jira/connection?userId=${encodeURIComponent(e.id)}`).catch(()=>null);if(!(z!=null&&z.ok))return;const ge=await z.json();if(!ge.success)return;const te=ge.connection||null;Z(te),te!=null&&te.siteUrl&&k(he=>he||te.siteUrl||""),te!=null&&te.email&&C(he=>he||te.email||""),te!=null&&te.projectInput&&I(he=>he||te.projectInput||""),te!=null&&te.jqlInput&&H(he=>he||te.jqlInput||""),te!=null&&te.siteName&&G(he=>he||te.siteName||"")})()},[e]),m.useEffect(()=>{e&&(async()=>{const z=await Te(`/api/notion/connection?userId=${encodeURIComponent(e.id)}`).catch(()=>null);if(!(z!=null&&z.ok))return;const ge=await z.json();if(!ge.success)return;const te=ge.connection||null;fe(te),te!=null&&te.targetInput&&O(he=>he||te.targetInput||""),te!=null&&te.label&&Y(he=>he||te.label||"")})()},[e]);const on=m.useMemo(()=>s==="local"?d||null:s==="slack"?b||(y==null?void 0:y.teamName)||"Slack Workspace":s==="jira"?D||(L==null?void 0:L.siteName)||"Jira Site":s==="notion"?$||(W==null?void 0:W.label)||"Notion Workspace":o||null,[s,d,o,b,y==null?void 0:y.teamName,D,L==null?void 0:L.siteName,$,W==null?void 0:W.label]),Ce=m.useMemo(()=>{const z=(Pe==null?void 0:Pe.availableBranches)||[];return Array.from(new Set(z.map(ge=>ge.trim()).filter(ge=>ge&&!ge.startsWith("spec-me/"))))},[Pe==null?void 0:Pe.availableBranches]),pr=async z=>{if(z.preventDefault(),!!e){if(s==="github"&&!o.trim()){n({title:"Error",description:"Repository URL is required.",variant:"destructive"});return}if(s==="local"&&!d.trim()){n({title:"Error",description:"Local project folder path is required.",variant:"destructive"});return}if(s==="slack"&&!v.trim()){n({title:"Error",description:"Enter at least one Slack channel name or channel ID.",variant:"destructive"});return}if(s==="jira"&&!S.trim()){n({title:"Error",description:"Jira site URL is required.",variant:"destructive"});return}if(s==="jira"&&!E.trim()){n({title:"Error",description:"Jira account email is required.",variant:"destructive"});return}if(s==="jira"&&!T.trim()&&!M.trim()){n({title:"Error",description:"Enter Jira project keys or provide a custom JQL query.",variant:"destructive"});return}if(s==="notion"&&!F.trim()){n({title:"Error",description:"Enter at least one Notion page or database URL/ID.",variant:"destructive"});return}await Dt()}},Dt=async z=>{var an,As,R,V;if(!e)return;const ge=o.trim(),te=d.trim(),he=h.trim(),Hn=v.trim(),Bo=S.trim(),zo=E.trim(),Ir=_.trim(),Wo=T.trim(),vi=M.trim(),Ns=N.trim(),qn=F.trim(),Rs=(z==null?void 0:z.trim())||l.trim();ae(!0),Ae(null);try{const q=await Te("/api/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s==="github"?{mode:"github",repoUrl:ge,repoBranch:Rs}:s==="local"?{mode:"local",localPath:te}:s==="slack"?{mode:"slack",userId:e.id,slackToken:he,slackChannels:Hn}
375:s==="jira"?{mode:"jira",userId:e.id,jiraSiteUrl:Bo,jiraEmail:zo,jiraApiToken:Ir,jiraProjects:Wo,jiraJql:vi}:{mode:"notion",userId:e.id,notionToken:Ns,notionTargets:qn})}),K=await q.text();if(!q.ok){let Se=null;try{Se=JSON.parse(K)}catch{Se=null}const Wt=Array.isArray(Se==null?void 0:Se.availableBranches)?Se.availableBranches:[];if(Ae({message:(Se==null?void 0:Se.error)||K||"Sync failed",reason:Se==null?void 0:Se.reason,availableBranches:Wt}),Wt.length>0){const Ht=Wt.find(ln=>!ln.startsWith("spec-me/"));me(ln=>ln||Ht||Wt[0])}else me("");const xn=dl(Se||ul(K),"Project sync failed.","Reconnect GitHub, local, Slack, Jira, or Notion source and verify access before retrying.");sn({open:!0,title:"Project sync failed",explanation:"SpecMe could not connect to the selected project source.",reason:xn.reason,nextSteps:xn.nextSteps,technicalDetails:xn.technicalDetails||K});return}let ce=null,we="",ye="",J="";try{const Se=JSON.parse(K);ce=((an=Se.branch)==null?void 0:an.trim())||null,we=((As=Se.workspaceLabel)==null?void 0:As.trim())||"",ye=((R=Se.siteLabel)==null?void 0:R.trim())||"",J=((V=Se.notionLabel)==null?void 0:V.trim())||""}catch{ce=null,we="",ye="",J=""}const ue=s==="local"?`local:${te}`:s==="slack"?`slack:${we||b||(y==null?void 0:y.teamName)||"Slack Workspace"}`:s==="jira"?`jira:${ye||D||(L==null?void 0:L.siteName)||"Jira Site"}`:s==="notion"?`notion:${J||$||(W==null?void 0:W.label)||"Notion Workspace"}`:ge,re=s==="github"?ce||Rs||"main":null,{error:Be}=await Ve.from("user_settings").upsert({user_id:e.id,repo_url:ue,repo_branch:re,updated_at:new Date().toISOString()},{onConflict:"user_id"});if(Be)throw Be;ce&&c(ce),we&&w(we),s==="slack"&&p(""),ye&&G(ye),s==="jira"&&j(""),J&&Y(J),s==="notion"&&P(""),n({title:s==="slack"?"Slack linked":s==="jira"?"Jira linked":s==="notion"?"Notion linked":"Project linked",description:s==="slack"?"Slack workspace saved and indexed successfully.":s==="jira"?"Jira site saved and indexed successfully.":s==="notion"?"Notion export saved and indexed successfully.":"Saved and indexed successfully."}),t("/dashboard")}catch(q){const K=q instanceof Error?q.message:"Something went wrong";sn({open:!0,title:"Project sync failed",explanation:"SpecMe could not reach or authenticate with the selected project source.",reason:K,nextSteps:"Check network access and credentials, then retry sync.",technicalDetails:q instanceof Error?q.stack||q.message:String(q)})}finally{ae(!1)}},Mr=async()=>{await Dt()},wn=async()=>{const z=Et.trim()||Qe.trim();if(!z){n({title:"Branch required",description:"Type a branch name or select an existing branch and retry.",variant:"destructive"});return}c(z),await Dt(z)};return u.jsxs(ao,{repoUrl:on,children:[u.jsxs("div",{className:"max-w-lg mx-auto px-6 py-10 animate-fade-in",children:[u.jsxs(yt,{to:"/dashboard",className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors mb-6",children:[u.jsx(dd,{className:"h-3.5 w-3.5"}),"Back to dashboard"]}),u.jsx("h1",{className:"text-2xl font-bold tracking-tight text-foreground mb-1",children:"Connect Project"}),u.jsx("p",{className:"text-muted-foreground text-sm mb-8",children:"Use a GitHub repository, local folder, Slack workspace, Jira site, or Notion export as the source for analysis."}),u.jsx("div",{className:"glass-card p-6",children:u.jsxs("form",{onSubmit:pr,className:"space-y-5",children:[u.jsxs("div",{className:"flex flex-wrap gap-2",children:[u.jsx(oe,{type:"button",variant:s==="github"?"default":"outline",onClick:()=>i("github"),className:"whitespace-nowrap",children:"GitHub Repo"}),u.jsx(oe,{type:"button",variant:s==="local"?"default":"outline",onClick:()=>i("local"),className:"whitespace-nowrap",children:"Local Folder"}),u.jsx(oe,{type:"button",variant:s==="slack"?"default":"outline",onClick:()=>i("slack"),className:"whitespace-nowrap",children:"Slack Workspace"}),u.jsx(oe,{type:"button",variant:s==="jira"?"default":"outline",onClick:()=>i("jira"),className:"whitespace-nowrap",children:"Jira Site"}),u.jsx(oe,{type:"button",variant:s==="notion"?"default":"outline",onClick:()=>i("notion"),className:"whitespace-nowrap",children:"Notion"})]}),s==="github"?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(tt,{htmlFor:"repo_url",children:"Repository URL *"}),u.jsx(Tt,{id:"repo_url",value:o,onChange:z=>a(z.target.value),placeholder:"https://github.com/org/repo.git",required:!0,className:"font-mono text-sm"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(tt,{htmlFor:"repo_branch",children:"Branch (optional)"}
375),u.jsx(Tt,{id:"repo_branch",value:l,onChange:z=>c(z.target.value),placeholder:"main",className:"font-mono text-sm"})]}),o.trim()?u.jsx("a",{href:o.trim(),target:"_blank",rel:"noreferrer",className:"text-xs text-primary underline underline-offset-2",children:"Open GitHub project"}):null]}):s==="local"?u.jsxs("div",{className:"space-y-2",children:[u.jsx(tt,{htmlFor:"local_path",children:"Local project folder path *"}),u.jsx(Tt,{id:"local_path",value:d,onChange:z=>f(z.target.value),placeholder:"/Users/you/path/to/project",required:!0,className:"font-mono text-sm"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Files will be analyzed and overwritten in this folder."})]}):s==="slack"?u.jsxs("div",{className:"space-y-5",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(tt,{htmlFor:"slack_token",children:"Slack bot token"}),u.jsx(Tt,{id:"slack_token",type:"password",value:h,onChange:z=>p(z.target.value),placeholder:"xoxb-...",className:"font-mono text-sm"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:y!=null&&y.hasSavedToken?`Leave blank to reuse the saved token (${y.tokenPreview}).`:"Required the first time you connect this Slack workspace."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(tt,{htmlFor:"slack_channels",children:"Channels *"}),u.jsx(Ji,{id:"slack_channels",value:v,onChange:z=>g(z.target.value),placeholder:"#engineering, #product, C0123456789",className:"min-h-24 font-mono text-sm"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Enter channel names or IDs, separated by commas or new lines. Private channels must include the bot."})]}),u.jsxs("div",{className:"rounded-md border border-border/70 bg-card/40 p-3 text-xs text-muted-foreground",children:[u.jsx("div",{className:"font-medium text-foreground",children:b||(y==null?void 0:y.teamName)||"Slack workspace"}),u.jsx("div",{className:"mt-1",children:"Slack sync pulls recent channel history into a read-only local export for analysis. Required bot scopes typically include `channels:read`, `channels:history`, `groups:read`, and `groups:history`."}),y!=null&&y.lastSyncedAt?u.jsxs("div",{className:"mt-2",children:["Last pull: ",new Date(y.lastSyncedAt).toLocaleString()]}):null]})]}):s==="jira"?u.jsxs("div",{className:"space-y-5",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(tt,{htmlFor:"jira_site_url",children:"Jira site URL *"}),u.jsx(Tt,{id:"jira_site_url",value:S,onChange:z=>k(z.target.value),placeholder:"https://your-site.atlassian.net",className:"font-mono text-sm"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(tt,{htmlFor:"jira_email",children:"Jira account email *"}),u.jsx(Tt,{id:"jira_email",value:E,onChange:z=>C(z.target.value),placeholder:"[email protected]",className:"font-mono text-sm"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(tt,{htmlFor:"jira_api_token",children:"Jira API token"}),u.jsx(Tt,{id:"jira_api_token",type:"password",value:_,onChange:z=>j(z.target.value),placeholder:"ATATT...",className:"font-mono text-sm"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:L!=null&&L.hasSavedToken?`Leave blank to reuse the saved token (${L.tokenPreview}).`:"Required the first time you connect this Jira site."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(tt,{htmlFor:"jira_projects",children:"Project keys"}),u.jsx(Ji,{id:"jira_projects",value:T,onChange:z=>I(z.target.value),placeholder:"ENG, PRODUCT",className:"min-h-20 font-mono text-sm"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Enter Jira project keys separated by commas or new lines. You can also leave this blank and use custom JQL below."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(tt,{htmlFor:"jira_jql",children:"Custom JQL (optional)"}),u.jsx(Ji,{id:"jira_jql",value:M,onChange:z=>H(z.target.value),placeholder:"project in (ENG, PRODUCT) AND statusCategory != Done ORDER BY updated DESC",className:"min-h-24 font-mono text-sm"})]}),u.jsxs("div",{className:"rounded-md border border-border/70 bg-card/40 p-3 text-xs text-muted-foreground",children:[u.jsx("div",{className:"font-medium text-foreground",children:D||(L==null?void 0:L.siteName)||"Jira site"}),u.jsx("div",{className:"mt-1",children:"Jira sync pulls recent issues into a read-only local export for analysis. Jira Cloud API auth uses your account email plus an API token."}),L!=null&&L.effectiveJql?u.jsxs("div",{className:"mt-2",children:["Saved JQL: ",L.effectiveJql]}):null,L!=null&&L.lastSyncedAt?u.jsxs("div",{className:"mt-2",children:["Last pull: ",new Date(L.lastSyncedAt).toLocaleStr
375ing()]}):null]})]}):u.jsxs("div",{className:"space-y-5",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(tt,{htmlFor:"notion_token",children:"Notion integration token"}),u.jsx(Tt,{id:"notion_token",type:"password",value:N,onChange:z=>P(z.target.value),placeholder:"secret_...",className:"font-mono text-sm"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:W!=null&&W.hasSavedToken?`Leave blank to reuse the saved token (${W.tokenPreview}).`:"Required the first time you connect this Notion integration."})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(tt,{htmlFor:"notion_targets",children:"Pages or databases *"}),u.jsx(Ji,{id:"notion_targets",value:F,onChange:z=>O(z.target.value),placeholder:`https://www.notion.so/your-page-id 376https://www.notion.so/your-database-id`,className:"min-h-24 font-mono text-sm"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Enter one or more Notion page/database URLs or IDs, separated by commas or new lines."})]}),u.jsxs("div",{className:"rounded-md border border-border/70 bg-card/40 p-3 text-xs text-muted-foreground",children:[u.jsx("div",{className:"font-medium text-foreground",children:$||(W==null?void 0:W.label)||"Notion workspace"}),u.jsx("div",{className:"mt-1",children:"Notion sync pulls shared page and database content into a read-only local export for analysis. Make sure each target is shared with the integration and that read content access is enabled."}),(js=W==null?void 0:W.targets)!=null&&js.length?u.jsxs("div",{className:"mt-2",children:["Saved targets: ",W.targets.join(", ")]}):null,W!=null&&W.lastSyncedAt?u.jsxs("div",{className:"mt-2",children:["Last pull: ",new Date(W.lastSyncedAt).toLocaleString()]}):null]})]}),u.jsxs(oe,{type:"submit",className:"w-full",disabled:ke,children:[ke&&u.jsx(Pt,{className:"mr-2 h-4 w-4 animate-spin"}),s==="slack"?"Save and Pull Slack Data":s==="jira"?"Save and Pull Jira Data":s==="notion"?"Save and Pull Notion Data":"Save and Sync"]}),Pe&&u.jsxs("div",{className:"rounded-md border border-red-500/30 bg-red-500/10 p-3 text-sm",children:[u.jsx("div",{className:"text-red-200 font-medium",children:s==="github"?"GitHub sync failed":s==="slack"?"Slack sync failed":s==="jira"?"Jira sync failed":s==="notion"?"Notion sync failed":"Local sync failed"}),u.jsx("div",{className:"text-red-200 mt-1",children:Pe.message}),s==="github"&&Pe.reason==="head_invalid"?u.jsxs("div",{className:"mt-3 space-y-2",children:[u.jsx("div",{className:"text-xs text-red-300/80",children:"The repository may be empty or in an invalid state. Try selecting a branch manually, or verify the repository has at least one commit."}),u.jsxs("div",{className:"flex flex-wrap gap-2",children:[u.jsx(oe,{type:"button",variant:"outline",onClick:()=>void Mr(),disabled:ke,children:"Retry Sync"}),u.jsx(oe,{type:"button",variant:"outline",onClick:()=>t("/sync"),children:"Reconnect"})]})]}):s==="github"&&(Pe.reason==="branch_selection_required"||Pe.reason==="branch_missing")?u.jsxs("div",{className:"mt-3 space-y-2",children:[u.jsx("div",{className:"text-xs text-red-300/80",children:"Type a branch name or select an existing branch and retry."}),u.jsx(tt,{htmlFor:"fallback_branch",children:"Select branch"}),Ce.length>0?u.jsx("select",{id:"fallback_branch",value:Qe,onChange:z=>me(z.target.value),className:"h-10 w-full rounded-md border border-border bg-background px-3 text-sm",children:Ce.map(z=>u.jsx("option",{value:z,children:z},z))}):null,u.jsx(Tt,{id:"manual_branch",value:Et,onChange:z=>zt(z.target.value),placeholder:"Type branch name (e.g. main, master, dev, feature/x)",list:"remote-branch-suggestions",className:"font-mono text-sm"}),Ce.length>0?u.jsx("datalist",{id:"remote-branch-suggestions",children:Ce.map(z=>u.jsx("option",{value:z},`suggestion-${z}`))}):null,Ce.length>0?u.jsxs("div",{className:"text-xs text-red-300/80",children:["Available branches: ",Ce.join(", ")]}):u.jsx("div",{className:"text-xs text-red-300/80",children:"Branch list could not be loaded. You can still type a branch name and retry."}),u.jsxs("div",{className:"flex flex-wrap gap-2",children:[u.jsx(oe,{type:"button",variant:"outline",onClick:()=>void wn(),disabled:ke,children:"Select/Type Branch"}),u.jsx(oe,{type:"button",variant:"outline",onClick:()=>void Mr(),disabled:ke,children:"Retry Sync"}),u.jsx(oe,{type:"button",variant:"outline",onClick:()=>t("/sync"),children:"Reconnect"})]})]}):u.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[u.jsx(oe,{type:"button",variant:"outline",onClick:()=>void Mr(),disabled:ke,children:"Retry Sync"}),u.jsx(oe,{type:"button",variant:"outline",onClick:()=>t("/sync"),children:"Reconnect"})]})]})]})})]}),u.jsx(Sy,{state:Wn,onOpenChange:z=>sn(ge=>
376({...ge,open:z}))})]})}function uz(e){const t=e.match(/position\s+(\d+)/i);if(!t)return null;const n=Number(t[1]);return Number.isFinite(n)?n:null}function dz(e,t){if(t===null||t<0)return"";const n=Math.max(0,t-80),r=Math.min(e.length,t+80),s=e.slice(n,r);return s?` 377Around position ${t}: 378${s}`:""}function Ud(e,t="JSON"){try{return JSON.parse(e)}catch(n){const r=n instanceof Error?n.message:String(n),s=uz(r),i=s!==null?` at position ${s}`:"";throw new Error(`Invalid ${t}${i}: ${r}${dz(e,s)}`)}}function fz(e,t="JSON"){const n=JSON.stringify(e,null,2);if(!n||typeof n!="string")throw new Error(`${t} serialization returned empty output.`);return Ud(n,`${t} serialization validation`),n}function hz(){const{user:e}=Ts(),t=hr(),n=fr(),{toast:r}=Ro(),s=n.state,[i,o]=m.useState(""),[a,l]=m.useState(s!=null&&s.prefill?s.prefill:""),[c,d]=m.useState(!1),[f,h]=m.useState(null),[p,v]=m.useState(null),[g,b]=m.useState(!1),[w,y]=m.useState(!1),[x,S]=m.useState({open:!1,title:"",explanation:"",reason:"",nextSteps:"",technicalDetails:""});m.useEffect(()=>{e&&Ve.from("user_settings").select("repo_url").eq("user_id",e.id).maybeSingle().then(async({data:C,error:_})=>{var H,D,G;if(_){console.error("user_settings load error:",_);return}if(!(C!=null&&C.repo_url)){r({title:"No project linked",description:"Please connect a GitHub repo, local folder, Slack workspace, Jira site, or Notion export first.",variant:"destructive"}),t("/sync");return}h(C.repo_url);const j=await Te("/api/project").catch(()=>null);if(!(j!=null&&j.ok)){const L=j?await j.text():"Could not verify active project state.",Z=ul(L),N=dl(Z,"Could not verify active project state.","Reconnect from Sync, then retry.");nm(Z.reason,N.reason)?S({open:!0,title:"Project connection error",explanation:"SpecMe could not verify your active project source.",reason:N.reason,nextSteps:N.nextSteps,technicalDetails:N.technicalDetails||L}):r({title:"Project connection error",description:N.reason,variant:"destructive"}),t("/sync");return}const T=await j.json(),I=((H=T.project)==null?void 0:H.mode)||"workspace",M=((D=T.project)==null?void 0:D.connectionStatus)||"disconnected";if(!T.success||I==="workspace"||M!=="connected"){r({title:"Project not ready",description:((G=T.project)==null?void 0:G.lastConnectionError)||"Reconnect your project source from Sync.",variant:"destructive"}),t("/sync");return}y(!0)})},[e,t,r]);const k=async C=>{if(C.preventDefault(),!e)return;const _=i.trim(),j=a.trim();if(!_||!j){r({title:"Missing fields",description:"Please enter both a title and content.",variant:"destructive"});return}d(!0);try{const{data:T,error:I}=await Ve.from("feedback").insert({user_id:e.id,title:_,content:j}).select("id").single();if(I)throw I;v(T.id),b(!0),r({title:"Feedback saved"})}catch(T){r({title:"Error",description:T instanceof Error?T.message:"Something went wrong",variant:"destructive"})}finally{d(!1)}},E=async()=>{if(!e||!p)return;if(!w){r({title:"Project not ready",description:"Reconnect your project source from Sync before generating.",variant:"destructive"}),t("/sync");return}d(!0);let C=!1;const{data:_,error:j}=await Ve.from("runs").insert({user_id:e.id,feedback_id:p,status:"running"}).select("id").single();if(j||!(_!=null&&_.id)){r({title:"Error",description:(j==null?void 0:j.message)||"Failed to create run",variant:"destructive"}),d(!1);return}const T=_.id;try{await Te("/api/runs/project",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runId:T})}).catch(()=>{});const I=await Te("/api/analyze",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:a,route:(s==null?void 0:s.originRoute)||n.pathname,pageTitle:(s==null?void 0:s.originTitle)||document.title,uiText:(s==null?void 0:s.originUiText)||"",selectedText:(s==null?void 0:s.selectedText)||""})}),M=await I.text();if(!I.ok){const L=ul(M),Z=dl(L,"Generation failed.","Retry in a moment. If this keeps happening, check Gemini configuration and quota.");throw nm(L.reason,Z.reason)&&(S({open:!0,title:"Plan generation failed",explanation:"SpecMe could not generate this plan from the AI service.",reason:Z.reason,nextSteps:Z.nextSteps,technicalDetails:Z.technicalDetails||M}
378),C=!0),new Error(Z.reason||M||"Analysis server error")}const H=Ud(M,"analyze API response");if(!H.success||!H.data)throw new Error(H.error||"Server response missing expected fields (success/data)");const D=H.data,{error:G}=await Ve.from("runs").update({status:"done",spec_output:D,error_message:null}).eq("id",T);if(G)throw G;t(`/runs/${T}`)}catch(I){const M=I instanceof Error?I.message:"Failed to reach analysis server";await Ve.from("runs").update({status:"error",error_message:M}).eq("id",T),C||r({title:"Error",description:M,variant:"destructive"})}finally{d(!1)}};return u.jsxs(ao,{repoUrl:f??null,children:[u.jsxs("div",{className:"max-w-lg mx-auto px-6 py-10",children:[u.jsxs(le.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.5,ease:[.22,1,.36,1]},children:[u.jsxs(yt,{to:"/dashboard",className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground hover:text-foreground transition-colors duration-200 mb-6 group",children:[u.jsx(dd,{className:"h-3.5 w-3.5 group-hover:-translate-x-0.5 transition-transform duration-200"}),"Back"]}),u.jsx("h1",{className:"text-3xl font-bold tracking-tight text-foreground mb-2",children:g?"Ready to Generate":"Upload Feedback"}),u.jsx("p",{className:"text-muted-foreground text-sm mb-8 leading-relaxed",children:g?"Your feedback has been saved. Generate your plan now.":"Paste your feedback or transcript to generate an implementation plan."})]}),u.jsx(le.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1,duration:.5,ease:[.22,1,.36,1]},className:"surface p-6 md:p-8",children:g?u.jsx(le.div,{initial:{opacity:0}
378,animate:{opacity:1},transition:{duration:.4},className:"py-2",children:c?u.jsxs("div",{className:"text-center",children:[u.jsx(cy,{compact:!0}),u.jsx("p",{className:"text-[13px] text-muted-foreground mt-3 animate-pulse",children:"Specy is processing your feedback..."})]}):u.jsxs("div",{className:"text-center",children:[u.jsx("div",{className:"flex justify-center mb-4",children:u.jsx(ly,{size:56,mood:"happy"})}),u.jsx("p",{className:"text-[13px] text-muted-foreground mb-5",children:"Feedback saved. Click below to generate your implementation plan."}),u.jsxs(oe,{onClick:E,disabled:c,className:"rounded-lg px-6 h-9 bg-primary hover:bg-primary/90 border-0 text-[13px] font-medium",children:[u.jsx(tp,{className:"mr-1.5 h-3.5 w-3.5"}),"Generate Plan"]})]})}):u.jsxs("form",{onSubmit:k,className:"space-y-5",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(tt,{className:"text-xs font-medium text-muted-foreground",children:"Title"}),u.jsx(Tt,{value:i,onChange:C=>o(C.target.value),required:!0,placeholder:"Brief description of the change",className:"premium-input"})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(tt,{className:"text-xs font-medium text-muted-foreground",children:"Content"}),u.jsx(Ji,{value:a,onChange:C=>l(C.target.value),rows:6,required:!0,placeholder:"Paste your feedback, transcript, or describe what you want to change...",className:"w-full rounded-xl border border-border bg-card px-4 py-3 text-sm outline-none transition-all duration-300 focus:border-primary/50 focus:ring-1 focus:ring-primary/20 focus:bg-white/[0.05] resize-y min-h-[140px]"})]}),u.jsxs(oe,{type:"submit",disabled:c,className:"w-full h-10 rounded-lg bg-primary hover:bg-primary/90 border-0 text-[13px] font-medium",children:[c&&u.jsx(Pt,{className:"mr-2 h-4 w-4 animate-spin"}),u.jsx(vu,{className:"mr-2 h-4 w-4"}),"Save Feedback"]})]})})]}),u.jsx(Sy,{state:x,onOpenChange:C=>S(_=>({..._,open:C}))})]})}const pz=[".env",".env.local"],rm=e=>e.replace(/\\/g,"/").replace(/^\/+/,""),xc=e=>{const t=rm(e);return t===".env"||t===".env.local"||t.includes("/.env.")||t.endsWith("/.env")||t.endsWith("/.env.local")?!0:pz.some(n=>t.startsWith(n))};function sm(e){if(Array.isArray(e))return e.map(t=>sm(t));if(e&&typeof e=="object"){const t=e,n=Object.keys(t).sort((s,i)=>s.localeCompare(i)),r={};for(const s of n)r[s]=sm(t[s]);return r}return e}function mz(e){var n,r,s;if(!e)return"";const t=[];return(n=e.summary)!=null&&n.trim()&&t.push(`Summary 379${e.summary.trim()}`),(r=e.technical_rationale)!=null&&r.trim()&&t.push(`Technical Rationale 380${e.technical_rationale.trim()}`),(s=e.project_type)!=null&&s.trim()&&t.push(`Project Type 381${e.project_type.trim()}`),(e.risks??[]).length&&t.push(`Risks 382${(e.risks??[]).map(i=>`- ${i}`).join(` 383`)}`),(e.next_steps??[]).length&&t.push(`Next Steps 384${(e.next_steps??[]).map((i,o)=>`${o+1}. ${i}`).join(` 385`)}`),(e.files_to_modify??[]).length&&t.push(`Files To Modify 386${(e.files_to_modify??[]).map(i=>{var o;return(o=i.explanation)!=null&&o.trim()?`- ${i.fileName}: ${i.explanation}`:`- ${i.fileName}`}).join(` 387`)}`),t.join(` 388 389`)}function Tx(e){if(e==null)return null;let t=e;if(typeof t=="string"){const n=t.trim();if(!n)return null;try{t=Ud(n,"spec output")}catch{return null}}return!t||typeof t!="object"||Array.isArray(t)?null:t}function gz(){var an,As;const{id:e}=XM(),t=fr(),{user:n}=Ts(),{toast:r}=Ro(),[s,i]=m.useState(null),[o,a]=m.useState(""),[l,c]=m.useState(null),[d,f]=m.useState(!0),[h,p]=m.useState(0),[v,g]=m.useState(!1),[b,w]=m.useState(!1),[y,x]=m.useState(!1),[S,k]=m.useState(!1),[E,C]=m.useState("changes"),[_,j]=m.useState(null),[T,I]=m.useState(""),[M,H]=m.useState(null),[D,G]=m.useState(!1),[L,Z]=m.useState(!1),[N,P]=m.useState([]),[F,O]=m.useState(null),[$,Y]=m.useState(""),[W,fe]=m.useState(!1),[ke,ae]=m.useState({open:!1,title:"",explanation:"",reason:"",nextSteps:"",technicalDetails:""}),Pe=Ve,Ae=m.useCallback((R,V)=>(R==null?void 0:R.mode)==="github"&&R.repoUrl?R.branch?`${R.repoUrl}#${R.branch}`:R.repoUrl:(R==null?void 0:R.mode)==="local"&&R.root?R.root:V??null,[]),Qe=m.useCallback(R=>{R&&(j(R),c(Ae(R,null)))},[Ae]),me=m.useCallback(async()=>
389{if(!e||!n)return;f(!0);const{data:R}=await Ve.from("user_settings").select("repo_url").eq("user_id",n.id).maybeSingle();c((R==null?void 0:R.repo_url)??null);const{data:V,error:q}=await Ve.from("runs").select("*").eq("id",e).maybeSingle();if(q){r({title:"Error",description:q.message||"Failed to load run",variant:"destructive"}),f(!1);return}if(V){const K=V;i(K);try{const we=await Te("/api/runs/activate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runId:K.id})}),ye=await we.text();if(!we.ok)throw new Error(ye||"Failed to activate run project");try{const J=JSON.parse(ye);if(J.success===!1){const ue=[J.message,J.reconnectManualHint].filter(Boolean).join(" ");r({title:"Project reconnect failed",description:ue||"Reconnect manually from Sync.",variant:"destructive"}),j({mode:"workspace",root:"",source:"workspace",connectionStatus:"failed",lastConnectionError:J.message||"Project reconnect failed"}),c(null)}else J.success&&J.project&&Qe(J.project)}catch{}}catch{}const{data:ce}=await Ve.from("feedback").select("title").eq("id",K.feedback_id).maybeSingle();ce!=null&&ce.title&&a(ce.title)}f(!1)},[e,n,r,Qe]),Et=m.useCallback(async()=>{if(!(!e||!n)){Z(!0);try{const{data:R,error:V}=await Pe.from("run_messages").select("id, run_id, user_id, role, content, spec_output, created_at").eq("run_id",e).eq("user_id",n.id).order("created_at",{ascending:!0});if(V){console.warn("run_messages load error:",V.message),P([]);return}P(R??[])}finally{Z(!1)}}},[e,n,Pe]),zt=m.useCallback(async()=>{try{const R=await Te("/api/project");
389if(!R.ok)return;const V=await R.json();V!=null&&V.success&&V.project&&Qe(V.project)}catch{}},[Qe]),Wn=m.useCallback(async()=>{var R;try{const V=await Te("/api/attempt/latest");if(!V.ok)return;const q=await V.json();if(!q.success)return;G(!!q.hasUndoableChanges),H(((R=q.attempt)==null?void 0:R.id)||null)}catch{}},[]),sn=m.useCallback(async()=>{try{const R=await Te("/api/save-local-destination");if(!R.ok)return I(""),null;const V=await R.json();if(!(V!=null&&V.success))return I(""),null;const q=(V.destinationPath||"").trim();return I(q),{destinationPath:q,exists:!!V.exists,missingReason:V.missingReason||""}}catch{return I(""),null}},[]);m.useEffect(()=>{me()},[me]),m.useEffect(()=>{Et()},[Et]),m.useEffect(()=>{zt()},[zt]),m.useEffect(()=>{Wn()},[Wn]),m.useEffect(()=>{sn()},[_==null?void 0:_.mode,_==null?void 0:_.root,_==null?void 0:_.repoUrl,_==null?void 0:_.branch,sn]);const on=m.useMemo(()=>N.filter(R=>R.role==="assistant"&&R.spec_output).map(R=>Tx(R.spec_output)).filter(R=>!!R),[N]),Ce=m.useMemo(()=>F!==null?on[F]??null:on.length?on[on.length-1]:Tx(s==null?void 0:s.spec_output),[on,F,s==null?void 0:s.spec_output]),pr=m.useMemo(()=>mz(Ce),[Ce]),Dt=async(R,V)=>{var q;if(!R){r({title:"Nothing to copy",description:`No ${V} is available yet.`,variant:"destructive"});return}try{if((q=navigator.clipboard)!=null&&q.writeText&&window.isSecureContext)await navigator.clipboard.writeText(R);else{const K=document.createElement("textarea");K.value=R,K.setAttribute("readonly",""),K.style.position="absolute",K.style.left="-9999px",document.body.appendChild(K),K.select();const ce=document.execCommand("copy");if(document.body.removeChild(K),!ce)throw new Error("Clipboard write failed.")}r(V==="JSON"?{title:"Copied JSON to clipboard"}:{title:"Copied to clipboard",description:`${V} copied.`})}catch{r({title:"Copy failed",description:"Clipboard access was blocked. Check browser permissions and try again.",variant:"destructive"})}},Mr=async()=>{if(!Ce){r({title:"Nothing to copy",description:"No valid generated JSON output is available yet.",variant:"destructive"});return}try{const R=sm(Ce),V=fz(R,"spec output");await Dt(V,"JSON")}catch(R){const V=R instanceof Error?R.stack||R.message:String(R);ae({open:!0,title:"Copy JSON failed",explanation:"SpecMe could not copy the JSON output.",reason:"The generated output could not be copied because its JSON is invali
389d.",nextSteps:"Regenerate the output and try Copy JSON again.",technicalDetails:V})}},wn=m.useCallback((R,V,q,K,ce)=>{const we=ul(q),ye=dl(we,K,ce);ae({open:!0,title:R,explanation:V,reason:ye.reason,nextSteps:ye.nextSteps,technicalDetails:ye.technicalDetails||q})},[]),js=R=>R==="done"?"status-done":R==="running"?"status-running":R==="error"?"status-error":"status-queued",z=m.useMemo(()=>((Ce==null?void 0:Ce.files_to_modify)??[]).map(V=>({...V,fileName:rm(V.fileName)})).filter(V=>V.fileName&&!xc(V.fileName)),[Ce==null?void 0:Ce.files_to_modify]),ge=z[h];m.useMemo(()=>(_==null?void 0:_.mode)==="github"?!0:(_==null?void 0:_.mode)==="local"?!1:!!(l&&!l.startsWith("local:")),[_==null?void 0:_.mode,l]);const te=m.useCallback(async R=>{const V=window.showDirectoryPicker;if(!V||!window.isSecureContext)return!1;const q=await V();for(const K of R){const ce=rm(K.fileName).replace(/^\/+/,"");if(!ce)continue;const we=ce.split("/").filter(Boolean);if(!we.length)continue;let ye=q;for(const re of we.slice(0,-1))ye=await ye.getDirectoryHandle(re,{create:!0});const ue=await(await ye.getFileHandle(we[we.length-1],{create:!0})).createWritable();await ue.write(String(K.fullCode??"")),await ue.close()}return!0},[]),he=m.useCallback(async(R,V)=>{if(!R.length)return r({title:V.emptyTitle,description:"Generate a plan with file changes first.",variant:"destructive"}),!1;try{try{if(await te(R))return r({title:V.successTitle,description:`Saved ${R.length} file(s) to selected folder.`}),!0}catch(re){if(re&&typeof re=="object"&&"name"in re&&re.name==="AbortError")return!1}
389const q=await sn(),K=q&&q.destinationPath&&q.exists?q.destinationPath:T;q&&q.destinationPath&&!q.exists&&r({title:"Choose a new destination folder",description:q.missingReason||"Your previously used destination folder no longer exists.",variant:"destructive"});const ce=window.prompt("Enter destination folder path for writing changed files (example: /Users/you/Desktop/specme-output):",K||"");if(!(ce!=null&&ce.trim()))return!1;const we=await Te("/api/save-local-changes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({destinationPath:ce.trim(),files:R.map(re=>({fileName:re.fileName,fullCode:re.fullCode}))})}),ye=await we.text();if(!we.ok){const re=ul(ye),Be=dl(re,"Failed to save changes locally.","Choose a writable folder path and retry.");if(nm(re.reason,Be.reason))return ae({open:!0,title:V.failureTitle,explanation:"SpecMe could not write files to the selected destination folder.",reason:Be.reason,nextSteps:Be.nextSteps,technicalDetails:Be.technicalDetails||ye}),!1;throw new Error(Be.reason)}let J="Saved changes locally.",ue=ce.trim();try{const re=JSON.parse(ye);J=re.message||J,ue=(re.rememberedDestinationPath||ue).trim()}catch{}return I(ue),r({title:V.successTitle,description:J}),!0}catch(q){return r({title:V.failureTitle,description:q instanceof Error?q.message:"Failed to save changes locally.",variant:"destructive"}),!1}},[sn,T,te,r]);m.useEffect(()=>{h>=z.length&&p(0)},[z.length,h]),m.useEffect(()=>{if(!ge)return;!!!(ge.diffPatch||"").trim()&&E==="changes"&&C("full")},[ge,E]);const Hn=async R=>{var V;if(xc(R.fileName)){r({title:"Blocked",description:`Refusing to apply changes to ${R.fileName}`,variant:"destructive"});return}g(!0);try{let q=M;if(!q){const ce=await Te("/api/attempt/start",{method:"POST",headers:{"Content-Type":"application/json"}}),we=await ce.text();if(!ce.ok)throw new Error(we||"Failed to start apply session");const ye=JSON.parse(we);if(!ye.success||!((V=ye.attempt)!=null&&V.id))throw new Error(ye.error||"Failed to start apply session");q=ye.attempt.id,H(q)}const K=await Te("/api/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({fileName:R.fileName,fullCode:R.fullCode,attemptId:q})});if(!K.ok){const ce=await K.text();throw new Error(ce||"Failed to apply changes")}r({title:"Applied",description:`Saved ${R.fileName} to your project.`}),G(!0)}catch(q){r({title:"Apply failed",description:q instanceof Error?q.message:"Something went wrong",variant:"destructive"})}finally{g(!1)}},Bo=async()=>{var R;if(z.length){g(!0);try{let V=M;if(!V){const q=await Te("/api/attempt/start",{method:"POST",headers:{"Content-Type":"application/json"}}),K=await q.text();if(!q.ok)throw new Error(K||"Failed to start apply session");const ce=JSON.parse(K);if(!ce.success||!((R=ce.attempt)!=null&&R.id))throw new Error(ce.error||"Failed to start apply session");V=ce.attempt.id,H(V)}for(const q of z){if(xc(q.fileName))continue;const K=await Te("/api/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({fileName:q.fileName,fullCode:q.fullCode,attemptId:V})});if(!K.ok){const ce=await K.text();throw new Error(ce||`Failed to apply ${q.fileName}`)}}r({title:"Applied",description:"All allowed file changes were applied."}),G(!0)}catch(V){r({title:"Apply failed",description:V instanceof Error?V.message:"Something went wrong",variant:"destructive"})}finally{g(!1)}}},zo=async()=>{if(D){x(!0);try{const R=await Te("/api/attempt/undo",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({attemptId:M})}),V=await R.text();if(!R.ok)throw new Error(V||"Undo failed");let q="Changes reverted.";try{const K=JSON.parse(V);if(!K.success)throw new Error(K.error||"Undo failed");q=K.message||q}catch(K){if(K instanceof Error)throw K}r({title:"Undo complete",description:q}),G(!1),H(null),await Wn()}catch(R){r({title:"Undo failed",description:R instanceof Error?R.message:"Unable to undo changes.",variant:"destructive"})}finally{x(!1)}}},Ir=R=>{const V=(R.diffPatch||"").trim();if(!V)return u.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:"No diffPatch provided for this file."});const q=V.split(` 390`);return u.jsx("pre",{className:"text-xs p-4 overflow-auto max-h-[520px] leading-relaxed font-mono bg-black/30",children:q.map((K,ce)=>{const we=K.startsWith("---")||K.startsWith("+++"),ye=K.startsWith("@@"),J=K.startsWith("+")&&!K.startsWith("+++"),ue=K.startsWith("-")&&!K.startsWith("---");
390let re="block whitespace-pre text-foreground/85";return we&&(re="block whitespace-pre text-muted-foreground/75"),ye&&(re="block whitespace-pre text-purple-200 bg-purple-500/10 px-1 rounded"),J&&(re="block whitespace-pre bg-emerald-500/25 text-emerald-100 border-l-4 border-emerald-400 pl-2 font-medium"),ue&&(re="block whitespace-pre bg-rose-500/25 text-rose-100 border-l-4 border-rose-400 pl-2 font-medium"),u.jsx("span",{className:re,children:K},ce)})})},Wo=async()=>{if((_==null?void 0:_.mode)==="github"){w(!0);try{const R=await Te("/api/push",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:`SpecMe updates for ${o||"run"}`,files:z.filter(K=>!xc(K.fileName)).map(K=>({fileName:K.fileName,fullCode:K.fullCode}))})}),V=await R.text();let q=V;try{const K=JSON.parse(V);if(!R.ok){wn("Push to GitHub failed","SpecMe could not push your commit to the remote repository.",V,"Push failed.","Check GitHub access, token permissions, branch rules, and repository ownership.");return}q=K.message||"Committed and pushed."}catch(K){if(!R.ok){wn("Push to GitHub failed","SpecMe could not push your commit to the remote repository.",K instanceof Error?K.message:V,"Push failed. Generated changes are still kept locally.","Check GitHub access, token permissions, branch rules, and repository ownership.");return}}r({title:"GitHub updated",description:q})}catch(R){ae({open:!0,title:"Push to GitHub failed",explanation:"SpecMe could not push your commit to the remote repository.",reason:R instanceof Error?R.message:"Push failed. Generated changes are still kept locally.",nextSteps:"Check your network and GitHub credentials, then retry the push.",technicalDetails:R instanceof Error?R.stack||R.message:String(R)})}finally{w(!1)}}},vi=async()=>{k(!0);try{await he(z,{successTitle:"Saved locally",emptyTitle:"No files to save",failureTitle:"Local save failed"})}finally{k(!1)}},Ns=R=>{const V=(R.fullCode||"").trim();return V?u.jsx("pre",{className:"text-xs p-4 overflow-auto max-h-[520px] leading-relaxed font-mono bg-black/30 text-foreground/90",children:V}):u.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:"No fullCode provided for this file."})},qn=async()=>{var q;if(!e||!n)return;const R=$.trim();if(!R)return;fe(!0);let V=!1;try{const{data:K,error:ce}=await Pe.from("run_messages").insert({run_id:e,user_id:n.id,role:"user",content:R,spec_output:null}).select("id, run_id, user_id, role, content, spec_output, created_at").single();if(ce)throw ce;P(Se=>[...Se,K]),Y("");const we=await Te("/api/analyze",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:R,route:t.pathname,pageTitle:document.title,uiText:"",selectedText:""})}),ye=await we.text();if(!we.ok)throw wn("Generation failed","SpecMe could not generate the updated plan for this request.",ye||"AI server error","Generation request failed.","Retry in a moment. If it keeps failing, verify Gemini API limits and model settings."),V=!0,new Error(ye||"AI server error");const J=Ud(ye,"analyze API response");if(!J.success||!J.data)throw new Error(J.error||"AI response missing expected fields.");const ue=J.data;await Ve.from("runs").update({status:"done",spec_output:ue,error_message:null}).eq("id",e);const{data:re,error:Be}=await Pe.from("run_messages").insert({run_id:e,user_id:n.id,role:"assistant",content:(q=ue.summary)!=null&&q.trim()?`Summary: ${ue.summary}`:"Generated an updated plan.",spec_output:ue}).select("id, run_id, user_id, role, content, spec_output, created_at").single();if(Be)throw Be;P(Se=>[...Se,re]),O(null),me()}catch(K){V||r({title:"Send failed",description:K instanceof Error?K.message:"Something went wrong",variant:"destructive"})}finally{fe(!1)}};if(d)return u.jsx(ao,{repoUrl:l,children:u.jsxs("div",{className:"max-w-[960px] mx-auto px-6 py-8",children:[u.jsx(qc,{className:"h-7 w-64 mb-2 rounded-lg bg-card"}),u.jsx(qc,{className:"h-4 w-32 mb-6 rounded bg-card"}),u.jsx(qc,{className:"h-40 w-full rounded-lg bg-card"})]})});if(!s)return u.jsx(ao,{repoUrl:l,children:u.jsxs("div",{className:"max-w-[960px] mx-auto px-6 py-8 text-center",children:[u.jsx("p",{className:"text-muted-foreground text-[13px]",children:"Run not found."}),u.jsx(yt,{to:"/dashboard",className:"text-primary text-[13px] mt-2 inline-block hover:underline",children:"Back to dashboard"})]})});const Rs=s.status==="running";return u.jsxs(ao,{repoUrl:l,children:[u.jsxs("div",{className:"max-w-[960px] mx-auto px-6 py-8 animate-fade-in",children:[u.jsxs(yt,{to:"/dashboard",className:"inline-flex items-center gap-1 text-[13px] text-muted-foreground hover:text-foreground transition-colors mb-5",children:[u.jsx(dd,{className:"h-3 w-3"}),"Back"]}),u.jsxs("div",{className:"flex items-start justify-between mb-6 flex-wrap gap-4",children:[u.jsxs("div",{children:[u.jsx("h1",{className:"text-xl font-semibold tracking-tight",children:o||"Run"}),u.jsx("div",{className:"mt-1.5",children:u.jsx("span",{className:js(s.status),children:s.status})}),s.status==="error"&&s.error_message&&u.jsx("div",{className:"mt-2 text-[13px] text-red-400 whitespace-pre-wrap bg-red-500/8 border border-red-500/15 rounded-lg p-3",children:s.error_message})]}),s.status==="done"&&u.jsxs("div",{className:"flex gap-2 flex-wrap",children:[u.jsxs(oe,{variant:"outline",size:"sm",onClick:()=>Dt(pr,"Spec"),disabled:!Ce,className:"rounded-lg border-border bg-transparent hover:bg-card/80",children:[u.jsx(vf,{className:"mr-1.5 h-3.5 w-3.5"}),"Copy Spec"]}),u.jsxs(oe,{variant:"outline",size:"sm",onClick:Mr,disabled:!Ce,className:"rounded-lg border-border bg-transparent hover:bg-card/80",children:[u.jsx(vf,{className:"mr-1.5 h-3.5 w-3.5"}),"Copy JSON"]}),u.jsxs(oe,{size:"sm",onClick:Bo,disabled:v||z.length===0,className:"rounded-lg bg-primary hover:bg-primary/90 border-0",children:[v?u.jsx(Pt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):u.jsx(yu,{className:"mr-1.5 h-3.5 w-3.5"}),"Apply All"]}),u.jsxs(oe,{variant:"outline",size:"sm",onClick:zo,disabled:y||!D,className:"rounded-lg border-border bg-transparent hover:bg-card/80",children:[y?u.jsx(Pt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):u.jsx(UN,{className:"mr-1.5 h-3.5 w-3.5"}),"Undo Changes"]}),(_==null?void 0:_.mode)==="github"&&(_==null?void 0:_.connectionStatus)==="connected"&&u.jsxs(oe,{variant:"outline",size:"sm",onClick:vi,disabled:S||z.length===0,className:"rounded-lg border-border bg-transparent hover:bg-card/80",children:[S?u.jsx(Pt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):u.jsx(jN,{className:"mr-1.5 h-3.5 w-3.5"}),"Save Changes Locally"]}),(_==null?void 0:_.mode)==="github"&&(_==null?void 0:_.connectionStatus)==="connected"&&u.jsxs(oe,{variant:"outline",size:"sm",onClick:Wo,disabled:b,className:"rounded-lg border-border bg-transparent hover:bg-card/80",children:[b?u.jsx(Pt,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}):u.jsx(RN,{className:"mr-1.5 h-3.5 w-3.5"}),"Commit & Push to GitHub"]})]})]}),(_==null?void 0:_.connectionStatus)==="failed"&&u.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/10 p-4 text-sm mb-6",children:[u.jsx("div",{className:"text-red-200 font-medium",children:"Project connection failed"}),_.lastConnectionError&&u.jsx("div",{className:"text-red-300/70 text-xs mt-1",children:_.lastConnectionError}),u.jsx("div",{className:"mt-2",children:u.jsx(yt,{to:"/sync",className:"text-xs text-primary hover:text-primary/80 underline underline-offset-2 transition-colors duration-200",children:"Reconnect from Sync"})})]}),u.jsxs("div",{className:"glass-card p-6 mb-6",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3 mb-4 flex-wrap",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(_S,{className:"h-4 w-4 text-primary"}),u.jsx("h2",{className:"section-label",children:"Conversation"}
390),L&&u.jsx("span",{className:"text-xs text-muted-foreground/60",children:"Loadingâ¦"})]}),u.jsx("div",{className:"text-xs text-muted-foreground/60",children:"Click an AI response to view/apply that version."})]}),u.jsx("div",{className:"max-h-[260px] overflow-auto rounded-xl border border-border bg-card",children:N.length===0?u.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:"No saved history yet. Send a message below to start."}):u.jsx("div",{className:"p-3 space-y-2",children:N.map((R,V)=>{const q=R.role==="user",K=!!R.spec_output,ce=K?N.filter(ye=>ye.role==="assistant"&&ye.spec_output).findIndex(ye=>ye.id===R.id):-1,we=!q&&K&&F!==null&&ce===F;return u.jsx("div",{className:`flex ${q?"justify-end":"justify-start"}`,children:u.jsxs("button",{type:"button",disabled:!(K&&!q),onClick:()=>{K&&!q&&(O(ce),p(0))},className:`text-left max-w-[85%] rounded-xl border px-3 py-2 text-sm transition-all duration-300 ${q?"bg-primary/15 border-primary/25":we?"bg-white/[0.04] border-primary/30":"bg-card/80 border-border hover:bg-white/[0.05]"}`,children:[u.jsxs("div",{className:"text-xs text-muted-foreground/70 mb-1",children:[q?"You":"AI"," â¢"," ",new Date(R.created_at).toLocaleString(),!q&&K?" ⢠(click to view)":""]}),u.jsx("div",{className:"whitespace-pre-wrap text-foreground/90",children:R.content||(q?"(no text)":"Generated output")})]})},R.id??V)})})}),u.jsxs("div",{className:"mt-4 flex gap-2 items-end",children:[u.jsx("textarea",{value:$,onChange:R=>Y(R.target.value),placeholder:"Type changes you want⦠(this will be saved to this projectâs history)",className:"w-full min-h-[44px] max-h-[140px] resize-y rounded-xl border border-white/[0.08] bg-card/80 px-4 py-3 text-sm text-foreground outline-none transition-all duration-300 focus:border-primary/30 focus:ring-1 focus:ring-primary/10 focus:bg-white/[0.05] placeholder:text-muted-foreground/40"}),u.jsx(oe,{onClick:qn,disabled:W||!$.trim(),className:"shrink-0 rounded-xl bg-primary hover:bg-primary/90 border-0",children:W?u.jsx(Pt,{className:"h-4 w-4 animate-spin"}):u.jsx(ES,{className:"h-4 w-4"})})]})]}),s.status==="done"&&Ce&&u.jsxs("div",{className:"mb-6 space-y-4",children:[u.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(vu,{className:"h-4 w-4 text-primary"}),u.jsx("h2",{className:"text-[15px] font-semibold",children:"Spec Overview"})]}),u.jsx("div",{className:"text-[12px] text-muted-foreground",children:Ce.project_type?`Project: ${Ce.project_type}`:""})]}),u.jsxs("div",{className:"surface-raised p-6",style:{boxShadow:"0 0 30px rgba(56,142,246,0.04), 0 8px 24px rgba(0,0,0,0.2)"},children:[u.jsx("div",{className:"text-[11px] font-semibold tracking-[0.1em] uppercase text-primary/70 mb-3",children:"Summary"}),u.jsx("div",{className:"text-[14px] text-foreground/90 whitespace-pre-wrap leading-[1.75]",children:((an=Ce.summary)==null?void 0:an.trim())||"-"})]}),u.jsxs("div",{className:"surface p-6",children:[u.jsx("div",{className:"text-[11px] font-semibold tracking-[0.1em] uppercase text-accent/70 mb-3",children:"Technical Rationale"}),u.jsx("div",{className:"text-[14px] text-foreground/85 whitespace-pre-wrap leading-[1.75]",children:((As=Ce.technical_rationale)==null?void 0:As.trim())||"-"})]}),u.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[u.jsxs("div",{className:"surface p-5",children:[u.jsx("div",{className:"text-[11px] font-semibold tracking-[0.1em] uppercase text-amber-400/70 mb-3",children:"Risks"}),(Ce.risks??[]).length?u.jsx("ul",{className:"space-y-2.5",children:(Ce.risks??[]).map((R,V)=>u.jsxs("li",{className:"flex gap-2.5 text-[13px] text-foreground/85",children:[u.jsx("span",{className:"mt-1.5 h-1.5 w-1.5 rounded-full bg-amber-400/50 shrink-0"}),u.jsx("span",{className:"leading-[1.6]",children:R})]},V))}):u.jsx("div",{className:"text-[13px] text-muted-foreground",children:"No risks identified"})]}),u.jsxs("div",{className:"surface p-5",children:[u.jsx("div",{className:"text-[11px] font-semibold tracking-[0.1em] uppercase text-emerald-400/70 mb
390-3",children:"Next Steps"}),(Ce.next_steps??[]).length?u.jsx("ol",{className:"space-y-2.5",children:(Ce.next_steps??[]).map((R,V)=>u.jsxs("li",{className:"flex gap-2.5 text-[13px] text-foreground/85",children:[u.jsx("span",{className:"text-[11px] font-mono text-emerald-400/50 mt-0.5 shrink-0",children:String(V+1).padStart(2,"0")}),u.jsx("span",{className:"leading-[1.6]",children:R})]},V))}):u.jsx("div",{className:"text-[13px] text-muted-foreground",children:"No next steps defined"})]})]})]}),Rs?u.jsxs("div",{className:"glass-card p-16 text-center relative overflow-hidden",children:[u.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-32 h-32 bg-primary/15 rounded-full blur-[50px] animate-pulse"}),u.jsx(Pt,{className:"h-8 w-8 animate-spin text-primary mx-auto mb-4 relative z-10"}),u.jsx("p",{className:"text-foreground font-medium relative z-10",children:"Analyzing feedbackâ¦"})]}):u.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[u.jsxs("div",{className:"glass-card p-5",children:[u.jsx("h2",{className:"section-label mb-4",children:"Files to Change"}),z.length===0?u.jsx("p",{className:"text-sm text-muted-foreground",children:"No allowed file outputs were saved."}):u.jsx("div",{className:"space-y-2",children:z.map((R,V)=>u.jsxs("button",{type:"button",onClick:()=>p(V),className:`w-full text-left p-3 rounded-xl border transition-all duration-300 ${V===h?"bg-white/[0.04] border-primary/30 shadow-[0_0_20px_rgba(139,92,246,0.05)]":"bg-card border-border hover:bg-white/[0.04] hover:border-white/[0.1]"}`,children:[u.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[u.jsx(PN,{className:"h-3.5 w-3.5 text-primary shrink-0"}),u.jsx("span",{className:"font-mono text-xs text-foreground truncate",children:R.fileName})]}),u.jsx("p",{className:"text-xs text-muted-foreground/70 pl-5 line-clamp-2",children:R.explanation||"No explanation provided."})]},`${R.fileName}-${V}`))}),s.status==="done"&&z.length>0&&u.jsx("div",{className:"mt-4 flex gap-2",children:u.jsxs(oe,{className:"w-full rounded-xl bg-primary hover:bg-primary/90 border-0",onClick:()=>ge&&Hn(ge),disabled:v||!ge,children:[v?u.jsx(Pt,{className:"mr-2 h-4 w-4 animate-spin"}):u.jsx(yu,{className:"mr-2 h-4 w-4"}),"Apply Selected"]})})]}),u.jsx("div",{className:"glass-card p-5 lg:col-span-2",children:ge?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-start justify-between gap-3 mb-4 flex-wrap",children:[u.jsxs("div",{children:[u.jsx("div",{className:"section-label mb-1",children:"Selected file"}),u.jsx("div",{className:"font-mono text-sm text-foreground",children:ge.fileName}),ge.explanation&&u.jsx("div",{className:"text-sm text-muted-foreground mt-2 whitespace-pre-wrap",children:ge.explanation})]}),u.jsxs("div",{className:"flex gap-2 flex-wrap",children:[u.jsxs(oe,{variant:E==="changes"?"default":"outline",size:"sm",onClick:()=>C("changes"),disabled:!(ge.diffPatch||"").trim(),className:E==="changes"?"rounded-lg bg-primary border-0":"rounded-lg border-border bg-card hover:bg-white/[0.05]",children:[u.jsx(TN,{className:"mr-1.5 h-3.5 w-3.5"}),"Changes"]}),u.jsxs(oe,{variant:E==="full"?"default":"outline",size:"sm",onClick:()=>C("full"),className:E==="full"?"rounded-lg bg-primary border-0":"rounded-lg border-border bg-card hover:bg-white/[0.05]",children:[u.jsx(vu,{className:"mr-1.5 h-3.5 w-3.5"}),"Full Code"]}),u.jsxs(oe,{variant:"outline",size:"sm",onClick:()=>Dt(ge.fullCode,"Full code"),className:"rounded-lg border-border bg-card hover:bg-white/[0.05]",children:[u.jsx(vf,{className:"mr-1.5 h-3.5 w-3.5"}),"Copy Full Code"]})]})]}),u.jsx("div",{className:"rounded-xl border border-border bg-black/20 overflow-hidden",children:E==="changes"?Ir(ge):Ns(ge)}),u.jsx("p",{className:"text-xs text-muted-foreground/60 mt-3",children:E==="changes"?"Green lines are additions. Red lines are deletions. Unchanged context is neutral.":"This is the full corrected file output from the model."})]}):u.jsx("div",{className:"text-sm text-muted-foreground",children:"Select a file to preview its changes."})})]})]}),u.jsx(Sy,{state:ke,onOpenChange:R=>
390ae(V=>({...V,open:R}))})]})}function yz(e,t){if(e==null)return"";try{return new Intl.NumberFormat("en-US",{style:"currency",currency:(t||"usd").toUpperCase(),maximumFractionDigits:2}).format(e/100)}catch{return`${(e/100).toFixed(2)} ${(t||"usd").toUpperCase()}`}}function vz(){const e=hr(),[t]=kg(),{user:n,loading:r}=Ts(),{toast:s}=Ro(),[i,o]=m.useState([]),[a,l]=m.useState(!1),[c,d]=m.useState(""),[f,h]=m.useState(!0),[p,v]=m.useState(""),[g,b]=m.useState(null),[w,y]=m.useState(!1),x=(t.get("checkout")||"").trim(),S=(t.get("session_id")||"").trim();m.useEffect(()=>{(async()=>{h(!0);try{const C=await(await Te("/api/billing/plans")).json();if(!C.success)throw new Error(C.reason||"Billing plans could not be loaded.");o(Array.isArray(C.plans)?C.plans:[]),l(!!C.enabled),d(C.reason||"")}catch(E){const C=E instanceof Error?E.message:"Billing plans could not be loaded.";l(!1),d(C)}finally{h(!1)}})()},[]),m.useEffect(()=>{if(x!=="success"||!S){b(null),y(!1);return}(async()=>{y(!0);try{const C=await(await Te(`/api/billing/session?sessionId=${encodeURIComponent(S)}`)).json();if(!C.success||!C.session)throw new Error(C.error||"Stripe checkout session could not be loaded.");b(C.session)}catch(E){s({title:"Payment status unavailable",description:E instanceof Error?E.message:"Could not confirm the Stripe checkout session.",variant:"destructive"})}finally{y(!1)}})()},[S,x,s]);const k=async E=>{if(!n){e(`/login?next=${encodeURIComponent("/pricing")}`);return}v(E.id);try{const C=await Te("/api/billing/checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({planId:E.id,userId:n.id,userEmail:n.email||"",returnUrlBase:window.location.origin})}),_=await C.text();if(!C.ok)try{const T=JSON.parse(_);throw new Error(T.error||_||"Stripe checkout could not be started.")}catch{throw new Error(_||"Stripe checkout could not be started.")}const j=JSON.parse(_);if(!j.success||!j.url)throw new Error(j.error||"Stripe checkout could not be started.");window.location.assign(j.url)}catch(C){s({title:"Checkout failed",description:C instanceof Error?C.message:"Stripe checkout could not be started.",variant:"destructive"}),v("")}};return u.jsx("div",{className:"min-h-screen bg-[radial-gradient(circle_at_top,rgba(59,130,246,0.18),transparent_34%),linear-gradient(180deg,#020617_0%,#0f172a_40%,#020617_100%)] text-white",children:u.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-10",children:[u.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap mb-10",children:[u.jsxs(yt,{to:n?"/dashboard":"/login",className:"inline-flex items-center gap-2 text-sm text-slate-300 hover:text-white transition-colors",children:[u.jsx(dd,{className:"h-4 w-4"}),n?"Back to dashboard":"Back to login"]}),u.jsx("div",{className:"flex items-center gap-3 flex-wrap",children:n?u.jsx(oe,{variant:"outline",onClick:()=>e("/dashboard"),children:"Open App"}):u.jsx(oe,{onClick:()=>e("/login?next=%2Fpricing"),children:"Sign In to Subscribe"})})]}),u.jsxs("div",{className:"mb-10 rounded-3xl border border-white/10 bg-white/5 backdrop-blur-xl p-8 shadow-[0_30px_90px_rgba(2,6,23,0.4)]",children:[u.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full border border-sky-400/30 bg-sky-400/10 px-3 py-1 text-xs font-medium text-sky-200",children:[u.jsx(CN,{className:"h-3.5 w-3.5"}),"Secure Stripe Checkout"]}),u.jsx("h1",{className:"mt-5 text-4xl md:text-5xl font-bold tracking-tight",children:"Pick a plan and pay in minutes"}),u.jsx("p",{className:"mt-4 max-w-2xl text-slate-300 text-base md:text-lg",children:"SpecMe uses Stripe-hosted checkout so users can pay with a familiar, secure flow without leaving your pricing experience confused or stuck."})]}),x==="success"&&u.jsx("div",{className:"mb-6 rounded-2xl border border-emerald-400/30 bg-emerald-500/10 p-5",children:u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx(kN,{className:"h-5 w-5 text-emerald-300 mt-0.5"}),u.jsxs("div",{children:[u.jsx("div",{className:"font-semibold text-emerald-100",children:"Checkout complete"}),u.jsx("div",{className:"text-sm text-emerald-50/80 mt-1",children:w?"Confirming the Stripe session now...":g?`Status: ${g.paymentStatus||g.status||"complete"}${g.amountTotal!=null?` ⢠${yz(g.amountTotal,g.currency)}`:""}`:"Stripe redirected back successfully."})]})]})}),x==="cancelled"&&u.jsx("div",{className:"mb-6 rounded-2xl border border-amber-400/30 bg-amber-500/10 p-5",children:u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx(_N,{className:"h-5 w-5 text-amber-300 mt-0.5"}),u.jsxs("div",{children:[u.jsx("div",{className:"font-semibold text-amber-100",children:"Checkout cancelled"}),u.jsx("div",{className:"text-sm text-amber-50/80 mt-1",children:"No charge was made. You can pick another plan or retry anytime."})]})]})}),f?u.jsxs("div",{className:"rounded-2xl border border-white/10 bg-white/5 p-10 text-center",children:[u.jsx(Pt,{className:"h-6 w-6 animate-spin mx-auto text-sky-300"}),u.jsx("div",{className:"mt-3 text-sm text-slate-300",children:"Loading Stripe plans..."})]}):a?u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-6",children:i.map(E=>{const C=p===E.id;return u.jsxs("div",{className:"rounded-3xl border border-white/10 bg-white/5 backdrop-blur-xl p-7 shadow-[0_20px_60px_rgba(2,6,23,0.35)]",children:[u.jsx("div",{className:"text-sm uppercase tracking-[0.18em] text-sky-200/80",children:E.mode==="subscription"?"Subscription":"One-Time"}),u.jsx("h2",{className:"mt-4 text-2xl font-semibold",children:E.name}),u.jsx("div",{className:"mt-3 text-4xl font-bold tracking-tight",children:E.amountLabel||"Custom"}),u.jsx("p",{className:"mt-4 min-h-[72px] text-sm text-slate-300",children:E.description||"Secure hosted checkout powered by Stripe."}),u.jsx(oe,{className:"mt-6 w-full",onClick:()=>void k(E),disabled:C||r,children:C?u.jsxs(u.Fragment,{children:[u.jsx(Pt,{className:"mr-2 h-4 w-4 animate-spin"}),"Redirecting..."]}):n?"Continue to Checkout":"Sign In to Pay"})]},E.id)})}):u.jsxs("div",{className:"rounded-2xl border border-white/10 bg-white/5 p-8",children:[u.jsx("div",{className:"text-xl font-semibold",children:"Stripe billing is not configured yet"}),u.jsx("div",{className:"mt-3 text-sm text-slate-300",children:c||"Add STRIPE_SECRET_KEY and STRIPE_PRICE_IDS in server/.env.local to publish plans here."}),u.jsx("div",{className:"mt-4 text-xs text-slate-400 font-mono",children:"Required keys: STRIPE_SECRET_KEY, STRIPE_PRICE_IDS"})]})]})})}const wz=()=>{const e=fr();return m.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),u.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background",children:u.jsxs(le.div,{initial:{opacity:0,y:8}
390,animate:{opacity:1,y:0},transition:{duration:.4},className:"text-center",children:[u.jsx("div",{className:"text-[13px] text-muted-foreground mb-4",children:"SpecMe"}),u.jsx("h1",{className:"text-5xl font-semibold tracking-tight text-foreground mb-3",children:"404"}),u.jsx("p",{className:"text-[15px] text-muted-foreground mb-6",children:"Page not found"}),u.jsx(yt,{to:"/",className:"text-[13px] text-primary hover:underline",children:"Return home"})]})})},xz=new wM,bz=()=>u.jsx(bM,{client:xz,children:u.jsxs(HO,{children:[u.jsx(_R,{}),u.jsx(nA,{}),u.jsx(iL,{}),u.jsx(kI,{children:u.jsxs(mI,{children:[u.jsx(yr,{path:"/",element:u.jsx(zU,{})}),u.jsx(yr,{path:"/login",element:u.jsx(rV,{})}),u.jsx(yr,{path:"/pricing",element:u.jsx(vz,{})}),u.jsx(yr,{path:"/dashboard",element:u.jsx(cc,{children:u.jsx(F8,{})})}),u.jsx(yr,{path:"/sync",element:u.jsx(cc,{children:u.jsx(cz,{})})}),u.jsx(yr,{path:"/upload",element:u.jsx(cc,{children:u.jsx(hz,{})})}),u.jsx(yr,{path:"/runs/:id",element:u.jsx(cc,{children:u.jsx(gz,{})})}),u.jsx(yr,{path:"*",element:u.jsx(wz,{})})]})})]})});Q1(document.getElementById("root")).render(u.jsx(bz,{}));
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.